utilium 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fs.d.ts +0 -5
- package/dist/fs.js +1 -11
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +4 -1
- package/src/fs.ts +1 -18
- package/src/index.ts +0 -1
package/dist/fs.d.ts
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
type fs = typeof import('fs');
|
2
|
-
declare let fs: fs;
|
3
|
-
export declare function whenDefaultFSDone(): Promise<void>;
|
4
|
-
export declare function useFS(_fs: fs): void;
|
5
1
|
export declare abstract class FileMap<V> implements Map<string, V> {
|
6
2
|
protected readonly path: string;
|
7
3
|
get [Symbol.toStringTag](): string;
|
@@ -67,4 +63,3 @@ export declare class FolderMap extends FileMap<string> {
|
|
67
63
|
set(key: string, value: string): this;
|
68
64
|
}
|
69
65
|
export declare function gitCommitHash(repo?: string): string;
|
70
|
-
export {};
|
package/dist/fs.js
CHANGED
@@ -1,12 +1,5 @@
|
|
1
1
|
import { isJSON } from './objects.js';
|
2
|
-
|
3
|
-
const defaultFS = import('fs').then(_ => (fs = _));
|
4
|
-
export async function whenDefaultFSDone() {
|
5
|
-
await defaultFS;
|
6
|
-
}
|
7
|
-
export function useFS(_fs) {
|
8
|
-
fs = _fs;
|
9
|
-
}
|
2
|
+
import * as fs from 'fs';
|
10
3
|
export class FileMap {
|
11
4
|
path;
|
12
5
|
get [Symbol.toStringTag]() {
|
@@ -17,9 +10,6 @@ export class FileMap {
|
|
17
10
|
if (!path) {
|
18
11
|
throw new ReferenceError('No path specified');
|
19
12
|
}
|
20
|
-
if (!fs) {
|
21
|
-
throw new ReferenceError('No filesystem API');
|
22
|
-
}
|
23
13
|
}
|
24
14
|
get size() {
|
25
15
|
return this._map.size;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "utilium",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.4",
|
4
4
|
"description": "Typescript utilies",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
7
7
|
"type": "module",
|
8
|
+
"exports": {
|
9
|
+
"./*": "./dist/*"
|
10
|
+
},
|
8
11
|
"scripts": {
|
9
12
|
"format:check": "prettier --check .",
|
10
13
|
"format": "prettier --write .",
|
package/src/fs.ts
CHANGED
@@ -1,18 +1,5 @@
|
|
1
1
|
import { isJSON } from './objects.js';
|
2
|
-
|
3
|
-
type fs = typeof import('fs');
|
4
|
-
|
5
|
-
let fs: fs;
|
6
|
-
|
7
|
-
const defaultFS = import('fs').then(_ => (fs = _));
|
8
|
-
|
9
|
-
export async function whenDefaultFSDone(): Promise<void> {
|
10
|
-
await defaultFS;
|
11
|
-
}
|
12
|
-
|
13
|
-
export function useFS(_fs: fs): void {
|
14
|
-
fs = _fs;
|
15
|
-
}
|
2
|
+
import * as fs from 'fs';
|
16
3
|
|
17
4
|
export abstract class FileMap<V> implements Map<string, V> {
|
18
5
|
public get [Symbol.toStringTag](): string {
|
@@ -23,10 +10,6 @@ export abstract class FileMap<V> implements Map<string, V> {
|
|
23
10
|
if (!path) {
|
24
11
|
throw new ReferenceError('No path specified');
|
25
12
|
}
|
26
|
-
|
27
|
-
if (!fs) {
|
28
|
-
throw new ReferenceError('No filesystem API');
|
29
|
-
}
|
30
13
|
}
|
31
14
|
|
32
15
|
protected abstract readonly _map: Map<string, V>;
|
package/src/index.ts
CHANGED