extract-base-iterator 3.4.1 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DirectoryEntry.js +2 -3
- package/dist/cjs/DirectoryEntry.js.map +1 -1
- package/dist/cjs/FileEntry.js +2 -3
- package/dist/cjs/FileEntry.js.map +1 -1
- package/dist/cjs/LinkEntry.js +2 -3
- package/dist/cjs/LinkEntry.js.map +1 -1
- package/dist/cjs/SymbolicLinkEntry.js +2 -3
- package/dist/cjs/SymbolicLinkEntry.js.map +1 -1
- package/dist/esm/DirectoryEntry.js +2 -5
- package/dist/esm/DirectoryEntry.js.map +1 -1
- package/dist/esm/FileEntry.js +2 -5
- package/dist/esm/FileEntry.js.map +1 -1
- package/dist/esm/LinkEntry.js +2 -5
- package/dist/esm/LinkEntry.js.map +1 -1
- package/dist/esm/SymbolicLinkEntry.js +2 -5
- package/dist/esm/SymbolicLinkEntry.js.map +1 -1
- package/package.json +1 -1
|
@@ -59,14 +59,13 @@ var DirectoryEntry = /*#__PURE__*/ function() {
|
|
|
59
59
|
queue.defer(_chownts.default.bind(null, fullPath, this, options));
|
|
60
60
|
queue.defer(_utimests.default.bind(null, fullPath, this, options));
|
|
61
61
|
queue.await(callback);
|
|
62
|
-
return;
|
|
63
62
|
} catch (err) {
|
|
64
63
|
callback(err);
|
|
65
|
-
return;
|
|
66
64
|
}
|
|
65
|
+
return;
|
|
67
66
|
}
|
|
68
67
|
return new Promise(function(resolve, reject) {
|
|
69
|
-
_this.create(dest, options, function(err, done) {
|
|
68
|
+
return _this.create(dest, options, function(err, done) {
|
|
70
69
|
return err ? reject(err) : resolve(done);
|
|
71
70
|
});
|
|
72
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/DirectoryEntry.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { DirectoryAttributes, ExtractOptions, NoParamCallback } from './types.ts';\n\nexport default class DirectoryEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: DirectoryAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.type === undefined) this.type = 'directory';\n if (this.basename === undefined) this.basename = path.basename(this.path);\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n // do not check for the existence of the directory but allow out-of-order calling\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/DirectoryEntry.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { DirectoryAttributes, ExtractOptions, NoParamCallback } from './types.ts';\n\nexport default class DirectoryEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: DirectoryAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.type === undefined) this.type = 'directory';\n if (this.basename === undefined) this.basename = path.basename(this.path);\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n // do not check for the existence of the directory but allow out-of-order calling\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["DirectoryEntry","MANDATORY_ATTRIBUTES","attributes","validateAttributes","objectAssign","type","undefined","basename","path","create","dest","options","callback","normalizedPath","normalize","fullPath","join","stripPath","queue","Queue","defer","mkdirp","bind","waitForAccess","chmod","chown","utim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CO,MAAME,KAAK,CAACM,iBAAM,CAACJ,IAAI,CAAC,MAAMP,UAAU,IAAI,EAAEJ;gBAC9CO,MAAMS,KAAK,CAACf;YACd,EAAE,OAAOgB,KAAK;gBACZhB,SAASgB;YACX;YACA;QACF;QAEA,OAAO,IAAIC,QAAQ,SAACC,SAASC;mBAAW,MAAKtB,MAAM,CAACC,MAAMC,SAAS,SAACiB,KAAaI;uBAAoBJ,MAAMG,OAAOH,OAAOE,QAAQE;;;IACnI;IAEAC,OAAAA,OAAY,GAAZA,SAAAA,WAAW;WA3CQjC"}
|
package/dist/cjs/FileEntry.js
CHANGED
|
@@ -85,14 +85,13 @@ var FileEntry = /*#__PURE__*/ function() {
|
|
|
85
85
|
queue.defer(_chownts.default.bind(null, fullPath, this, options));
|
|
86
86
|
queue.defer(_utimests.default.bind(null, fullPath, this, options));
|
|
87
87
|
queue.await(callback);
|
|
88
|
-
return;
|
|
89
88
|
} catch (err) {
|
|
90
89
|
callback(err);
|
|
91
|
-
return;
|
|
92
90
|
}
|
|
91
|
+
return;
|
|
93
92
|
}
|
|
94
93
|
return new Promise(function(resolve, reject) {
|
|
95
|
-
_this.create(dest, options, function(err, done) {
|
|
94
|
+
return _this.create(dest, options, function(err, done) {
|
|
96
95
|
return err ? reject(err) : resolve(done);
|
|
97
96
|
});
|
|
98
97
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/FileEntry.ts"],"sourcesContent":["import { rm } from 'fs-remove-compat';\nimport fs from 'graceful-fs';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, FileAttributes, NoParamCallback, WriteFileFn } from './types.ts';\n\ninterface AbstractFileEntry {\n _writeFile: WriteFileFn;\n}\n\nexport default class FileEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: FileAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'file';\n if ((this as unknown as AbstractFileEntry)._writeFile === undefined) throw new Error('File this missing _writeFile. Please implement this method in your subclass');\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n } else {\n // Check if file exists - throw EEXIST if it does\n queue.defer((callback) => {\n fs.stat(fullPath, (err) => {\n if (!err) {\n const existsErr = new Error(`EEXIST: file already exists, open '${fullPath}'`) as NodeJS.ErrnoException;\n existsErr.code = 'EEXIST';\n existsErr.path = fullPath;\n return callback(existsErr);\n }\n // ENOENT means file doesn't exist - that's what we want\n if (err.code === 'ENOENT') return callback();\n // Other errors should be reported\n callback(err);\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer((this as unknown as AbstractFileEntry)._writeFile.bind(this, fullPath, options));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/FileEntry.ts"],"sourcesContent":["import { rm } from 'fs-remove-compat';\nimport fs from 'graceful-fs';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, FileAttributes, NoParamCallback, WriteFileFn } from './types.ts';\n\ninterface AbstractFileEntry {\n _writeFile: WriteFileFn;\n}\n\nexport default class FileEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: FileAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'file';\n if ((this as unknown as AbstractFileEntry)._writeFile === undefined) throw new Error('File this missing _writeFile. Please implement this method in your subclass');\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n } else {\n // Check if file exists - throw EEXIST if it does\n queue.defer((callback) => {\n fs.stat(fullPath, (err) => {\n if (!err) {\n const existsErr = new Error(`EEXIST: file already exists, open '${fullPath}'`) as NodeJS.ErrnoException;\n existsErr.code = 'EEXIST';\n existsErr.path = fullPath;\n return callback(existsErr);\n }\n // ENOENT means file doesn't exist - that's what we want\n if (err.code === 'ENOENT') return callback();\n // Other errors should be reported\n callback(err);\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer((this as unknown as AbstractFileEntry)._writeFile.bind(this, fullPath, options));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["FileEntry","MANDATORY_ATTRIBUTES","attributes","validateAttributes","objectAssign","basename","undefined","path","type","_writeFile","Error","create","dest","options","callback","normalizedPath","normalize","fullPath","join","stripPath","queue","Queue","force","defer","rm","err","code","fs","stat","existsErr","mkdirp","bind","dirname","waitForAccess","chmod","chown","utimes","await","Promise","resolve","reject","done","destroy"],"mappings":";;;;;;;eAsBqBA;;;8BAtBF;iEACJ;oEACI;2DACF;8DACC;8DACA;8DACA;+DACC;uBACU;kEACP;2EACS;sEACL;;;;;;;;;;;AAE1B,IAAMC,uBAAuB;IAAC;IAAQ;IAAS;CAAO;AASvC,IAAA,AAAMD,0BAAN;;aAAMA,UAOPE,UAA0B;gCAPnBF;QAQjBG,IAAAA,6BAAkB,EAACD,YAAYD;QAC/BG,IAAAA,qBAAY,EAAC,IAAI,EAAEF;QACnB,IAAI,IAAI,CAACG,QAAQ,K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AK,CAACO,sBAAM,CAACC,IAAI,CAAC,MAAMxB,aAAI,CAACyB,OAAO,CAACf;gBAC3CG,MAAMG,KAAK,CAAC,AAAC,IAAI,CAAkCd,UAAU,CAACsB,IAAI,CAAC,IAAI,EAAEd,UAAUJ;gBACnFO,MAAMG,KAAK,CAACU,wBAAa,CAACF,IAAI,CAAC,MAAMd;gBACrCG,MAAMG,KAAK,CAACW,gBAAK,CAACH,IAAI,CAAC,MAAMd,UAAU,IAAI,EAAEJ;gBAC7CO,MAAMG,KAAK,CAACY,gBAAK,CAACJ,IAAI,CAAC,MAAMd,UAAU,IAAI,EAAEJ;gBAC7CO,MAAMG,KAAK,CAACa,iBAAM,CAACL,IAAI,CAAC,MAAMd,UAAU,IAAI,EAAEJ;gBAC9CO,MAAMiB,KAAK,CAACvB;YACd,EAAE,OAAOW,KAAK;gBACZX,SAASW;YACX;YACA;QACF;QAEA,OAAO,IAAIa,QAAQ,SAACC,SAASC;mBAAW,MAAK7B,MAAM,CAACC,MAAMC,SAAS,SAACY,KAAagB;uBAAoBhB,MAAMe,OAAOf,OAAOc,QAAQE;;;IACnI;IAEAC,OAAAA,OAAY,GAAZA,SAAAA,WAAW;WAnEQ1C"}
|
package/dist/cjs/LinkEntry.js
CHANGED
|
@@ -72,14 +72,13 @@ var LinkEntry = /*#__PURE__*/ function() {
|
|
|
72
72
|
queue.defer(_chownts.default.bind(null, fullPath, this, options));
|
|
73
73
|
queue.defer(_utimests.default.bind(null, fullPath, this, options));
|
|
74
74
|
queue.await(callback);
|
|
75
|
-
return;
|
|
76
75
|
} catch (err) {
|
|
77
76
|
callback(err);
|
|
78
|
-
return;
|
|
79
77
|
}
|
|
78
|
+
return;
|
|
80
79
|
}
|
|
81
80
|
return new Promise(function(resolve, reject) {
|
|
82
|
-
_this.create(dest, options, function(err, done) {
|
|
81
|
+
return _this.create(dest, options, function(err, done) {
|
|
83
82
|
return err ? reject(err) : resolve(done);
|
|
84
83
|
});
|
|
85
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/LinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class LinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'link';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n const normalizedLinkpath = path.normalize(this.linkpath);\n const linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer(waitForAccess.bind(null, linkFullPath)); // ensure target file is accessible before linking\n queue.defer(fs.link.bind(fs, linkFullPath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/LinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class LinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'link';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n const normalizedLinkpath = path.normalize(this.linkpath);\n const linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer(waitForAccess.bind(null, linkFullPath)); // ensure target file is accessible before linking\n queue.defer(fs.link.bind(fs, linkFullPath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["LinkEntry","MANDATORY_ATTRIBUTES","attributes","validateAttributes","objectAssign","basename","undefined","path","type","create","dest","options","callback","normalizedPath","normalize","fullPath","join","stripPath","normalizedLinkpath","linkpath","linkFullPath","queue","Queue","force","defer","rm","err","code","mkdirp","bind","dirname","waitForAccess","fs","link","chmod","chown","utimes","await","Promise","resolve","reject","done","destroy"],"mappings":";;;;;;;eAkBqBA;;;yDAlBN;8BACI;oEACA;2DACF;8DACC;8DACA;8DACA;+DACC;uBACU;kEACP;2EACS;sEACL;;;;;;;;;;;AAE1B,IAAMC,uBAAuB;IAAC;IAAQ;IAAS;IAAQ;CAAW;AAKnD,IAAA,AAAMD,0BAAN;;aAAMA,UAQPE,UAA0B;gCARnBF;QASjBG,IAAAA,6BAAkB,EAACD,YAAYD;QAC/BG,IAAAA,qBAAY,EAAC,IAAI,EAAEF;QACnB,IAAI,IAAI,CAACG,QAAQ,KAAKC,WAAW,IAAI,CAACD,QAAQ,GAAGE,aAAI,CAACF,QAAQ,CAAC,IAAI,CAACE,IAAI;QACxE,IAAI,IAAI,CAACC,IAAI,KAAKF,WA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I,CAAC,MAAMd,UAAU,IAAI,EAAEJ;gBAC7CU,MAAMG,KAAK,CAACY,iBAAM,CAACP,IAAI,CAAC,MAAMd,UAAU,IAAI,EAAEJ;gBAC9CU,MAAMgB,KAAK,CAACzB;YACd,EAAE,OAAOc,KAAK;gBACZd,SAASc;YACX;YACA;QACF;QAEA,OAAO,IAAIY,QAAQ,SAACC,SAASC;mBAAW,MAAK/B,MAAM,CAACC,MAAMC,SAAS,SAACe,KAAae;uBAAoBf,MAAMc,OAAOd,OAAOa,QAAQE;;;IACnI;IAEAC,OAAAA,OAAY,GAAZA,SAAAA,WAAW;WAtDQ1C"}
|
|
@@ -80,14 +80,13 @@ var SymbolicLinkEntry = /*#__PURE__*/ function() {
|
|
|
80
80
|
queue.defer(_chownts.default.bind(null, fullPath, this, options));
|
|
81
81
|
queue.defer(_lutimests.default.bind(null, fullPath, this, options));
|
|
82
82
|
queue.await(callback);
|
|
83
|
-
return;
|
|
84
83
|
} catch (err) {
|
|
85
84
|
callback(err);
|
|
86
|
-
return;
|
|
87
85
|
}
|
|
86
|
+
return;
|
|
88
87
|
}
|
|
89
88
|
return new Promise(function(resolve, reject) {
|
|
90
|
-
_this.create(dest, options, function(err, done) {
|
|
89
|
+
return _this.create(dest, options, function(err, done) {
|
|
91
90
|
return err ? reject(err) : resolve(done);
|
|
92
91
|
});
|
|
93
92
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/SymbolicLinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport isAbsolute from 'is-absolute';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport lutimes from './fs/lutimes.ts';\nimport symlinkWin32 from './fs/symlinkWin32.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class SymbolicLinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'symlink';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n let normalizedLinkpath = path.normalize(this.linkpath);\n let linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n if (!isAbsolute(normalizedLinkpath)) {\n const linkRelativePath = path.join(path.dirname(normalizedPath), this.linkpath);\n linkFullPath = path.join(dest, stripPath(linkRelativePath, options));\n normalizedLinkpath = path.relative(path.dirname(fullPath), linkFullPath);\n }\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n if (isWindows) queue.defer(symlinkWin32.bind(null, linkFullPath, normalizedLinkpath, fullPath));\n else queue.defer(fs.symlink.bind(fs, normalizedLinkpath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath, true)); // noFollow=true for symlinks\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(lutimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/SymbolicLinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport isAbsolute from 'is-absolute';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport lutimes from './fs/lutimes.ts';\nimport symlinkWin32 from './fs/symlinkWin32.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class SymbolicLinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'symlink';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n let normalizedLinkpath = path.normalize(this.linkpath);\n let linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n if (!isAbsolute(normalizedLinkpath)) {\n const linkRelativePath = path.join(path.dirname(normalizedPath), this.linkpath);\n linkFullPath = path.join(dest, stripPath(linkRelativePath, options));\n normalizedLinkpath = path.relative(path.dirname(fullPath), linkFullPath);\n }\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n if (isWindows) queue.defer(symlinkWin32.bind(null, linkFullPath, normalizedLinkpath, fullPath));\n else queue.defer(fs.symlink.bind(fs, normalizedLinkpath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath, true)); // noFollow=true for symlinks\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(lutimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["SymbolicLinkEntry","isWindows","process","platform","test","env","OSTYPE","MANDATORY_ATTRIBUTES","attributes","validateAttributes","objectAssign","basename","undefined","path","type","create","dest","options","callback","normalizedPath","normalize","fullPath","join","stripPath","normalizedLinkpath","linkpath","linkFullPath","isAbsolute","linkRelativePath","dirname","relative","queue","Queue","force","defer","rm","err","code","mkdirp","bind","symlinkWin32","fs","symlink","waitForAccess","chmod","chown","lutimes","await","Promise","resolve","reject","done","destroy"],"mappings":";;;;;;;eAsBqBA;;;yDAtBN;8BACI;iEACI;oEACJ;2DACF;8DACC;8DACA;8DACA;gEACE;qEACK;uBACI;kEACP;2EACS;sEACL;;;;;;;;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@@ let DirectoryEntry = class DirectoryEntry {
|
|
|
29
29
|
queue.defer(chown.bind(null, fullPath, this, options));
|
|
30
30
|
queue.defer(utimes.bind(null, fullPath, this, options));
|
|
31
31
|
queue.await(callback);
|
|
32
|
-
return;
|
|
33
32
|
} catch (err) {
|
|
34
33
|
callback(err);
|
|
35
|
-
return;
|
|
36
34
|
}
|
|
35
|
+
return;
|
|
37
36
|
}
|
|
38
|
-
return new Promise((resolve, reject)=>
|
|
39
|
-
this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done));
|
|
40
|
-
});
|
|
37
|
+
return new Promise((resolve, reject)=>this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done)));
|
|
41
38
|
}
|
|
42
39
|
destroy() {}
|
|
43
40
|
constructor(attributes){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/DirectoryEntry.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { DirectoryAttributes, ExtractOptions, NoParamCallback } from './types.ts';\n\nexport default class DirectoryEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: DirectoryAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.type === undefined) this.type = 'directory';\n if (this.basename === undefined) this.basename = path.basename(this.path);\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n // do not check for the existence of the directory but allow out-of-order calling\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/DirectoryEntry.ts"],"sourcesContent":["import mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { DirectoryAttributes, ExtractOptions, NoParamCallback } from './types.ts';\n\nexport default class DirectoryEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: DirectoryAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.type === undefined) this.type = 'directory';\n if (this.basename === undefined) this.basename = path.basename(this.path);\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n // do not check for the existence of the directory but allow out-of-order calling\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["mkdirp","path","Queue","chmod","chown","utimes","objectAssign","stripPath","validateAttributes","waitForAccess","MANDATORY_ATTRIBUTES","DirectoryEntry","create","dest","options","callback","normalizedPath","normalize","fullPath","join","queue","defer","bind","await","err","Promise","resolve","reject","done","destroy","attributes","type","undefined","basename"],"mappings":"AAAA,OAAOA,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,WAAW,gBAAgB;AAClC,OAAOC,WAAW,gBAAgB;AAClC,OAAOC,YAAY,iBAAiB;AACpC,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,eAAe,wBAAwB;AAC9C,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,mBAAmB,qBAAqB;AAE/C,MAAMC,uBAAuB;IAAC;IAAQ;IAAS;CAAO;AAKvC,IAAA,AAAMC,iBAAN,MAAMA;IAiBnBC,OAAOC,IAAY,EAAEC,OAA0C,EAAEC,QAA0B,EAA2B;QACpHA,WAAW,OAAOD,YAAY,aAAaA,UAAUC;QACrDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;QAE7D,IAAI,OAAOC,aAAa,YAAY;Y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bind(null, fullPath, this, options));
|
|
56
56
|
queue.await(callback);
|
|
57
|
-
return;
|
|
58
57
|
} catch (err) {
|
|
59
58
|
callback(err);
|
|
60
|
-
return;
|
|
61
59
|
}
|
|
60
|
+
return;
|
|
62
61
|
}
|
|
63
|
-
return new Promise((resolve, reject)=>
|
|
64
|
-
this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done));
|
|
65
|
-
});
|
|
62
|
+
return new Promise((resolve, reject)=>this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done)));
|
|
66
63
|
}
|
|
67
64
|
destroy() {}
|
|
68
65
|
constructor(attributes){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/FileEntry.ts"],"sourcesContent":["import { rm } from 'fs-remove-compat';\nimport fs from 'graceful-fs';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, FileAttributes, NoParamCallback, WriteFileFn } from './types.ts';\n\ninterface AbstractFileEntry {\n _writeFile: WriteFileFn;\n}\n\nexport default class FileEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: FileAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'file';\n if ((this as unknown as AbstractFileEntry)._writeFile === undefined) throw new Error('File this missing _writeFile. Please implement this method in your subclass');\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n } else {\n // Check if file exists - throw EEXIST if it does\n queue.defer((callback) => {\n fs.stat(fullPath, (err) => {\n if (!err) {\n const existsErr = new Error(`EEXIST: file already exists, open '${fullPath}'`) as NodeJS.ErrnoException;\n existsErr.code = 'EEXIST';\n existsErr.path = fullPath;\n return callback(existsErr);\n }\n // ENOENT means file doesn't exist - that's what we want\n if (err.code === 'ENOENT') return callback();\n // Other errors should be reported\n callback(err);\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer((this as unknown as AbstractFileEntry)._writeFile.bind(this, fullPath, options));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/FileEntry.ts"],"sourcesContent":["import { rm } from 'fs-remove-compat';\nimport fs from 'graceful-fs';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, FileAttributes, NoParamCallback, WriteFileFn } from './types.ts';\n\ninterface AbstractFileEntry {\n _writeFile: WriteFileFn;\n}\n\nexport default class FileEntry {\n mode: Mode;\n mtime: number;\n path: string;\n basename: string;\n type: string;\n\n constructor(attributes: FileAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'file';\n if ((this as unknown as AbstractFileEntry)._writeFile === undefined) throw new Error('File this missing _writeFile. Please implement this method in your subclass');\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n } else {\n // Check if file exists - throw EEXIST if it does\n queue.defer((callback) => {\n fs.stat(fullPath, (err) => {\n if (!err) {\n const existsErr = new Error(`EEXIST: file already exists, open '${fullPath}'`) as NodeJS.ErrnoException;\n existsErr.code = 'EEXIST';\n existsErr.path = fullPath;\n return callback(existsErr);\n }\n // ENOENT means file doesn't exist - that's what we want\n if (err.code === 'ENOENT') return callback();\n // Other errors should be reported\n callback(err);\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer((this as unknown as AbstractFileEntry)._writeFile.bind(this, fullPath, options));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["rm","fs","mkdirp","path","Queue","chmod","chown","utimes","objectAssign","stripPath","validateAttributes","waitForAccess","MANDATORY_ATTRIBUTES","FileEntry","create","dest","options","callback","normalizedPath","normalize","fullPath","join","queue","force","defer","err","code","stat","existsErr","Error","bind","dirname","_writeFile","await","Promise","resolve","reject","done","destroy","attributes","basename","undefined","type"],"mappings":"AAAA,SAASA,EAAE,QAAQ,mBAAmB;AACtC,OAAOC,QAAQ,cAAc;AAC7B,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,WAAW,gBAAgB;AAClC,OAAOC,WAAW,gBAAgB;AAClC,OAAOC,YAAY,iBAAiB;AACpC,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,eAAe,wBAAwB;AAC9C,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,mBAAmB,qBAAqB;AAE/C,MAAMC,uBAAuB;IAAC;IAAQ;IAAS;CAAO;AASvC,IAAA,AAAMC,YAAN,MAAMA;IAkBnBC,OAAOC,IAAY,EAAEC,OAA0C,EAAEC,QAA0B,EAA2B;QACpHA,WAAW,OAAOD,YAAY,aAAaA,UAAUC;QACrDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;QAE7D,IAAI,OAAOC,aAAa,YAAY;YAClC,IAAI;gBACF,MAAMC,iBAAiBf,KAAKgB,SAAS,CAAC,IAAI,CAAChB,IAAI;gBAC/C,MAAMiB,WAAWjB,KAAKkB,IAAI,CAACN,MAAMN,UAAUS,gBAAgBF;gBAE3D,MAA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AMW,OAAOX,OAAOU,QAAQE;IACnI;IAEAC,UAAU,CAAC;IA5DX,YAAYC,UAA0B,CAAE;QACtC7B,mBAAmB6B,YAAY3B;QAC/BJ,aAAa,IAAI,EAAE+B;QACnB,IAAI,IAAI,CAACC,QAAQ,KAAKC,WAAW,IAAI,CAACD,QAAQ,GAAGrC,KAAKqC,QAAQ,CAAC,IAAI,CAACrC,IAAI;QACxE,IAAI,IAAI,CAACuC,IAAI,KAAKD,WAAW,IAAI,CAACC,IAAI,GAAG;QACzC,IAAI,AAAC,IAAI,CAAkCV,UAAU,KAAKS,WAAW,MAAM,IAAIZ,MAAM;IACvF;AAuDF;AApEA,SAAqBhB,uBAoEpB"}
|
package/dist/esm/LinkEntry.js
CHANGED
|
@@ -42,15 +42,12 @@ let LinkEntry = class LinkEntry {
|
|
|
42
42
|
queue.defer(chown.bind(null, fullPath, this, options));
|
|
43
43
|
queue.defer(utimes.bind(null, fullPath, this, options));
|
|
44
44
|
queue.await(callback);
|
|
45
|
-
return;
|
|
46
45
|
} catch (err) {
|
|
47
46
|
callback(err);
|
|
48
|
-
return;
|
|
49
47
|
}
|
|
48
|
+
return;
|
|
50
49
|
}
|
|
51
|
-
return new Promise((resolve, reject)=>
|
|
52
|
-
this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done));
|
|
53
|
-
});
|
|
50
|
+
return new Promise((resolve, reject)=>this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done)));
|
|
54
51
|
}
|
|
55
52
|
destroy() {}
|
|
56
53
|
constructor(attributes){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/LinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class LinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'link';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n const normalizedLinkpath = path.normalize(this.linkpath);\n const linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer(waitForAccess.bind(null, linkFullPath)); // ensure target file is accessible before linking\n queue.defer(fs.link.bind(fs, linkFullPath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/LinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport utimes from './fs/utimes.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class LinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'link';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n const normalizedLinkpath = path.normalize(this.linkpath);\n const linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n queue.defer(waitForAccess.bind(null, linkFullPath)); // ensure target file is accessible before linking\n queue.defer(fs.link.bind(fs, linkFullPath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath));\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(utimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["fs","rm","mkdirp","path","Queue","chmod","chown","utimes","objectAssign","stripPath","validateAttributes","waitForAccess","MANDATORY_ATTRIBUTES","LinkEntry","create","dest","options","callback","normalizedPath","normalize","fullPath","join","normalizedLinkpath","linkpath","linkFullPath","queue","force","defer","err","code","bind","dirname","link","await","Promise","resolve","reject","done","destroy","attributes","basename","undefined","type"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,EAAE,QAAQ,mBAAmB;AACtC,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,WAAW,gBAAgB;AAClC,OAAOC,WAAW,gBAAgB;AAClC,OAAOC,YAAY,iBAAiB;AACpC,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,eAAe,wBAAwB;AAC9C,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,mBAAmB,qBAAqB;AAE/C,MAAMC,uBAAuB;IAAC;IAAQ;IAAS;IAAQ;CAAW;AAKnD,IAAA,AAAMC,YAAN,MAAMA;IAkBnBC,OAAOC,IAAY,EAAEC,OAA0C,EAAEC,QAA0B,EAA2B;QACpHA,WAAW,OAAOD,YAAY,aAAaA,UAAUC;QACrDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;QAE7D,IAAI,OAAOC,aAAa,YAAY;YAClC,IAAI;gBACF,MAAMC,iBAAiBf,KAAKgB,SAAS,CAAC,IAAI,CAAChB,IAAI;gBAC/C,MAAMiB,WAAWjB,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ACnB,IAAI,IAAI,CAACC,QAAQ,KAAKC,WAAW,IAAI,CAACD,QAAQ,GAAGrC,KAAKqC,QAAQ,CAAC,IAAI,CAACrC,IAAI;QACxE,IAAI,IAAI,CAACuC,IAAI,KAAKD,WAAW,IAAI,CAACC,IAAI,GAAG;IAC3C;AA0CF;AAvDA,SAAqB7B,uBAuDpB"}
|
|
@@ -50,15 +50,12 @@ let SymbolicLinkEntry = class SymbolicLinkEntry {
|
|
|
50
50
|
queue.defer(chown.bind(null, fullPath, this, options));
|
|
51
51
|
queue.defer(lutimes.bind(null, fullPath, this, options));
|
|
52
52
|
queue.await(callback);
|
|
53
|
-
return;
|
|
54
53
|
} catch (err) {
|
|
55
54
|
callback(err);
|
|
56
|
-
return;
|
|
57
55
|
}
|
|
56
|
+
return;
|
|
58
57
|
}
|
|
59
|
-
return new Promise((resolve, reject)=>
|
|
60
|
-
this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done));
|
|
61
|
-
});
|
|
58
|
+
return new Promise((resolve, reject)=>this.create(dest, options, (err, done)=>err ? reject(err) : resolve(done)));
|
|
62
59
|
}
|
|
63
60
|
destroy() {}
|
|
64
61
|
constructor(attributes){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/SymbolicLinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport isAbsolute from 'is-absolute';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport lutimes from './fs/lutimes.ts';\nimport symlinkWin32 from './fs/symlinkWin32.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class SymbolicLinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'symlink';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n let normalizedLinkpath = path.normalize(this.linkpath);\n let linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n if (!isAbsolute(normalizedLinkpath)) {\n const linkRelativePath = path.join(path.dirname(normalizedPath), this.linkpath);\n linkFullPath = path.join(dest, stripPath(linkRelativePath, options));\n normalizedLinkpath = path.relative(path.dirname(fullPath), linkFullPath);\n }\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n if (isWindows) queue.defer(symlinkWin32.bind(null, linkFullPath, normalizedLinkpath, fullPath));\n else queue.defer(fs.symlink.bind(fs, normalizedLinkpath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath, true)); // noFollow=true for symlinks\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(lutimes.bind(null, fullPath, this, options));\n queue.await(callback);\n
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/SymbolicLinkEntry.ts"],"sourcesContent":["import fs from 'fs';\nimport { rm } from 'fs-remove-compat';\nimport isAbsolute from 'is-absolute';\nimport mkdirp from 'mkdirp-classic';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport chmod from './fs/chmod.ts';\nimport chown from './fs/chown.ts';\nimport lutimes from './fs/lutimes.ts';\nimport symlinkWin32 from './fs/symlinkWin32.ts';\nimport { objectAssign } from './shared/index.ts';\nimport stripPath from './shared/stripPath.ts';\nimport validateAttributes from './validateAttributes.ts';\nimport waitForAccess from './waitForAccess.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n\nconst MANDATORY_ATTRIBUTES = ['mode', 'mtime', 'path', 'linkpath'];\n\nimport type { Mode } from 'fs';\nimport type { ExtractOptions, LinkAttributes, NoParamCallback } from './types.ts';\n\nexport default class SymbolicLinkEntry {\n mode: Mode;\n mtime: number;\n path: string;\n linkpath: string;\n basename: string;\n type: string;\n\n constructor(attributes: LinkAttributes) {\n validateAttributes(attributes, MANDATORY_ATTRIBUTES);\n objectAssign(this, attributes);\n if (this.basename === undefined) this.basename = path.basename(this.path);\n if (this.type === undefined) this.type = 'symlink';\n }\n\n create(dest: string, callback: NoParamCallback): void;\n create(dest: string, options: ExtractOptions, callback: NoParamCallback): void;\n create(dest: string, options?: ExtractOptions): Promise<boolean>;\n create(dest: string, options?: ExtractOptions | NoParamCallback, callback?: NoParamCallback): void | Promise<boolean> {\n callback = typeof options === 'function' ? options : callback;\n options = typeof options === 'function' ? {} : ((options || {}) as ExtractOptions);\n\n if (typeof callback === 'function') {\n try {\n const normalizedPath = path.normalize(this.path);\n const fullPath = path.join(dest, stripPath(normalizedPath, options));\n let normalizedLinkpath = path.normalize(this.linkpath);\n let linkFullPath = path.join(dest, stripPath(normalizedLinkpath, options));\n if (!isAbsolute(normalizedLinkpath)) {\n const linkRelativePath = path.join(path.dirname(normalizedPath), this.linkpath);\n linkFullPath = path.join(dest, stripPath(linkRelativePath, options));\n normalizedLinkpath = path.relative(path.dirname(fullPath), linkFullPath);\n }\n\n const queue = new Queue(1);\n if (options.force) {\n queue.defer((callback) => {\n rm(fullPath, (err) => {\n err && err.code !== 'ENOENT' ? callback(err) : callback();\n });\n });\n }\n queue.defer(mkdirp.bind(null, path.dirname(fullPath)));\n if (isWindows) queue.defer(symlinkWin32.bind(null, linkFullPath, normalizedLinkpath, fullPath));\n else queue.defer(fs.symlink.bind(fs, normalizedLinkpath, fullPath));\n queue.defer(waitForAccess.bind(null, fullPath, true)); // noFollow=true for symlinks\n queue.defer(chmod.bind(null, fullPath, this, options));\n queue.defer(chown.bind(null, fullPath, this, options));\n queue.defer(lutimes.bind(null, fullPath, this, options));\n queue.await(callback);\n } catch (err) {\n callback(err);\n }\n return;\n }\n\n return new Promise((resolve, reject) => this.create(dest, options, (err?: Error, done?: boolean) => (err ? reject(err) : resolve(done))));\n }\n\n destroy() {}\n}\n"],"names":["fs","rm","isAbsolute","mkdirp","path","Queue","chmod","chown","lutimes","symlinkWin32","objectAssign","stripPath","validateAttributes","waitForAccess","isWindows","process","platform","test","env","OSTYPE","MANDATORY_ATTRIBUTES","SymbolicLinkEntry","create","dest","options","callback","normalizedPath","normalize","fullPath","join","normalizedLinkpath","linkpath","linkFullPath","linkRelativePath","dirname","relative","queue","force","defer","err","code","bind","symlink","await","Promise","resolve","reject","done","destroy","attributes","basename","undefined","type"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,EAAE,QAAQ,mBAAmB;AACtC,OAAOC,gBAAgB,cAAc;AACrC,OAAOC,YAAY,iBAAiB;AACpC,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,WAAW,gBAAgB;AAClC,OAAOC,WAAW,gBAAgB;AAClC,OAAO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