{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nconst events_1 = require(\"events\");\nconst fsScandir = require(\"@nodelib/fs.scandir\");\nconst fastq = require(\"fastq\");\nconst common = require(\"./common\");\nconst reader_1 = require(\"./reader\");\nclass AsyncReader extends reader_1.default {\n  constructor(_root, _settings) {\n    super(_root, _settings);\n    this._settings = _settings;\n    this._scandir = fsScandir.scandir;\n    this._emitter = new events_1.EventEmitter();\n    this._queue = fastq(this._worker.bind(this), this._settings.concurrency);\n    this._isFatalError = false;\n    this._isDestroyed = false;\n    this._queue.drain = () => {\n      if (!this._isFatalError) {\n        this._emitter.emit('end');\n      }\n    };\n  }\n  read() {\n    this._isFatalError = false;\n    this._isDestroyed = false;\n    setImmediate(() => {\n      this._pushToQueue(this._root, this._settings.basePath);\n    });\n    return this._emitter;\n  }\n  get isDestroyed() {\n    return this._isDestroyed;\n  }\n  destroy() {\n    if (this._isDestroyed) {\n      throw new Error('The reader is already destroyed');\n    }\n    this._isDestroyed = true;\n    this._queue.killAndDrain();\n  }\n  onEntry(callback) {\n    this._emitter.on('entry', callback);\n  }\n  onError(callback) {\n    this._emitter.once('error', callback);\n  }\n  onEnd(callback) {\n    this._emitter.once('end', callback);\n  }\n  _pushToQueue(directory, base) {\n    const queueItem = {\n      directory,\n      base\n    };\n    this._queue.push(queueItem, error => {\n      if (error !== null) {\n        this._handleError(error);\n      }\n    });\n  }\n  _worker(item, done) {\n    this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {\n      if (error !== null) {\n        done(error, undefined);\n        return;\n      }\n      for (const entry of entries) {\n        this._handleEntry(entry, item.base);\n      }\n      done(null, undefined);\n    });\n  }\n  _handleError(error) {\n    if (this._isDestroyed || !common.isFatalError(this._settings, error)) {\n      return;\n    }\n    this._isFatalError = true;\n    this._isDestroyed = true;\n    this._emitter.emit('error', error);\n  }\n  _handleEntry(entry, base) {\n    if (this._isDestroyed || this._isFatalError) {\n      return;\n    }\n    const fullpath = entry.path;\n    if (base !== undefined) {\n      entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);\n    }\n    if (common.isAppliedFilter(this._settings.entryFilter, entry)) {\n      this._emitEntry(entry);\n    }\n    if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {\n      this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);\n    }\n  }\n  _emitEntry(entry) {\n    this._emitter.emit('entry', entry);\n  }\n}\nexports.default = AsyncReader;","map":{"version":3,"names":["Object","defineProperty","exports","value","events_1","require","fsScandir","fastq","common","reader_1","AsyncReader","default","constructor","_root","_settings","_scandir","scandir","_emitter","EventEmitter","_queue","_worker","bind","concurrency","_isFatalError","_isDestroyed","drain","emit","read","setImmediate","_pushToQueue","basePath","isDestroyed","destroy","Error","killAndDrain","onEntry","callback","on","onError","once","onEnd","directory","base","queueItem","push","error","_handleError","item","done","fsScandirSettings","entries","undefined","entry","_handleEntry","isFatalError","fullpath","path","joinPathSegments","name","pathSegmentSeparator","isAppliedFilter","entryFilter","_emitEntry","dirent","isDirectory","deepFilter"],"sources":["C:/Users/user/Desktop/000newport/node_modules/@nodelib/fs.walk/out/readers/async.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst events_1 = require(\"events\");\nconst fsScandir = require(\"@nodelib/fs.scandir\");\nconst fastq = require(\"fastq\");\nconst common = require(\"./common\");\nconst reader_1 = require(\"./reader\");\nclass AsyncReader extends reader_1.default {\n    constructor(_root, _settings) {\n        super(_root, _settings);\n        this._settings = _settings;\n        this._scandir = fsScandir.scandir;\n        this._emitter = new events_1.EventEmitter();\n        this._queue = fastq(this._worker.bind(this), this._settings.concurrency);\n        this._isFatalError = false;\n        this._isDestroyed = false;\n        this._queue.drain = () => {\n            if (!this._isFatalError) {\n                this._emitter.emit('end');\n            }\n        };\n    }\n    read() {\n        this._isFatalError = false;\n        this._isDestroyed = false;\n        setImmediate(() => {\n            this._pushToQueue(this._root, this._settings.basePath);\n        });\n        return this._emitter;\n    }\n    get isDestroyed() {\n        return this._isDestroyed;\n    }\n    destroy() {\n        if (this._isDestroyed) {\n            throw new Error('The reader is already destroyed');\n        }\n        this._isDestroyed = true;\n        this._queue.killAndDrain();\n    }\n    onEntry(callback) {\n        this._emitter.on('entry', callback);\n    }\n    onError(callback) {\n        this._emitter.once('error', callback);\n    }\n    onEnd(callback) {\n        this._emitter.once('end', callback);\n    }\n    _pushToQueue(directory, base) {\n        const queueItem = { directory, base };\n        this._queue.push(queueItem, (error) => {\n            if (error !== null) {\n                this._handleError(error);\n            }\n        });\n    }\n    _worker(item, done) {\n        this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {\n            if (error !== null) {\n                done(error, undefined);\n                return;\n            }\n            for (const entry of entries) {\n                this._handleEntry(entry, item.base);\n            }\n            done(null, undefined);\n        });\n    }\n    _handleError(error) {\n        if (this._isDestroyed || !common.isFatalError(this._settings, error)) {\n            return;\n        }\n        this._isFatalError = true;\n        this._isDestroyed = true;\n        this._emitter.emit('error', error);\n    }\n    _handleEntry(entry, base) {\n        if (this._isDestroyed || this._isFatalError) {\n            return;\n        }\n        const fullpath = entry.path;\n        if (base !== undefined) {\n            entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);\n        }\n        if (common.isAppliedFilter(this._settings.entryFilter, entry)) {\n            this._emitEntry(entry);\n        }\n        if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {\n            this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);\n        }\n    }\n    _emitEntry(entry) {\n        this._emitter.emit('entry', entry);\n    }\n}\nexports.default = AsyncReader;\n"],"mappings":"AAAA,YAAY;;AACZA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7D,MAAMC,QAAQ,GAAGC,OAAO,CAAC,QAAQ,CAAC;AAClC,MAAMC,SAAS,GA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