linguist-js
Advanced tools
Comparing version 2.8.0 to 2.8.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = pcre; | ||
/** Convert a PCRE regex into JS. */ | ||
@@ -38,2 +39,1 @@ function pcre(regex) { | ||
} | ||
exports.default = pcre; |
/** Nukes unused `generated.rb` file content. */ | ||
export declare function parseGeneratedDataFile(fileContent: string): Promise<string[]>; | ||
export declare function parseGeneratedDataFile(fileContent: string): string[]; | ||
/** Load a data file from github-linguist. */ | ||
export default function loadFile(file: string, offline?: boolean): Promise<string>; |
@@ -6,3 +6,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseGeneratedDataFile = void 0; | ||
exports.parseGeneratedDataFile = parseGeneratedDataFile; | ||
exports.default = loadFile; | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -30,11 +31,9 @@ const path_1 = __importDefault(require("path")); | ||
/** Nukes unused `generated.rb` file content. */ | ||
async function parseGeneratedDataFile(fileContent) { | ||
function parseGeneratedDataFile(fileContent) { | ||
var _a; | ||
return [...(_a = fileContent.match(/(?<=name\.match\(\/).+?(?=(?<!\\)\/)/gm)) !== null && _a !== void 0 ? _a : []]; | ||
} | ||
exports.parseGeneratedDataFile = parseGeneratedDataFile; | ||
/** Load a data file from github-linguist. */ | ||
async function loadFile(file, offline = false) { | ||
function loadFile(file, offline = false) { | ||
return offline ? loadLocalFile(file) : loadWebFile(file); | ||
} | ||
exports.default = loadFile; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = parseAttributes; | ||
const norm_path_1 = require("./norm-path"); | ||
@@ -37,2 +38,1 @@ /** | ||
} | ||
exports.default = parseAttributes; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = parseGitignore; | ||
function parseGitignore(content) { | ||
@@ -12,2 +13,1 @@ const readableData = content | ||
} | ||
exports.default = parseGitignore; |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = readFileChunk; | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -24,2 +25,1 @@ /** | ||
} | ||
exports.default = readFileChunk; |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = walk; | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -40,3 +41,8 @@ const path_1 = __importDefault(require("path")); | ||
const ignoredPaths = (0, parse_gitignore_1.default)(gitignoreContents); | ||
ignored.add(ignoredPaths); | ||
const rootRelIgnoredPaths = ignoredPaths.map(ignorePath => | ||
// get absolute path of the ignore glob | ||
(0, norm_path_1.normPath)(folder, ignorePath) | ||
// convert abs ignore glob to be relative to the root folder | ||
.replace(commonRoot + '/', '')); | ||
ignored.add(rootRelIgnoredPaths); | ||
} | ||
@@ -87,2 +93,1 @@ // Add gitattributes if present | ||
} | ||
exports.default = walk; |
@@ -49,3 +49,3 @@ "use strict"; | ||
opts = { | ||
calculateLines: (_b = opts.calculateLines) !== null && _b !== void 0 ? _b : true, | ||
calculateLines: (_b = opts.calculateLines) !== null && _b !== void 0 ? _b : true, // default to true if unset | ||
checkIgnored: !opts.quick, | ||
@@ -52,0 +52,0 @@ checkDetected: !opts.quick, |
{ | ||
"name": "linguist-js", | ||
"version": "2.8.0", | ||
"version": "2.8.1", | ||
"description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.", | ||
@@ -11,3 +11,4 @@ "main": "dist/index.js", | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=12", | ||
"npm": "<9" | ||
}, | ||
@@ -14,0 +15,0 @@ "scripts": { |
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
Sorry, the diff of this file is not supported yet
293909
56
2141