aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@nodelib/fs.walk/out/providers
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@nodelib/fs.walk/out/providers')
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/async.d.ts12
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/async.js30
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/index.d.ts4
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/index.js9
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/stream.d.ts12
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/stream.js34
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/sync.d.ts10
-rw-r--r--node_modules/@nodelib/fs.walk/out/providers/sync.js14
8 files changed, 125 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..0f6717d
--- /dev/null
+++ b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts
@@ -0,0 +1,12 @@
+import AsyncReader from '../readers/async';
+import type Settings from '../settings';
+import type { Entry, Errno } from '../types';
+export declare type AsyncCallback = (error: 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;
+}
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..51d3be5
--- /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 = [];
+ }
+ read(callback) {
+ this._reader.onError((error) => {
+ callFailureCallback(callback, error);
+ });
+ this._reader.onEntry((entry) => {
+ this._storage.push(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..874f60c
--- /dev/null
+++ b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts
@@ -0,0 +1,4 @@
+import AsyncProvider from './async';
+import StreamProvider from './stream';
+import SyncProvider from './sync';
+export { AsyncProvider, StreamProvider, SyncProvider };
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..4c2529c
--- /dev/null
+++ b/node_modules/@nodelib/fs.walk/out/providers/index.js
@@ -0,0 +1,9 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0;
+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..294185f
--- /dev/null
+++ b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts
@@ -0,0 +1,12 @@
+/// <reference types="node" />
+import { Readable } from 'stream';
+import AsyncReader from '../readers/async';
+import type 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;
+}
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..51298b0
--- /dev/null
+++ b/node_modules/@nodelib/fs.walk/out/providers/stream.js
@@ -0,0 +1,34 @@
+"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: () => {
+ if (!this._reader.isDestroyed) {
+ this._reader.destroy();
+ }
+ }
+ });
+ }
+ 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..551c42e
--- /dev/null
+++ b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts
@@ -0,0 +1,10 @@
+import SyncReader from '../readers/sync';
+import type Settings from '../settings';
+import type { Entry } from '../types';
+export default class SyncProvider {
+ private readonly _root;
+ private readonly _settings;
+ protected readonly _reader: SyncReader;
+ constructor(_root: string, _settings: Settings);
+ read(): Entry[];
+}
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..faab6ca
--- /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;