@pnpm/exe 11.10.0 → 12.0.0-alpha.0
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/node_modules/v8-compile-cache/LICENSE → LICENSE} +2 -1
- package/README.md +259 -12
- package/install.js +175 -0
- package/package.json +30 -61
- package/pnpm +4 -1
- package/dist/node-gyp-bin/node-gyp +0 -6
- package/dist/node-gyp-bin/node-gyp.cmd +0 -5
- package/dist/node_modules/.package-map.json +0 -1
- package/dist/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
- package/dist/node_modules/@isaacs/fs-minipass/package.json +0 -72
- package/dist/node_modules/abbrev/LICENSE +0 -46
- package/dist/node_modules/abbrev/lib/index.js +0 -53
- package/dist/node_modules/abbrev/package.json +0 -41
- package/dist/node_modules/chownr/dist/commonjs/index.js +0 -93
- package/dist/node_modules/chownr/dist/commonjs/package.json +0 -3
- package/dist/node_modules/chownr/dist/esm/index.js +0 -85
- package/dist/node_modules/chownr/dist/esm/package.json +0 -3
- package/dist/node_modules/chownr/package.json +0 -69
- package/dist/node_modules/env-paths/index.js +0 -74
- package/dist/node_modules/env-paths/license +0 -9
- package/dist/node_modules/env-paths/package.json +0 -45
- package/dist/node_modules/exponential-backoff/LICENSE +0 -202
- package/dist/node_modules/exponential-backoff/dist/backoff.js +0 -124
- package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +0 -25
- package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +0 -45
- package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +0 -17
- package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +0 -3
- package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +0 -82
- package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +0 -8
- package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +0 -15
- package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +0 -7
- package/dist/node_modules/exponential-backoff/dist/options.js +0 -31
- package/dist/node_modules/exponential-backoff/package.json +0 -62
- package/dist/node_modules/fdir/LICENSE +0 -7
- package/dist/node_modules/fdir/dist/index.cjs +0 -588
- package/dist/node_modules/fdir/dist/index.d.cts +0 -155
- package/dist/node_modules/fdir/dist/index.d.mts +0 -155
- package/dist/node_modules/fdir/dist/index.mjs +0 -570
- package/dist/node_modules/fdir/package.json +0 -103
- package/dist/node_modules/graceful-fs/LICENSE +0 -15
- package/dist/node_modules/graceful-fs/clone.js +0 -23
- package/dist/node_modules/graceful-fs/graceful-fs.js +0 -448
- package/dist/node_modules/graceful-fs/legacy-streams.js +0 -118
- package/dist/node_modules/graceful-fs/package.json +0 -53
- package/dist/node_modules/graceful-fs/polyfills.js +0 -355
- package/dist/node_modules/isexe/dist/commonjs/index.js +0 -56
- package/dist/node_modules/isexe/dist/commonjs/index.min.js +0 -2
- package/dist/node_modules/isexe/dist/commonjs/options.js +0 -3
- package/dist/node_modules/isexe/dist/commonjs/package.json +0 -3
- package/dist/node_modules/isexe/dist/commonjs/posix.js +0 -67
- package/dist/node_modules/isexe/dist/commonjs/win32.js +0 -63
- package/dist/node_modules/isexe/dist/esm/index.js +0 -16
- package/dist/node_modules/isexe/dist/esm/index.min.js +0 -2
- package/dist/node_modules/isexe/dist/esm/options.js +0 -2
- package/dist/node_modules/isexe/dist/esm/package.json +0 -3
- package/dist/node_modules/isexe/dist/esm/posix.js +0 -62
- package/dist/node_modules/isexe/dist/esm/win32.js +0 -58
- package/dist/node_modules/isexe/package.json +0 -78
- package/dist/node_modules/minipass/dist/commonjs/index.js +0 -1038
- package/dist/node_modules/minipass/dist/commonjs/package.json +0 -3
- package/dist/node_modules/minipass/dist/esm/index.js +0 -1020
- package/dist/node_modules/minipass/dist/esm/package.json +0 -3
- package/dist/node_modules/minipass/package.json +0 -77
- package/dist/node_modules/minizlib/LICENSE +0 -26
- package/dist/node_modules/minizlib/dist/commonjs/constants.js +0 -123
- package/dist/node_modules/minizlib/dist/commonjs/index.js +0 -416
- package/dist/node_modules/minizlib/dist/commonjs/package.json +0 -3
- package/dist/node_modules/minizlib/dist/esm/constants.js +0 -117
- package/dist/node_modules/minizlib/dist/esm/index.js +0 -363
- package/dist/node_modules/minizlib/dist/esm/package.json +0 -3
- package/dist/node_modules/minizlib/package.json +0 -80
- package/dist/node_modules/node-gyp/.release-please-manifest.json +0 -3
- package/dist/node_modules/node-gyp/LICENSE +0 -24
- package/dist/node_modules/node-gyp/addon.gypi +0 -204
- package/dist/node_modules/node-gyp/bin/node-gyp.js +0 -145
- package/dist/node_modules/node-gyp/eslint.config.js +0 -3
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +0 -3
- package/dist/node_modules/node-gyp/gyp/LICENSE +0 -28
- package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +0 -4
- package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +0 -12
- package/dist/node_modules/node-gyp/gyp/gyp +0 -8
- package/dist/node_modules/node-gyp/gyp/gyp.bat +0 -5
- package/dist/node_modules/node-gyp/gyp/gyp_main.py +0 -45
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1283
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1545
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -607
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -706
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -725
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -186
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -170
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1169
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1316
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -461
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -88
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -55
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2755
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3970
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2957
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -77
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1389
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3097
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -765
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1255
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -371
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1936
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -301
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3180
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -64
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +0 -3
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +0 -177
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +0 -23
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +0 -107
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +0 -251
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +0 -807
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +0 -541
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +0 -172
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +0 -563
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +0 -116
- package/dist/node_modules/node-gyp/gyp/release-please-config.json +0 -11
- package/dist/node_modules/node-gyp/gyp/test_gyp.py +0 -260
- package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +0 -250
- package/dist/node_modules/node-gyp/lib/build.js +0 -230
- package/dist/node_modules/node-gyp/lib/clean.js +0 -15
- package/dist/node_modules/node-gyp/lib/configure.js +0 -328
- package/dist/node_modules/node-gyp/lib/create-config-gypi.js +0 -153
- package/dist/node_modules/node-gyp/lib/download.js +0 -86
- package/dist/node_modules/node-gyp/lib/find-node-directory.js +0 -63
- package/dist/node_modules/node-gyp/lib/find-python.js +0 -304
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +0 -606
- package/dist/node_modules/node-gyp/lib/install.js +0 -411
- package/dist/node_modules/node-gyp/lib/list.js +0 -26
- package/dist/node_modules/node-gyp/lib/log.js +0 -168
- package/dist/node_modules/node-gyp/lib/node-gyp.js +0 -199
- package/dist/node_modules/node-gyp/lib/process-release.js +0 -144
- package/dist/node_modules/node-gyp/lib/rebuild.js +0 -12
- package/dist/node_modules/node-gyp/lib/remove.js +0 -43
- package/dist/node_modules/node-gyp/lib/util.js +0 -81
- package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +0 -21
- package/dist/node_modules/node-gyp/package.json +0 -52
- package/dist/node_modules/node-gyp/release-please-config.json +0 -40
- package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +0 -41
- package/dist/node_modules/nopt/LICENSE +0 -15
- package/dist/node_modules/nopt/bin/nopt.js +0 -29
- package/dist/node_modules/nopt/lib/debug.js +0 -5
- package/dist/node_modules/nopt/lib/nopt-lib.js +0 -514
- package/dist/node_modules/nopt/lib/nopt.js +0 -34
- package/dist/node_modules/nopt/lib/type-defs.js +0 -91
- package/dist/node_modules/nopt/package.json +0 -52
- package/dist/node_modules/picomatch/LICENSE +0 -21
- package/dist/node_modules/picomatch/index.js +0 -17
- package/dist/node_modules/picomatch/lib/constants.js +0 -184
- package/dist/node_modules/picomatch/lib/parse.js +0 -1416
- package/dist/node_modules/picomatch/lib/picomatch.js +0 -361
- package/dist/node_modules/picomatch/lib/scan.js +0 -391
- package/dist/node_modules/picomatch/lib/utils.js +0 -72
- package/dist/node_modules/picomatch/package.json +0 -83
- package/dist/node_modules/picomatch/posix.js +0 -3
- package/dist/node_modules/proc-log/LICENSE +0 -15
- package/dist/node_modules/proc-log/lib/index.js +0 -158
- package/dist/node_modules/proc-log/package.json +0 -46
- package/dist/node_modules/semver/LICENSE +0 -15
- package/dist/node_modules/semver/bin/semver.js +0 -195
- package/dist/node_modules/semver/classes/comparator.js +0 -143
- package/dist/node_modules/semver/classes/index.js +0 -7
- package/dist/node_modules/semver/classes/range.js +0 -577
- package/dist/node_modules/semver/classes/semver.js +0 -350
- package/dist/node_modules/semver/functions/clean.js +0 -8
- package/dist/node_modules/semver/functions/cmp.js +0 -54
- package/dist/node_modules/semver/functions/coerce.js +0 -62
- package/dist/node_modules/semver/functions/compare-build.js +0 -9
- package/dist/node_modules/semver/functions/compare-loose.js +0 -5
- package/dist/node_modules/semver/functions/compare.js +0 -7
- package/dist/node_modules/semver/functions/diff.js +0 -60
- package/dist/node_modules/semver/functions/eq.js +0 -5
- package/dist/node_modules/semver/functions/gt.js +0 -5
- package/dist/node_modules/semver/functions/gte.js +0 -5
- package/dist/node_modules/semver/functions/inc.js +0 -21
- package/dist/node_modules/semver/functions/lt.js +0 -5
- package/dist/node_modules/semver/functions/lte.js +0 -5
- package/dist/node_modules/semver/functions/major.js +0 -5
- package/dist/node_modules/semver/functions/minor.js +0 -5
- package/dist/node_modules/semver/functions/neq.js +0 -5
- package/dist/node_modules/semver/functions/parse.js +0 -18
- package/dist/node_modules/semver/functions/patch.js +0 -5
- package/dist/node_modules/semver/functions/prerelease.js +0 -8
- package/dist/node_modules/semver/functions/rcompare.js +0 -5
- package/dist/node_modules/semver/functions/rsort.js +0 -5
- package/dist/node_modules/semver/functions/satisfies.js +0 -12
- package/dist/node_modules/semver/functions/sort.js +0 -5
- package/dist/node_modules/semver/functions/truncate.js +0 -48
- package/dist/node_modules/semver/functions/valid.js +0 -8
- package/dist/node_modules/semver/index.js +0 -93
- package/dist/node_modules/semver/internal/constants.js +0 -37
- package/dist/node_modules/semver/internal/debug.js +0 -11
- package/dist/node_modules/semver/internal/identifiers.js +0 -29
- package/dist/node_modules/semver/internal/lrucache.js +0 -42
- package/dist/node_modules/semver/internal/parse-options.js +0 -17
- package/dist/node_modules/semver/internal/re.js +0 -223
- package/dist/node_modules/semver/package.json +0 -78
- package/dist/node_modules/semver/preload.js +0 -4
- package/dist/node_modules/semver/range.bnf +0 -17
- package/dist/node_modules/semver/ranges/gtr.js +0 -6
- package/dist/node_modules/semver/ranges/intersects.js +0 -9
- package/dist/node_modules/semver/ranges/ltr.js +0 -6
- package/dist/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/dist/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/dist/node_modules/semver/ranges/min-version.js +0 -63
- package/dist/node_modules/semver/ranges/outside.js +0 -82
- package/dist/node_modules/semver/ranges/simplify.js +0 -49
- package/dist/node_modules/semver/ranges/subset.js +0 -249
- package/dist/node_modules/semver/ranges/to-comparators.js +0 -10
- package/dist/node_modules/semver/ranges/valid.js +0 -13
- package/dist/node_modules/tar/dist/commonjs/create.js +0 -82
- package/dist/node_modules/tar/dist/commonjs/cwd-error.js +0 -18
- package/dist/node_modules/tar/dist/commonjs/extract.js +0 -88
- package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
- package/dist/node_modules/tar/dist/commonjs/header.js +0 -348
- package/dist/node_modules/tar/dist/commonjs/index.js +0 -64
- package/dist/node_modules/tar/dist/commonjs/index.min.js +0 -4
- package/dist/node_modules/tar/dist/commonjs/large-numbers.js +0 -99
- package/dist/node_modules/tar/dist/commonjs/list.js +0 -145
- package/dist/node_modules/tar/dist/commonjs/make-command.js +0 -52
- package/dist/node_modules/tar/dist/commonjs/mkdir.js +0 -187
- package/dist/node_modules/tar/dist/commonjs/mode-fix.js +0 -29
- package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +0 -38
- package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
- package/dist/node_modules/tar/dist/commonjs/options.js +0 -66
- package/dist/node_modules/tar/dist/commonjs/pack.js +0 -544
- package/dist/node_modules/tar/dist/commonjs/package.json +0 -3
- package/dist/node_modules/tar/dist/commonjs/parse.js +0 -645
- package/dist/node_modules/tar/dist/commonjs/path-reservations.js +0 -170
- package/dist/node_modules/tar/dist/commonjs/pax.js +0 -182
- package/dist/node_modules/tar/dist/commonjs/process-umask.js +0 -7
- package/dist/node_modules/tar/dist/commonjs/read-entry.js +0 -136
- package/dist/node_modules/tar/dist/commonjs/replace.js +0 -227
- package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +0 -29
- package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +0 -18
- package/dist/node_modules/tar/dist/commonjs/symlink-error.js +0 -19
- package/dist/node_modules/tar/dist/commonjs/types.js +0 -70
- package/dist/node_modules/tar/dist/commonjs/unpack.js +0 -932
- package/dist/node_modules/tar/dist/commonjs/update.js +0 -33
- package/dist/node_modules/tar/dist/commonjs/warn-method.js +0 -31
- package/dist/node_modules/tar/dist/commonjs/winchars.js +0 -14
- package/dist/node_modules/tar/dist/commonjs/write-entry.js +0 -698
- package/dist/node_modules/tar/dist/esm/create.js +0 -76
- package/dist/node_modules/tar/dist/esm/cwd-error.js +0 -14
- package/dist/node_modules/tar/dist/esm/extract.js +0 -49
- package/dist/node_modules/tar/dist/esm/get-write-flag.js +0 -26
- package/dist/node_modules/tar/dist/esm/header.js +0 -311
- package/dist/node_modules/tar/dist/esm/index.js +0 -20
- package/dist/node_modules/tar/dist/esm/index.min.js +0 -4
- package/dist/node_modules/tar/dist/esm/large-numbers.js +0 -94
- package/dist/node_modules/tar/dist/esm/list.js +0 -105
- package/dist/node_modules/tar/dist/esm/make-command.js +0 -48
- package/dist/node_modules/tar/dist/esm/mkdir.js +0 -179
- package/dist/node_modules/tar/dist/esm/mode-fix.js +0 -25
- package/dist/node_modules/tar/dist/esm/normalize-unicode.js +0 -34
- package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
- package/dist/node_modules/tar/dist/esm/options.js +0 -54
- package/dist/node_modules/tar/dist/esm/pack.js +0 -502
- package/dist/node_modules/tar/dist/esm/package.json +0 -3
- package/dist/node_modules/tar/dist/esm/parse.js +0 -641
- package/dist/node_modules/tar/dist/esm/path-reservations.js +0 -166
- package/dist/node_modules/tar/dist/esm/pax.js +0 -178
- package/dist/node_modules/tar/dist/esm/process-umask.js +0 -3
- package/dist/node_modules/tar/dist/esm/read-entry.js +0 -132
- package/dist/node_modules/tar/dist/esm/replace.js +0 -221
- package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +0 -25
- package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +0 -14
- package/dist/node_modules/tar/dist/esm/symlink-error.js +0 -15
- package/dist/node_modules/tar/dist/esm/types.js +0 -65
- package/dist/node_modules/tar/dist/esm/unpack.js +0 -891
- package/dist/node_modules/tar/dist/esm/update.js +0 -30
- package/dist/node_modules/tar/dist/esm/warn-method.js +0 -27
- package/dist/node_modules/tar/dist/esm/winchars.js +0 -9
- package/dist/node_modules/tar/dist/esm/write-entry.js +0 -656
- package/dist/node_modules/tar/package.json +0 -298
- package/dist/node_modules/tinyglobby/LICENSE +0 -21
- package/dist/node_modules/tinyglobby/dist/index.cjs +0 -335
- package/dist/node_modules/tinyglobby/dist/index.d.cts +0 -148
- package/dist/node_modules/tinyglobby/dist/index.d.mts +0 -148
- package/dist/node_modules/tinyglobby/dist/index.mjs +0 -307
- package/dist/node_modules/tinyglobby/package.json +0 -70
- package/dist/node_modules/undici/LICENSE +0 -21
- package/dist/node_modules/undici/index-fetch.js +0 -35
- package/dist/node_modules/undici/index.js +0 -169
- package/dist/node_modules/undici/lib/api/abort-signal.js +0 -57
- package/dist/node_modules/undici/lib/api/api-connect.js +0 -108
- package/dist/node_modules/undici/lib/api/api-pipeline.js +0 -251
- package/dist/node_modules/undici/lib/api/api-request.js +0 -214
- package/dist/node_modules/undici/lib/api/api-stream.js +0 -220
- package/dist/node_modules/undici/lib/api/api-upgrade.js +0 -108
- package/dist/node_modules/undici/lib/api/index.js +0 -7
- package/dist/node_modules/undici/lib/api/readable.js +0 -385
- package/dist/node_modules/undici/lib/api/util.js +0 -93
- package/dist/node_modules/undici/lib/core/connect.js +0 -240
- package/dist/node_modules/undici/lib/core/constants.js +0 -118
- package/dist/node_modules/undici/lib/core/diagnostics.js +0 -202
- package/dist/node_modules/undici/lib/core/errors.js +0 -425
- package/dist/node_modules/undici/lib/core/request.js +0 -405
- package/dist/node_modules/undici/lib/core/symbols.js +0 -67
- package/dist/node_modules/undici/lib/core/tree.js +0 -152
- package/dist/node_modules/undici/lib/core/util.js +0 -719
- package/dist/node_modules/undici/lib/dispatcher/agent.js +0 -129
- package/dist/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -209
- package/dist/node_modules/undici/lib/dispatcher/client-h1.js +0 -1487
- package/dist/node_modules/undici/lib/dispatcher/client-h2.js +0 -744
- package/dist/node_modules/undici/lib/dispatcher/client.js +0 -623
- package/dist/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -199
- package/dist/node_modules/undici/lib/dispatcher/dispatcher.js +0 -65
- package/dist/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -160
- package/dist/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -117
- package/dist/node_modules/undici/lib/dispatcher/pool-base.js +0 -194
- package/dist/node_modules/undici/lib/dispatcher/pool-stats.js +0 -34
- package/dist/node_modules/undici/lib/dispatcher/pool.js +0 -107
- package/dist/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -274
- package/dist/node_modules/undici/lib/dispatcher/retry-agent.js +0 -35
- package/dist/node_modules/undici/lib/global.js +0 -32
- package/dist/node_modules/undici/lib/handler/decorator-handler.js +0 -44
- package/dist/node_modules/undici/lib/handler/redirect-handler.js +0 -232
- package/dist/node_modules/undici/lib/handler/retry-handler.js +0 -374
- package/dist/node_modules/undici/lib/interceptor/dns.js +0 -375
- package/dist/node_modules/undici/lib/interceptor/dump.js +0 -123
- package/dist/node_modules/undici/lib/interceptor/redirect-interceptor.js +0 -21
- package/dist/node_modules/undici/lib/interceptor/redirect.js +0 -24
- package/dist/node_modules/undici/lib/interceptor/response-error.js +0 -86
- package/dist/node_modules/undici/lib/interceptor/retry.js +0 -19
- package/dist/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/dist/node_modules/undici/lib/llhttp/constants.js +0 -278
- package/dist/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -5
- package/dist/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -5
- package/dist/node_modules/undici/lib/llhttp/utils.js +0 -15
- package/dist/node_modules/undici/lib/mock/mock-agent.js +0 -160
- package/dist/node_modules/undici/lib/mock/mock-client.js +0 -59
- package/dist/node_modules/undici/lib/mock/mock-errors.js +0 -28
- package/dist/node_modules/undici/lib/mock/mock-interceptor.js +0 -207
- package/dist/node_modules/undici/lib/mock/mock-pool.js +0 -59
- package/dist/node_modules/undici/lib/mock/mock-symbols.js +0 -23
- package/dist/node_modules/undici/lib/mock/mock-utils.js +0 -367
- package/dist/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
- package/dist/node_modules/undici/lib/mock/pluralizer.js +0 -29
- package/dist/node_modules/undici/lib/util/timers.js +0 -423
- package/dist/node_modules/undici/lib/web/cache/cache.js +0 -859
- package/dist/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
- package/dist/node_modules/undici/lib/web/cache/symbols.js +0 -5
- package/dist/node_modules/undici/lib/web/cache/util.js +0 -45
- package/dist/node_modules/undici/lib/web/cookies/constants.js +0 -12
- package/dist/node_modules/undici/lib/web/cookies/index.js +0 -184
- package/dist/node_modules/undici/lib/web/cookies/parse.js +0 -310
- package/dist/node_modules/undici/lib/web/cookies/util.js +0 -282
- package/dist/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -398
- package/dist/node_modules/undici/lib/web/eventsource/eventsource.js +0 -480
- package/dist/node_modules/undici/lib/web/eventsource/util.js +0 -37
- package/dist/node_modules/undici/lib/web/fetch/LICENSE +0 -21
- package/dist/node_modules/undici/lib/web/fetch/body.js +0 -529
- package/dist/node_modules/undici/lib/web/fetch/constants.js +0 -124
- package/dist/node_modules/undici/lib/web/fetch/data-url.js +0 -744
- package/dist/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +0 -46
- package/dist/node_modules/undici/lib/web/fetch/file.js +0 -126
- package/dist/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -474
- package/dist/node_modules/undici/lib/web/fetch/formdata.js +0 -252
- package/dist/node_modules/undici/lib/web/fetch/global.js +0 -40
- package/dist/node_modules/undici/lib/web/fetch/headers.js +0 -687
- package/dist/node_modules/undici/lib/web/fetch/index.js +0 -2272
- package/dist/node_modules/undici/lib/web/fetch/request.js +0 -1037
- package/dist/node_modules/undici/lib/web/fetch/response.js +0 -610
- package/dist/node_modules/undici/lib/web/fetch/symbols.js +0 -9
- package/dist/node_modules/undici/lib/web/fetch/util.js +0 -1632
- package/dist/node_modules/undici/lib/web/fetch/webidl.js +0 -695
- package/dist/node_modules/undici/lib/web/fileapi/encoding.js +0 -290
- package/dist/node_modules/undici/lib/web/fileapi/filereader.js +0 -344
- package/dist/node_modules/undici/lib/web/fileapi/progressevent.js +0 -78
- package/dist/node_modules/undici/lib/web/fileapi/symbols.js +0 -10
- package/dist/node_modules/undici/lib/web/fileapi/util.js +0 -391
- package/dist/node_modules/undici/lib/web/websocket/connection.js +0 -371
- package/dist/node_modules/undici/lib/web/websocket/constants.js +0 -66
- package/dist/node_modules/undici/lib/web/websocket/events.js +0 -329
- package/dist/node_modules/undici/lib/web/websocket/frame.js +0 -96
- package/dist/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -100
- package/dist/node_modules/undici/lib/web/websocket/receiver.js +0 -513
- package/dist/node_modules/undici/lib/web/websocket/sender.js +0 -104
- package/dist/node_modules/undici/lib/web/websocket/symbols.js +0 -12
- package/dist/node_modules/undici/lib/web/websocket/util.js +0 -322
- package/dist/node_modules/undici/lib/web/websocket/websocket.js +0 -595
- package/dist/node_modules/undici/package.json +0 -160
- package/dist/node_modules/undici/scripts/strip-comments.js +0 -8
- package/dist/node_modules/v8-compile-cache/package.json +0 -34
- package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +0 -373
- package/dist/node_modules/which/LICENSE +0 -15
- package/dist/node_modules/which/bin/which.js +0 -52
- package/dist/node_modules/which/lib/index.js +0 -111
- package/dist/node_modules/which/package.json +0 -52
- package/dist/node_modules/yallist/dist/commonjs/index.js +0 -384
- package/dist/node_modules/yallist/dist/commonjs/package.json +0 -3
- package/dist/node_modules/yallist/dist/esm/index.js +0 -379
- package/dist/node_modules/yallist/dist/esm/package.json +0 -3
- package/dist/node_modules/yallist/package.json +0 -68
- package/dist/pnpm.mjs +0 -307717
- package/dist/pnpmrc +0 -2
- package/dist/templates/completion.bash +0 -31
- package/dist/templates/completion.fish +0 -22
- package/dist/templates/completion.ps1 +0 -193
- package/dist/templates/completion.zsh +0 -27
- package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
- package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
- package/dist/worker.js +0 -11938
- package/platform-pkg-name.js +0 -18
- package/pn.cmd +0 -2
- package/pn.ps1 +0 -1
- package/pnpx.cmd +0 -2
- package/pnpx.ps1 +0 -1
- package/pnx.cmd +0 -2
- package/pnx.ps1 +0 -1
- package/prepare.js +0 -29
- package/setup.js +0 -106
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var zr=Object.defineProperty;var Ur=(s,t)=>{for(var e in t)zr(s,e,{get:t[e],enumerable:!0})};import Qr from"events";import I from"fs";import{EventEmitter as Di}from"node:events";import Cs from"node:stream";import{StringDecoder as Hr}from"node:string_decoder";var Ds=typeof process=="object"&&process?process:{stdout:null,stderr:null},Wr=s=>!!s&&typeof s=="object"&&(s instanceof A||s instanceof Cs||Gr(s)||Zr(s)),Gr=s=>!!s&&typeof s=="object"&&s instanceof Di&&typeof s.pipe=="function"&&s.pipe!==Cs.Writable.prototype.pipe,Zr=s=>!!s&&typeof s=="object"&&s instanceof Di&&typeof s.write=="function"&&typeof s.end=="function",Q=Symbol("EOF"),J=Symbol("maybeEmitEnd"),nt=Symbol("emittedEnd"),De=Symbol("emittingEnd"),qt=Symbol("emittedError"),Ne=Symbol("closed"),Ns=Symbol("read"),Ae=Symbol("flush"),As=Symbol("flushChunk"),z=Symbol("encoding"),Mt=Symbol("decoder"),g=Symbol("flowing"),Qt=Symbol("paused"),Bt=Symbol("resume"),b=Symbol("buffer"),N=Symbol("pipes"),_=Symbol("bufferLength"),bi=Symbol("bufferPush"),Ie=Symbol("bufferShift"),L=Symbol("objectMode"),w=Symbol("destroyed"),_i=Symbol("error"),Oi=Symbol("emitData"),Is=Symbol("emitEnd"),Ti=Symbol("emitEnd2"),Z=Symbol("async"),xi=Symbol("abort"),Ce=Symbol("aborted"),Jt=Symbol("signal"),Rt=Symbol("dataListeners"),C=Symbol("discarded"),jt=s=>Promise.resolve().then(s),Yr=s=>s(),Kr=s=>s==="end"||s==="finish"||s==="prefinish",Vr=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,$r=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Fe=class{src;dest;opts;ondrain;constructor(t,e,i){this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[Bt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Li=class extends Fe{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,i){super(t,e,i),this.proxyErrors=r=>this.dest.emit("error",r),t.on("error",this.proxyErrors)}},Xr=s=>!!s.objectMode,qr=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",A=class extends Di{[g]=!1;[Qt]=!1;[N]=[];[b]=[];[L];[z];[Z];[Mt];[Q]=!1;[nt]=!1;[De]=!1;[Ne]=!1;[qt]=null;[_]=0;[w]=!1;[Jt];[Ce]=!1;[Rt]=0;[C]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Xr(e)?(this[L]=!0,this[z]=null):qr(e)?(this[z]=e.encoding,this[L]=!1):(this[L]=!1,this[z]=null),this[Z]=!!e.async,this[Mt]=this[z]?new Hr(this[z]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[b]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[N]});let{signal:i}=e;i&&(this[Jt]=i,i.aborted?this[xi]():i.addEventListener("abort",()=>this[xi]()))}get bufferLength(){return this[_]}get encoding(){return this[z]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[L]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Z]}set async(t){this[Z]=this[Z]||!!t}[xi](){this[Ce]=!0,this.emit("abort",this[Jt]?.reason),this.destroy(this[Jt]?.reason)}get aborted(){return this[Ce]}set aborted(t){}write(t,e,i){if(this[Ce])return!1;if(this[Q])throw new Error("write after end");if(this[w])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(i=e,e="utf8"),e||(e="utf8");let r=this[Z]?jt:Yr;if(!this[L]&&!Buffer.isBuffer(t)){if($r(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Vr(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[L]?(this[g]&&this[_]!==0&&this[Ae](!0),this[g]?this.emit("data",t):this[bi](t),this[_]!==0&&this.emit("readable"),i&&r(i),this[g]):t.length?(typeof t=="string"&&!(e===this[z]&&!this[Mt]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[z]&&(t=this[Mt].write(t)),this[g]&&this[_]!==0&&this[Ae](!0),this[g]?this.emit("data",t):this[bi](t),this[_]!==0&&this.emit("readable"),i&&r(i),this[g]):(this[_]!==0&&this.emit("readable"),i&&r(i),this[g])}read(t){if(this[w])return null;if(this[C]=!1,this[_]===0||t===0||t&&t>this[_])return this[J](),null;this[L]&&(t=null),this[b].length>1&&!this[L]&&(this[b]=[this[z]?this[b].join(""):Buffer.concat(this[b],this[_])]);let e=this[Ns](t||null,this[b][0]);return this[J](),e}[Ns](t,e){if(this[L])this[Ie]();else{let i=e;t===i.length||t===null?this[Ie]():typeof i=="string"?(this[b][0]=i.slice(t),e=i.slice(0,t),this[_]-=t):(this[b][0]=i.subarray(t),e=i.subarray(0,t),this[_]-=t)}return this.emit("data",e),!this[b].length&&!this[Q]&&this.emit("drain"),e}end(t,e,i){return typeof t=="function"&&(i=t,t=void 0),typeof e=="function"&&(i=e,e="utf8"),t!==void 0&&this.write(t,e),i&&this.once("end",i),this[Q]=!0,this.writable=!1,(this[g]||!this[Qt])&&this[J](),this}[Bt](){this[w]||(!this[Rt]&&!this[N].length&&(this[C]=!0),this[Qt]=!1,this[g]=!0,this.emit("resume"),this[b].length?this[Ae]():this[Q]?this[J]():this.emit("drain"))}resume(){return this[Bt]()}pause(){this[g]=!1,this[Qt]=!0,this[C]=!1}get destroyed(){return this[w]}get flowing(){return this[g]}get paused(){return this[Qt]}[bi](t){this[L]?this[_]+=1:this[_]+=t.length,this[b].push(t)}[Ie](){return this[L]?this[_]-=1:this[_]-=this[b][0].length,this[b].shift()}[Ae](t=!1){do;while(this[As](this[Ie]())&&this[b].length);!t&&!this[b].length&&!this[Q]&&this.emit("drain")}[As](t){return this.emit("data",t),this[g]}pipe(t,e){if(this[w])return t;this[C]=!1;let i=this[nt];return e=e||{},t===Ds.stdout||t===Ds.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,i?e.end&&t.end():(this[N].push(e.proxyErrors?new Li(this,t,e):new Fe(this,t,e)),this[Z]?jt(()=>this[Bt]()):this[Bt]()),t}unpipe(t){let e=this[N].find(i=>i.dest===t);e&&(this[N].length===1?(this[g]&&this[Rt]===0&&(this[g]=!1),this[N]=[]):this[N].splice(this[N].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let i=super.on(t,e);if(t==="data")this[C]=!1,this[Rt]++,!this[N].length&&!this[g]&&this[Bt]();else if(t==="readable"&&this[_]!==0)super.emit("readable");else if(Kr(t)&&this[nt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[qt]){let r=e;this[Z]?jt(()=>r.call(this,this[qt])):r.call(this,this[qt])}return i}removeListener(t,e){return this.off(t,e)}off(t,e){let i=super.off(t,e);return t==="data"&&(this[Rt]=this.listeners("data").length,this[Rt]===0&&!this[C]&&!this[N].length&&(this[g]=!1)),i}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Rt]=0,!this[C]&&!this[N].length&&(this[g]=!1)),e}get emittedEnd(){return this[nt]}[J](){!this[De]&&!this[nt]&&!this[w]&&this[b].length===0&&this[Q]&&(this[De]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ne]&&this.emit("close"),this[De]=!1)}emit(t,...e){let i=e[0];if(t!=="error"&&t!=="close"&&t!==w&&this[w])return!1;if(t==="data")return!this[L]&&!i?!1:this[Z]?(jt(()=>this[Oi](i)),!0):this[Oi](i);if(t==="end")return this[Is]();if(t==="close"){if(this[Ne]=!0,!this[nt]&&!this[w])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[qt]=i,super.emit(_i,i);let n=!this[Jt]||this.listeners("error").length?super.emit("error",i):!1;return this[J](),n}else if(t==="resume"){let n=super.emit("resume");return this[J](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...e);return this[J](),r}[Oi](t){for(let i of this[N])i.dest.write(t)===!1&&this.pause();let e=this[C]?!1:super.emit("data",t);return this[J](),e}[Is](){return this[nt]?!1:(this[nt]=!0,this.readable=!1,this[Z]?(jt(()=>this[Ti]()),!0):this[Ti]())}[Ti](){if(this[Mt]){let e=this[Mt].end();if(e){for(let i of this[N])i.dest.write(e);this[C]||super.emit("data",e)}}for(let e of this[N])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[L]||(t.dataLength=0);let e=this.promise();return this.on("data",i=>{t.push(i),this[L]||(t.dataLength+=i.length)}),await e,t}async concat(){if(this[L])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[z]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(w,()=>e(new Error("stream destroyed"))),this.on("error",i=>e(i)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[C]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Q])return e();let n,o,h=d=>{this.off("data",a),this.off("end",l),this.off(w,c),e(),o(d)},a=d=>{this.off("error",h),this.off("end",l),this.off(w,c),this.pause(),n({value:d,done:!!this[Q]})},l=()=>{this.off("error",h),this.off("data",a),this.off(w,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((d,S)=>{o=S,n=d,this.once(w,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[C]=!1;let t=!1,e=()=>(this.pause(),this.off(_i,e),this.off(w,e),this.off("end",e),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return e();let r=this.read();return r===null?e():{done:!1,value:r}};return this.once("end",e),this.once(_i,e),this.once(w,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[w])return t?this.emit("error",t):this.emit(w),this;this[w]=!0,this[C]=!0,this[b].length=0,this[_]=0;let e=this;return typeof e.close=="function"&&!this[Ne]&&e.close(),t?this.emit("error",t):this.emit(w),this}static get isStream(){return Wr}};var Jr=I.writev,ht=Symbol("_autoClose"),H=Symbol("_close"),te=Symbol("_ended"),u=Symbol("_fd"),Ni=Symbol("_finished"),tt=Symbol("_flags"),Ai=Symbol("_flush"),ki=Symbol("_handleChunk"),vi=Symbol("_makeBuf"),ie=Symbol("_mode"),ke=Symbol("_needDrain"),Ut=Symbol("_onerror"),Ht=Symbol("_onopen"),Ii=Symbol("_onread"),Pt=Symbol("_onwrite"),at=Symbol("_open"),U=Symbol("_path"),ot=Symbol("_pos"),Y=Symbol("_queue"),zt=Symbol("_read"),Ci=Symbol("_readSize"),j=Symbol("_reading"),ee=Symbol("_remain"),Fi=Symbol("_size"),ve=Symbol("_write"),gt=Symbol("_writing"),Me=Symbol("_defaultFlag"),bt=Symbol("_errored"),_t=class extends A{[bt]=!1;[u];[U];[Ci];[j]=!1;[Fi];[ee];[ht];constructor(t,e){if(e=e||{},super(e),this.readable=!0,this.writable=!1,typeof t!="string")throw new TypeError("path must be a string");this[bt]=!1,this[u]=typeof e.fd=="number"?e.fd:void 0,this[U]=t,this[Ci]=e.readSize||16*1024*1024,this[j]=!1,this[Fi]=typeof e.size=="number"?e.size:1/0,this[ee]=this[Fi],this[ht]=typeof e.autoClose=="boolean"?e.autoClose:!0,typeof this[u]=="number"?this[zt]():this[at]()}get fd(){return this[u]}get path(){return this[U]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[at](){I.open(this[U],"r",(t,e)=>this[Ht](t,e))}[Ht](t,e){t?this[Ut](t):(this[u]=e,this.emit("open",e),this[zt]())}[vi](){return Buffer.allocUnsafe(Math.min(this[Ci],this[ee]))}[zt](){if(!this[j]){this[j]=!0;let t=this[vi]();if(t.length===0)return process.nextTick(()=>this[Ii](null,0,t));I.read(this[u],t,0,t.length,null,(e,i,r)=>this[Ii](e,i,r))}}[Ii](t,e,i){this[j]=!1,t?this[Ut](t):this[ki](e,i)&&this[zt]()}[H](){if(this[ht]&&typeof this[u]=="number"){let t=this[u];this[u]=void 0,I.close(t,e=>e?this.emit("error",e):this.emit("close"))}}[Ut](t){this[j]=!0,this[H](),this.emit("error",t)}[ki](t,e){let i=!1;return this[ee]-=t,t>0&&(i=super.write(t<e.length?e.subarray(0,t):e)),(t===0||this[ee]<=0)&&(i=!1,this[H](),super.end()),i}emit(t,...e){switch(t){case"prefinish":case"finish":return!1;case"drain":return typeof this[u]=="number"&&this[zt](),!1;case"error":return this[bt]?!1:(this[bt]=!0,super.emit(t,...e));default:return super.emit(t,...e)}}},Be=class extends _t{[at](){let t=!0;try{this[Ht](null,I.openSync(this[U],"r")),t=!1}finally{t&&this[H]()}}[zt](){let t=!0;try{if(!this[j]){this[j]=!0;do{let e=this[vi](),i=e.length===0?0:I.readSync(this[u],e,0,e.length,null);if(!this[ki](i,e))break}while(!0);this[j]=!1}t=!1}finally{t&&this[H]()}}[H](){if(this[ht]&&typeof this[u]=="number"){let t=this[u];this[u]=void 0,I.closeSync(t),this.emit("close")}}},et=class extends Qr{readable=!1;writable=!0;[bt]=!1;[gt]=!1;[te]=!1;[Y]=[];[ke]=!1;[U];[ie];[ht];[u];[Me];[tt];[Ni]=!1;[ot];constructor(t,e){e=e||{},super(e),this[U]=t,this[u]=typeof e.fd=="number"?e.fd:void 0,this[ie]=e.mode===void 0?438:e.mode,this[ot]=typeof e.start=="number"?e.start:void 0,this[ht]=typeof e.autoClose=="boolean"?e.autoClose:!0;let i=this[ot]!==void 0?"r+":"w";this[Me]=e.flags===void 0,this[tt]=e.flags===void 0?i:e.flags,this[u]===void 0&&this[at]()}emit(t,...e){if(t==="error"){if(this[bt])return!1;this[bt]=!0}return super.emit(t,...e)}get fd(){return this[u]}get path(){return this[U]}[Ut](t){this[H](),this[gt]=!0,this.emit("error",t)}[at](){I.open(this[U],this[tt],this[ie],(t,e)=>this[Ht](t,e))}[Ht](t,e){this[Me]&&this[tt]==="r+"&&t&&t.code==="ENOENT"?(this[tt]="w",this[at]()):t?this[Ut](t):(this[u]=e,this.emit("open",e),this[gt]||this[Ai]())}end(t,e){return t&&this.write(t,e),this[te]=!0,!this[gt]&&!this[Y].length&&typeof this[u]=="number"&&this[Pt](null,0),this}write(t,e){return typeof t=="string"&&(t=Buffer.from(t,e)),this[te]?(this.emit("error",new Error("write() after end()")),!1):this[u]===void 0||this[gt]||this[Y].length?(this[Y].push(t),this[ke]=!0,!1):(this[gt]=!0,this[ve](t),!0)}[ve](t){I.write(this[u],t,0,t.length,this[ot],(e,i)=>this[Pt](e,i))}[Pt](t,e){t?this[Ut](t):(this[ot]!==void 0&&typeof e=="number"&&(this[ot]+=e),this[Y].length?this[Ai]():(this[gt]=!1,this[te]&&!this[Ni]?(this[Ni]=!0,this[H](),this.emit("finish")):this[ke]&&(this[ke]=!1,this.emit("drain"))))}[Ai](){if(this[Y].length===0)this[te]&&this[Pt](null,0);else if(this[Y].length===1)this[ve](this[Y].pop());else{let t=this[Y];this[Y]=[],Jr(this[u],t,this[ot],(e,i)=>this[Pt](e,i))}}[H](){if(this[ht]&&typeof this[u]=="number"){let t=this[u];this[u]=void 0,I.close(t,e=>e?this.emit("error",e):this.emit("close"))}}},Wt=class extends et{[at](){let t;if(this[Me]&&this[tt]==="r+")try{t=I.openSync(this[U],this[tt],this[ie])}catch(e){if(e?.code==="ENOENT")return this[tt]="w",this[at]();throw e}else t=I.openSync(this[U],this[tt],this[ie]);this[Ht](null,t)}[H](){if(this[ht]&&typeof this[u]=="number"){let t=this[u];this[u]=void 0,I.closeSync(t),this.emit("close")}}[ve](t){let e=!0;try{this[Pt](null,I.writeSync(this[u],t,0,t.length,this[ot])),e=!1}finally{if(e)try{this[H]()}catch{}}}};import cr from"node:path";import Kt from"node:fs";import{dirname as Fn,parse as kn}from"path";var jr=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),Fs=s=>!!s.sync&&!!s.file,ks=s=>!s.sync&&!!s.file,vs=s=>!!s.sync&&!s.file,Ms=s=>!s.sync&&!s.file;var Bs=s=>!!s.file;var tn=s=>{let t=jr.get(s);return t||s},se=(s={})=>{if(!s)return{};let t={};for(let[e,i]of Object.entries(s)){let r=tn(e);t[r]=i}return t.chmod===void 0&&t.noChmod===!1&&(t.chmod=!0),delete t.noChmod,t};var K=(s,t,e,i,r)=>Object.assign((n=[],o,h)=>{Array.isArray(n)&&(o=n,n={}),typeof o=="function"&&(h=o,o=void 0),o=o?Array.from(o):[];let a=se(n);if(r?.(a,o),Fs(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return s(a,o)}else if(ks(a)){let l=t(a,o);return h?l.then(()=>h(),h):l}else if(vs(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return e(a,o)}else if(Ms(a)){if(typeof h=="function")throw new TypeError("callback only supported with file option");return i(a,o)}throw new Error("impossible options??")},{syncFile:s,asyncFile:t,syncNoFile:e,asyncNoFile:i,validate:r});import{EventEmitter as Dn}from"events";import zi from"assert";import{Buffer as Ot}from"buffer";import*as Ps from"zlib";import en from"zlib";var sn=en.constants||{ZLIB_VERNUM:4736},M=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},sn));var rn=Ot.concat,zs=Object.getOwnPropertyDescriptor(Ot,"concat"),nn=s=>s,Bi=zs?.writable===!0||zs?.set!==void 0?s=>{Ot.concat=s?nn:rn}:s=>{},Tt=Symbol("_superWrite"),Gt=class extends Error{code;errno;constructor(t,e){super("zlib: "+t.message,{cause:t}),this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,e??this.constructor)}get name(){return"ZlibError"}},Pi=Symbol("flushFlag"),re=class extends A{#t=!1;#i=!1;#s;#n;#r;#e;#o;get sawError(){return this.#t}get handle(){return this.#e}get flushFlag(){return this.#s}constructor(t,e){if(!t||typeof t!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(t),this.#s=t.flush??0,this.#n=t.finishFlush??0,this.#r=t.fullFlushFlag??0,typeof Ps[e]!="function")throw new TypeError("Compression method not supported: "+e);try{this.#e=new Ps[e](t)}catch(i){throw new Gt(i,this.constructor)}this.#o=i=>{this.#t||(this.#t=!0,this.close(),this.emit("error",i))},this.#e?.on("error",i=>this.#o(new Gt(i))),this.once("end",()=>this.close)}close(){this.#e&&(this.#e.close(),this.#e=void 0,this.emit("close"))}reset(){if(!this.#t)return zi(this.#e,"zlib binding closed"),this.#e.reset?.()}flush(t){this.ended||(typeof t!="number"&&(t=this.#r),this.write(Object.assign(Ot.alloc(0),{[Pi]:t})))}end(t,e,i){return typeof t=="function"&&(i=t,e=void 0,t=void 0),typeof e=="function"&&(i=e,e=void 0),t&&(e?this.write(t,e):this.write(t)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Tt](t){return super.write(t)}write(t,e,i){if(typeof e=="function"&&(i=e,e="utf8"),typeof t=="string"&&(t=Ot.from(t,e)),this.#t)return;zi(this.#e,"zlib binding closed");let r=this.#e._handle,n=r.close;r.close=()=>{};let o=this.#e.close;this.#e.close=()=>{},Bi(!0);let h;try{let l=typeof t[Pi]=="number"?t[Pi]:this.#s;h=this.#e._processChunk(t,l),Bi(!1)}catch(l){Bi(!1),this.#o(new Gt(l,this.write))}finally{this.#e&&(this.#e._handle=r,r.close=n,this.#e.close=o,this.#e.removeAllListeners("error"))}this.#e&&this.#e.on("error",l=>this.#o(new Gt(l,this.write)));let a;if(h)if(Array.isArray(h)&&h.length>0){let l=h[0];a=this[Tt](Ot.from(l));for(let c=1;c<h.length;c++)a=this[Tt](h[c])}else a=this[Tt](Ot.from(h));return i&&i(),a}},Pe=class extends re{#t;#i;constructor(t,e){t=t||{},t.flush=t.flush||M.Z_NO_FLUSH,t.finishFlush=t.finishFlush||M.Z_FINISH,t.fullFlushFlag=M.Z_FULL_FLUSH,super(t,e),this.#t=t.level,this.#i=t.strategy}params(t,e){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#t!==t||this.#i!==e){this.flush(M.Z_SYNC_FLUSH),zi(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(r,n)=>{typeof r=="function"&&(n=r,r=this.flushFlag),this.flush(r),n?.()};try{this.handle.params(t,e)}finally{this.handle.flush=i}this.handle&&(this.#t=t,this.#i=e)}}}};var ze=class extends Pe{#t;constructor(t){super(t,"Gzip"),this.#t=t&&!!t.portable}[Tt](t){return this.#t?(this.#t=!1,t[9]=255,super[Tt](t)):super[Tt](t)}};var Ue=class extends Pe{constructor(t){super(t,"Unzip")}},He=class extends re{constructor(t,e){t=t||{},t.flush=t.flush||M.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||M.BROTLI_OPERATION_FINISH,t.fullFlushFlag=M.BROTLI_OPERATION_FLUSH,super(t,e)}},We=class extends He{constructor(t){super(t,"BrotliCompress")}},Ge=class extends He{constructor(t){super(t,"BrotliDecompress")}},Ze=class extends re{constructor(t,e){t=t||{},t.flush=t.flush||M.ZSTD_e_continue,t.finishFlush=t.finishFlush||M.ZSTD_e_end,t.fullFlushFlag=M.ZSTD_e_flush,super(t,e)}},Ye=class extends Ze{constructor(t){super(t,"ZstdCompress")}},Ke=class extends Ze{constructor(t){super(t,"ZstdDecompress")}};import{posix as Zt}from"node:path";var Us=(s,t)=>{if(Number.isSafeInteger(s))s<0?an(s,t):hn(s,t);else throw Error("cannot encode number outside of javascript safe integer range");return t},hn=(s,t)=>{t[0]=128;for(var e=t.length;e>1;e--)t[e-1]=s&255,s=Math.floor(s/256)},an=(s,t)=>{t[0]=255;var e=!1;s=s*-1;for(var i=t.length;i>1;i--){var r=s&255;s=Math.floor(s/256),e?t[i-1]=Ws(r):r===0?t[i-1]=0:(e=!0,t[i-1]=Gs(r))}},Hs=s=>{let t=s[0],e=t===128?cn(s.subarray(1,s.length)):t===255?ln(s):null;if(e===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(e))throw Error("parsed number outside of javascript safe integer range");return e},ln=s=>{for(var t=s.length,e=0,i=!1,r=t-1;r>-1;r--){var n=Number(s[r]),o;i?o=Ws(n):n===0?o=n:(i=!0,o=Gs(n)),o!==0&&(e-=o*Math.pow(256,t-r-1))}return e},cn=s=>{for(var t=s.length,e=0,i=t-1;i>-1;i--){var r=Number(s[i]);r!==0&&(e+=r*Math.pow(256,t-i-1))}return e},Ws=s=>(255^s)&255,Gs=s=>(255^s)+1&255;var Hi={};Ur(Hi,{code:()=>Ve,isCode:()=>ne,isName:()=>dn,name:()=>oe,normalFsTypes:()=>Ui});var ne=s=>oe.has(s),dn=s=>Ve.has(s),Ui=new Set(["0","","1","2","3","4","5","6","7","D"]),oe=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),Ve=new Map(Array.from(oe).map(s=>[s[1],s[0]]));var mn=s=>s===void 0||s<0?void 0:s,F=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#t="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(t,e=0,i,r){Buffer.isBuffer(t)?this.decode(t,e||0,i,r):t&&this.#i(t)}decode(t,e,i,r){if(e||(e=0),!t||!(t.length>=e+512))throw new Error("need 512 bytes for header");let n=xt(t,e+156,1),o=Ui.has(n),h=o?i:void 0,a=o?r:void 0;if(this.path=h?.path??xt(t,e,100),this.mode=h?.mode??a?.mode??lt(t,e+100,8),this.uid=h?.uid??a?.uid??lt(t,e+108,8),this.gid=h?.gid??a?.gid??lt(t,e+116,8),this.size=mn(h?.size??a?.size??lt(t,e+124,12)),this.mtime=h?.mtime??a?.mtime??Wi(t,e+136,12),this.cksum=lt(t,e+148,12),a&&this.#i(a,!0),h&&this.#i(h),ne(n)&&(this.#t=n||"0"),this.#t==="0"&&this.path.slice(-1)==="/"&&(this.#t="5"),this.#t==="5"&&(this.size=0),this.linkpath=xt(t,e+157,100),t.subarray(e+257,e+265).toString()==="ustar\x0000")if(this.uname=h?.uname??a?.uname??xt(t,e+265,32),this.gname=h?.gname??a?.gname??xt(t,e+297,32),this.devmaj=h?.devmaj??a?.devmaj??lt(t,e+329,8)??0,this.devmin=h?.devmin??a?.devmin??lt(t,e+337,8)??0,t[e+475]!==0){let c=xt(t,e+345,155);this.path=c+"/"+this.path}else{let c=xt(t,e+345,130);c&&(this.path=c+"/"+this.path),this.atime=i?.atime??r?.atime??Wi(t,e+476,12),this.ctime=i?.ctime??r?.ctime??Wi(t,e+488,12)}let l=256;for(let c=e;c<e+148;c++)l+=t[c];for(let c=e+156;c<e+512;c++)l+=t[c];this.cksumValid=l===this.cksum,this.cksum===void 0&&l===256&&(this.nullBlock=!0)}#i(t,e=!1){Object.assign(this,Object.fromEntries(Object.entries(t).filter(([i,r])=>!(r==null||i==="size"&&Number(r)<0||i==="path"&&e||i==="linkpath"&&e||i==="global"))))}encode(t,e=0){if(t||(t=this.block=Buffer.alloc(512)),this.#t==="Unsupported"&&(this.#t="0"),!(t.length>=e+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=un(this.path||"",i),n=r[0],o=r[1];this.needPax=!!r[2],this.needPax=Lt(t,e,100,n)||this.needPax,this.needPax=ct(t,e+100,8,this.mode)||this.needPax,this.needPax=ct(t,e+108,8,this.uid)||this.needPax,this.needPax=ct(t,e+116,8,this.gid)||this.needPax,this.needPax=ct(t,e+124,12,this.size)||this.needPax,this.needPax=Gi(t,e+136,12,this.mtime)||this.needPax,t[e+156]=Number(this.#t.codePointAt(0)),this.needPax=Lt(t,e+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",e+257,8),this.needPax=Lt(t,e+265,32,this.uname)||this.needPax,this.needPax=Lt(t,e+297,32,this.gname)||this.needPax,this.needPax=ct(t,e+329,8,this.devmaj)||this.needPax,this.needPax=ct(t,e+337,8,this.devmin)||this.needPax,this.needPax=Lt(t,e+345,i,o)||this.needPax,t[e+475]!==0?this.needPax=Lt(t,e+345,155,o)||this.needPax:(this.needPax=Lt(t,e+345,130,o)||this.needPax,this.needPax=Gi(t,e+476,12,this.atime)||this.needPax,this.needPax=Gi(t,e+488,12,this.ctime)||this.needPax);let h=256;for(let a=e;a<e+148;a++)h+=t[a];for(let a=e+156;a<e+512;a++)h+=t[a];return this.cksum=h,ct(t,e+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#t==="Unsupported"?this.#t:oe.get(this.#t)}get typeKey(){return this.#t}set type(t){let e=String(Ve.get(t));if(ne(e)||e==="Unsupported")this.#t=e;else if(ne(t))this.#t=t;else throw new TypeError("invalid entry type: "+t)}},un=(s,t)=>{let i=s,r="",n,o=Zt.parse(s).root||".";if(Buffer.byteLength(i)<100)n=[i,r,!1];else{r=Zt.dirname(i),i=Zt.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(r)<=t?n=[i,r,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(r)<=t?n=[i.slice(0,99),r,!0]:(i=Zt.join(Zt.basename(r),i),r=Zt.dirname(r));while(r!==o&&n===void 0);n||(n=[s.slice(0,99),"",!0])}return n},xt=(s,t,e)=>s.subarray(t,t+e).toString("utf8").replace(/\0.*/,""),Wi=(s,t,e)=>pn(lt(s,t,e)),pn=s=>s===void 0?void 0:new Date(s*1e3),lt=(s,t,e)=>Number(s[t])&128?Hs(s.subarray(t,t+e)):wn(s,t,e),En=s=>isNaN(s)?void 0:s,wn=(s,t,e)=>En(parseInt(s.subarray(t,t+e).toString("utf8").replace(/\0.*$/,"").trim(),8)),Sn={12:8589934591,8:2097151},ct=(s,t,e,i)=>i===void 0?!1:i>Sn[e]||i<0?(Us(i,s.subarray(t,t+e)),!0):(yn(s,t,e,i),!1),yn=(s,t,e,i)=>s.write(Rn(i,e),t,e,"ascii"),Rn=(s,t)=>gn(Math.floor(s).toString(8),t),gn=(s,t)=>(s.length===t-1?s:new Array(t-s.length-1).join("0")+s+" ")+"\0",Gi=(s,t,e,i)=>i===void 0?!1:ct(s,t,e,i.getTime()/1e3),bn=new Array(156).join("\0"),Lt=(s,t,e,i)=>i===void 0?!1:(s.write(i+bn,t,e,"utf8"),i.length!==Buffer.byteLength(i)||i.length>e);import{basename as _n}from"node:path";var ft=class s{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,e=!1){this.atime=t.atime,this.charset=t.charset,this.comment=t.comment,this.ctime=t.ctime,this.dev=t.dev,this.gid=t.gid,this.global=e,this.gname=t.gname,this.ino=t.ino,this.linkpath=t.linkpath,this.mtime=t.mtime,this.nlink=t.nlink,this.path=t.path,this.size=t.size,this.uid=t.uid,this.uname=t.uname}encode(){let t=this.encodeBody();if(t==="")return Buffer.allocUnsafe(0);let e=Buffer.byteLength(t),i=512*Math.ceil(1+e/512),r=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)r[n]=0;new F({path:("PaxHeader/"+_n(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:e,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(t,512,e,"utf8");for(let n=e+512;n<r.length;n++)r[n]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===void 0)return"";let e=this[t],i=e instanceof Date?e.getTime()/1e3:e,r=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+i+`
|
|
2
|
-
`,n=Buffer.byteLength(r),o=Math.floor(Math.log(n)/Math.log(10))+1;return n+o>=Math.pow(10,o)&&(o+=1),o+n+r}static parse(t,e,i=!1){return new s(On(Tn(t),e),i)}},On=(s,t)=>t?Object.assign({},t,s):s,Tn=s=>s.replace(/\n$/,"").split(`
|
|
3
|
-
`).reduce(xn,Object.create(null)),xn=(s,t)=>{let e=parseInt(t,10);if(e!==Buffer.byteLength(t)+1)return s;t=t.slice((e+" ").length);let i=t.split("="),r=i.shift();if(!r)return s;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=i.join("=").replace(/\0.*/,"");switch(n){case"path":case"linkpath":case"type":case"charset":case"comment":case"gname":case"uname":s[n]=o;break;case"ctime":case"atime":case"mtime":s[n]=new Date(Number(o)*1e3);break;case"size":let h=+o;h>=0&&(s[n]=h);break;case"gid":case"uid":case"dev":case"ino":case"nlink":case"mode":s[n]=+o;break}return s};var Ln=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,f=Ln!=="win32"?s=>String(s):s=>String(s).replaceAll(/\\/g,"/");var $e=class extends A{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(t,e,i){switch(super({}),this.pause(),this.extended=e,this.globalExtended=i,this.header=t,this.remain=t.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=t.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!t.path)throw new Error("no path provided for tar.ReadEntry");this.path=f(t.path),this.mode=t.mode,this.mode&&(this.mode=this.mode&4095),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=this.remain,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=t.linkpath?f(t.linkpath):void 0,this.uname=t.uname,this.gname=t.gname,e&&this.#t(e),i&&this.#t(i,!0)}write(t){let e=t.length;if(e>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-e),this.blockRemain=Math.max(0,r-e),this.ignore?!0:i>=e?super.write(t):super.write(t.subarray(0,i))}#t(t,e=!1){t.path&&(t.path=f(t.path)),t.linkpath&&(t.linkpath=f(t.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(t).filter(([i,r])=>!(r==null||i==="path"&&e))))}};var Dt=(s,t,e,i={})=>{s.file&&(i.file=s.file),s.cwd&&(i.cwd=s.cwd),i.code=e instanceof Error&&e.code||t,i.tarCode=t,!s.strict&&i.recoverable!==!1?(e instanceof Error&&(i=Object.assign(e,i),e=e.message),s.emit("warn",t,e,i)):e instanceof Error?s.emit("error",Object.assign(e,i)):s.emit("error",Object.assign(new Error(`${t}: ${e}`),i))};var Nn=1024*1024,Xi=Buffer.from([31,139]),qi=Buffer.from([40,181,47,253]),An=Math.max(Xi.length,qi.length),B=Symbol("state"),Nt=Symbol("writeEntry"),it=Symbol("readEntry"),Zi=Symbol("nextEntry"),Zs=Symbol("processEntry"),V=Symbol("extendedHeader"),he=Symbol("globalExtendedHeader"),dt=Symbol("meta"),Ys=Symbol("emitMeta"),p=Symbol("buffer"),st=Symbol("queue"),mt=Symbol("ended"),Yi=Symbol("emittedEnd"),At=Symbol("emit"),y=Symbol("unzip"),Xe=Symbol("consumeChunk"),qe=Symbol("consumeChunkSub"),Ki=Symbol("consumeBody"),Ks=Symbol("consumeMeta"),Vs=Symbol("consumeHeader"),ae=Symbol("consuming"),Vi=Symbol("bufferConcat"),Qe=Symbol("maybeEnd"),Yt=Symbol("writing"),$=Symbol("aborted"),Je=Symbol("onDone"),It=Symbol("sawValidEntry"),je=Symbol("sawNullBlock"),ti=Symbol("sawEOF"),$s=Symbol("closeStream"),In=1e3,le=Symbol("compressedBytesRead"),$i=Symbol("decompressedBytesRead"),Xs=Symbol("checkDecompressionRatio"),Cn=()=>!0,rt=class extends Dn{file;strict;maxMetaEntrySize;filter;brotli;zstd;maxDecompressionRatio;writable=!0;readable=!1;[st]=[];[p];[it];[Nt];[B]="begin";[dt]="";[V];[he];[mt]=!1;[y];[$]=!1;[It];[je]=!1;[ti]=!1;[Yt]=!1;[ae]=!1;[Yi]=!1;[le]=0;[$i]=0;constructor(t={}){super(),this.file=t.file||"",this.on(Je,()=>{(this[B]==="begin"||this[It]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),t.ondone?this.on(Je,t.ondone):this.on(Je,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!t.strict,this.maxDecompressionRatio=typeof t.maxDecompressionRatio=="number"?t.maxDecompressionRatio:In,this.maxMetaEntrySize=t.maxMetaEntrySize||Nn,this.filter=typeof t.filter=="function"?t.filter:Cn;let e=t.file&&(t.file.endsWith(".tar.br")||t.file.endsWith(".tbr"));this.brotli=!(t.gzip||t.zstd)&&t.brotli!==void 0?t.brotli:e?void 0:!1;let i=t.file&&(t.file.endsWith(".tar.zst")||t.file.endsWith(".tzst"));this.zstd=!(t.gzip||t.brotli)&&t.zstd!==void 0?t.zstd:i?!0:void 0,this.on("end",()=>this[$s]()),typeof t.onwarn=="function"&&this.on("warn",t.onwarn),typeof t.onReadEntry=="function"&&this.on("entry",t.onReadEntry)}warn(t,e,i={}){Dt(this,t,e,i)}[Vs](t,e){this[It]===void 0&&(this[It]=!1);let i;try{i=new F(t,e,this[V],this[he])}catch(r){return this.warn("TAR_ENTRY_INVALID",r)}if(i.nullBlock)this[je]?(this[ti]=!0,this[B]==="begin"&&(this[B]="header"),this[At]("eof")):(this[je]=!0,this[At]("nullBlock"));else if(this[je]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let r=i.type;if(/^(Symbolic)?Link$/.test(r)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(r)&&!/^(Global)?ExtendedHeader$/.test(r)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[Nt]=new $e(i,this[V],this[he]);if(!this[It])if(n.remain){let o=()=>{n.invalid||(this[It]=!0)};n.on("end",o)}else this[It]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[B]="ignore",n.resume()):n.size>0&&(this[dt]="",n.on("data",o=>this[dt]+=o),this[B]="meta"):(this[V]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[B]=n.remain?"ignore":"header",n.resume()):(n.remain?this[B]="body":(this[B]="header",n.end()),this[it]?this[st].push(n):(this[st].push(n),this[Zi]())))}}}[$s](){queueMicrotask(()=>this.emit("close"))}[Zs](t){let e=!0;if(!t)this[it]=void 0,e=!1;else if(Array.isArray(t)){let[i,...r]=t;this.emit(i,...r)}else this[it]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",()=>this[Zi]()),e=!1);return e}[Zi](){do;while(this[Zs](this[st].shift()));if(this[st].length===0){let t=this[it];!t||t.flowing||t.size===t.remain?this[Yt]||this.emit("drain"):t.once("drain",()=>this.emit("drain"))}}[Ki](t,e){let i=this[Nt];if(!i)throw new Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=t.length&&e===0?t:t.subarray(e,e+r);return i.write(n),i.blockRemain||(this[B]="header",this[Nt]=void 0,i.end()),n.length}[Ks](t,e){let i=this[Nt],r=this[Ki](t,e);return!this[Nt]&&i&&this[Ys](i),r}[At](t,e,i){this[st].length===0&&!this[it]?this.emit(t,e,i):this[st].push([t,e,i])}[Ys](t){switch(this[At]("meta",this[dt]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[V]=ft.parse(this[dt],this[V],!1);break;case"GlobalExtendedHeader":this[he]=ft.parse(this[dt],this[he],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let e=this[V]??Object.create(null);this[V]=e,e.path=this[dt].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let e=this[V]||Object.create(null);this[V]=e,e.linkpath=this[dt].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+t.type)}}abort(t){this[$]||(this[$]=!0,this.emit("abort",t),this.warn("TAR_ABORT",t,{recoverable:!1}))}[Xs](t){this[$i]+=t.length;let e=this[$i]/this[le];return e>this.maxDecompressionRatio?(this.abort(new Error(`max decompression ratio exceeded: ${e.toFixed(2)} > ${this.maxDecompressionRatio}`)),!1):!0}write(t,e,i){if(typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof e=="string"?e:"utf8")),this[$])return i?.(),!1;if((this[y]===void 0||this.brotli===void 0&&this[y]===!1)&&t){if(this[p]&&(t=Buffer.concat([this[p],t]),this[p]=void 0),t.length<An)return this[p]=t,i?.(),!0;for(let a=0;this[y]===void 0&&a<Xi.length;a++)t[a]!==Xi[a]&&(this[y]=!1);let o=!1;if(this[y]===!1&&this.zstd!==!1){o=!0;for(let a=0;a<qi.length;a++)if(t[a]!==qi[a]){o=!1;break}}let h=this.brotli===void 0&&!o;if(this[y]===!1&&h)if(t.length<512)if(this[mt])this.brotli=!0;else return this[p]=t,i?.(),!0;else try{new F(t.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[y]===void 0||this[y]===!1&&(this.brotli||o)){let a=this[mt];this[mt]=!1,this[y]=this[y]===void 0?new Ue({}):o?new Ke({}):new Ge({}),this[y].on("data",c=>{this[Xs](c)&&this[Xe](c)}),this[y].on("error",c=>{this[$]||this.abort(c)}),this[y].on("end",()=>{this[mt]=!0,this[Xe]()}),this[Yt]=!0,this[le]+=t.length;let l=!!this[y][a?"end":"write"](t);return this[Yt]=!1,i?.(),l}}this[Yt]=!0,this[y]?(this[le]+=t.length,this[y].write(t)):this[Xe](t),this[Yt]=!1;let n=this[st].length>0?!1:this[it]?this[it].flowing:!0;return!n&&this[st].length===0&&this[it]?.once("drain",()=>this.emit("drain")),i?.(),n}[Vi](t){t&&!this[$]&&(this[p]=this[p]?Buffer.concat([this[p],t]):t)}[Qe](){if(this[mt]&&!this[Yi]&&!this[$]&&!this[ae]){this[Yi]=!0;let t=this[Nt];if(t?.blockRemain){let e=this[p]?this[p].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`,{entry:t}),this[p]&&t.write(this[p]),t.end()}this[At](Je)}}[Xe](t){if(this[ae]&&t)this[Vi](t);else if(!t&&!this[p])this[Qe]();else if(t){if(this[ae]=!0,this[p]){this[Vi](t);let e=this[p];this[p]=void 0,this[qe](e)}else this[qe](t);for(;this[p]&&this[p]?.length>=512&&!this[$]&&!this[ti];){let e=this[p];this[p]=void 0,this[qe](e)}this[ae]=!1}(!this[p]||this[mt])&&this[Qe]()}[qe](t){let e=0,i=t.length;for(;e+512<=i&&!this[$]&&!this[ti];)switch(this[B]){case"begin":case"header":this[Vs](t,e),e+=512;break;case"ignore":case"body":e+=this[Ki](t,e);break;case"meta":e+=this[Ks](t,e);break;default:throw new Error("invalid state: "+this[B])}e<i&&(this[p]=this[p]?Buffer.concat([t.subarray(e),this[p]]):t.subarray(e))}end(t,e,i){return typeof t=="function"&&(i=t,e=void 0,t=void 0),typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,e)),i&&this.once("finish",i),this[$]||(this[y]?(t&&(this[le]+=t.length,this[y].write(t)),this[y].end()):(this[mt]=!0,(this.brotli===void 0||this.zstd===void 0)&&(t=t||Buffer.alloc(0)),t&&this.write(t),this[Qe]())),this}};var ut=s=>{let t=s.length-1,e=-1;for(;t>-1&&s.charAt(t)==="/";)e=t,t--;return e===-1?s:s.slice(0,e)};var vn=s=>{let t=s.onReadEntry;s.onReadEntry=t?e=>{t(e),e.resume()}:e=>e.resume()},Qi=(s,t)=>{let e=new Map(t.map(n=>[ut(n),!0])),i=s.filter,r=(n,o="")=>{let h=o||kn(n).root||".",a;if(n===h)a=!1;else{let l=e.get(n);a=l!==void 0?l:r(Fn(n),h)}return e.set(n,a),a};s.filter=i?(n,o)=>i(n,o)&&r(ut(n)):n=>r(ut(n))},Mn=s=>{let t=new rt(s),e=s.file,i;try{i=Kt.openSync(e,"r");let r=Kt.fstatSync(i),n=s.maxReadSize||16*1024*1024;if(r.size<n){let o=Buffer.allocUnsafe(r.size),h=Kt.readSync(i,o,0,r.size,0);t.end(h===o.byteLength?o:o.subarray(0,h))}else{let o=0,h=Buffer.allocUnsafe(n);for(;o<r.size;){let a=Kt.readSync(i,h,0,n,o);if(a===0)break;o+=a,t.write(h.subarray(0,a))}t.end()}}finally{if(typeof i=="number")try{Kt.closeSync(i)}catch{}}},Bn=(s,t)=>{let e=new rt(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,h)=>{e.on("error",h),e.on("end",o),Kt.stat(r,(a,l)=>{if(a)h(a);else{let c=new _t(r,{readSize:i,size:l.size});c.on("error",h),c.pipe(e)}})})},Ct=K(Mn,Bn,s=>new rt(s),s=>new rt(s),(s,t)=>{t?.length&&Qi(s,t),s.noResume||vn(s)});import ui from"fs";import X from"fs";import js from"path";var Ji=(s,t,e)=>(s&=4095,e&&(s=(s|384)&-19),t&&(s&256&&(s|=64),s&32&&(s|=8),s&4&&(s|=1)),s);import{win32 as Pn}from"node:path";var{isAbsolute:zn,parse:qs}=Pn,ce=s=>{let t="",e=qs(s);for(;zn(s)||e.root;){let i=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":e.root;s=s.slice(i.length),t+=i,e=qs(s)}return[t,s]};var ei=["|","<",">","?",":"],ji=ei.map(s=>String.fromCodePoint(61440+Number(s.codePointAt(0)))),Un=new Map(ei.map((s,t)=>[s,ji[t]])),Hn=new Map(ji.map((s,t)=>[s,ei[t]])),ts=s=>ei.reduce((t,e)=>t.split(e).join(Un.get(e)),s),Qs=s=>ji.reduce((t,e)=>t.split(e).join(Hn.get(e)),s);var rr=(s,t)=>t?(s=f(s).replace(/^\.(\/|$)/,""),ut(t)+"/"+s):f(s),Wn=16*1024*1024,tr=Symbol("process"),er=Symbol("file"),ir=Symbol("directory"),is=Symbol("symlink"),sr=Symbol("hardlink"),fe=Symbol("header"),ii=Symbol("read"),ss=Symbol("lstat"),si=Symbol("onlstat"),rs=Symbol("onread"),ns=Symbol("onreadlink"),os=Symbol("openfile"),hs=Symbol("onopenfile"),pt=Symbol("close"),ri=Symbol("mode"),as=Symbol("awaitDrain"),es=Symbol("ondrain"),q=Symbol("prefix"),de=class extends A{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#t=!1;constructor(t,e={}){let i=se(e);super(),this.path=f(t),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||Wn,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=f(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?f(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[o,h]=ce(this.path);o&&typeof h=="string"&&(this.path=h,r=o)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=Qs(this.path.replaceAll(/\\/g,"/")),t=t.replaceAll(/\\/g,"/")),this.absolute=f(i.absolute||js.resolve(this.cwd,t)),this.path===""&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[si](n):this[ss]()}warn(t,e,i={}){return Dt(this,t,e,i)}emit(t,...e){return t==="error"&&(this.#t=!0),super.emit(t,...e)}[ss](){X.lstat(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[si](e)})}[si](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=Gn(t),this.emit("stat",t),this[tr]()}[tr](){switch(this.type){case"File":return this[er]();case"Directory":return this[ir]();case"SymbolicLink":return this[is]();default:return this.end()}}[ri](t){return Ji(t,this.type==="Directory",this.portable)}[q](t){return rr(t,this.prefix)}[fe](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new F({path:this[q](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[q](this.linkpath):this.linkpath,mode:this[ri](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new ft({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[q](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[q](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let t=this.header?.block;if(!t)throw new Error("failed to encode header");super.write(t)}[ir](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[fe](),this.end()}[is](){X.readlink(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[ns](e)})}[ns](t){this.linkpath=f(t),this[fe](),this.end()}[sr](t){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=f(js.relative(this.cwd,t)),this.stat.size=0,this[fe](),this.end()}[er](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let t=`${this.stat.dev}:${this.stat.ino}`,e=this.linkCache.get(t);if(e?.indexOf(this.cwd)===0)return this[sr](e);this.linkCache.set(t,this.absolute)}if(this[fe](),this.stat.size===0)return this.end();this[os]()}[os](){X.open(this.absolute,"r",(t,e)=>{if(t)return this.emit("error",t);this[hs](e)})}[hs](t){if(this.fd=t,this.#t)return this[pt]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let e=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(e),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ii]()}[ii](){let{fd:t,buf:e,offset:i,length:r,pos:n}=this;if(t===void 0||e===void 0)throw new Error("cannot read file without first opening");X.read(t,e,i,r,n,(o,h)=>{if(o)return this[pt](()=>this.emit("error",o));this[rs](h)})}[pt](t=()=>{}){this.fd!==void 0&&X.close(this.fd,t)}[rs](t){if(t<=0&&this.remain>0){let r=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[pt](()=>this.emit("error",r))}if(t>this.remain){let r=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[pt](()=>this.emit("error",r))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(t===this.remain)for(let r=t;r<this.length&&t<this.blockRemain;r++)this.buf[r+this.offset]=0,t++,this.remain++;let e=this.offset===0&&t===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+t);this.write(e)?this[es]():this[as](()=>this[es]())}[as](t){this.once("drain",t)}write(t,e,i){if(typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof e=="string"?e:"utf8")),this.blockRemain<t.length){let r=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",r)}return this.remain-=t.length,this.blockRemain-=t.length,this.pos+=t.length,this.offset+=t.length,super.write(t,null,i)}[es](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[pt](t=>t?this.emit("error",t):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[ii]()}},ni=class extends de{sync=!0;[ss](){this[si](X.lstatSync(this.absolute))}[is](){this[ns](X.readlinkSync(this.absolute))}[os](){this[hs](X.openSync(this.absolute,"r"))}[ii](){let t=!0;try{let{fd:e,buf:i,offset:r,length:n,pos:o}=this;if(e===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let h=X.readSync(e,i,r,n,o);this[rs](h),t=!1}finally{if(t)try{this[pt](()=>{})}catch{}}}[as](t){t()}[pt](t=()=>{}){this.fd!==void 0&&X.closeSync(this.fd),t()}},oi=class extends A{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(t,e,i={}){return Dt(this,t,e,i)}constructor(t,e={}){let i=se(e);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=t;let{type:r}=t;if(r==="Unsupported")throw new Error("writing entry that should be ignored");this.type=r,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=f(t.path),this.mode=t.mode!==void 0?this[ri](t.mode):void 0,this.uid=this.portable?void 0:t.uid,this.gid=this.portable?void 0:t.gid,this.uname=this.portable?void 0:t.uname,this.gname=this.portable?void 0:t.gname,this.size=t.size,this.mtime=this.noMtime?void 0:i.mtime||t.mtime,this.atime=this.portable?void 0:t.atime,this.ctime=this.portable?void 0:t.ctime,this.linkpath=t.linkpath!==void 0?f(t.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[h,a]=ce(this.path);h&&typeof a=="string"&&(this.path=a,n=h)}this.remain=t.size,this.blockRemain=t.startBlockSize,this.onWriteEntry?.(this),this.header=new F({path:this[q](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[q](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new ft({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[q](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[q](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw new Error("failed to encode header");super.write(o),t.pipe(this)}[q](t){return rr(t,this.prefix)}[ri](t){return Ji(t,this.type==="Directory",this.portable)}write(t,e,i){typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof e=="string"?e:"utf8"));let r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(t,i)}end(t,e,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof t=="function"&&(i=t,e=void 0,t=void 0),typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,e??"utf8")),i&&this.once("finish",i),t?super.end(t,i):super.end(i),this}},Gn=s=>s.isFile()?"File":s.isDirectory()?"Directory":s.isSymbolicLink()?"SymbolicLink":"Unsupported";var hi=class s{tail;head;length=0;static create(t=[]){return new s(t)}constructor(t=[]){for(let e of t)this.push(e)}*[Symbol.iterator](){for(let t=this.head;t;t=t.next)yield t.value}removeNode(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");let e=t.next,i=t.prev;return e&&(e.prev=i),i&&(i.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=i),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,e}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}pushNode(t){if(t===this.tail)return;t.list&&t.list.removeNode(t);let e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}push(...t){for(let e=0,i=t.length;e<i;e++)Yn(this,t[e]);return this.length}unshift(...t){for(var e=0,i=t.length;e<i;e++)Kn(this,t[e]);return this.length}pop(){if(!this.tail)return;let t=this.tail.value,e=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,e.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,e=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,e.list=void 0,this.length--,t}forEach(t,e){e=e||this;for(let i=this.head,r=0;i;r++)t.call(e,i.value,r,this),i=i.next}forEachReverse(t,e){e=e||this;for(let i=this.tail,r=this.length-1;i;r--)t.call(e,i.value,r,this),i=i.prev}get(t){let e=0,i=this.head;for(;i&&e<t;e++)i=i.next;if(e===t&&i)return i.value}getReverse(t){let e=0,i=this.tail;for(;i&&e<t;e++)i=i.prev;if(e===t&&i)return i.value}map(t,e){e=e||this;let i=new s;for(let r=this.head;r;)i.push(t.call(e,r.value,this)),r=r.next;return i}mapReverse(t,e){e=e||this;var i=new s;for(let r=this.tail;r;)i.push(t.call(e,r.value,this)),r=r.prev;return i}reduce(t,e){let i,r=this.head;if(arguments.length>1)i=e;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=t(i,r.value,n),r=r.next;return i}reduceReverse(t,e){let i,r=this.tail;if(arguments.length>1)i=e;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;r;n--)i=t(i,r.value,n),r=r.prev;return i}toArray(){let t=new Array(this.length);for(let e=0,i=this.head;i;e++)t[e]=i.value,i=i.next;return t}toArrayReverse(){let t=new Array(this.length);for(let e=0,i=this.tail;i;e++)t[e]=i.value,i=i.prev;return t}slice(t=0,e=this.length){e<0&&(e+=this.length),t<0&&(t+=this.length);let i=new s;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);let r=this.head,n=0;for(n=0;r&&n<t;n++)r=r.next;for(;r&&n<e;n++,r=r.next)i.push(r.value);return i}sliceReverse(t=0,e=this.length){e<0&&(e+=this.length),t<0&&(t+=this.length);let i=new s;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);let r=this.length,n=this.tail;for(;n&&r>e;r--)n=n.prev;for(;n&&r>t;r--,n=n.prev)i.push(n.value);return i}splice(t,e=0,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let r=this.head;for(let o=0;r&&o<t;o++)r=r.next;let n=[];for(let o=0;r&&o<e;o++)n.push(r.value),r=this.removeNode(r);r?r!==this.tail&&(r=r.prev):r=this.tail;for(let o of i)r=Zn(this,r,o);return n}reverse(){let t=this.head,e=this.tail;for(let i=t;i;i=i.prev){let r=i.prev;i.prev=i.next,i.next=r}return this.head=e,this.tail=t,this}};function Zn(s,t,e){let i=t,r=t?t.next:s.head,n=new me(e,i,r,s);return n.next===void 0&&(s.tail=n),n.prev===void 0&&(s.head=n),s.length++,n}function Yn(s,t){s.tail=new me(t,s.tail,void 0,s),s.head||(s.head=s.tail),s.length++}function Kn(s,t){s.head=new me(t,void 0,s.head,s),s.tail||(s.tail=s.head),s.length++}var me=class{list;next;prev;value;constructor(t,e,i,r){this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}};import ar from"path";var pi=class{path;absolute;entry;stat;readdir;pending=!1;pendingLink=!1;ignore=!1;piped=!1;constructor(t,e){this.path=t||"./",this.absolute=e}},nr=Buffer.alloc(1024),li=Symbol("onStat"),ue=Symbol("ended"),W=Symbol("queue"),pe=Symbol("pendingLinks"),Et=Symbol("current"),Ft=Symbol("process"),Ee=Symbol("processing"),ai=Symbol("processJob"),G=Symbol("jobs"),ls=Symbol("jobDone"),ci=Symbol("addFSEntry"),or=Symbol("addTarEntry"),ds=Symbol("stat"),ms=Symbol("readdir"),fi=Symbol("onreaddir"),di=Symbol("pipe"),hr=Symbol("entry"),cs=Symbol("entryOpt"),mi=Symbol("writeEntryClass"),lr=Symbol("write"),fs=Symbol("ondrain"),wt=class extends A{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[mi];onWriteEntry;[W];[pe]=new Map;[G]=0;[Ee]=!1;[ue]=!1;constructor(t={}){if(super(),this.opt=t,this.file=t.file||"",this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=f(t.prefix||""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this.onWriteEntry=t.onWriteEntry,this[mi]=de,typeof t.onwarn=="function"&&this.on("warn",t.onwarn),this.portable=!!t.portable,t.gzip||t.brotli||t.zstd){if((t.gzip?1:0)+(t.brotli?1:0)+(t.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(t.gzip&&(typeof t.gzip!="object"&&(t.gzip={}),this.portable&&(t.gzip.portable=!0),this.zip=new ze(t.gzip)),t.brotli&&(typeof t.brotli!="object"&&(t.brotli={}),this.zip=new We(t.brotli)),t.zstd&&(typeof t.zstd!="object"&&(t.zstd={}),this.zip=new Ye(t.zstd)),!this.zip)throw new Error("impossible");let e=this.zip;e.on("data",i=>super.write(i)),e.on("end",()=>super.end()),e.on("drain",()=>this[fs]()),this.on("resume",()=>e.resume())}else this.on("drain",this[fs]);this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,t.mtime&&(this.mtime=t.mtime),this.filter=typeof t.filter=="function"?t.filter:()=>!0,this[W]=new hi,this[G]=0,this.jobs=Number(t.jobs)||4,this[Ee]=!1,this[ue]=!1}[lr](t){return super.write(t)}add(t){return this.write(t),this}end(t,e,i){return typeof t=="function"&&(i=t,t=void 0),typeof e=="function"&&(i=e,e=void 0),t&&this.add(t),this[ue]=!0,this[Ft](),i&&i(),this}write(t){if(this[ue])throw new Error("write after end");return typeof t=="string"?this[ci](t):this[or](t),this.flowing}[or](t){let e=f(ar.resolve(this.cwd,t.path));if(!this.filter(t.path,t))t.resume();else{let i=new pi(t.path,e);i.entry=new oi(t,this[cs](i)),i.entry.on("end",()=>this[ls](i)),this[G]+=1,this[W].push(i)}this[Ft]()}[ci](t){let e=f(ar.resolve(this.cwd,t));this[W].push(new pi(t,e)),this[Ft]()}[ds](t){t.pending=!0,this[G]+=1;let e=this.follow?"stat":"lstat";ui[e](t.absolute,(i,r)=>{t.pending=!1,this[G]-=1,i?this.emit("error",i):this[li](t,r)})}[li](t,e){if(this.statCache.set(t.absolute,e),t.stat=e,!this.filter(t.path,e))t.ignore=!0;else if(e.isFile()&&e.nlink>1&&!this.linkCache.get(`${e.dev}:${e.ino}`)&&!this.sync)if(t===this[Et])this[ai](t);else{let i=`${e.dev}:${e.ino}`,r=this[pe].get(i);r?r.push(t):this[pe].set(i,[t]),t.pendingLink=!0,t.pending=!0}this[Ft]()}[ms](t){t.pending=!0,this[G]+=1,ui.readdir(t.absolute,(e,i)=>{if(t.pending=!1,this[G]-=1,e)return this.emit("error",e);this[fi](t,i)})}[fi](t,e){this.readdirCache.set(t.absolute,e),t.readdir=e,this[Ft]()}[Ft](){if(!this[Ee]){this[Ee]=!0;for(let t=this[W].head;t&&this[G]<this.jobs;t=t.next)if(this[ai](t.value),t.value.ignore){let e=t.next;this[W].removeNode(t),t.next=e}this[Ee]=!1,this[ue]&&this[W].length===0&&this[G]===0&&(this.zip?this.zip.end(nr):(super.write(nr),super.end()))}}get[Et](){return this[W]&&this[W].head&&this[W].head.value}[ls](t){this[W].shift(),this[G]-=1;let{stat:e}=t;if(e&&e.isFile()&&e.nlink>1){let i=`${e.dev}:${e.ino}`,r=this[pe].get(i);if(r){this[pe].delete(i);for(let n of r)n.pending=!1,this[ai](n)}}this[Ft]()}[ai](t){if(t.pending&&t.pendingLink&&t===this[Et]&&(t.pending=!1,t.pendingLink=!1),!t.pending){if(t.entry){t===this[Et]&&!t.piped&&this[di](t);return}if(!t.stat){let e=this.statCache.get(t.absolute);e?this[li](t,e):this[ds](t)}if(t.stat&&!t.ignore){if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){let e=this.readdirCache.get(t.absolute);if(e?this[fi](t,e):this[ms](t),!t.readdir)return}if(t.entry=this[hr](t),!t.entry){t.ignore=!0;return}t===this[Et]&&!t.piped&&this[di](t)}}}[cs](t){return{onwarn:(e,i,r)=>this.warn(e,i,r),noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[hr](t){this[G]+=1;try{return new this[mi](t.path,this[cs](t)).on("end",()=>this[ls](t)).on("error",i=>this.emit("error",i))}catch(e){this.emit("error",e)}}[fs](){this[Et]&&this[Et].entry&&this[Et].entry.resume()}[di](t){t.piped=!0,t.readdir&&t.readdir.forEach(r=>{let n=t.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ci](o+r)});let e=t.entry,i=this.zip;if(!e)throw new Error("cannot pipe without source");i?e.on("data",r=>{i.write(r)||e.pause()}):e.on("data",r=>{super.write(r)||e.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(t,e,i={}){Dt(this,t,e,i)}},kt=class extends wt{sync=!0;constructor(t){super(t),this[mi]=ni}pause(){}resume(){}[ds](t){let e=this.follow?"statSync":"lstatSync";this[li](t,ui[e](t.absolute))}[ms](t){this[fi](t,ui.readdirSync(t.absolute))}[di](t){let e=t.entry,i=this.zip;if(t.readdir&&t.readdir.forEach(r=>{let n=t.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ci](o+r)}),!e)throw new Error("Cannot pipe without source");i?e.on("data",r=>{i.write(r)}):e.on("data",r=>{super[lr](r)})}};var Vn=(s,t)=>{let e=new kt(s),i=new Wt(s.file,{mode:s.mode||438});e.pipe(i),fr(e,t)},$n=(s,t)=>{let e=new wt(s),i=new et(s.file,{mode:s.mode||438});e.pipe(i);let r=new Promise((n,o)=>{i.on("error",o),i.on("close",n),e.on("error",o)});return dr(e,t).catch(n=>e.emit("error",n)),r},fr=(s,t)=>{t.forEach(e=>{e.charAt(0)==="@"?Ct({file:cr.resolve(s.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(e)}),s.end()},dr=async(s,t)=>{for(let e of t)e.charAt(0)==="@"?await Ct({file:cr.resolve(String(s.cwd),e.slice(1)),noResume:!0,onReadEntry:i=>{s.add(i)}}):s.add(e);s.end()},Xn=(s,t)=>{let e=new kt(s);return fr(e,t),e},qn=(s,t)=>{let e=new wt(s);return dr(e,t).catch(i=>e.emit("error",i)),e},Qn=K(Vn,$n,Xn,qn,(s,t)=>{if(!t?.length)throw new TypeError("no paths specified to add to archive")});import Br from"node:fs";import co from"node:assert";import{randomBytes as Mr}from"node:crypto";import m from"node:fs";import R from"node:path";import pr from"fs";var Jn=process.env.__FAKE_PLATFORM__||process.platform,Er=Jn==="win32",{O_CREAT:wr,O_NOFOLLOW:mr,O_TRUNC:Sr,O_WRONLY:yr}=pr.constants,Rr=Number(process.env.__FAKE_FS_O_FILENAME__)||pr.constants.UV_FS_O_FILEMAP||0,jn=Er&&!!Rr,to=512*1024,eo=Rr|Sr|wr|yr,ur=!Er&&typeof mr=="number"?mr|Sr|wr|yr:null,us=ur!==null?()=>ur:jn?s=>s<to?eo:"w":()=>"w";import wi from"node:fs";import we from"node:path";var ps=(s,t,e)=>{try{return wi.lchownSync(s,t,e)}catch(i){if(i?.code!=="ENOENT")throw i}},Ei=(s,t,e,i)=>{wi.lchown(s,t,e,r=>{i(r&&r?.code!=="ENOENT"?r:null)})},io=(s,t,e,i,r)=>{if(t.isDirectory())Es(we.resolve(s,t.name),e,i,n=>{if(n)return r(n);let o=we.resolve(s,t.name);Ei(o,e,i,r)});else{let n=we.resolve(s,t.name);Ei(n,e,i,r)}},Es=(s,t,e,i)=>{wi.readdir(s,{withFileTypes:!0},(r,n)=>{if(r){if(r.code==="ENOENT")return i();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return i(r)}if(r||!n.length)return Ei(s,t,e,i);let o=n.length,h=null,a=l=>{if(!h){if(l)return i(h=l);if(--o===0)return Ei(s,t,e,i)}};for(let l of n)io(s,l,t,e,a)})},so=(s,t,e,i)=>{t.isDirectory()&&ws(we.resolve(s,t.name),e,i),ps(we.resolve(s,t.name),e,i)},ws=(s,t,e)=>{let i;try{i=wi.readdirSync(s,{withFileTypes:!0})}catch(r){let n=r;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return ps(s,t,e);throw n}for(let r of i)so(s,r,t,e);return ps(s,t,e)};import k from"node:fs";import ro from"node:fs/promises";import Si from"node:path";var Se=class extends Error{path;code;syscall="chdir";constructor(t,e){super(`${e}: Cannot cd into '${t}'`),this.path=t,this.code=e}get name(){return"CwdError"}};var St=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(t,e){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=t,this.path=e}get name(){return"SymlinkError"}};var no=(s,t)=>{k.stat(s,(e,i)=>{(e||!i.isDirectory())&&(e=new Se(s,e?.code||"ENOTDIR")),t(e)})},gr=(s,t,e)=>{s=f(s);let i=t.umask??18,r=t.mode|448,n=(r&i)!==0,o=t.uid,h=t.gid,a=typeof o=="number"&&typeof h=="number"&&(o!==t.processUid||h!==t.processGid),l=t.preserve,c=t.unlink,d=f(t.cwd),S=(E,x)=>{E?e(E):x&&a?Es(x,o,h,Le=>S(Le)):n?k.chmod(s,r,e):e()};if(s===d)return no(s,S);if(l)return ro.mkdir(s,{mode:r,recursive:!0}).then(E=>S(null,E??void 0),S);let D=f(Si.relative(d,s)).split("/");Ss(d,D,r,c,d,void 0,S)},Ss=(s,t,e,i,r,n,o)=>{if(t.length===0)return o(null,n);let h=t.shift(),a=f(Si.resolve(s+"/"+h));k.mkdir(a,e,br(a,t,e,i,r,n,o))},br=(s,t,e,i,r,n,o)=>h=>{h?k.lstat(s,(a,l)=>{if(a)a.path=a.path&&f(a.path),o(a);else if(l.isDirectory())Ss(s,t,e,i,r,n,o);else if(i)k.unlink(s,c=>{if(c)return o(c);k.mkdir(s,e,br(s,t,e,i,r,n,o))});else{if(l.isSymbolicLink())return o(new St(s,s+"/"+t.join("/")));o(h)}}):(n=n||s,Ss(s,t,e,i,r,n,o))},oo=s=>{let t=!1,e;try{t=k.statSync(s).isDirectory()}catch(i){e=i?.code}finally{if(!t)throw new Se(s,e??"ENOTDIR")}},_r=(s,t)=>{s=f(s);let e=t.umask??18,i=t.mode|448,r=(i&e)!==0,n=t.uid,o=t.gid,h=typeof n=="number"&&typeof o=="number"&&(n!==t.processUid||o!==t.processGid),a=t.preserve,l=t.unlink,c=f(t.cwd),d=E=>{E&&h&&ws(E,n,o),r&&k.chmodSync(s,i)};if(s===c)return oo(c),d();if(a)return d(k.mkdirSync(s,{mode:i,recursive:!0})??void 0);let T=f(Si.relative(c,s)).split("/"),D;for(let E=T.shift(),x=c;E&&(x+="/"+E);E=T.shift()){x=f(Si.resolve(x));try{k.mkdirSync(x,i),D=D||x}catch{let Le=k.lstatSync(x);if(Le.isDirectory())continue;if(l){k.unlinkSync(x),k.mkdirSync(x,i),D=D||x;continue}else if(Le.isSymbolicLink())return new St(x,x+"/"+T.join("/"))}}return d(D)};import{join as xr}from"node:path";var ys=Object.create(null),Or=1e4,Vt=new Set,Tr=s=>{Vt.has(s)?Vt.delete(s):ys[s]=s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),Vt.add(s);let t=ys[s],e=Vt.size-Or;if(e>Or/10){for(let i of Vt)if(Vt.delete(i),delete ys[i],--e<=0)break}return t};var ho=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,ao=ho==="win32",lo=s=>s.split("/").slice(0,-1).reduce((e,i)=>{let r=e.at(-1);return r!==void 0&&(i=xr(r,i)),e.push(i||"/"),e},[]),yi=class{#t=new Map;#i=new Map;#s=new Set;reserve(t,e){t=ao?["win32 parallelization disabled"]:t.map(r=>ut(xr(Tr(r))));let i=new Set(t.map(r=>lo(r)).reduce((r,n)=>r.concat(n)));this.#i.set(e,{dirs:i,paths:t});for(let r of t){let n=this.#t.get(r);n?n.push(e):this.#t.set(r,[e])}for(let r of i){let n=this.#t.get(r);if(!n)this.#t.set(r,[new Set([e])]);else{let o=n.at(-1);o instanceof Set?o.add(e):n.push(new Set([e]))}}return this.#r(e)}#n(t){let e=this.#i.get(t);if(!e)throw new Error("function does not have any path reservations");return{paths:e.paths.map(i=>this.#t.get(i)),dirs:[...e.dirs].map(i=>this.#t.get(i))}}check(t){let{paths:e,dirs:i}=this.#n(t);return e.every(r=>r&&r[0]===t)&&i.every(r=>r&&r[0]instanceof Set&&r[0].has(t))}#r(t){return this.#s.has(t)||!this.check(t)?!1:(this.#s.add(t),t(()=>this.#e(t)),!0)}#e(t){if(!this.#s.has(t))return!1;let e=this.#i.get(t);if(!e)throw new Error("invalid reservation");let{paths:i,dirs:r}=e,n=new Set;for(let o of i){let h=this.#t.get(o);if(!h||h?.[0]!==t)continue;let a=h[1];if(!a){this.#t.delete(o);continue}if(h.shift(),typeof a=="function")n.add(a);else for(let l of a)n.add(l)}for(let o of r){let h=this.#t.get(o),a=h?.[0];if(!(!h||!(a instanceof Set)))if(a.size===1&&h.length===1){this.#t.delete(o);continue}else if(a.size===1){h.shift();let l=h[0];typeof l=="function"&&n.add(l)}else a.delete(t)}return this.#s.delete(t),n.forEach(o=>this.#r(o)),!0}};var Lr=()=>process.umask();var Dr=Symbol("onEntry"),_s=Symbol("checkFs"),Nr=Symbol("checkFs2"),Os=Symbol("isReusable"),P=Symbol("makeFs"),Ts=Symbol("file"),xs=Symbol("directory"),gi=Symbol("link"),Ar=Symbol("symlink"),Ir=Symbol("hardlink"),Re=Symbol("ensureNoSymlink"),Cr=Symbol("unsupported"),Fr=Symbol("checkPath"),Rs=Symbol("stripAbsolutePath"),yt=Symbol("mkdir"),O=Symbol("onError"),Ri=Symbol("pending"),kr=Symbol("pend"),$t=Symbol("unpend"),gs=Symbol("ended"),bs=Symbol("maybeClose"),Ls=Symbol("skip"),ge=Symbol("doChown"),be=Symbol("uid"),_e=Symbol("gid"),Oe=Symbol("checkedCwd"),fo=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Te=fo==="win32",mo=1024,uo=(s,t)=>{if(!Te)return m.unlink(s,t);let e=s+".DELETE."+Mr(16).toString("hex");m.rename(s,e,i=>{if(i)return t(i);m.unlink(e,t)})},po=s=>{if(!Te)return m.unlinkSync(s);let t=s+".DELETE."+Mr(16).toString("hex");m.renameSync(s,t),m.unlinkSync(t)},vr=(s,t,e)=>s!==void 0&&s===s>>>0?s:t!==void 0&&t===t>>>0?t:e,Xt=class extends rt{[gs]=!1;[Oe]=!1;[Ri]=0;reservations=new yi;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(t={}){if(t.ondone=()=>{this[gs]=!0,this[bs]()},super(t),this.transform=t.transform,this.chmod=!!t.chmod,typeof t.uid=="number"||typeof t.gid=="number"){if(typeof t.uid!="number"||typeof t.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=t.preserveOwner===void 0&&typeof t.uid!="number"?process.getuid?.()===0:!!t.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:mo,this.forceChown=t.forceChown===!0,this.win32=!!t.win32||Te,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=f(R.resolve(t.cwd||process.cwd())),this.strip=Number(t.strip)||0,this.processUmask=this.chmod?typeof t.processUmask=="number"?t.processUmask:Lr():0,this.umask=typeof t.umask=="number"?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",e=>this[Dr](e))}warn(t,e,i={}){return(t==="TAR_BAD_ARCHIVE"||t==="TAR_ABORT")&&(i.recoverable=!1),super.warn(t,e,i)}[bs](){this[gs]&&this[Ri]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Rs](t,e){let i=t[e],{type:r}=t;if(!i||this.preservePaths)return!0;let[n,o]=ce(i),h=o.replaceAll(/\\/g,"/").split("/");if(h.includes("..")||Te&&/^[a-z]:\.\.$/i.test(h[0]??"")){if(e==="path"||r==="Link")return this.warn("TAR_ENTRY_ERROR",`${e} contains '..'`,{entry:t,[e]:i}),!1;let a=R.posix.dirname(t.path),l=R.posix.normalize(R.posix.join(a,h.join("/")));if(l.startsWith("../")||l==="..")return this.warn("TAR_ENTRY_ERROR",`${e} escapes extraction directory`,{entry:t,[e]:i}),!1}return n&&(t[e]=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${e}`,{entry:t,[e]:i})),!0}[Fr](t){let e=f(t.path),i=e.split("/");if(this.strip){if(i.length<this.strip)return!1;if(t.type==="Link"){let r=f(String(t.linkpath)).split("/");if(r.length>=this.strip)t.linkpath=r.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),t.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:e,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[Rs](t,"path")||!this[Rs](t,"linkpath"))return!1;if(t.absolute=R.isAbsolute(t.path)?f(R.resolve(t.path)):f(R.resolve(this.cwd,t.path)),!this.preservePaths&&typeof t.absolute=="string"&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:f(t.path),resolvedPath:t.absolute,cwd:this.cwd}),!1;if(t.absolute===this.cwd&&t.type!=="Directory"&&t.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=R.win32.parse(String(t.absolute));t.absolute=r+ts(String(t.absolute).slice(r.length));let{root:n}=R.win32.parse(t.path);t.path=n+ts(t.path.slice(n.length))}return!0}[Dr](t){if(!this[Fr](t))return t.resume();switch(co.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=t.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[_s](t);default:return this[Cr](t)}}[O](t,e){t.name==="CwdError"?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:e}),this[$t](),e.resume())}[yt](t,e,i){gr(f(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:e},i)}[ge](t){return this.forceChown||this.preserveOwner&&(typeof t.uid=="number"&&t.uid!==this.processUid||typeof t.gid=="number"&&t.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[be](t){return vr(this.uid,t.uid,this.processUid)}[_e](t){return vr(this.gid,t.gid,this.processGid)}[Ts](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.fmode,r=new et(String(t.absolute),{flags:us(t.size),mode:i,autoClose:!1});r.on("error",a=>{r.fd&&m.close(r.fd,()=>{}),r.write=()=>!0,this[O](a,t),e()});let n=1,o=a=>{if(a){r.fd&&m.close(r.fd,()=>{}),this[O](a,t),e();return}--n===0&&r.fd!==void 0&&m.close(r.fd,l=>{l?this[O](l,t):this[$t](),e()})};r.on("finish",()=>{let a=String(t.absolute),l=r.fd;if(typeof l=="number"&&t.mtime&&!this.noMtime){n++;let c=t.atime||new Date,d=t.mtime;m.futimes(l,c,d,S=>S?m.utimes(a,c,d,T=>o(T&&S)):o())}if(typeof l=="number"&&this[ge](t)){n++;let c=this[be](t),d=this[_e](t);typeof c=="number"&&typeof d=="number"&&m.fchown(l,c,d,S=>S?m.chown(a,c,d,T=>o(T&&S)):o())}o()});let h=this.transform&&this.transform(t)||t;h!==t&&(h.on("error",a=>{this[O](a,t),e()}),t.pipe(h)),h.pipe(r)}[xs](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.dmode;this[yt](String(t.absolute),i,r=>{if(r){this[O](r,t),e();return}let n=1,o=()=>{--n===0&&(e(),this[$t](),t.resume())};t.mtime&&!this.noMtime&&(n++,m.utimes(String(t.absolute),t.atime||new Date,t.mtime,o)),this[ge](t)&&(n++,m.chown(String(t.absolute),Number(this[be](t)),Number(this[_e](t)),o)),o()})}[Cr](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t}),t.resume()}[Ar](t,e){let i=f(R.relative(this.cwd,R.resolve(R.dirname(String(t.absolute)),String(t.linkpath)))).split("/");this[Re](t,this.cwd,i,()=>this[gi](t,String(t.linkpath),"symlink",e),r=>{this[O](r,t),e()})}[Ir](t,e){let i=f(R.resolve(this.cwd,String(t.linkpath))),r=f(String(t.linkpath)).split("/");this[Re](t,this.cwd,r,()=>this[gi](t,i,"link",e),n=>{this[O](n,t),e()})}[Re](t,e,i,r,n){let o=i.shift();if(this.preservePaths||o===void 0)return r();let h=R.resolve(e,o);m.lstat(h,(a,l)=>{if(a)return r();if(l?.isSymbolicLink())return n(new St(h,R.resolve(h,i.join("/"))));this[Re](t,h,i,r,n)})}[kr](){this[Ri]++}[$t](){this[Ri]--,this[bs]()}[Ls](t){this[$t](),t.resume()}[Os](t,e){return t.type==="File"&&!this.unlink&&e.isFile()&&e.nlink<=1&&!Te}[_s](t){this[kr]();let e=[t.path];t.linkpath&&e.push(t.linkpath),this.reservations.reserve(e,i=>this[Nr](t,i))}[Nr](t,e){let i=h=>{e(h)},r=()=>{this[yt](this.cwd,this.dmode,h=>{if(h){this[O](h,t),i();return}this[Oe]=!0,n()})},n=()=>{if(t.absolute!==this.cwd){let h=f(R.dirname(String(t.absolute)));if(h!==this.cwd)return this[yt](h,this.dmode,a=>{if(a){this[O](a,t),i();return}o()})}o()},o=()=>{m.lstat(String(t.absolute),(h,a)=>{if(a&&(this.keep||this.newer&&a.mtime>(t.mtime??a.mtime))){this[Ls](t),i();return}if(h||this[Os](t,a))return this[P](null,t,i);if(a.isDirectory()){if(t.type==="Directory"){let l=this.chmod&&t.mode&&(a.mode&4095)!==t.mode,c=d=>this[P](d??null,t,i);return l?m.chmod(String(t.absolute),Number(t.mode),c):c()}if(t.absolute!==this.cwd)return m.rmdir(String(t.absolute),l=>this[P](l??null,t,i))}if(t.absolute===this.cwd)return this[P](null,t,i);uo(String(t.absolute),l=>this[P](l??null,t,i))})};this[Oe]?n():r()}[P](t,e,i){if(t){this[O](t,e),i();return}switch(e.type){case"File":case"OldFile":case"ContiguousFile":return this[Ts](e,i);case"Link":return this[Ir](e,i);case"SymbolicLink":return this[Ar](e,i);case"Directory":case"GNUDumpDir":return this[xs](e,i)}}[gi](t,e,i,r){m[i](e,String(t.absolute),n=>{n?this[O](n,t):(this[$t](),t.resume()),r()})}},ye=s=>{try{return[null,s()]}catch(t){return[t,null]}},xe=class extends Xt{sync=!0;[P](t,e){return super[P](t,e,()=>{})}[_s](t){if(!this[Oe]){let n=this[yt](this.cwd,this.dmode);if(n)return this[O](n,t);this[Oe]=!0}if(t.absolute!==this.cwd){let n=f(R.dirname(String(t.absolute)));if(n!==this.cwd){let o=this[yt](n,this.dmode);if(o)return this[O](o,t)}}let[e,i]=ye(()=>m.lstatSync(String(t.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(t.mtime??i.mtime)))return this[Ls](t);if(e||this[Os](t,i))return this[P](null,t);if(i.isDirectory()){if(t.type==="Directory"){let o=this.chmod&&t.mode&&(i.mode&4095)!==t.mode,[h]=o?ye(()=>{m.chmodSync(String(t.absolute),Number(t.mode))}):[];return this[P](h,t)}let[n]=ye(()=>m.rmdirSync(String(t.absolute)));this[P](n,t)}let[r]=t.absolute===this.cwd?[]:ye(()=>po(String(t.absolute)));this[P](r,t)}[Ts](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.fmode,r=h=>{let a;try{m.closeSync(n)}catch(l){a=l}(h||a)&&this[O](h||a,t),e()},n;try{n=m.openSync(String(t.absolute),us(t.size),i)}catch(h){return r(h)}let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",h=>this[O](h,t)),t.pipe(o)),o.on("data",h=>{try{m.writeSync(n,h,0,h.length)}catch(a){r(a)}}),o.on("end",()=>{let h=null;if(t.mtime&&!this.noMtime){let a=t.atime||new Date,l=t.mtime;try{m.futimesSync(n,a,l)}catch(c){try{m.utimesSync(String(t.absolute),a,l)}catch{h=c}}}if(this[ge](t)){let a=this[be](t),l=this[_e](t);try{m.fchownSync(n,Number(a),Number(l))}catch(c){try{m.chownSync(String(t.absolute),Number(a),Number(l))}catch{h=h||c}}}r(h)})}[xs](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.dmode,r=this[yt](String(t.absolute),i);if(r){this[O](r,t),e();return}if(t.mtime&&!this.noMtime)try{m.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch{}if(this[ge](t))try{m.chownSync(String(t.absolute),Number(this[be](t)),Number(this[_e](t)))}catch{}e(),t.resume()}[yt](t,e){try{return _r(f(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:e})}catch(i){return i}}[Re](t,e,i,r,n){if(this.preservePaths||i.length===0)return r();let o=e;for(let h of i){o=R.resolve(o,h);let[a,l]=ye(()=>m.lstatSync(o));if(a)return r();if(l.isSymbolicLink())return n(new St(o,R.resolve(e,i.join("/"))))}r()}[gi](t,e,i,r){let n=`${i}Sync`;try{m[n](e,String(t.absolute)),r(),t.resume()}catch(o){return this[O](o,t)}}};var Eo=s=>{let t=new xe(s),e=s.file,i=Br.statSync(e),r=s.maxReadSize||16*1024*1024;new Be(e,{readSize:r,size:i.size}).pipe(t)},wo=(s,t)=>{let e=new Xt(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,h)=>{e.on("error",h),e.on("close",o),Br.stat(r,(a,l)=>{if(a)h(a);else{let c=new _t(r,{readSize:i,size:l.size});c.on("error",h),c.pipe(e)}})})},So=K(Eo,wo,s=>new xe(s),s=>new Xt(s),(s,t)=>{t?.length&&Qi(s,t)});import v from"node:fs";import Pr from"node:path";var yo=(s,t)=>{let e=new kt(s),i=!0,r,n;try{try{r=v.openSync(s.file,"r+")}catch(a){if(a?.code==="ENOENT")r=v.openSync(s.file,"w+");else throw a}let o=v.fstatSync(r),h=Buffer.alloc(512);t:for(n=0;n<o.size;n+=512){for(let c=0,d=0;c<512;c+=d){if(d=v.readSync(r,h,c,h.length-c,n+c),n===0&&h[0]===31&&h[1]===139)throw new Error("cannot append to compressed archives");if(!d)break t}let a=new F(h);if(!a.cksumValid)break;let l=512*Math.ceil((a.size||0)/512);if(n+l+512>o.size)break;n+=l,s.mtimeCache&&a.mtime&&s.mtimeCache.set(String(a.path),a.mtime)}i=!1,Ro(s,e,n,r,t)}finally{if(i)try{v.closeSync(r)}catch{}}},Ro=(s,t,e,i,r)=>{let n=new Wt(s.file,{fd:i,start:e});t.pipe(n),bo(t,r)},go=(s,t)=>{t=Array.from(t);let e=new wt(s),i=(n,o,h)=>{let a=(T,D)=>{T?v.close(n,E=>h(T)):h(null,D)},l=0;if(o===0)return a(null,0);let c=0,d=Buffer.alloc(512),S=(T,D)=>{if(T||D===void 0)return a(T);if(c+=D,c<512&&D)return v.read(n,d,c,d.length-c,l+c,S);if(l===0&&d[0]===31&&d[1]===139)return a(new Error("cannot append to compressed archives"));if(c<512)return a(null,l);let E=new F(d);if(!E.cksumValid)return a(null,l);let x=512*Math.ceil((E.size??0)/512);if(l+x+512>o||(l+=x+512,l>=o))return a(null,l);s.mtimeCache&&E.mtime&&s.mtimeCache.set(String(E.path),E.mtime),c=0,v.read(n,d,0,512,l,S)};v.read(n,d,0,512,l,S)};return new Promise((n,o)=>{e.on("error",o);let h="r+",a=(l,c)=>{if(l&&l.code==="ENOENT"&&h==="r+")return h="w+",v.open(s.file,h,a);if(l||!c)return o(l);v.fstat(c,(d,S)=>{if(d)return v.close(c,()=>o(d));i(c,S.size,(T,D)=>{if(T)return o(T);let E=new et(s.file,{fd:c,start:D});e.pipe(E),E.on("error",o),E.on("close",n),_o(e,t)})})};v.open(s.file,h,a)})},bo=(s,t)=>{t.forEach(e=>{e.charAt(0)==="@"?Ct({file:Pr.resolve(s.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(e)}),s.end()},_o=async(s,t)=>{for(let e of t)e.charAt(0)==="@"?await Ct({file:Pr.resolve(String(s.cwd),e.slice(1)),noResume:!0,onReadEntry:i=>s.add(i)}):s.add(e);s.end()},vt=K(yo,go,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(s,t)=>{if(!Bs(s))throw new TypeError("file is required");if(s.gzip||s.brotli||s.zstd||s.file.endsWith(".br")||s.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!t?.length)throw new TypeError("no paths specified to add/replace")});var Oo=K(vt.syncFile,vt.asyncFile,vt.syncNoFile,vt.asyncNoFile,(s,t=[])=>{vt.validate?.(s,t),To(s)}),To=s=>{let t=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=t?(e,i)=>t(e,i)&&!((s.mtimeCache?.get(e)??i.mtime??0)>(i.mtime??0)):(e,i)=>!((s.mtimeCache?.get(e)??i.mtime??0)>(i.mtime??0))};export{F as Header,wt as Pack,pi as PackJob,kt as PackSync,rt as Parser,ft as Pax,$e as ReadEntry,Xt as Unpack,xe as UnpackSync,de as WriteEntry,ni as WriteEntrySync,oi as WriteEntryTar,Qn as c,Qn as create,So as extract,Qi as filesFilter,Ct as list,vt as r,vt as replace,Ct as t,Hi as types,Oo as u,Oo as update,So as x};
|
|
4
|
-
//# sourceMappingURL=index.min.js.map
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
// Tar can encode large and negative numbers using a leading byte of
|
|
2
|
-
// 0xff for negative, and 0x80 for positive.
|
|
3
|
-
export const encode = (num, buf) => {
|
|
4
|
-
if (!Number.isSafeInteger(num)) {
|
|
5
|
-
// The number is so large that javascript cannot represent it with integer
|
|
6
|
-
// precision.
|
|
7
|
-
throw Error('cannot encode number outside of javascript safe integer range');
|
|
8
|
-
}
|
|
9
|
-
else if (num < 0) {
|
|
10
|
-
encodeNegative(num, buf);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
encodePositive(num, buf);
|
|
14
|
-
}
|
|
15
|
-
return buf;
|
|
16
|
-
};
|
|
17
|
-
const encodePositive = (num, buf) => {
|
|
18
|
-
buf[0] = 0x80;
|
|
19
|
-
for (var i = buf.length; i > 1; i--) {
|
|
20
|
-
buf[i - 1] = num & 0xff;
|
|
21
|
-
num = Math.floor(num / 0x100);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const encodeNegative = (num, buf) => {
|
|
25
|
-
buf[0] = 0xff;
|
|
26
|
-
var flipped = false;
|
|
27
|
-
num = num * -1;
|
|
28
|
-
for (var i = buf.length; i > 1; i--) {
|
|
29
|
-
var byte = num & 0xff;
|
|
30
|
-
num = Math.floor(num / 0x100);
|
|
31
|
-
if (flipped) {
|
|
32
|
-
buf[i - 1] = onesComp(byte);
|
|
33
|
-
}
|
|
34
|
-
else if (byte === 0) {
|
|
35
|
-
buf[i - 1] = 0;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
flipped = true;
|
|
39
|
-
buf[i - 1] = twosComp(byte);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
export const parse = (buf) => {
|
|
44
|
-
const pre = buf[0];
|
|
45
|
-
const value = pre === 0x80 ? pos(buf.subarray(1, buf.length))
|
|
46
|
-
: pre === 0xff ? twos(buf)
|
|
47
|
-
: null;
|
|
48
|
-
if (value === null) {
|
|
49
|
-
throw Error('invalid base256 encoding');
|
|
50
|
-
}
|
|
51
|
-
if (!Number.isSafeInteger(value)) {
|
|
52
|
-
// The number is so large that javascript cannot represent it with integer
|
|
53
|
-
// precision.
|
|
54
|
-
throw Error('parsed number outside of javascript safe integer range');
|
|
55
|
-
}
|
|
56
|
-
return value;
|
|
57
|
-
};
|
|
58
|
-
const twos = (buf) => {
|
|
59
|
-
var len = buf.length;
|
|
60
|
-
var sum = 0;
|
|
61
|
-
var flipped = false;
|
|
62
|
-
for (var i = len - 1; i > -1; i--) {
|
|
63
|
-
var byte = Number(buf[i]);
|
|
64
|
-
var f;
|
|
65
|
-
if (flipped) {
|
|
66
|
-
f = onesComp(byte);
|
|
67
|
-
}
|
|
68
|
-
else if (byte === 0) {
|
|
69
|
-
f = byte;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
flipped = true;
|
|
73
|
-
f = twosComp(byte);
|
|
74
|
-
}
|
|
75
|
-
if (f !== 0) {
|
|
76
|
-
sum -= f * Math.pow(256, len - i - 1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return sum;
|
|
80
|
-
};
|
|
81
|
-
const pos = (buf) => {
|
|
82
|
-
var len = buf.length;
|
|
83
|
-
var sum = 0;
|
|
84
|
-
for (var i = len - 1; i > -1; i--) {
|
|
85
|
-
var byte = Number(buf[i]);
|
|
86
|
-
if (byte !== 0) {
|
|
87
|
-
sum += byte * Math.pow(256, len - i - 1);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return sum;
|
|
91
|
-
};
|
|
92
|
-
const onesComp = (byte) => (0xff ^ byte) & 0xff;
|
|
93
|
-
const twosComp = (byte) => ((0xff ^ byte) + 1) & 0xff;
|
|
94
|
-
//# sourceMappingURL=large-numbers.js.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// tar -t
|
|
2
|
-
import * as fsm from '@isaacs/fs-minipass';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import { dirname, parse } from 'path';
|
|
5
|
-
import { makeCommand } from './make-command.js';
|
|
6
|
-
import { Parser } from './parse.js';
|
|
7
|
-
import { stripTrailingSlashes } from './strip-trailing-slashes.js';
|
|
8
|
-
const onReadEntryFunction = (opt) => {
|
|
9
|
-
const onReadEntry = opt.onReadEntry;
|
|
10
|
-
opt.onReadEntry =
|
|
11
|
-
onReadEntry ?
|
|
12
|
-
e => {
|
|
13
|
-
onReadEntry(e);
|
|
14
|
-
e.resume();
|
|
15
|
-
}
|
|
16
|
-
: e => e.resume();
|
|
17
|
-
};
|
|
18
|
-
// construct a filter that limits the file entries listed
|
|
19
|
-
// include child entries if a dir is included
|
|
20
|
-
export const filesFilter = (opt, files) => {
|
|
21
|
-
const map = new Map(files.map(f => [stripTrailingSlashes(f), true]));
|
|
22
|
-
const filter = opt.filter;
|
|
23
|
-
const mapHas = (file, r = '') => {
|
|
24
|
-
const root = r || parse(file).root || '.';
|
|
25
|
-
let ret;
|
|
26
|
-
if (file === root)
|
|
27
|
-
ret = false;
|
|
28
|
-
else {
|
|
29
|
-
const m = map.get(file);
|
|
30
|
-
ret = m !== undefined ? m : mapHas(dirname(file), root);
|
|
31
|
-
}
|
|
32
|
-
map.set(file, ret);
|
|
33
|
-
return ret;
|
|
34
|
-
};
|
|
35
|
-
opt.filter =
|
|
36
|
-
filter ?
|
|
37
|
-
(file, entry) => filter(file, entry) && mapHas(stripTrailingSlashes(file))
|
|
38
|
-
: file => mapHas(stripTrailingSlashes(file));
|
|
39
|
-
};
|
|
40
|
-
const listFileSync = (opt) => {
|
|
41
|
-
const p = new Parser(opt);
|
|
42
|
-
const file = opt.file;
|
|
43
|
-
let fd;
|
|
44
|
-
try {
|
|
45
|
-
fd = fs.openSync(file, 'r');
|
|
46
|
-
const stat = fs.fstatSync(fd);
|
|
47
|
-
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
48
|
-
if (stat.size < readSize) {
|
|
49
|
-
const buf = Buffer.allocUnsafe(stat.size);
|
|
50
|
-
const read = fs.readSync(fd, buf, 0, stat.size, 0);
|
|
51
|
-
p.end(read === buf.byteLength ? buf : buf.subarray(0, read));
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
let pos = 0;
|
|
55
|
-
const buf = Buffer.allocUnsafe(readSize);
|
|
56
|
-
while (pos < stat.size) {
|
|
57
|
-
const bytesRead = fs.readSync(fd, buf, 0, readSize, pos);
|
|
58
|
-
if (bytesRead === 0)
|
|
59
|
-
break;
|
|
60
|
-
pos += bytesRead;
|
|
61
|
-
p.write(buf.subarray(0, bytesRead));
|
|
62
|
-
}
|
|
63
|
-
p.end();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
finally {
|
|
67
|
-
if (typeof fd === 'number') {
|
|
68
|
-
try {
|
|
69
|
-
fs.closeSync(fd);
|
|
70
|
-
/* c8 ignore next */
|
|
71
|
-
}
|
|
72
|
-
catch { }
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const listFile = (opt, _files) => {
|
|
77
|
-
const parse = new Parser(opt);
|
|
78
|
-
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
79
|
-
const file = opt.file;
|
|
80
|
-
const p = new Promise((resolve, reject) => {
|
|
81
|
-
parse.on('error', reject);
|
|
82
|
-
parse.on('end', resolve);
|
|
83
|
-
fs.stat(file, (er, stat) => {
|
|
84
|
-
if (er) {
|
|
85
|
-
reject(er);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
const stream = new fsm.ReadStream(file, {
|
|
89
|
-
readSize: readSize,
|
|
90
|
-
size: stat.size,
|
|
91
|
-
});
|
|
92
|
-
stream.on('error', reject);
|
|
93
|
-
stream.pipe(parse);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
return p;
|
|
98
|
-
};
|
|
99
|
-
export const list = makeCommand(listFileSync, listFile, opt => new Parser(opt), opt => new Parser(opt), (opt, files) => {
|
|
100
|
-
if (files?.length)
|
|
101
|
-
filesFilter(opt, files);
|
|
102
|
-
if (!opt.noResume)
|
|
103
|
-
onReadEntryFunction(opt);
|
|
104
|
-
});
|
|
105
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { dealias, isAsyncFile, isAsyncNoFile, isSyncFile, isSyncNoFile, } from './options.js';
|
|
2
|
-
export const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => {
|
|
3
|
-
return Object.assign((opt_ = [], entries, cb) => {
|
|
4
|
-
if (Array.isArray(opt_)) {
|
|
5
|
-
entries = opt_;
|
|
6
|
-
opt_ = {};
|
|
7
|
-
}
|
|
8
|
-
if (typeof entries === 'function') {
|
|
9
|
-
cb = entries;
|
|
10
|
-
entries = undefined;
|
|
11
|
-
}
|
|
12
|
-
entries = !entries ? [] : Array.from(entries);
|
|
13
|
-
const opt = dealias(opt_);
|
|
14
|
-
validate?.(opt, entries);
|
|
15
|
-
if (isSyncFile(opt)) {
|
|
16
|
-
if (typeof cb === 'function') {
|
|
17
|
-
throw new TypeError('callback not supported for sync tar functions');
|
|
18
|
-
}
|
|
19
|
-
return syncFile(opt, entries);
|
|
20
|
-
}
|
|
21
|
-
else if (isAsyncFile(opt)) {
|
|
22
|
-
const p = asyncFile(opt, entries);
|
|
23
|
-
return cb ? p.then(() => cb(), cb) : p;
|
|
24
|
-
}
|
|
25
|
-
else if (isSyncNoFile(opt)) {
|
|
26
|
-
if (typeof cb === 'function') {
|
|
27
|
-
throw new TypeError('callback not supported for sync tar functions');
|
|
28
|
-
}
|
|
29
|
-
return syncNoFile(opt, entries);
|
|
30
|
-
}
|
|
31
|
-
else if (isAsyncNoFile(opt)) {
|
|
32
|
-
if (typeof cb === 'function') {
|
|
33
|
-
throw new TypeError('callback only supported with file option');
|
|
34
|
-
}
|
|
35
|
-
return asyncNoFile(opt, entries);
|
|
36
|
-
/* c8 ignore start */
|
|
37
|
-
}
|
|
38
|
-
throw new Error('impossible options??');
|
|
39
|
-
/* c8 ignore stop */
|
|
40
|
-
}, {
|
|
41
|
-
syncFile,
|
|
42
|
-
asyncFile,
|
|
43
|
-
syncNoFile,
|
|
44
|
-
asyncNoFile,
|
|
45
|
-
validate,
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=make-command.js.map
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { chownr, chownrSync } from 'chownr';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import fsp from 'node:fs/promises';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { CwdError } from './cwd-error.js';
|
|
6
|
-
import { normalizeWindowsPath } from './normalize-windows-path.js';
|
|
7
|
-
import { SymlinkError } from './symlink-error.js';
|
|
8
|
-
const checkCwd = (dir, cb) => {
|
|
9
|
-
fs.stat(dir, (er, st) => {
|
|
10
|
-
if (er || !st.isDirectory()) {
|
|
11
|
-
er = new CwdError(dir, er?.code || 'ENOTDIR');
|
|
12
|
-
}
|
|
13
|
-
cb(er);
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Wrapper around fs/promises.mkdir for tar's needs.
|
|
18
|
-
*
|
|
19
|
-
* The main purpose is to avoid creating directories if we know that
|
|
20
|
-
* they already exist (and track which ones exist for this purpose),
|
|
21
|
-
* and prevent entries from being extracted into symlinked folders,
|
|
22
|
-
* if `preservePaths` is not set.
|
|
23
|
-
*/
|
|
24
|
-
export const mkdir = (dir, opt, cb) => {
|
|
25
|
-
dir = normalizeWindowsPath(dir);
|
|
26
|
-
// if there's any overlap between mask and mode,
|
|
27
|
-
// then we'll need an explicit chmod
|
|
28
|
-
/* c8 ignore next */
|
|
29
|
-
const umask = opt.umask ?? 0o22;
|
|
30
|
-
const mode = opt.mode | 0o0700;
|
|
31
|
-
const needChmod = (mode & umask) !== 0;
|
|
32
|
-
const uid = opt.uid;
|
|
33
|
-
const gid = opt.gid;
|
|
34
|
-
const doChown = typeof uid === 'number' &&
|
|
35
|
-
typeof gid === 'number' &&
|
|
36
|
-
(uid !== opt.processUid || gid !== opt.processGid);
|
|
37
|
-
const preserve = opt.preserve;
|
|
38
|
-
const unlink = opt.unlink;
|
|
39
|
-
const cwd = normalizeWindowsPath(opt.cwd);
|
|
40
|
-
const done = (er, created) => {
|
|
41
|
-
if (er) {
|
|
42
|
-
cb(er);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
if (created && doChown) {
|
|
46
|
-
chownr(created, uid, gid, er => done(er));
|
|
47
|
-
}
|
|
48
|
-
else if (needChmod) {
|
|
49
|
-
fs.chmod(dir, mode, cb);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
cb();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
if (dir === cwd) {
|
|
57
|
-
return checkCwd(dir, done);
|
|
58
|
-
}
|
|
59
|
-
if (preserve) {
|
|
60
|
-
return fsp.mkdir(dir, { mode, recursive: true }).then(made => done(null, made ?? undefined), // oh, ts
|
|
61
|
-
done);
|
|
62
|
-
}
|
|
63
|
-
const sub = normalizeWindowsPath(path.relative(cwd, dir));
|
|
64
|
-
const parts = sub.split('/');
|
|
65
|
-
mkdir_(cwd, parts, mode, unlink, cwd, undefined, done);
|
|
66
|
-
};
|
|
67
|
-
const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
|
|
68
|
-
if (parts.length === 0) {
|
|
69
|
-
return cb(null, created);
|
|
70
|
-
}
|
|
71
|
-
const p = parts.shift();
|
|
72
|
-
const part = normalizeWindowsPath(path.resolve(base + '/' + p));
|
|
73
|
-
fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
|
|
74
|
-
};
|
|
75
|
-
const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
|
|
76
|
-
if (er) {
|
|
77
|
-
fs.lstat(part, (statEr, st) => {
|
|
78
|
-
if (statEr) {
|
|
79
|
-
statEr.path = statEr.path && normalizeWindowsPath(statEr.path);
|
|
80
|
-
cb(statEr);
|
|
81
|
-
}
|
|
82
|
-
else if (st.isDirectory()) {
|
|
83
|
-
mkdir_(part, parts, mode, unlink, cwd, created, cb);
|
|
84
|
-
}
|
|
85
|
-
else if (unlink) {
|
|
86
|
-
fs.unlink(part, er => {
|
|
87
|
-
if (er) {
|
|
88
|
-
return cb(er);
|
|
89
|
-
}
|
|
90
|
-
fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
else if (st.isSymbolicLink()) {
|
|
94
|
-
return cb(new SymlinkError(part, part + '/' + parts.join('/')));
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
cb(er);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
created = created || part;
|
|
103
|
-
mkdir_(part, parts, mode, unlink, cwd, created, cb);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
const checkCwdSync = (dir) => {
|
|
107
|
-
let ok = false;
|
|
108
|
-
let code;
|
|
109
|
-
try {
|
|
110
|
-
ok = fs.statSync(dir).isDirectory();
|
|
111
|
-
}
|
|
112
|
-
catch (er) {
|
|
113
|
-
code = er?.code;
|
|
114
|
-
}
|
|
115
|
-
finally {
|
|
116
|
-
if (!ok) {
|
|
117
|
-
throw new CwdError(dir, code ?? 'ENOTDIR');
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
export const mkdirSync = (dir, opt) => {
|
|
122
|
-
dir = normalizeWindowsPath(dir);
|
|
123
|
-
// if there's any overlap between mask and mode,
|
|
124
|
-
// then we'll need an explicit chmod
|
|
125
|
-
/* c8 ignore next */
|
|
126
|
-
const umask = opt.umask ?? 0o22;
|
|
127
|
-
const mode = opt.mode | 0o700;
|
|
128
|
-
const needChmod = (mode & umask) !== 0;
|
|
129
|
-
const uid = opt.uid;
|
|
130
|
-
const gid = opt.gid;
|
|
131
|
-
const doChown = typeof uid === 'number' &&
|
|
132
|
-
typeof gid === 'number' &&
|
|
133
|
-
(uid !== opt.processUid || gid !== opt.processGid);
|
|
134
|
-
const preserve = opt.preserve;
|
|
135
|
-
const unlink = opt.unlink;
|
|
136
|
-
const cwd = normalizeWindowsPath(opt.cwd);
|
|
137
|
-
const done = (created) => {
|
|
138
|
-
if (created && doChown) {
|
|
139
|
-
chownrSync(created, uid, gid);
|
|
140
|
-
}
|
|
141
|
-
if (needChmod) {
|
|
142
|
-
fs.chmodSync(dir, mode);
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
if (dir === cwd) {
|
|
146
|
-
checkCwdSync(cwd);
|
|
147
|
-
return done();
|
|
148
|
-
}
|
|
149
|
-
if (preserve) {
|
|
150
|
-
return done(fs.mkdirSync(dir, { mode, recursive: true }) ?? undefined);
|
|
151
|
-
}
|
|
152
|
-
const sub = normalizeWindowsPath(path.relative(cwd, dir));
|
|
153
|
-
const parts = sub.split('/');
|
|
154
|
-
let created;
|
|
155
|
-
for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
|
|
156
|
-
part = normalizeWindowsPath(path.resolve(part));
|
|
157
|
-
try {
|
|
158
|
-
fs.mkdirSync(part, mode);
|
|
159
|
-
created = created || part;
|
|
160
|
-
}
|
|
161
|
-
catch {
|
|
162
|
-
const st = fs.lstatSync(part);
|
|
163
|
-
if (st.isDirectory()) {
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
else if (unlink) {
|
|
167
|
-
fs.unlinkSync(part);
|
|
168
|
-
fs.mkdirSync(part, mode);
|
|
169
|
-
created = created || part;
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
else if (st.isSymbolicLink()) {
|
|
173
|
-
return new SymlinkError(part, part + '/' + parts.join('/'));
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return done(created);
|
|
178
|
-
};
|
|
179
|
-
//# sourceMappingURL=mkdir.js.map
|