diff options
Diffstat (limited to 'node_modules/@nodelib/fs.walk/out/providers')
8 files changed, 124 insertions, 0 deletions
diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts new file mode 100644 index 0000000..1f5f1ba --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts @@ -0,0 +1,13 @@ +import AsyncReader from '../readers/async';
+import Settings from '../settings';
+import { Entry, Errno } from '../types';
+export declare type AsyncCallback = (err: Errno, entries: Entry[]) => void;
+export default class AsyncProvider {
+ private readonly _root;
+ private readonly _settings;
+ protected readonly _reader: AsyncReader;
+ private readonly _storage;
+ constructor(_root: string, _settings: Settings);
+ read(callback: AsyncCallback): void;
+}
+//# sourceMappingURL=async.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js new file mode 100644 index 0000000..20e4ab5 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.js @@ -0,0 +1,30 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const async_1 = require("../readers/async");
+class AsyncProvider {
+ constructor(_root, _settings) {
+ this._root = _root;
+ this._settings = _settings;
+ this._reader = new async_1.default(this._root, this._settings);
+ this._storage = new Set();
+ }
+ read(callback) {
+ this._reader.onError((error) => {
+ callFailureCallback(callback, error);
+ });
+ this._reader.onEntry((entry) => {
+ this._storage.add(entry);
+ });
+ this._reader.onEnd(() => {
+ callSuccessCallback(callback, [...this._storage]);
+ });
+ this._reader.read();
+ }
+}
+exports.default = AsyncProvider;
+function callFailureCallback(callback, error) {
+ callback(error);
+}
+function callSuccessCallback(callback, entries) {
+ callback(null, entries);
+}
diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts new file mode 100644 index 0000000..cbdfb3b --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts @@ -0,0 +1,5 @@ +import AsyncProvider from './async';
+import StreamProvider from './stream';
+import SyncProvider from './sync';
+export { AsyncProvider, StreamProvider, SyncProvider };
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js new file mode 100644 index 0000000..c6dd916 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.js @@ -0,0 +1,8 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const async_1 = require("./async");
+exports.AsyncProvider = async_1.default;
+const stream_1 = require("./stream");
+exports.StreamProvider = stream_1.default;
+const sync_1 = require("./sync");
+exports.SyncProvider = sync_1.default;
diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts new file mode 100644 index 0000000..810111d --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts @@ -0,0 +1,13 @@ +/// <reference types="node" />
+import { Readable } from 'stream';
+import AsyncReader from '../readers/async';
+import Settings from '../settings';
+export default class StreamProvider {
+ private readonly _root;
+ private readonly _settings;
+ protected readonly _reader: AsyncReader;
+ protected readonly _stream: Readable;
+ constructor(_root: string, _settings: Settings);
+ read(): Readable;
+}
+//# sourceMappingURL=stream.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js new file mode 100644 index 0000000..f44cd8a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.js @@ -0,0 +1,30 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const stream_1 = require("stream");
+const async_1 = require("../readers/async");
+class StreamProvider {
+ constructor(_root, _settings) {
+ this._root = _root;
+ this._settings = _settings;
+ this._reader = new async_1.default(this._root, this._settings);
+ this._stream = new stream_1.Readable({
+ objectMode: true,
+ read: () => { },
+ destroy: this._reader.destroy.bind(this._reader)
+ });
+ }
+ read() {
+ this._reader.onError((error) => {
+ this._stream.emit('error', error);
+ });
+ this._reader.onEntry((entry) => {
+ this._stream.push(entry);
+ });
+ this._reader.onEnd(() => {
+ this._stream.push(null);
+ });
+ this._reader.read();
+ return this._stream;
+ }
+}
+exports.default = StreamProvider;
diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts new file mode 100644 index 0000000..9570fd1 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts @@ -0,0 +1,11 @@ +import SyncReader from '../readers/sync';
+import Settings from '../settings';
+import { Entry } from '../types';
+export default class SyncProvider {
+ private readonly _root;
+ private readonly _settings;
+ protected readonly _reader: SyncReader;
+ constructor(_root: string, _settings: Settings);
+ read(): Entry[];
+}
+//# sourceMappingURL=sync.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js new file mode 100644 index 0000000..fef1d8d --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.js @@ -0,0 +1,14 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const sync_1 = require("../readers/sync");
+class SyncProvider {
+ constructor(_root, _settings) {
+ this._root = _root;
+ this._settings = _settings;
+ this._reader = new sync_1.default(this._root, this._settings);
+ }
+ read() {
+ return this._reader.read();
+ }
+}
+exports.default = SyncProvider;
|