linguist-js
Advanced tools
Comparing version 2.5.5 to 2.5.6
export {}; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -18,3 +18,4 @@ "use strict"; | ||
const dataUrl = (file) => `https://raw.githubusercontent.com/github/linguist/HEAD/lib/linguist/${file}`; | ||
const fileContent = await (0, cross_fetch_1.default)(dataUrl(file)).then(data => data.text()); | ||
// Load file content, falling back to the local file if the request fails | ||
const fileContent = await (0, cross_fetch_1.default)(dataUrl(file)).then(data => data.text()).catch(async () => await loadLocalFile(file)); | ||
cache.set(file, fileContent); | ||
@@ -21,0 +22,0 @@ return fileContent; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import * as T from './types'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -36,3 +36,3 @@ import { Category, Language } from './types'; | ||
} | ||
export type VendorSchema = string[]; | ||
export declare type VendorSchema = string[]; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,7 +0,7 @@ | ||
export type LanguageResult = string | null; | ||
export type Language = string; | ||
export type Category = 'data' | 'markup' | 'programming' | 'prose'; | ||
export type FilePath = string; | ||
export type Bytes = Integer; | ||
export type Integer = number; | ||
export declare type LanguageResult = string | null; | ||
export declare type Language = string; | ||
export declare type Category = 'data' | 'markup' | 'programming' | 'prose'; | ||
export declare type FilePath = string; | ||
export declare type Bytes = Integer; | ||
export declare type Integer = number; | ||
export interface Options { | ||
@@ -8,0 +8,0 @@ fileContent?: string | string[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
{ | ||
"name": "linguist-js", | ||
"version": "2.5.5", | ||
"version": "2.5.6", | ||
"description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.", | ||
@@ -47,3 +47,3 @@ "main": "dist/index.js", | ||
"ignore": "^5.2.4", | ||
"isbinaryfile": "^4.0.8 <5", | ||
"isbinaryfile": "^4.0.10 <5", | ||
"js-yaml": "^4.1.0", | ||
@@ -54,6 +54,6 @@ "node-cache": "^5.1.2" | ||
"@types/js-yaml": "^4.0.5", | ||
"@types/node": "ts5.1", | ||
"@types/node": "ts5.0", | ||
"deep-object-diff": "^1.1.9", | ||
"typescript": "~5.1.3" | ||
"typescript": "^5.1" | ||
} | ||
} |
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
226810
733
Updatedisbinaryfile@^4.0.10 <5