@tapjs/processinfo 2.5.4 → 2.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../lib/line-lengths.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe,aAAc,MAAM,WAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../lib/line-lengths.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe,aAAc,MAAM,WAAW,MAAM,SAchE,CAAA;AAED,eAAO,MAAM,cAAc,aAAc,MAAM,yBAG9C,CAAA"}
|
package/dist/cjs/line-lengths.js
CHANGED
|
@@ -11,15 +11,17 @@ const sourceMapComment = '//# sourceMappingURL=';
|
|
|
11
11
|
const saveLineLengths = (filename, content) => {
|
|
12
12
|
if (filename.startsWith('file://'))
|
|
13
13
|
filename = (0, url_1.fileURLToPath)(filename);
|
|
14
|
-
if (cache.has(filename))
|
|
15
|
-
return;
|
|
16
14
|
// no need if it's not sourcemapped
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
// don't cache an empty array, though, because ts-node files will show
|
|
16
|
+
// up first as source, and then as their built content.
|
|
17
|
+
const last = content.trimEnd().split('\n').pop();
|
|
18
|
+
if (cache.has(filename) || !last?.startsWith(sourceMapComment))
|
|
19
|
+
return;
|
|
20
|
+
const ll = content
|
|
21
|
+
.replace(/[\n\u2028\u2029]$/, '')
|
|
22
|
+
.split(/\n|\u2028|\u2029/)
|
|
23
|
+
.map(l => l.length);
|
|
24
|
+
cache.set(filename, ll);
|
|
23
25
|
cache.set(filename, ll);
|
|
24
26
|
};
|
|
25
27
|
exports.saveLineLengths = saveLineLengths;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-lengths.js","sourceRoot":"","sources":["../../lib/line-lengths.ts"],"names":[],"mappings":";AAAA,wEAAwE;;;AAExE,6BAAmC;AAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;AAC9D,MAAM,CAAC,GAAG,MAET,CAAA;AACD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAoB,CAAA;AACpD,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;AAEf,MAAM,gBAAgB,GAAG,uBAAuB,CAAA;AACzC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAE,EAAE;IACnE,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,IAAA,mBAAa,EAAC,QAAQ,CAAC,CAAA;IACtE,IAAI,
|
|
1
|
+
{"version":3,"file":"line-lengths.js","sourceRoot":"","sources":["../../lib/line-lengths.ts"],"names":[],"mappings":";AAAA,wEAAwE;;;AAExE,6BAAmC;AAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;AAC9D,MAAM,CAAC,GAAG,MAET,CAAA;AACD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAoB,CAAA;AACpD,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;AAEf,MAAM,gBAAgB,GAAG,uBAAuB,CAAA;AACzC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAE,EAAE;IACnE,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,IAAA,mBAAa,EAAC,QAAQ,CAAC,CAAA;IACtE,mCAAmC;IACnC,sEAAsE;IACtE,uDAAuD;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAA;IAChD,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAM;IACtE,MAAM,EAAE,GAAG,OAAO;SACf,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,KAAK,CAAC,kBAAkB,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACrB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAEvB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzB,CAAC,CAAA;AAdY,QAAA,eAAe,mBAc3B;AAEM,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,IAAA,mBAAa,EAAC,QAAQ,CAAC,CAAA;IACtE,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC5B,CAAC,CAAA;AAHY,QAAA,cAAc,kBAG1B","sourcesContent":["// TODO: Refactor once https://github.com/nodejs/node/issues/48460 fixed\n\nimport { fileURLToPath } from 'url'\n\nconst kLLC = Symbol.for('@tapjs/processinfo lineLength cache')\nconst g = global as {\n [kLLC]?: Map<string, number[]>\n}\nconst cache = g[kLLC] || new Map<string, number[]>()\ng[kLLC] = cache\n\nconst sourceMapComment = '//# sourceMappingURL='\nexport const saveLineLengths = (filename: string, content: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n // no need if it's not sourcemapped\n // don't cache an empty array, though, because ts-node files will show\n // up first as source, and then as their built content.\n const last = content.trimEnd().split('\\n').pop()\n if (cache.has(filename) || !last?.startsWith(sourceMapComment)) return\n const ll = content\n .replace(/[\\n\\u2028\\u2029]$/, '')\n .split(/\\n|\\u2028|\\u2029/)\n .map(l => l.length)\n cache.set(filename, ll)\n\n cache.set(filename, ll)\n}\n\nexport const getLineLengths = (filename: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n return cache.get(filename)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../lib/line-lengths.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe,aAAc,MAAM,WAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../lib/line-lengths.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe,aAAc,MAAM,WAAW,MAAM,SAchE,CAAA;AAED,eAAO,MAAM,cAAc,aAAc,MAAM,yBAG9C,CAAA"}
|
package/dist/mjs/line-lengths.js
CHANGED
|
@@ -8,15 +8,17 @@ const sourceMapComment = '//# sourceMappingURL=';
|
|
|
8
8
|
export const saveLineLengths = (filename, content) => {
|
|
9
9
|
if (filename.startsWith('file://'))
|
|
10
10
|
filename = fileURLToPath(filename);
|
|
11
|
-
if (cache.has(filename))
|
|
12
|
-
return;
|
|
13
11
|
// no need if it's not sourcemapped
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
// don't cache an empty array, though, because ts-node files will show
|
|
13
|
+
// up first as source, and then as their built content.
|
|
14
|
+
const last = content.trimEnd().split('\n').pop();
|
|
15
|
+
if (cache.has(filename) || !last?.startsWith(sourceMapComment))
|
|
16
|
+
return;
|
|
17
|
+
const ll = content
|
|
18
|
+
.replace(/[\n\u2028\u2029]$/, '')
|
|
19
|
+
.split(/\n|\u2028|\u2029/)
|
|
20
|
+
.map(l => l.length);
|
|
21
|
+
cache.set(filename, ll);
|
|
20
22
|
cache.set(filename, ll);
|
|
21
23
|
};
|
|
22
24
|
export const getLineLengths = (filename) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-lengths.js","sourceRoot":"","sources":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AE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAA;IAChD,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAM;IACtE,MAAM,EAAE,GAAG,OAAO;SACf,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,KAAK,CAAC,kBAAkB,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACrB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAEvB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;IACtE,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC5B,CAAC,CAAA","sourcesContent":["// TODO: Refactor once https://github.com/nodejs/node/issues/48460 fixed\n\nimport { fileURLToPath } from 'url'\n\nconst kLLC = Symbol.for('@tapjs/processinfo lineLength cache')\nconst g = global as {\n [kLLC]?: Map<string, number[]>\n}\nconst cache = g[kLLC] || new Map<string, number[]>()\ng[kLLC] = cache\n\nconst sourceMapComment = '//# sourceMappingURL='\nexport const saveLineLengths = (filename: string, content: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n // no need if it's not sourcemapped\n // don't cache an empty array, though, because ts-node files will show\n // up first as source, and then as their built content.\n const last = content.trimEnd().split('\\n').pop()\n if (cache.has(filename) || !last?.startsWith(sourceMapComment)) return\n const ll = content\n .replace(/[\\n\\u2028\\u2029]$/, '')\n .split(/\\n|\\u2028|\\u2029/)\n .map(l => l.length)\n cache.set(filename, ll)\n\n cache.set(filename, ll)\n}\n\nexport const getLineLengths = (filename: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n return cache.get(filename)\n}\n"]}
|