Comparing version 0.5.2 to 0.5.3
@@ -1,5 +0,1 @@ | ||
type fs = typeof import('fs'); | ||
declare let fs: fs; | ||
export declare function whenDefaultFSDone(): Promise<void>; | ||
export declare function useFS(_fs: fs): void; | ||
export declare abstract class FileMap<V> implements Map<string, V> { | ||
@@ -70,2 +66,1 @@ protected readonly path: string; | ||
export declare function gitCommitHash(repo?: string): string; | ||
export {}; |
import { isJSON } from './objects.js'; | ||
let fs; | ||
const defaultFS = import('fs').then(_ => (fs = _)); | ||
export async function whenDefaultFSDone() { | ||
await defaultFS; | ||
} | ||
export function useFS(_fs) { | ||
fs = _fs; | ||
} | ||
import * as fs from 'fs'; | ||
export class FileMap { | ||
@@ -20,5 +13,2 @@ path; | ||
} | ||
if (!fs) { | ||
throw new ReferenceError('No filesystem API'); | ||
} | ||
} | ||
@@ -25,0 +15,0 @@ get size() { |
{ | ||
"name": "utilium", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Typescript utilies", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import { isJSON } from './objects.js'; | ||
import * as fs from 'fs'; | ||
type fs = typeof import('fs'); | ||
let fs: fs; | ||
const defaultFS = import('fs').then(_ => (fs = _)); | ||
export async function whenDefaultFSDone(): Promise<void> { | ||
await defaultFS; | ||
} | ||
export function useFS(_fs: fs): void { | ||
fs = _fs; | ||
} | ||
export abstract class FileMap<V> implements Map<string, V> { | ||
@@ -26,6 +13,2 @@ public get [Symbol.toStringTag](): string { | ||
} | ||
if (!fs) { | ||
throw new ReferenceError('No filesystem API'); | ||
} | ||
} | ||
@@ -32,0 +15,0 @@ |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
67755
1979
1