update
This commit is contained in:
3
dist_ts/tiny-readdir/index.d.ts
vendored
Normal file
3
dist_ts/tiny-readdir/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { Options, Result } from './types.js';
|
||||
declare const readdir: (rootPath: string, options?: Options) => Promise<Result>;
|
||||
export default readdir;
|
179
dist_ts/tiny-readdir/index.js
Normal file
179
dist_ts/tiny-readdir/index.js
Normal file
File diff suppressed because one or more lines are too long
28
dist_ts/tiny-readdir/types.d.ts
vendored
Normal file
28
dist_ts/tiny-readdir/types.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
type Callback = () => void;
|
||||
type Options = {
|
||||
depth?: number;
|
||||
limit?: number;
|
||||
followSymlinks?: boolean;
|
||||
ignore?: ((targetPath: string) => boolean) | RegExp;
|
||||
signal?: {
|
||||
aborted: boolean;
|
||||
};
|
||||
};
|
||||
type ResultDirectory = {
|
||||
directories: string[];
|
||||
directoriesNames: Set<string>;
|
||||
directoriesNamesToPaths: Record<string, string[]>;
|
||||
files: string[];
|
||||
filesNames: Set<string>;
|
||||
filesNamesToPaths: Record<string, string[]>;
|
||||
symlinks: string[];
|
||||
symlinksNames: Set<string>;
|
||||
symlinksNamesToPaths: Record<string, string[]>;
|
||||
};
|
||||
type ResultDirectories = {
|
||||
[path: string]: ResultDirectory;
|
||||
};
|
||||
type Result = ResultDirectory & {
|
||||
map: ResultDirectories;
|
||||
};
|
||||
export type { Callback, Options, ResultDirectory, ResultDirectories, Result };
|
3
dist_ts/tiny-readdir/types.js
Normal file
3
dist_ts/tiny-readdir/types.js
Normal file
@ -0,0 +1,3 @@
|
||||
/* HELPERS */
|
||||
export {};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy90aW55LXJlYWRkaXIvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsYUFBYSJ9
|
8
dist_ts/tiny-readdir/utils.d.ts
vendored
Normal file
8
dist_ts/tiny-readdir/utils.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import type { Callback } from './types.js';
|
||||
declare const isFunction: (value: unknown) => value is Function;
|
||||
declare const makeCounterPromise: () => {
|
||||
promise: Promise<void>;
|
||||
increment: Callback;
|
||||
decrement: Callback;
|
||||
};
|
||||
export { isFunction, makeCounterPromise };
|
23
dist_ts/tiny-readdir/utils.js
Normal file
23
dist_ts/tiny-readdir/utils.js
Normal file
@ -0,0 +1,23 @@
|
||||
/* IMPORT */
|
||||
import makeNakedPromise from '../promise-make-naked/index.js';
|
||||
/* MAIN */
|
||||
const isFunction = (value) => {
|
||||
return (typeof value === 'function');
|
||||
};
|
||||
const makeCounterPromise = () => {
|
||||
const { promise, resolve } = makeNakedPromise();
|
||||
let counter = 0;
|
||||
const increment = () => {
|
||||
counter += 1;
|
||||
};
|
||||
const decrement = () => {
|
||||
counter -= 1;
|
||||
if (counter)
|
||||
return;
|
||||
resolve();
|
||||
};
|
||||
return { promise, increment, decrement };
|
||||
};
|
||||
/* EXPORT */
|
||||
export { isFunction, makeCounterPromise };
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy90aW55LXJlYWRkaXIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsWUFBWTtBQUVaLE9BQU8sZ0JBQWdCLE1BQU0sZ0NBQWdDLENBQUM7QUFHOUQsVUFBVTtBQUVWLE1BQU0sVUFBVSxHQUFHLENBQUUsS0FBYyxFQUFzQixFQUFFO0lBRXpELE9BQU8sQ0FBRSxPQUFPLEtBQUssS0FBSyxVQUFVLENBQUUsQ0FBQztBQUV6QyxDQUFDLENBQUM7QUFFRixNQUFNLGtCQUFrQixHQUFHLEdBQXlFLEVBQUU7SUFFcEcsTUFBTSxFQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUMsR0FBRyxnQkFBZ0IsRUFBUyxDQUFDO0lBRXJELElBQUksT0FBTyxHQUFHLENBQUMsQ0FBQztJQUVoQixNQUFNLFNBQVMsR0FBRyxHQUFTLEVBQUU7UUFFM0IsT0FBTyxJQUFJLENBQUMsQ0FBQztJQUVmLENBQUMsQ0FBQztJQUVGLE1BQU0sU0FBUyxHQUFHLEdBQVMsRUFBRTtRQUUzQixPQUFPLElBQUksQ0FBQyxDQUFDO1FBRWIsSUFBSyxPQUFPO1lBQUcsT0FBTztRQUV0QixPQUFPLEVBQUcsQ0FBQztJQUViLENBQUMsQ0FBQztJQUVGLE9BQU8sRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLFNBQVMsRUFBRSxDQUFDO0FBRTNDLENBQUMsQ0FBQztBQUVGLFlBQVk7QUFFWixPQUFPLEVBQUMsVUFBVSxFQUFFLGtCQUFrQixFQUFDLENBQUMifQ==
|
Reference in New Issue
Block a user