diff options
| author | pack <pack@packgekko.xyz> | 2026-08-09 10:54:08 +0000 |
|---|---|---|
| committer | pack <pack@packgekko.xyz> | 2026-08-09 10:54:08 +0000 |
| commit | d3adc16a08d95d6e331de55d7d3bf05a66a874a8 (patch) | |
| tree | a2dabd199501e67c547c2ce79e1374ca3aa55443 /node_modules/tar/dist/esm/extract.js | |
| parent | 55a4f1fc869e41aca748c63d3018f0448b1606e0 (diff) | |
| download | crud-d3adc16a08d95d6e331de55d7d3bf05a66a874a8.tar.gz | |
stop tracking node_modules/
Diffstat (limited to '')
| -rw-r--r-- | node_modules/tar/dist/esm/extract.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/node_modules/tar/dist/esm/extract.js b/node_modules/tar/dist/esm/extract.js deleted file mode 100644 index 2274fee..0000000 --- a/node_modules/tar/dist/esm/extract.js +++ /dev/null @@ -1,49 +0,0 @@ -// tar -x -import * as fsm from '@isaacs/fs-minipass'; -import fs from 'node:fs'; -import { filesFilter } from './list.js'; -import { makeCommand } from './make-command.js'; -import { Unpack, UnpackSync } from './unpack.js'; -const extractFileSync = (opt) => { - const u = new UnpackSync(opt); - const file = opt.file; - const stat = fs.statSync(file); - // This trades a zero-byte read() syscall for a stat - // However, it will usually result in less memory allocation - const readSize = opt.maxReadSize || 16 * 1024 * 1024; - const stream = new fsm.ReadStreamSync(file, { - readSize: readSize, - size: stat.size, - }); - stream.pipe(u); -}; -const extractFile = (opt, _) => { - const u = new Unpack(opt); - const readSize = opt.maxReadSize || 16 * 1024 * 1024; - const file = opt.file; - const p = new Promise((resolve, reject) => { - u.on('error', reject); - u.on('close', resolve); - // This trades a zero-byte read() syscall for a stat - // However, it will usually result in less memory allocation - fs.stat(file, (er, stat) => { - if (er) { - reject(er); - } - else { - const stream = new fsm.ReadStream(file, { - readSize: readSize, - size: stat.size, - }); - stream.on('error', reject); - stream.pipe(u); - } - }); - }); - return p; -}; -export const extract = makeCommand(extractFileSync, extractFile, opt => new UnpackSync(opt), opt => new Unpack(opt), (opt, files) => { - if (files?.length) - filesFilter(opt, files); -}); -//# sourceMappingURL=extract.js.map
\ No newline at end of file |