linguist-js
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -46,4 +46,5 @@ "use strict"; | ||
content += data.toString(); | ||
if (onlyFirstLine && /\n/.test(content)) | ||
return content; | ||
if (onlyFirstLine && content.includes('\n')) { | ||
return content.split(/\r?\n/)[0]; | ||
} | ||
} | ||
@@ -141,3 +142,3 @@ return content; | ||
if (firstLine.startsWith('#!')) { | ||
const matches = Object.entries(langData).filter(([, data]) => { var _a; return (_a = data.interpreters) === null || _a === void 0 ? void 0 : _a.some(interpreter => firstLine.includes(interpreter)); }); | ||
const matches = Object.entries(langData).filter(([, data]) => { var _a; return (_a = data.interpreters) === null || _a === void 0 ? void 0 : _a.some(interpreter => firstLine.match('\\b' + interpreter + '\\b')); }); | ||
if (matches.length) { | ||
@@ -144,0 +145,0 @@ const forcedLang = matches[0][0]; |
{ | ||
"name": "linguist-js", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.", | ||
@@ -47,6 +47,3 @@ "main": "dist/index.js", | ||
"typescript": "~4.3.5" | ||
}, | ||
"engines": { | ||
"node": "^12 || ^14 || >=16" | ||
} | ||
} |
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
386
25419