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AK,QAAQ,SACjE,KAAK,QAAQ,YAAc,EAAU,KAAK,KAAK,QAAQ,YAE3D,KAAK,MAAM,KAAK,MAAM,KAAK,MAAO,GAElC,KAAK,KAAK,EAAI,GACf,GAEL,EAOF,SAAS,KAAM,EAAM,GACnB,OAAO,IAAI,OAAO,EAAM,EAC1B,CAEA,OAAO,QAAU","file":"/npm/klaw@4.1.0/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/klaw@4.1.0/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const { strictEqual } = require('assert')\nconst path = require('path')\nconst fs = require('fs')\nconst { Readable } = require('stream')\nconst { fileURLToPath } = require('url')\n\nclass Walker extends Readable {\n  /**\n   * @param {string} dir\n   * @param {Object} options\n   */\n  constructor (dir, options) {\n    if (dir instanceof URL) {\n      dir = fileURLToPath(dir)\n    }\n    strictEqual(typeof dir, 'string', '`dir` parameter should be of type string or file URL. Got type: ' + typeof dir)\n    options = {\n      queueMethod: 'shift',\n      pathSorter: undefined,\n      filter: undefined,\n      depthLimit: undefined,\n      preserveSymlinks: false,\n      ...options,\n      objectMode: true\n    }\n\n    super(options)\n    this.root = path.resolve(dir)\n    this.paths = [this.root]\n    this.options = options\n    if (options.depthLimit > -1) { this.rootDepth = this.root.split(path.sep).length + 1 }\n    this.fs = options.fs || fs\n  }\n\n  _read () {\n    if (this.paths.length === 0) { return this.push(null) }\n    const pathItem = this.paths[this.options.queueMethod]()\n\n    const statFunction = this.options.preserveSymlinks ? this.fs.lstat : this.fs.stat\n\n    statFunction(pathItem, (err, stats) => {\n      const item = { path: pathItem, stats: stats }\n      if (err) { return this.emit('error', err, item) }\n\n      if (!stats.isDirectory() || (this.rootDepth &&\n        pathItem.split(path.sep).length - this.rootDepth >= this.options.depthLimit)) {\n        return this.push(item)\n      }\n\n      this.fs.readdir(pathItem, (err, pathItems) => {\n        if (err) {\n          this.push(item)\n          return this.emit('error', err, item)\n        }\n\n        pathItems = pathItems.map(function (part) { return path.join(pathItem, part) })\n        if (this.options.filter) { pathItems = pathItems.filter(this.options.filter) }\n        if (this.options.pathSorter) { pathItems.sort(this.options.pathSorter) }\n        // faster way to do do incremental batch array pushes\n        this.paths.push.apply(this.paths, pathItems)\n\n        this.push(item)\n      })\n    })\n  }\n}\n\n/**\n * @param {string} root\n * @param {Object} [options]\n */\nfunction walk (root, options) {\n  return new Walker(root, options)\n}\n\nmodule.exports = walk\n"]}