@tapjs/processinfo
Advanced tools
Comparing version 2.5.4 to 2.5.5
@@ -14,12 +14,14 @@ "use strict"; | ||
filename = (0, url_1.fileURLToPath)(filename); | ||
if (cache.has(filename)) | ||
// no need if it's not sourcemapped | ||
// don't cache an empty array, though, because ts-node files will show | ||
// up first as source, and then as their built content. | ||
const last = content.trimEnd().split('\n').pop(); | ||
if (cache.has(filename) || !last?.startsWith(sourceMapComment)) | ||
return; | ||
// no need if it's not sourcemapped | ||
const ll = !content.includes(sourceMapComment) | ||
? [] | ||
: content | ||
.replace(/[\n\u2028\u2029]$/, '') | ||
.split(/\n|\u2028|\u2029/) | ||
.map(l => l.length); | ||
const ll = content | ||
.replace(/[\n\u2028\u2029]$/, '') | ||
.split(/\n|\u2028|\u2029/) | ||
.map(l => l.length); | ||
cache.set(filename, ll); | ||
cache.set(filename, ll); | ||
}; | ||
@@ -26,0 +28,0 @@ exports.saveLineLengths = saveLineLengths; |
@@ -11,12 +11,14 @@ // TODO: Refactor once https://github.com/nodejs/node/issues/48460 fixed | ||
filename = fileURLToPath(filename); | ||
if (cache.has(filename)) | ||
// no need if it's not sourcemapped | ||
// don't cache an empty array, though, because ts-node files will show | ||
// up first as source, and then as their built content. | ||
const last = content.trimEnd().split('\n').pop(); | ||
if (cache.has(filename) || !last?.startsWith(sourceMapComment)) | ||
return; | ||
// no need if it's not sourcemapped | ||
const ll = !content.includes(sourceMapComment) | ||
? [] | ||
: content | ||
.replace(/[\n\u2028\u2029]$/, '') | ||
.split(/\n|\u2028|\u2029/) | ||
.map(l => l.length); | ||
const ll = content | ||
.replace(/[\n\u2028\u2029]$/, '') | ||
.split(/\n|\u2028|\u2029/) | ||
.map(l => l.length); | ||
cache.set(filename, ll); | ||
cache.set(filename, ll); | ||
}; | ||
@@ -23,0 +25,0 @@ export const getLineLengths = (filename) => { |
{ | ||
"name": "@tapjs/processinfo", | ||
"version": "2.5.4", | ||
"version": "2.5.5", | ||
"main": "./dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./dist/cjs/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
346814
2744