@remotion/renderer 4.0.364 → 4.0.365
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/package.json +12 -12
- package/.prettierignore +0 -2
- package/dist/test/actual-concurrency.test.d.ts +0 -1
- package/dist/test/artifacts.test.d.ts +0 -1
- package/dist/test/asset-calculation.test.d.ts +0 -1
- package/dist/test/asset-compression.test.d.ts +0 -1
- package/dist/test/avoid-ffmpeg-stackoverflow.test.d.ts +0 -1
- package/dist/test/browser-log-message.test.d.ts +0 -1
- package/dist/test/calculate-atempo.test.d.ts +0 -1
- package/dist/test/compositor-rust.test.d.ts +0 -1
- package/dist/test/crf.test.d.ts +0 -1
- package/dist/test/derive-codec-from-file-extension.test.d.ts +0 -1
- package/dist/test/dont-skip-assets.test.d.ts +0 -1
- package/dist/test/download-file.test.d.ts +0 -1
- package/dist/test/even-dimensions.test.d.ts +0 -1
- package/dist/test/extra-frames-to-capture.test.d.ts +0 -1
- package/dist/test/extract-audio.test.d.ts +0 -1
- package/dist/test/extract-frame-rust.test.d.ts +0 -1
- package/dist/test/ffmpeg-filters.test.d.ts +0 -1
- package/dist/test/ffmpeg-merge-filter.test.d.ts +0 -1
- package/dist/test/ffmpeg-volume-expression.test.d.ts +0 -1
- package/dist/test/file-extension.test.d.ts +0 -1
- package/dist/test/find-closest-package-json.test.d.ts +0 -1
- package/dist/test/flatten-volume-array.test.d.ts +0 -1
- package/dist/test/format-logs.test.d.ts +0 -1
- package/dist/test/frame-padded-index.test.d.ts +0 -1
- package/dist/test/frame.test.d.ts +0 -1
- package/dist/test/get-assets-for-markup.d.ts +0 -8
- package/dist/test/get-audio-channels.test.d.ts +0 -1
- package/dist/test/get-bundle-url-from-serve-url.test.d.ts +0 -1
- package/dist/test/get-silent-parts.test.d.ts +0 -1
- package/dist/test/guess-extension-for-media.test.d.ts +0 -1
- package/dist/test/handle-weird-file-names.test.d.ts +0 -1
- package/dist/test/log-level.test.d.ts +0 -1
- package/dist/test/mime-types.test.d.ts +0 -1
- package/dist/test/offthread-extract-url.test.d.ts +0 -1
- package/dist/test/parse-ffmpeg-progress.test.d.ts +0 -1
- package/dist/test/partitions.test.d.ts +0 -1
- package/dist/test/pixel-format.test.d.ts +0 -1
- package/dist/test/port-config.test.d.ts +0 -1
- package/dist/test/port-selection.test.d.ts +0 -1
- package/dist/test/prores-profile.test.d.ts +0 -1
- package/dist/test/render-still.test.d.ts +0 -1
- package/dist/test/rust-errors.test.d.ts +0 -1
- package/dist/test/rust-get-video-metadata.test.d.ts +0 -1
- package/dist/test/rust-memory-usage.test.d.ts +0 -1
- package/dist/test/sanitize-file-path.test.d.ts +0 -1
- package/dist/test/serve-url.test.d.ts +0 -1
- package/dist/test/symbolicate-remote-stack.test.d.ts +0 -1
- package/dist/test/validate-concurrency.test.d.ts +0 -1
- package/dist/test/validate-config-stitcher.test.d.ts +0 -1
- package/dist/test/validate-config.test.d.ts +0 -1
- package/dist/test/validate-even-dimensions-with-codec.test.d.ts +0 -1
- package/dist/test/validate-image-format.test.d.ts +0 -1
- package/dist/test/webpack-to-serve-url.test.d.ts +0 -1
- package/ensure-browser.mjs +0 -3337
- package/package/dist/assets/apply-tone-frequency.d.ts +0 -11
- package/package/dist/assets/apply-tone-frequency.js +0 -34
- package/package/dist/assets/calculate-asset-positions.d.ts +0 -3
- package/package/dist/assets/calculate-asset-positions.js +0 -72
- package/package/dist/assets/calculate-atempo.d.ts +0 -1
- package/package/dist/assets/calculate-atempo.js +0 -16
- package/package/dist/assets/convert-assets-to-file-urls.d.ts +0 -13
- package/package/dist/assets/convert-assets-to-file-urls.js +0 -36
- package/package/dist/assets/download-and-map-assets-to-file.d.ts +0 -37
- package/package/dist/assets/download-and-map-assets-to-file.js +0 -312
- package/package/dist/assets/download-file.d.ts +0 -18
- package/package/dist/assets/download-file.js +0 -135
- package/package/dist/assets/download-map.d.ts +0 -55
- package/package/dist/assets/download-map.js +0 -63
- package/package/dist/assets/ffmpeg-volume-expression.d.ts +0 -12
- package/package/dist/assets/ffmpeg-volume-expression.js +0 -96
- package/package/dist/assets/flatten-volume-array.d.ts +0 -3
- package/package/dist/assets/flatten-volume-array.js +0 -26
- package/package/dist/assets/get-audio-channels.d.ts +0 -20
- package/package/dist/assets/get-audio-channels.js +0 -78
- package/package/dist/assets/inline-audio-mixing.d.ts +0 -22
- package/package/dist/assets/inline-audio-mixing.js +0 -189
- package/package/dist/assets/read-file.d.ts +0 -7
- package/package/dist/assets/read-file.js +0 -97
- package/package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -1
- package/package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -17
- package/package/dist/assets/sanitize-filename.d.ts +0 -1
- package/package/dist/assets/sanitize-filename.js +0 -58
- package/package/dist/assets/sanitize-filepath.d.ts +0 -1
- package/package/dist/assets/sanitize-filepath.js +0 -16
- package/package/dist/assets/truncate-utf8-bytes.d.ts +0 -1
- package/package/dist/assets/truncate-utf8-bytes.js +0 -36
- package/package/dist/assets/types.d.ts +0 -18
- package/package/dist/assets/types.js +0 -21
- package/package/dist/browser/Browser.d.ts +0 -97
- package/package/dist/browser/Browser.js +0 -246
- package/package/dist/browser/BrowserFetcher.d.ts +0 -33
- package/package/dist/browser/BrowserFetcher.js +0 -215
- package/package/dist/browser/BrowserPage.d.ts +0 -104
- package/package/dist/browser/BrowserPage.js +0 -436
- package/package/dist/browser/BrowserRunner.d.ts +0 -33
- package/package/dist/browser/BrowserRunner.js +0 -303
- package/package/dist/browser/Connection.d.ts +0 -49
- package/package/dist/browser/Connection.js +0 -258
- package/package/dist/browser/ConsoleMessage.d.ts +0 -42
- package/package/dist/browser/ConsoleMessage.js +0 -47
- package/package/dist/browser/DOMWorld.d.ts +0 -56
- package/package/dist/browser/DOMWorld.js +0 -272
- package/package/dist/browser/Errors.d.ts +0 -25
- package/package/dist/browser/Errors.js +0 -35
- package/package/dist/browser/EvalTypes.d.ts +0 -27
- package/package/dist/browser/EvalTypes.js +0 -17
- package/package/dist/browser/EventEmitter.d.ts +0 -23
- package/package/dist/browser/EventEmitter.js +0 -53
- package/package/dist/browser/ExecutionContext.d.ts +0 -34
- package/package/dist/browser/ExecutionContext.js +0 -174
- package/package/dist/browser/FrameManager.d.ts +0 -89
- package/package/dist/browser/FrameManager.js +0 -487
- package/package/dist/browser/HTTPRequest.d.ts +0 -29
- package/package/dist/browser/HTTPRequest.js +0 -39
- package/package/dist/browser/HTTPResponse.d.ts +0 -21
- package/package/dist/browser/HTTPResponse.js +0 -41
- package/package/dist/browser/JSHandle.d.ts +0 -35
- package/package/dist/browser/JSHandle.js +0 -90
- package/package/dist/browser/LaunchOptions.d.ts +0 -26
- package/package/dist/browser/LaunchOptions.js +0 -17
- package/package/dist/browser/Launcher.d.ts +0 -18
- package/package/dist/browser/Launcher.js +0 -41
- package/package/dist/browser/LifecycleWatcher.d.ts +0 -29
- package/package/dist/browser/LifecycleWatcher.js +0 -180
- package/package/dist/browser/NetworkEventManager.d.ts +0 -34
- package/package/dist/browser/NetworkEventManager.js +0 -85
- package/package/dist/browser/NetworkManager.d.ts +0 -37
- package/package/dist/browser/NetworkManager.js +0 -246
- package/package/dist/browser/NodeWebSocketTransport.d.ts +0 -19
- package/package/dist/browser/NodeWebSocketTransport.js +0 -81
- package/package/dist/browser/PuppeteerViewport.d.ts +0 -5
- package/package/dist/browser/PuppeteerViewport.js +0 -2
- package/package/dist/browser/ScreenshotOptions.d.ts +0 -0
- package/package/dist/browser/ScreenshotOptions.js +0 -1
- package/package/dist/browser/Target.d.ts +0 -72
- package/package/dist/browser/Target.js +0 -161
- package/package/dist/browser/TaskQueue.d.ts +0 -20
- package/package/dist/browser/TaskQueue.js +0 -47
- package/package/dist/browser/TimeoutSettings.d.ts +0 -24
- package/package/dist/browser/TimeoutSettings.js +0 -62
- package/package/dist/browser/assert.d.ts +0 -1
- package/package/dist/browser/assert.js +0 -9
- package/package/dist/browser/browser-download-progress-bar.d.ts +0 -7
- package/package/dist/browser/browser-download-progress-bar.js +0 -31
- package/package/dist/browser/devtools-commands.d.ts +0 -274
- package/package/dist/browser/devtools-commands.js +0 -2
- package/package/dist/browser/devtools-types.d.ts +0 -1263
- package/package/dist/browser/devtools-types.js +0 -2
- package/package/dist/browser/flaky-errors.d.ts +0 -2
- package/package/dist/browser/flaky-errors.js +0 -20
- package/package/dist/browser/get-download-destination.d.ts +0 -1
- package/package/dist/browser/get-download-destination.js +0 -38
- package/package/dist/browser/handle-failed-resource.d.ts +0 -10
- package/package/dist/browser/handle-failed-resource.js +0 -21
- package/package/dist/browser/mitt/index.d.ts +0 -22
- package/package/dist/browser/mitt/index.js +0 -49
- package/package/dist/browser/should-log-message.d.ts +0 -24
- package/package/dist/browser/should-log-message.js +0 -104
- package/package/dist/browser/source-map-getter.d.ts +0 -2
- package/package/dist/browser/source-map-getter.js +0 -2
- package/package/dist/browser/util.d.ts +0 -37
- package/package/dist/browser/util.js +0 -169
- package/package/dist/browser-executable.d.ts +0 -1
- package/package/dist/browser-executable.js +0 -2
- package/package/dist/browser-log.d.ts +0 -6
- package/package/dist/browser-log.js +0 -2
- package/package/dist/browser.d.ts +0 -2
- package/package/dist/browser.js +0 -4
- package/package/dist/call-ffmpeg.d.ts +0 -22
- package/package/dist/call-ffmpeg.js +0 -53
- package/package/dist/can-concat-seamlessly.d.ts +0 -4
- package/package/dist/can-concat-seamlessly.js +0 -17
- package/package/dist/can-use-parallel-encoding.d.ts +0 -3
- package/package/dist/can-use-parallel-encoding.js +0 -19
- package/package/dist/chalk/index.d.ts +0 -55
- package/package/dist/chalk/index.js +0 -130
- package/package/dist/chalk/is-color-supported.d.ts +0 -1
- package/package/dist/chalk/is-color-supported.js +0 -55
- package/package/dist/check-version-requirements.d.ts +0 -3
- package/package/dist/check-version-requirements.js +0 -82
- package/package/dist/chunk.d.ts +0 -1
- package/package/dist/chunk.js +0 -11
- package/package/dist/client.d.ts +0 -3016
- package/package/dist/client.js +0 -57
- package/package/dist/codec-supports-media.d.ts +0 -9
- package/package/dist/codec-supports-media.js +0 -76
- package/package/dist/codec.d.ts +0 -4
- package/package/dist/codec.js +0 -17
- package/package/dist/collect-assets.d.ts +0 -7
- package/package/dist/collect-assets.js +0 -38
- package/package/dist/combine-audio.d.ts +0 -21
- package/package/dist/combine-audio.js +0 -183
- package/package/dist/combine-chunks.d.ts +0 -39
- package/package/dist/combine-chunks.js +0 -171
- package/package/dist/combine-video-streams-seamlessly.d.ts +0 -3
- package/package/dist/combine-video-streams-seamlessly.js +0 -8
- package/package/dist/combine-video-streams.d.ts +0 -17
- package/package/dist/combine-video-streams.js +0 -75
- package/package/dist/compositor/compositor.d.ts +0 -22
- package/package/dist/compositor/compositor.js +0 -182
- package/package/dist/compositor/get-executable-path.d.ts +0 -12
- package/package/dist/compositor/get-executable-path.js +0 -95
- package/package/dist/compositor/get-explicit-env.d.ts +0 -3
- package/package/dist/compositor/get-explicit-env.js +0 -13
- package/package/dist/compositor/make-file-executable.d.ts +0 -1
- package/package/dist/compositor/make-file-executable.js +0 -44
- package/package/dist/compositor/make-nonce.d.ts +0 -1
- package/package/dist/compositor/make-nonce.js +0 -8
- package/package/dist/compositor/payloads.d.ts +0 -73
- package/package/dist/compositor/payloads.js +0 -2
- package/package/dist/compositor/serialize-command.d.ts +0 -2
- package/package/dist/compositor/serialize-command.js +0 -14
- package/package/dist/compress-assets.d.ts +0 -7
- package/package/dist/compress-assets.js +0 -25
- package/package/dist/compress-audio.d.ts +0 -16
- package/package/dist/compress-audio.js +0 -44
- package/package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -1
- package/package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -17
- package/package/dist/convert-to-positive-frame-index.d.ts +0 -4
- package/package/dist/convert-to-positive-frame-index.js +0 -8
- package/package/dist/create-audio.d.ts +0 -29
- package/package/dist/create-audio.js +0 -127
- package/package/dist/create-ffmpeg-complex-filter.d.ts +0 -10
- package/package/dist/create-ffmpeg-complex-filter.js +0 -24
- package/package/dist/create-ffmpeg-merge-filter.d.ts +0 -5
- package/package/dist/create-ffmpeg-merge-filter.js +0 -25
- package/package/dist/create-silent-audio.d.ts +0 -10
- package/package/dist/create-silent-audio.js +0 -28
- package/package/dist/crf.d.ts +0 -13
- package/package/dist/crf.js +0 -103
- package/package/dist/cycle-browser-tabs.d.ts +0 -10
- package/package/dist/cycle-browser-tabs.js +0 -50
- package/package/dist/default-on-log.d.ts +0 -2
- package/package/dist/default-on-log.js +0 -8
- package/package/dist/delay-render-embedded-stack.d.ts +0 -2
- package/package/dist/delay-render-embedded-stack.js +0 -17
- package/package/dist/delete-directory.d.ts +0 -1
- package/package/dist/delete-directory.js +0 -68
- package/package/dist/ensure-browser.d.ts +0 -24
- package/package/dist/ensure-browser.js +0 -58
- package/package/dist/ensure-frames-in-order.d.ts +0 -5
- package/package/dist/ensure-frames-in-order.js +0 -39
- package/package/dist/ensure-output-directory.d.ts +0 -1
- package/package/dist/ensure-output-directory.js +0 -17
- package/package/dist/error-handling/handle-javascript-exception.d.ts +0 -23
- package/package/dist/error-handling/handle-javascript-exception.js +0 -86
- package/package/dist/error-handling/symbolicate-error.d.ts +0 -3
- package/package/dist/error-handling/symbolicate-error.js +0 -26
- package/package/dist/error-handling/symbolicateable-error.d.ts +0 -18
- package/package/dist/error-handling/symbolicateable-error.js +0 -19
- package/package/dist/error-handling.d.ts +0 -1
- package/package/dist/error-handling.js +0 -5
- package/package/dist/esm/client.mjs +0 -3270
- package/package/dist/esm/error-handling.mjs +0 -363
- package/package/dist/esm/index.mjs +0 -23201
- package/package/dist/esm/pure.mjs +0 -526
- package/package/dist/extract-audio.d.ts +0 -7
- package/package/dist/extract-audio.js +0 -25
- package/package/dist/ffmpeg-args.d.ts +0 -21
- package/package/dist/ffmpeg-args.js +0 -96
- package/package/dist/ffmpeg-filter-file.d.ts +0 -13
- package/package/dist/ffmpeg-filter-file.js +0 -70
- package/package/dist/ffmpeg-override.d.ts +0 -4
- package/package/dist/ffmpeg-override.js +0 -2
- package/package/dist/file-extensions.d.ts +0 -14
- package/package/dist/file-extensions.js +0 -85
- package/package/dist/filter-asset-types.d.ts +0 -8
- package/package/dist/filter-asset-types.js +0 -44
- package/package/dist/find-closest-package-json.d.ts +0 -2
- package/package/dist/find-closest-package-json.js +0 -31
- package/package/dist/format-logs.d.ts +0 -3
- package/package/dist/format-logs.js +0 -214
- package/package/dist/frame-range.d.ts +0 -2
- package/package/dist/frame-range.js +0 -49
- package/package/dist/get-browser-instance.d.ts +0 -24
- package/package/dist/get-browser-instance.js +0 -63
- package/package/dist/get-bundle-url-from-serve-url.d.ts +0 -2
- package/package/dist/get-bundle-url-from-serve-url.js +0 -30
- package/package/dist/get-codec-name.d.ts +0 -21
- package/package/dist/get-codec-name.js +0 -87
- package/package/dist/get-compositions.d.ts +0 -34
- package/package/dist/get-compositions.js +0 -196
- package/package/dist/get-concurrency.d.ts +0 -1
- package/package/dist/get-concurrency.js +0 -27
- package/package/dist/get-cpu-count.d.ts +0 -2
- package/package/dist/get-cpu-count.js +0 -33
- package/package/dist/get-duration-from-frame-range.d.ts +0 -1
- package/package/dist/get-duration-from-frame-range.js +0 -17
- package/package/dist/get-extension-from-codec.d.ts +0 -6
- package/package/dist/get-extension-from-codec.js +0 -61
- package/package/dist/get-extension-of-filename.d.ts +0 -1
- package/package/dist/get-extension-of-filename.js +0 -15
- package/package/dist/get-extra-frames-to-capture.d.ts +0 -14
- package/package/dist/get-extra-frames-to-capture.js +0 -62
- package/package/dist/get-frame-padded-index.d.ts +0 -21
- package/package/dist/get-frame-padded-index.js +0 -43
- package/package/dist/get-frame-to-render.d.ts +0 -2
- package/package/dist/get-frame-to-render.js +0 -19
- package/package/dist/get-local-browser-executable.d.ts +0 -9
- package/package/dist/get-local-browser-executable.js +0 -36
- package/package/dist/get-port.d.ts +0 -15
- package/package/dist/get-port.js +0 -86
- package/package/dist/get-prores-profile-name.d.ts +0 -3
- package/package/dist/get-prores-profile-name.js +0 -25
- package/package/dist/get-silent-parts.d.ts +0 -10
- package/package/dist/get-silent-parts.js +0 -66
- package/package/dist/get-video-metadata.d.ts +0 -10
- package/package/dist/get-video-metadata.js +0 -25
- package/package/dist/get-video-threads-flag.d.ts +0 -2
- package/package/dist/get-video-threads-flag.js +0 -16
- package/package/dist/goto-page-or-throw.d.ts +0 -3
- package/package/dist/goto-page-or-throw.js +0 -16
- package/package/dist/guess-extension-for-media.d.ts +0 -9
- package/package/dist/guess-extension-for-media.js +0 -31
- package/package/dist/image-format.d.ts +0 -13
- package/package/dist/image-format.js +0 -37
- package/package/dist/index.d.ts +0 -1256
- package/package/dist/index.js +0 -227
- package/package/dist/is-audio-codec.d.ts +0 -2
- package/package/dist/is-audio-codec.js +0 -7
- package/package/dist/is-delay-render-error-with-retry.d.ts +0 -1
- package/package/dist/is-delay-render-error-with-retry.js +0 -28
- package/package/dist/is-serve-url.d.ts +0 -1
- package/package/dist/is-serve-url.js +0 -15
- package/package/dist/jpeg-quality.d.ts +0 -2
- package/package/dist/jpeg-quality.js +0 -22
- package/package/dist/locks.d.ts +0 -7
- package/package/dist/locks.js +0 -47
- package/package/dist/log-level.d.ts +0 -4
- package/package/dist/log-level.js +0 -15
- package/package/dist/logger.d.ts +0 -20
- package/package/dist/logger.js +0 -89
- package/package/dist/make-cancel-signal.d.ts +0 -14
- package/package/dist/make-cancel-signal.js +0 -48
- package/package/dist/make-metadata-args.d.ts +0 -2
- package/package/dist/make-metadata-args.js +0 -22
- package/package/dist/make-page.d.ts +0 -30
- package/package/dist/make-page.js +0 -70
- package/package/dist/memory/from-docker-cgroup.d.ts +0 -1
- package/package/dist/memory/from-docker-cgroup.js +0 -66
- package/package/dist/memory/from-lambda-env.d.ts +0 -1
- package/package/dist/memory/from-lambda-env.js +0 -10
- package/package/dist/memory/from-proc-meminfo.d.ts +0 -2
- package/package/dist/memory/from-proc-meminfo.js +0 -44
- package/package/dist/memory/get-available-memory.d.ts +0 -2
- package/package/dist/memory/get-available-memory.js +0 -44
- package/package/dist/merge-audio-track.d.ts +0 -19
- package/package/dist/merge-audio-track.js +0 -133
- package/package/dist/mime-db.d.ts +0 -6
- package/package/dist/mime-db.js +0 -8636
- package/package/dist/mime-types.d.ts +0 -3
- package/package/dist/mime-types.js +0 -94
- package/package/dist/mux-video-and-audio.d.ts +0 -15
- package/package/dist/mux-video-and-audio.js +0 -54
- package/package/dist/next-frame-to-render.d.ts +0 -11
- package/package/dist/next-frame-to-render.js +0 -41
- package/package/dist/normalize-serve-url.d.ts +0 -1
- package/package/dist/normalize-serve-url.js +0 -19
- package/package/dist/offthread-video-server.d.ts +0 -51
- package/package/dist/offthread-video-server.js +0 -217
- package/package/dist/open-browser.d.ts +0 -47
- package/package/dist/open-browser.js +0 -200
- package/package/dist/options/api-key.d.ts +0 -15
- package/package/dist/options/api-key.js +0 -29
- package/package/dist/options/audio-bitrate.d.ts +0 -18
- package/package/dist/options/audio-bitrate.js +0 -35
- package/package/dist/options/audio-codec.d.ts +0 -55
- package/package/dist/options/audio-codec.js +0 -188
- package/package/dist/options/beep-on-finish.d.ts +0 -15
- package/package/dist/options/beep-on-finish.js +0 -35
- package/package/dist/options/binaries-directory.d.ts +0 -15
- package/package/dist/options/binaries-directory.js +0 -35
- package/package/dist/options/chrome-mode.d.ts +0 -17
- package/package/dist/options/chrome-mode.js +0 -46
- package/package/dist/options/color-space.d.ts +0 -23
- package/package/dist/options/color-space.js +0 -49
- package/package/dist/options/crf.d.ts +0 -17
- package/package/dist/options/crf.js +0 -43
- package/package/dist/options/cross-site-isolation.d.ts +0 -15
- package/package/dist/options/cross-site-isolation.js +0 -29
- package/package/dist/options/delete-after.d.ts +0 -19
- package/package/dist/options/delete-after.js +0 -37
- package/package/dist/options/disable-git-source.d.ts +0 -15
- package/package/dist/options/disable-git-source.js +0 -28
- package/package/dist/options/disallow-parallel-encoding.d.ts +0 -15
- package/package/dist/options/disallow-parallel-encoding.js +0 -35
- package/package/dist/options/enable-lambda-insights.d.ts +0 -15
- package/package/dist/options/enable-lambda-insights.js +0 -35
- package/package/dist/options/enable-multiprocess-on-linux.d.ts +0 -15
- package/package/dist/options/enable-multiprocess-on-linux.js +0 -36
- package/package/dist/options/encoding-buffer-size.d.ts +0 -18
- package/package/dist/options/encoding-buffer-size.js +0 -39
- package/package/dist/options/encoding-max-rate.d.ts +0 -18
- package/package/dist/options/encoding-max-rate.js +0 -35
- package/package/dist/options/enforce-audio.d.ts +0 -18
- package/package/dist/options/enforce-audio.js +0 -36
- package/package/dist/options/folder-expiry.d.ts +0 -15
- package/package/dist/options/folder-expiry.js +0 -37
- package/package/dist/options/for-seamless-aac-concatenation.d.ts +0 -19
- package/package/dist/options/for-seamless-aac-concatenation.js +0 -40
- package/package/dist/options/gl.d.ts +0 -24
- package/package/dist/options/gl.js +0 -68
- package/package/dist/options/hardware-acceleration.d.ts +0 -18
- package/package/dist/options/hardware-acceleration.js +0 -56
- package/package/dist/options/headless.d.ts +0 -15
- package/package/dist/options/headless.js +0 -36
- package/package/dist/options/image-sequence-pattern.d.ts +0 -15
- package/package/dist/options/image-sequence-pattern.js +0 -30
- package/package/dist/options/index.d.ts +0 -747
- package/package/dist/options/index.js +0 -97
- package/package/dist/options/jpeg-quality.d.ts +0 -17
- package/package/dist/options/jpeg-quality.js +0 -47
- package/package/dist/options/latency-hint.d.ts +0 -18
- package/package/dist/options/latency-hint.js +0 -27
- package/package/dist/options/log-level.d.ts +0 -16
- package/package/dist/options/log-level.js +0 -32
- package/package/dist/options/metadata.d.ts +0 -18
- package/package/dist/options/metadata.js +0 -47
- package/package/dist/options/mute.d.ts +0 -15
- package/package/dist/options/mute.js +0 -37
- package/package/dist/options/number-of-gif-loops.d.ts +0 -19
- package/package/dist/options/number-of-gif-loops.js +0 -44
- package/package/dist/options/offthreadvideo-cache-size.d.ts +0 -20
- package/package/dist/options/offthreadvideo-cache-size.js +0 -60
- package/package/dist/options/offthreadvideo-threads.d.ts +0 -20
- package/package/dist/options/offthreadvideo-threads.js +0 -40
- package/package/dist/options/on-browser-download.d.ts +0 -22
- package/package/dist/options/on-browser-download.js +0 -19
- package/package/dist/options/option.d.ts +0 -20
- package/package/dist/options/option.js +0 -2
- package/package/dist/options/options-map.d.ts +0 -2040
- package/package/dist/options/options-map.js +0 -192
- package/package/dist/options/overwrite.d.ts +0 -15
- package/package/dist/options/overwrite.js +0 -42
- package/package/dist/options/prefer-lossless.d.ts +0 -18
- package/package/dist/options/prefer-lossless.js +0 -26
- package/package/dist/options/public-dir.d.ts +0 -18
- package/package/dist/options/public-dir.js +0 -37
- package/package/dist/options/public-path.d.ts +0 -18
- package/package/dist/options/public-path.js +0 -37
- package/package/dist/options/repro.d.ts +0 -15
- package/package/dist/options/repro.js +0 -36
- package/package/dist/options/scale.d.ts +0 -15
- package/package/dist/options/scale.js +0 -41
- package/package/dist/options/separate-audio.d.ts +0 -18
- package/package/dist/options/separate-audio.js +0 -28
- package/package/dist/options/throw-if-site-exists.d.ts +0 -15
- package/package/dist/options/throw-if-site-exists.js +0 -28
- package/package/dist/options/timeout.d.ts +0 -15
- package/package/dist/options/timeout.js +0 -44
- package/package/dist/options/video-bitrate.d.ts +0 -15
- package/package/dist/options/video-bitrate.js +0 -35
- package/package/dist/options/video-cache-size.d.ts +0 -19
- package/package/dist/options/video-cache-size.js +0 -39
- package/package/dist/options/video-codec.d.ts +0 -23
- package/package/dist/options/video-codec.js +0 -104
- package/package/dist/options/webhook-custom-data.d.ts +0 -10
- package/package/dist/options/webhook-custom-data.js +0 -21
- package/package/dist/options/x264-preset.d.ts +0 -25
- package/package/dist/options/x264-preset.js +0 -55
- package/package/dist/overwrite.d.ts +0 -1
- package/package/dist/overwrite.js +0 -4
- package/package/dist/p-limit.d.ts +0 -1
- package/package/dist/p-limit.js +0 -57
- package/package/dist/parse-browser-error-stack.d.ts +0 -7
- package/package/dist/parse-browser-error-stack.js +0 -87
- package/package/dist/parse-ffmpeg-progress.d.ts +0 -1
- package/package/dist/parse-ffmpeg-progress.js +0 -18
- package/package/dist/path-normalize.d.ts +0 -1
- package/package/dist/path-normalize.js +0 -132
- package/package/dist/perf.d.ts +0 -5
- package/package/dist/perf.js +0 -37
- package/package/dist/pixel-format.d.ts +0 -6
- package/package/dist/pixel-format.js +0 -37
- package/package/dist/pool.d.ts +0 -8
- package/package/dist/pool.js +0 -30
- package/package/dist/port-config.d.ts +0 -14
- package/package/dist/port-config.js +0 -79
- package/package/dist/prepare-server.d.ts +0 -32
- package/package/dist/prepare-server.js +0 -123
- package/package/dist/preprocess-audio-track.d.ts +0 -27
- package/package/dist/preprocess-audio-track.js +0 -82
- package/package/dist/prespawn-ffmpeg.d.ts +0 -49
- package/package/dist/prespawn-ffmpeg.js +0 -112
- package/package/dist/prestitcher-memory-usage.d.ts +0 -10
- package/package/dist/prestitcher-memory-usage.js +0 -26
- package/package/dist/print-useful-error-message.d.ts +0 -2
- package/package/dist/print-useful-error-message.js +0 -110
- package/package/dist/prores-profile.d.ts +0 -7
- package/package/dist/prores-profile.js +0 -23
- package/package/dist/puppeteer-evaluate.d.ts +0 -17
- package/package/dist/puppeteer-evaluate.js +0 -162
- package/package/dist/puppeteer-screenshot.d.ts +0 -12
- package/package/dist/puppeteer-screenshot.js +0 -58
- package/package/dist/pure.d.ts +0 -17
- package/package/dist/pure.js +0 -17
- package/package/dist/redirect-status-codes.d.ts +0 -1
- package/package/dist/redirect-status-codes.js +0 -6
- package/package/dist/render-frame-and-retry-target-close.d.ts +0 -54
- package/package/dist/render-frame-and-retry-target-close.js +0 -179
- package/package/dist/render-frame-with-option-to-reject.d.ts +0 -48
- package/package/dist/render-frame-with-option-to-reject.js +0 -156
- package/package/dist/render-frame.d.ts +0 -47
- package/package/dist/render-frame.js +0 -51
- package/package/dist/render-frames.d.ts +0 -97
- package/package/dist/render-frames.js +0 -413
- package/package/dist/render-has-audio.d.ts +0 -8
- package/package/dist/render-has-audio.js +0 -20
- package/package/dist/render-media.d.ts +0 -135
- package/package/dist/render-media.js +0 -621
- package/package/dist/render-partitions.d.ts +0 -7
- package/package/dist/render-partitions.js +0 -50
- package/package/dist/render-still.d.ts +0 -74
- package/package/dist/render-still.js +0 -356
- package/package/dist/replace-browser.d.ts +0 -7
- package/package/dist/replace-browser.js +0 -48
- package/package/dist/repro.d.ts +0 -25
- package/package/dist/repro.js +0 -184
- package/package/dist/resolve-asset-src.d.ts +0 -1
- package/package/dist/resolve-asset-src.js +0 -17
- package/package/dist/sample-rate.d.ts +0 -1
- package/package/dist/sample-rate.js +0 -4
- package/package/dist/screenshot-task.d.ts +0 -12
- package/package/dist/screenshot-task.js +0 -86
- package/package/dist/seamless-aac-trim.d.ts +0 -12
- package/package/dist/seamless-aac-trim.js +0 -24
- package/package/dist/seek-to-frame.d.ts +0 -18
- package/package/dist/seek-to-frame.js +0 -148
- package/package/dist/select-composition.d.ts +0 -45
- package/package/dist/select-composition.js +0 -219
- package/package/dist/serialize-artifact.d.ts +0 -7
- package/package/dist/serialize-artifact.js +0 -2
- package/package/dist/serve-handler/index.d.ts +0 -4
- package/package/dist/serve-handler/index.js +0 -208
- package/package/dist/serve-handler/is-path-inside.d.ts +0 -1
- package/package/dist/serve-handler/is-path-inside.js +0 -27
- package/package/dist/serve-handler/range-parser.d.ts +0 -13
- package/package/dist/serve-handler/range-parser.js +0 -57
- package/package/dist/serve-static.d.ts +0 -18
- package/package/dist/serve-static.js +0 -141
- package/package/dist/set-props-and-env.d.ts +0 -22
- package/package/dist/set-props-and-env.js +0 -219
- package/package/dist/stitch-frames-to-video.d.ts +0 -77
- package/package/dist/stitch-frames-to-video.js +0 -350
- package/package/dist/stringify-ffmpeg-filter.d.ts +0 -24
- package/package/dist/stringify-ffmpeg-filter.js +0 -140
- package/package/dist/succeed-or-cancel.d.ts +0 -6
- package/package/dist/succeed-or-cancel.js +0 -23
- package/package/dist/symbolicate-stacktrace.d.ts +0 -29
- package/package/dist/symbolicate-stacktrace.js +0 -155
- package/package/dist/take-frame.d.ts +0 -13
- package/package/dist/take-frame.js +0 -47
- package/package/dist/test/actual-concurrency.test.d.ts +0 -1
- package/package/dist/test/artifacts.test.d.ts +0 -1
- package/package/dist/test/asset-calculation.test.d.ts +0 -1
- package/package/dist/test/asset-compression.test.d.ts +0 -1
- package/package/dist/test/avoid-ffmpeg-stackoverflow.test.d.ts +0 -1
- package/package/dist/test/browser-log-message.test.d.ts +0 -1
- package/package/dist/test/calculate-atempo.test.d.ts +0 -1
- package/package/dist/test/compositor-rust.test.d.ts +0 -1
- package/package/dist/test/crf.test.d.ts +0 -1
- package/package/dist/test/derive-codec-from-file-extension.test.d.ts +0 -1
- package/package/dist/test/dont-skip-assets.test.d.ts +0 -1
- package/package/dist/test/download-file.test.d.ts +0 -1
- package/package/dist/test/even-dimensions.test.d.ts +0 -1
- package/package/dist/test/extra-frames-to-capture.test.d.ts +0 -1
- package/package/dist/test/extract-audio.test.d.ts +0 -1
- package/package/dist/test/extract-frame-rust.test.d.ts +0 -1
- package/package/dist/test/ffmpeg-filters.test.d.ts +0 -1
- package/package/dist/test/ffmpeg-merge-filter.test.d.ts +0 -1
- package/package/dist/test/ffmpeg-volume-expression.test.d.ts +0 -1
- package/package/dist/test/file-extension.test.d.ts +0 -1
- package/package/dist/test/find-closest-package-json.test.d.ts +0 -1
- package/package/dist/test/flatten-volume-array.test.d.ts +0 -1
- package/package/dist/test/format-logs.test.d.ts +0 -1
- package/package/dist/test/frame-padded-index.test.d.ts +0 -1
- package/package/dist/test/frame.test.d.ts +0 -1
- package/package/dist/test/get-assets-for-markup.d.ts +0 -8
- package/package/dist/test/get-audio-channels.test.d.ts +0 -1
- package/package/dist/test/get-bundle-url-from-serve-url.test.d.ts +0 -1
- package/package/dist/test/get-silent-parts.test.d.ts +0 -1
- package/package/dist/test/guess-extension-for-media.test.d.ts +0 -1
- package/package/dist/test/handle-weird-file-names.test.d.ts +0 -1
- package/package/dist/test/log-level.test.d.ts +0 -1
- package/package/dist/test/mime-types.test.d.ts +0 -1
- package/package/dist/test/offthread-extract-url.test.d.ts +0 -1
- package/package/dist/test/parse-ffmpeg-progress.test.d.ts +0 -1
- package/package/dist/test/partitions.test.d.ts +0 -1
- package/package/dist/test/pixel-format.test.d.ts +0 -1
- package/package/dist/test/port-config.test.d.ts +0 -1
- package/package/dist/test/port-selection.test.d.ts +0 -1
- package/package/dist/test/prores-profile.test.d.ts +0 -1
- package/package/dist/test/render-still.test.d.ts +0 -1
- package/package/dist/test/rust-errors.test.d.ts +0 -1
- package/package/dist/test/rust-get-video-metadata.test.d.ts +0 -1
- package/package/dist/test/rust-memory-usage.test.d.ts +0 -1
- package/package/dist/test/sanitize-file-path.test.d.ts +0 -1
- package/package/dist/test/serve-url.test.d.ts +0 -1
- package/package/dist/test/symbolicate-remote-stack.test.d.ts +0 -1
- package/package/dist/test/validate-concurrency.test.d.ts +0 -1
- package/package/dist/test/validate-config-stitcher.test.d.ts +0 -1
- package/package/dist/test/validate-config.test.d.ts +0 -1
- package/package/dist/test/validate-even-dimensions-with-codec.test.d.ts +0 -1
- package/package/dist/test/validate-image-format.test.d.ts +0 -1
- package/package/dist/test/webpack-to-serve-url.test.d.ts +0 -1
- package/package/dist/test-gpu.d.ts +0 -21
- package/package/dist/test-gpu.js +0 -45
- package/package/dist/tmp-dir.d.ts +0 -1
- package/package/dist/tmp-dir.js +0 -63
- package/package/dist/to-megabytes.d.ts +0 -1
- package/package/dist/to-megabytes.js +0 -7
- package/package/dist/truthy.d.ts +0 -3
- package/package/dist/truthy.js +0 -6
- package/package/dist/types.d.ts +0 -10
- package/package/dist/types.js +0 -2
- package/package/dist/v5-required-input-props.d.ts +0 -6
- package/package/dist/v5-required-input-props.js +0 -2
- package/package/dist/validate-concurrency.d.ts +0 -7
- package/package/dist/validate-concurrency.js +0 -38
- package/package/dist/validate-even-dimensions-with-codec.d.ts +0 -14
- package/package/dist/validate-even-dimensions-with-codec.js +0 -40
- package/package/dist/validate-every-nth-frame.d.ts +0 -1
- package/package/dist/validate-every-nth-frame.js +0 -24
- package/package/dist/validate-ffmpeg-override.d.ts +0 -2
- package/package/dist/validate-ffmpeg-override.js +0 -12
- package/package/dist/validate-number-of-gif-loops.d.ts +0 -2
- package/package/dist/validate-number-of-gif-loops.js +0 -24
- package/package/dist/validate-output-filename.d.ts +0 -9
- package/package/dist/validate-output-filename.js +0 -32
- package/package/dist/validate-puppeteer-timeout.d.ts +0 -1
- package/package/dist/validate-puppeteer-timeout.js +0 -25
- package/package/dist/validate-scale.d.ts +0 -1
- package/package/dist/validate-scale.js +0 -26
- package/package/dist/validate-videobitrate.d.ts +0 -1
- package/package/dist/validate-videobitrate.js +0 -20
- package/package/dist/validate.d.ts +0 -4
- package/package/dist/validate.js +0 -8
- package/package/dist/wait-for-symbolication-error-to-be-done.d.ts +0 -3
- package/package/dist/wait-for-symbolication-error-to-be-done.js +0 -8
- package/package/dist/wrap-with-error-handling.d.ts +0 -8
- package/package/dist/wrap-with-error-handling.js +0 -18
- package/package/dist/ws/ws-types.d.ts +0 -15
- package/package/dist/ws/ws-types.js +0 -8
- package/package/ensure-browser.mjs +0 -3337
package/ensure-browser.mjs
DELETED
|
@@ -1,3337 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
8
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
|
-
for (let key of __getOwnPropNames(mod))
|
|
11
|
-
if (!__hasOwnProp.call(to, key))
|
|
12
|
-
__defProp(to, key, {
|
|
13
|
-
get: () => mod[key],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
19
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
20
|
-
|
|
21
|
-
// ../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
|
|
22
|
-
var require_ms = __commonJS((exports, module) => {
|
|
23
|
-
var s = 1000;
|
|
24
|
-
var m = s * 60;
|
|
25
|
-
var h = m * 60;
|
|
26
|
-
var d = h * 24;
|
|
27
|
-
var w = d * 7;
|
|
28
|
-
var y = d * 365.25;
|
|
29
|
-
module.exports = function(val, options) {
|
|
30
|
-
options = options || {};
|
|
31
|
-
var type = typeof val;
|
|
32
|
-
if (type === "string" && val.length > 0) {
|
|
33
|
-
return parse(val);
|
|
34
|
-
} else if (type === "number" && isFinite(val)) {
|
|
35
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
36
|
-
}
|
|
37
|
-
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
|
38
|
-
};
|
|
39
|
-
function parse(str) {
|
|
40
|
-
str = String(str);
|
|
41
|
-
if (str.length > 100) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
|
|
45
|
-
if (!match) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
var n = parseFloat(match[1]);
|
|
49
|
-
var type = (match[2] || "ms").toLowerCase();
|
|
50
|
-
switch (type) {
|
|
51
|
-
case "years":
|
|
52
|
-
case "year":
|
|
53
|
-
case "yrs":
|
|
54
|
-
case "yr":
|
|
55
|
-
case "y":
|
|
56
|
-
return n * y;
|
|
57
|
-
case "weeks":
|
|
58
|
-
case "week":
|
|
59
|
-
case "w":
|
|
60
|
-
return n * w;
|
|
61
|
-
case "days":
|
|
62
|
-
case "day":
|
|
63
|
-
case "d":
|
|
64
|
-
return n * d;
|
|
65
|
-
case "hours":
|
|
66
|
-
case "hour":
|
|
67
|
-
case "hrs":
|
|
68
|
-
case "hr":
|
|
69
|
-
case "h":
|
|
70
|
-
return n * h;
|
|
71
|
-
case "minutes":
|
|
72
|
-
case "minute":
|
|
73
|
-
case "mins":
|
|
74
|
-
case "min":
|
|
75
|
-
case "m":
|
|
76
|
-
return n * m;
|
|
77
|
-
case "seconds":
|
|
78
|
-
case "second":
|
|
79
|
-
case "secs":
|
|
80
|
-
case "sec":
|
|
81
|
-
case "s":
|
|
82
|
-
return n * s;
|
|
83
|
-
case "milliseconds":
|
|
84
|
-
case "millisecond":
|
|
85
|
-
case "msecs":
|
|
86
|
-
case "msec":
|
|
87
|
-
case "ms":
|
|
88
|
-
return n;
|
|
89
|
-
default:
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function fmtShort(ms) {
|
|
94
|
-
var msAbs = Math.abs(ms);
|
|
95
|
-
if (msAbs >= d) {
|
|
96
|
-
return Math.round(ms / d) + "d";
|
|
97
|
-
}
|
|
98
|
-
if (msAbs >= h) {
|
|
99
|
-
return Math.round(ms / h) + "h";
|
|
100
|
-
}
|
|
101
|
-
if (msAbs >= m) {
|
|
102
|
-
return Math.round(ms / m) + "m";
|
|
103
|
-
}
|
|
104
|
-
if (msAbs >= s) {
|
|
105
|
-
return Math.round(ms / s) + "s";
|
|
106
|
-
}
|
|
107
|
-
return ms + "ms";
|
|
108
|
-
}
|
|
109
|
-
function fmtLong(ms) {
|
|
110
|
-
var msAbs = Math.abs(ms);
|
|
111
|
-
if (msAbs >= d) {
|
|
112
|
-
return plural(ms, msAbs, d, "day");
|
|
113
|
-
}
|
|
114
|
-
if (msAbs >= h) {
|
|
115
|
-
return plural(ms, msAbs, h, "hour");
|
|
116
|
-
}
|
|
117
|
-
if (msAbs >= m) {
|
|
118
|
-
return plural(ms, msAbs, m, "minute");
|
|
119
|
-
}
|
|
120
|
-
if (msAbs >= s) {
|
|
121
|
-
return plural(ms, msAbs, s, "second");
|
|
122
|
-
}
|
|
123
|
-
return ms + " ms";
|
|
124
|
-
}
|
|
125
|
-
function plural(ms, msAbs, n, name) {
|
|
126
|
-
var isPlural = msAbs >= n * 1.5;
|
|
127
|
-
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
// ../../node_modules/.bun/debug@4.4.0/node_modules/debug/src/common.js
|
|
132
|
-
var require_common = __commonJS((exports, module) => {
|
|
133
|
-
function setup(env) {
|
|
134
|
-
createDebug.debug = createDebug;
|
|
135
|
-
createDebug.default = createDebug;
|
|
136
|
-
createDebug.coerce = coerce;
|
|
137
|
-
createDebug.disable = disable;
|
|
138
|
-
createDebug.enable = enable;
|
|
139
|
-
createDebug.enabled = enabled;
|
|
140
|
-
createDebug.humanize = require_ms();
|
|
141
|
-
createDebug.destroy = destroy;
|
|
142
|
-
Object.keys(env).forEach((key) => {
|
|
143
|
-
createDebug[key] = env[key];
|
|
144
|
-
});
|
|
145
|
-
createDebug.names = [];
|
|
146
|
-
createDebug.skips = [];
|
|
147
|
-
createDebug.formatters = {};
|
|
148
|
-
function selectColor(namespace) {
|
|
149
|
-
let hash = 0;
|
|
150
|
-
for (let i = 0;i < namespace.length; i++) {
|
|
151
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
152
|
-
hash |= 0;
|
|
153
|
-
}
|
|
154
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
155
|
-
}
|
|
156
|
-
createDebug.selectColor = selectColor;
|
|
157
|
-
function createDebug(namespace) {
|
|
158
|
-
let prevTime;
|
|
159
|
-
let enableOverride = null;
|
|
160
|
-
let namespacesCache;
|
|
161
|
-
let enabledCache;
|
|
162
|
-
function debug(...args) {
|
|
163
|
-
if (!debug.enabled) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
const self = debug;
|
|
167
|
-
const curr = Number(new Date);
|
|
168
|
-
const ms = curr - (prevTime || curr);
|
|
169
|
-
self.diff = ms;
|
|
170
|
-
self.prev = prevTime;
|
|
171
|
-
self.curr = curr;
|
|
172
|
-
prevTime = curr;
|
|
173
|
-
args[0] = createDebug.coerce(args[0]);
|
|
174
|
-
if (typeof args[0] !== "string") {
|
|
175
|
-
args.unshift("%O");
|
|
176
|
-
}
|
|
177
|
-
let index = 0;
|
|
178
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
179
|
-
if (match === "%%") {
|
|
180
|
-
return "%";
|
|
181
|
-
}
|
|
182
|
-
index++;
|
|
183
|
-
const formatter = createDebug.formatters[format];
|
|
184
|
-
if (typeof formatter === "function") {
|
|
185
|
-
const val = args[index];
|
|
186
|
-
match = formatter.call(self, val);
|
|
187
|
-
args.splice(index, 1);
|
|
188
|
-
index--;
|
|
189
|
-
}
|
|
190
|
-
return match;
|
|
191
|
-
});
|
|
192
|
-
createDebug.formatArgs.call(self, args);
|
|
193
|
-
const logFn = self.log || createDebug.log;
|
|
194
|
-
logFn.apply(self, args);
|
|
195
|
-
}
|
|
196
|
-
debug.namespace = namespace;
|
|
197
|
-
debug.useColors = createDebug.useColors();
|
|
198
|
-
debug.color = createDebug.selectColor(namespace);
|
|
199
|
-
debug.extend = extend;
|
|
200
|
-
debug.destroy = createDebug.destroy;
|
|
201
|
-
Object.defineProperty(debug, "enabled", {
|
|
202
|
-
enumerable: true,
|
|
203
|
-
configurable: false,
|
|
204
|
-
get: () => {
|
|
205
|
-
if (enableOverride !== null) {
|
|
206
|
-
return enableOverride;
|
|
207
|
-
}
|
|
208
|
-
if (namespacesCache !== createDebug.namespaces) {
|
|
209
|
-
namespacesCache = createDebug.namespaces;
|
|
210
|
-
enabledCache = createDebug.enabled(namespace);
|
|
211
|
-
}
|
|
212
|
-
return enabledCache;
|
|
213
|
-
},
|
|
214
|
-
set: (v) => {
|
|
215
|
-
enableOverride = v;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
if (typeof createDebug.init === "function") {
|
|
219
|
-
createDebug.init(debug);
|
|
220
|
-
}
|
|
221
|
-
return debug;
|
|
222
|
-
}
|
|
223
|
-
function extend(namespace, delimiter) {
|
|
224
|
-
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
225
|
-
newDebug.log = this.log;
|
|
226
|
-
return newDebug;
|
|
227
|
-
}
|
|
228
|
-
function enable(namespaces) {
|
|
229
|
-
createDebug.save(namespaces);
|
|
230
|
-
createDebug.namespaces = namespaces;
|
|
231
|
-
createDebug.names = [];
|
|
232
|
-
createDebug.skips = [];
|
|
233
|
-
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
234
|
-
for (const ns of split) {
|
|
235
|
-
if (ns[0] === "-") {
|
|
236
|
-
createDebug.skips.push(ns.slice(1));
|
|
237
|
-
} else {
|
|
238
|
-
createDebug.names.push(ns);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function matchesTemplate(search, template) {
|
|
243
|
-
let searchIndex = 0;
|
|
244
|
-
let templateIndex = 0;
|
|
245
|
-
let starIndex = -1;
|
|
246
|
-
let matchIndex = 0;
|
|
247
|
-
while (searchIndex < search.length) {
|
|
248
|
-
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
249
|
-
if (template[templateIndex] === "*") {
|
|
250
|
-
starIndex = templateIndex;
|
|
251
|
-
matchIndex = searchIndex;
|
|
252
|
-
templateIndex++;
|
|
253
|
-
} else {
|
|
254
|
-
searchIndex++;
|
|
255
|
-
templateIndex++;
|
|
256
|
-
}
|
|
257
|
-
} else if (starIndex !== -1) {
|
|
258
|
-
templateIndex = starIndex + 1;
|
|
259
|
-
matchIndex++;
|
|
260
|
-
searchIndex = matchIndex;
|
|
261
|
-
} else {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
266
|
-
templateIndex++;
|
|
267
|
-
}
|
|
268
|
-
return templateIndex === template.length;
|
|
269
|
-
}
|
|
270
|
-
function disable() {
|
|
271
|
-
const namespaces = [
|
|
272
|
-
...createDebug.names,
|
|
273
|
-
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
274
|
-
].join(",");
|
|
275
|
-
createDebug.enable("");
|
|
276
|
-
return namespaces;
|
|
277
|
-
}
|
|
278
|
-
function enabled(name) {
|
|
279
|
-
for (const skip of createDebug.skips) {
|
|
280
|
-
if (matchesTemplate(name, skip)) {
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
for (const ns of createDebug.names) {
|
|
285
|
-
if (matchesTemplate(name, ns)) {
|
|
286
|
-
return true;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
function coerce(val) {
|
|
292
|
-
if (val instanceof Error) {
|
|
293
|
-
return val.stack || val.message;
|
|
294
|
-
}
|
|
295
|
-
return val;
|
|
296
|
-
}
|
|
297
|
-
function destroy() {
|
|
298
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
299
|
-
}
|
|
300
|
-
createDebug.enable(createDebug.load());
|
|
301
|
-
return createDebug;
|
|
302
|
-
}
|
|
303
|
-
module.exports = setup;
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
// ../../node_modules/.bun/debug@4.4.0/node_modules/debug/src/browser.js
|
|
307
|
-
var require_browser = __commonJS((exports, module) => {
|
|
308
|
-
exports.formatArgs = formatArgs;
|
|
309
|
-
exports.save = save;
|
|
310
|
-
exports.load = load;
|
|
311
|
-
exports.useColors = useColors;
|
|
312
|
-
exports.storage = localstorage();
|
|
313
|
-
exports.destroy = (() => {
|
|
314
|
-
let warned = false;
|
|
315
|
-
return () => {
|
|
316
|
-
if (!warned) {
|
|
317
|
-
warned = true;
|
|
318
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
})();
|
|
322
|
-
exports.colors = [
|
|
323
|
-
"#0000CC",
|
|
324
|
-
"#0000FF",
|
|
325
|
-
"#0033CC",
|
|
326
|
-
"#0033FF",
|
|
327
|
-
"#0066CC",
|
|
328
|
-
"#0066FF",
|
|
329
|
-
"#0099CC",
|
|
330
|
-
"#0099FF",
|
|
331
|
-
"#00CC00",
|
|
332
|
-
"#00CC33",
|
|
333
|
-
"#00CC66",
|
|
334
|
-
"#00CC99",
|
|
335
|
-
"#00CCCC",
|
|
336
|
-
"#00CCFF",
|
|
337
|
-
"#3300CC",
|
|
338
|
-
"#3300FF",
|
|
339
|
-
"#3333CC",
|
|
340
|
-
"#3333FF",
|
|
341
|
-
"#3366CC",
|
|
342
|
-
"#3366FF",
|
|
343
|
-
"#3399CC",
|
|
344
|
-
"#3399FF",
|
|
345
|
-
"#33CC00",
|
|
346
|
-
"#33CC33",
|
|
347
|
-
"#33CC66",
|
|
348
|
-
"#33CC99",
|
|
349
|
-
"#33CCCC",
|
|
350
|
-
"#33CCFF",
|
|
351
|
-
"#6600CC",
|
|
352
|
-
"#6600FF",
|
|
353
|
-
"#6633CC",
|
|
354
|
-
"#6633FF",
|
|
355
|
-
"#66CC00",
|
|
356
|
-
"#66CC33",
|
|
357
|
-
"#9900CC",
|
|
358
|
-
"#9900FF",
|
|
359
|
-
"#9933CC",
|
|
360
|
-
"#9933FF",
|
|
361
|
-
"#99CC00",
|
|
362
|
-
"#99CC33",
|
|
363
|
-
"#CC0000",
|
|
364
|
-
"#CC0033",
|
|
365
|
-
"#CC0066",
|
|
366
|
-
"#CC0099",
|
|
367
|
-
"#CC00CC",
|
|
368
|
-
"#CC00FF",
|
|
369
|
-
"#CC3300",
|
|
370
|
-
"#CC3333",
|
|
371
|
-
"#CC3366",
|
|
372
|
-
"#CC3399",
|
|
373
|
-
"#CC33CC",
|
|
374
|
-
"#CC33FF",
|
|
375
|
-
"#CC6600",
|
|
376
|
-
"#CC6633",
|
|
377
|
-
"#CC9900",
|
|
378
|
-
"#CC9933",
|
|
379
|
-
"#CCCC00",
|
|
380
|
-
"#CCCC33",
|
|
381
|
-
"#FF0000",
|
|
382
|
-
"#FF0033",
|
|
383
|
-
"#FF0066",
|
|
384
|
-
"#FF0099",
|
|
385
|
-
"#FF00CC",
|
|
386
|
-
"#FF00FF",
|
|
387
|
-
"#FF3300",
|
|
388
|
-
"#FF3333",
|
|
389
|
-
"#FF3366",
|
|
390
|
-
"#FF3399",
|
|
391
|
-
"#FF33CC",
|
|
392
|
-
"#FF33FF",
|
|
393
|
-
"#FF6600",
|
|
394
|
-
"#FF6633",
|
|
395
|
-
"#FF9900",
|
|
396
|
-
"#FF9933",
|
|
397
|
-
"#FFCC00",
|
|
398
|
-
"#FFCC33"
|
|
399
|
-
];
|
|
400
|
-
function useColors() {
|
|
401
|
-
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
402
|
-
return true;
|
|
403
|
-
}
|
|
404
|
-
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
405
|
-
return false;
|
|
406
|
-
}
|
|
407
|
-
let m;
|
|
408
|
-
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
409
|
-
}
|
|
410
|
-
function formatArgs(args) {
|
|
411
|
-
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
412
|
-
if (!this.useColors) {
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
const c = "color: " + this.color;
|
|
416
|
-
args.splice(1, 0, c, "color: inherit");
|
|
417
|
-
let index = 0;
|
|
418
|
-
let lastC = 0;
|
|
419
|
-
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
420
|
-
if (match === "%%") {
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
index++;
|
|
424
|
-
if (match === "%c") {
|
|
425
|
-
lastC = index;
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
args.splice(lastC, 0, c);
|
|
429
|
-
}
|
|
430
|
-
exports.log = console.debug || console.log || (() => {});
|
|
431
|
-
function save(namespaces) {
|
|
432
|
-
try {
|
|
433
|
-
if (namespaces) {
|
|
434
|
-
exports.storage.setItem("debug", namespaces);
|
|
435
|
-
} else {
|
|
436
|
-
exports.storage.removeItem("debug");
|
|
437
|
-
}
|
|
438
|
-
} catch (error) {}
|
|
439
|
-
}
|
|
440
|
-
function load() {
|
|
441
|
-
let r;
|
|
442
|
-
try {
|
|
443
|
-
r = exports.storage.getItem("debug");
|
|
444
|
-
} catch (error) {}
|
|
445
|
-
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
446
|
-
r = process.env.DEBUG;
|
|
447
|
-
}
|
|
448
|
-
return r;
|
|
449
|
-
}
|
|
450
|
-
function localstorage() {
|
|
451
|
-
try {
|
|
452
|
-
return localStorage;
|
|
453
|
-
} catch (error) {}
|
|
454
|
-
}
|
|
455
|
-
module.exports = require_common()(exports);
|
|
456
|
-
var { formatters } = module.exports;
|
|
457
|
-
formatters.j = function(v) {
|
|
458
|
-
try {
|
|
459
|
-
return JSON.stringify(v);
|
|
460
|
-
} catch (error) {
|
|
461
|
-
return "[UnexpectedJSONParseError]: " + error.message;
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
// ../../node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
467
|
-
var require_has_flag = __commonJS((exports, module) => {
|
|
468
|
-
module.exports = (flag, argv = process.argv) => {
|
|
469
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
470
|
-
const position = argv.indexOf(prefix + flag);
|
|
471
|
-
const terminatorPosition = argv.indexOf("--");
|
|
472
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
473
|
-
};
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
// ../../node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
477
|
-
var require_supports_color = __commonJS((exports, module) => {
|
|
478
|
-
var os = __require("os");
|
|
479
|
-
var tty = __require("tty");
|
|
480
|
-
var hasFlag = require_has_flag();
|
|
481
|
-
var { env } = process;
|
|
482
|
-
var forceColor;
|
|
483
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
484
|
-
forceColor = 0;
|
|
485
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
486
|
-
forceColor = 1;
|
|
487
|
-
}
|
|
488
|
-
if ("FORCE_COLOR" in env) {
|
|
489
|
-
if (env.FORCE_COLOR === "true") {
|
|
490
|
-
forceColor = 1;
|
|
491
|
-
} else if (env.FORCE_COLOR === "false") {
|
|
492
|
-
forceColor = 0;
|
|
493
|
-
} else {
|
|
494
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
function translateLevel(level) {
|
|
498
|
-
if (level === 0) {
|
|
499
|
-
return false;
|
|
500
|
-
}
|
|
501
|
-
return {
|
|
502
|
-
level,
|
|
503
|
-
hasBasic: true,
|
|
504
|
-
has256: level >= 2,
|
|
505
|
-
has16m: level >= 3
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
509
|
-
if (forceColor === 0) {
|
|
510
|
-
return 0;
|
|
511
|
-
}
|
|
512
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
513
|
-
return 3;
|
|
514
|
-
}
|
|
515
|
-
if (hasFlag("color=256")) {
|
|
516
|
-
return 2;
|
|
517
|
-
}
|
|
518
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
519
|
-
return 0;
|
|
520
|
-
}
|
|
521
|
-
const min = forceColor || 0;
|
|
522
|
-
if (env.TERM === "dumb") {
|
|
523
|
-
return min;
|
|
524
|
-
}
|
|
525
|
-
if (process.platform === "win32") {
|
|
526
|
-
const osRelease = os.release().split(".");
|
|
527
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
528
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
529
|
-
}
|
|
530
|
-
return 1;
|
|
531
|
-
}
|
|
532
|
-
if ("CI" in env) {
|
|
533
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
|
|
534
|
-
return 1;
|
|
535
|
-
}
|
|
536
|
-
return min;
|
|
537
|
-
}
|
|
538
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
539
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
540
|
-
}
|
|
541
|
-
if (env.COLORTERM === "truecolor") {
|
|
542
|
-
return 3;
|
|
543
|
-
}
|
|
544
|
-
if ("TERM_PROGRAM" in env) {
|
|
545
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
546
|
-
switch (env.TERM_PROGRAM) {
|
|
547
|
-
case "iTerm.app":
|
|
548
|
-
return version >= 3 ? 3 : 2;
|
|
549
|
-
case "Apple_Terminal":
|
|
550
|
-
return 2;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
554
|
-
return 2;
|
|
555
|
-
}
|
|
556
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
557
|
-
return 1;
|
|
558
|
-
}
|
|
559
|
-
if ("COLORTERM" in env) {
|
|
560
|
-
return 1;
|
|
561
|
-
}
|
|
562
|
-
return min;
|
|
563
|
-
}
|
|
564
|
-
function getSupportLevel(stream) {
|
|
565
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
566
|
-
return translateLevel(level);
|
|
567
|
-
}
|
|
568
|
-
module.exports = {
|
|
569
|
-
supportsColor: getSupportLevel,
|
|
570
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
571
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
572
|
-
};
|
|
573
|
-
});
|
|
574
|
-
|
|
575
|
-
// ../../node_modules/.bun/debug@4.4.0/node_modules/debug/src/node.js
|
|
576
|
-
var require_node = __commonJS((exports, module) => {
|
|
577
|
-
var tty = __require("tty");
|
|
578
|
-
var util = __require("util");
|
|
579
|
-
exports.init = init;
|
|
580
|
-
exports.log = log;
|
|
581
|
-
exports.formatArgs = formatArgs;
|
|
582
|
-
exports.save = save;
|
|
583
|
-
exports.load = load;
|
|
584
|
-
exports.useColors = useColors;
|
|
585
|
-
exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
586
|
-
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
587
|
-
try {
|
|
588
|
-
const supportsColor = require_supports_color();
|
|
589
|
-
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
590
|
-
exports.colors = [
|
|
591
|
-
20,
|
|
592
|
-
21,
|
|
593
|
-
26,
|
|
594
|
-
27,
|
|
595
|
-
32,
|
|
596
|
-
33,
|
|
597
|
-
38,
|
|
598
|
-
39,
|
|
599
|
-
40,
|
|
600
|
-
41,
|
|
601
|
-
42,
|
|
602
|
-
43,
|
|
603
|
-
44,
|
|
604
|
-
45,
|
|
605
|
-
56,
|
|
606
|
-
57,
|
|
607
|
-
62,
|
|
608
|
-
63,
|
|
609
|
-
68,
|
|
610
|
-
69,
|
|
611
|
-
74,
|
|
612
|
-
75,
|
|
613
|
-
76,
|
|
614
|
-
77,
|
|
615
|
-
78,
|
|
616
|
-
79,
|
|
617
|
-
80,
|
|
618
|
-
81,
|
|
619
|
-
92,
|
|
620
|
-
93,
|
|
621
|
-
98,
|
|
622
|
-
99,
|
|
623
|
-
112,
|
|
624
|
-
113,
|
|
625
|
-
128,
|
|
626
|
-
129,
|
|
627
|
-
134,
|
|
628
|
-
135,
|
|
629
|
-
148,
|
|
630
|
-
149,
|
|
631
|
-
160,
|
|
632
|
-
161,
|
|
633
|
-
162,
|
|
634
|
-
163,
|
|
635
|
-
164,
|
|
636
|
-
165,
|
|
637
|
-
166,
|
|
638
|
-
167,
|
|
639
|
-
168,
|
|
640
|
-
169,
|
|
641
|
-
170,
|
|
642
|
-
171,
|
|
643
|
-
172,
|
|
644
|
-
173,
|
|
645
|
-
178,
|
|
646
|
-
179,
|
|
647
|
-
184,
|
|
648
|
-
185,
|
|
649
|
-
196,
|
|
650
|
-
197,
|
|
651
|
-
198,
|
|
652
|
-
199,
|
|
653
|
-
200,
|
|
654
|
-
201,
|
|
655
|
-
202,
|
|
656
|
-
203,
|
|
657
|
-
204,
|
|
658
|
-
205,
|
|
659
|
-
206,
|
|
660
|
-
207,
|
|
661
|
-
208,
|
|
662
|
-
209,
|
|
663
|
-
214,
|
|
664
|
-
215,
|
|
665
|
-
220,
|
|
666
|
-
221
|
|
667
|
-
];
|
|
668
|
-
}
|
|
669
|
-
} catch (error) {}
|
|
670
|
-
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
671
|
-
return /^debug_/i.test(key);
|
|
672
|
-
}).reduce((obj, key) => {
|
|
673
|
-
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
674
|
-
return k.toUpperCase();
|
|
675
|
-
});
|
|
676
|
-
let val = process.env[key];
|
|
677
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
678
|
-
val = true;
|
|
679
|
-
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
680
|
-
val = false;
|
|
681
|
-
} else if (val === "null") {
|
|
682
|
-
val = null;
|
|
683
|
-
} else {
|
|
684
|
-
val = Number(val);
|
|
685
|
-
}
|
|
686
|
-
obj[prop] = val;
|
|
687
|
-
return obj;
|
|
688
|
-
}, {});
|
|
689
|
-
function useColors() {
|
|
690
|
-
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
691
|
-
}
|
|
692
|
-
function formatArgs(args) {
|
|
693
|
-
const { namespace: name, useColors: useColors2 } = this;
|
|
694
|
-
if (useColors2) {
|
|
695
|
-
const c = this.color;
|
|
696
|
-
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
697
|
-
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
698
|
-
args[0] = prefix + args[0].split(`
|
|
699
|
-
`).join(`
|
|
700
|
-
` + prefix);
|
|
701
|
-
args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
|
|
702
|
-
} else {
|
|
703
|
-
args[0] = getDate() + name + " " + args[0];
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
function getDate() {
|
|
707
|
-
if (exports.inspectOpts.hideDate) {
|
|
708
|
-
return "";
|
|
709
|
-
}
|
|
710
|
-
return new Date().toISOString() + " ";
|
|
711
|
-
}
|
|
712
|
-
function log(...args) {
|
|
713
|
-
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + `
|
|
714
|
-
`);
|
|
715
|
-
}
|
|
716
|
-
function save(namespaces) {
|
|
717
|
-
if (namespaces) {
|
|
718
|
-
process.env.DEBUG = namespaces;
|
|
719
|
-
} else {
|
|
720
|
-
delete process.env.DEBUG;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
function load() {
|
|
724
|
-
return process.env.DEBUG;
|
|
725
|
-
}
|
|
726
|
-
function init(debug) {
|
|
727
|
-
debug.inspectOpts = {};
|
|
728
|
-
const keys = Object.keys(exports.inspectOpts);
|
|
729
|
-
for (let i = 0;i < keys.length; i++) {
|
|
730
|
-
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
module.exports = require_common()(exports);
|
|
734
|
-
var { formatters } = module.exports;
|
|
735
|
-
formatters.o = function(v) {
|
|
736
|
-
this.inspectOpts.colors = this.useColors;
|
|
737
|
-
return util.inspect(v, this.inspectOpts).split(`
|
|
738
|
-
`).map((str) => str.trim()).join(" ");
|
|
739
|
-
};
|
|
740
|
-
formatters.O = function(v) {
|
|
741
|
-
this.inspectOpts.colors = this.useColors;
|
|
742
|
-
return util.inspect(v, this.inspectOpts);
|
|
743
|
-
};
|
|
744
|
-
});
|
|
745
|
-
|
|
746
|
-
// ../../node_modules/.bun/debug@4.4.0/node_modules/debug/src/index.js
|
|
747
|
-
var require_src = __commonJS((exports, module) => {
|
|
748
|
-
if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
|
|
749
|
-
module.exports = require_browser();
|
|
750
|
-
} else {
|
|
751
|
-
module.exports = require_node();
|
|
752
|
-
}
|
|
753
|
-
});
|
|
754
|
-
|
|
755
|
-
// ../../node_modules/.bun/wrappy@1.0.2/node_modules/wrappy/wrappy.js
|
|
756
|
-
var require_wrappy = __commonJS((exports, module) => {
|
|
757
|
-
module.exports = wrappy;
|
|
758
|
-
function wrappy(fn, cb) {
|
|
759
|
-
if (fn && cb)
|
|
760
|
-
return wrappy(fn)(cb);
|
|
761
|
-
if (typeof fn !== "function")
|
|
762
|
-
throw new TypeError("need wrapper function");
|
|
763
|
-
Object.keys(fn).forEach(function(k) {
|
|
764
|
-
wrapper[k] = fn[k];
|
|
765
|
-
});
|
|
766
|
-
return wrapper;
|
|
767
|
-
function wrapper() {
|
|
768
|
-
var args = new Array(arguments.length);
|
|
769
|
-
for (var i = 0;i < args.length; i++) {
|
|
770
|
-
args[i] = arguments[i];
|
|
771
|
-
}
|
|
772
|
-
var ret = fn.apply(this, args);
|
|
773
|
-
var cb2 = args[args.length - 1];
|
|
774
|
-
if (typeof ret === "function" && ret !== cb2) {
|
|
775
|
-
Object.keys(cb2).forEach(function(k) {
|
|
776
|
-
ret[k] = cb2[k];
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
return ret;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
});
|
|
783
|
-
|
|
784
|
-
// ../../node_modules/.bun/once@1.4.0/node_modules/once/once.js
|
|
785
|
-
var require_once = __commonJS((exports, module) => {
|
|
786
|
-
var wrappy = require_wrappy();
|
|
787
|
-
module.exports = wrappy(once);
|
|
788
|
-
module.exports.strict = wrappy(onceStrict);
|
|
789
|
-
once.proto = once(function() {
|
|
790
|
-
Object.defineProperty(Function.prototype, "once", {
|
|
791
|
-
value: function() {
|
|
792
|
-
return once(this);
|
|
793
|
-
},
|
|
794
|
-
configurable: true
|
|
795
|
-
});
|
|
796
|
-
Object.defineProperty(Function.prototype, "onceStrict", {
|
|
797
|
-
value: function() {
|
|
798
|
-
return onceStrict(this);
|
|
799
|
-
},
|
|
800
|
-
configurable: true
|
|
801
|
-
});
|
|
802
|
-
});
|
|
803
|
-
function once(fn) {
|
|
804
|
-
var f = function() {
|
|
805
|
-
if (f.called)
|
|
806
|
-
return f.value;
|
|
807
|
-
f.called = true;
|
|
808
|
-
return f.value = fn.apply(this, arguments);
|
|
809
|
-
};
|
|
810
|
-
f.called = false;
|
|
811
|
-
return f;
|
|
812
|
-
}
|
|
813
|
-
function onceStrict(fn) {
|
|
814
|
-
var f = function() {
|
|
815
|
-
if (f.called)
|
|
816
|
-
throw new Error(f.onceError);
|
|
817
|
-
f.called = true;
|
|
818
|
-
return f.value = fn.apply(this, arguments);
|
|
819
|
-
};
|
|
820
|
-
var name = fn.name || "Function wrapped with `once`";
|
|
821
|
-
f.onceError = name + " shouldn't be called more than once";
|
|
822
|
-
f.called = false;
|
|
823
|
-
return f;
|
|
824
|
-
}
|
|
825
|
-
});
|
|
826
|
-
|
|
827
|
-
// ../../node_modules/.bun/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
|
|
828
|
-
var require_end_of_stream = __commonJS((exports, module) => {
|
|
829
|
-
var once = require_once();
|
|
830
|
-
var noop = function() {};
|
|
831
|
-
var isRequest = function(stream) {
|
|
832
|
-
return stream.setHeader && typeof stream.abort === "function";
|
|
833
|
-
};
|
|
834
|
-
var isChildProcess = function(stream) {
|
|
835
|
-
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
|
|
836
|
-
};
|
|
837
|
-
var eos = function(stream, opts, callback) {
|
|
838
|
-
if (typeof opts === "function")
|
|
839
|
-
return eos(stream, null, opts);
|
|
840
|
-
if (!opts)
|
|
841
|
-
opts = {};
|
|
842
|
-
callback = once(callback || noop);
|
|
843
|
-
var ws = stream._writableState;
|
|
844
|
-
var rs = stream._readableState;
|
|
845
|
-
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
846
|
-
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
847
|
-
var cancelled = false;
|
|
848
|
-
var onlegacyfinish = function() {
|
|
849
|
-
if (!stream.writable)
|
|
850
|
-
onfinish();
|
|
851
|
-
};
|
|
852
|
-
var onfinish = function() {
|
|
853
|
-
writable = false;
|
|
854
|
-
if (!readable)
|
|
855
|
-
callback.call(stream);
|
|
856
|
-
};
|
|
857
|
-
var onend = function() {
|
|
858
|
-
readable = false;
|
|
859
|
-
if (!writable)
|
|
860
|
-
callback.call(stream);
|
|
861
|
-
};
|
|
862
|
-
var onexit = function(exitCode) {
|
|
863
|
-
callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
|
|
864
|
-
};
|
|
865
|
-
var onerror = function(err) {
|
|
866
|
-
callback.call(stream, err);
|
|
867
|
-
};
|
|
868
|
-
var onclose = function() {
|
|
869
|
-
process.nextTick(onclosenexttick);
|
|
870
|
-
};
|
|
871
|
-
var onclosenexttick = function() {
|
|
872
|
-
if (cancelled)
|
|
873
|
-
return;
|
|
874
|
-
if (readable && !(rs && (rs.ended && !rs.destroyed)))
|
|
875
|
-
return callback.call(stream, new Error("premature close"));
|
|
876
|
-
if (writable && !(ws && (ws.ended && !ws.destroyed)))
|
|
877
|
-
return callback.call(stream, new Error("premature close"));
|
|
878
|
-
};
|
|
879
|
-
var onrequest = function() {
|
|
880
|
-
stream.req.on("finish", onfinish);
|
|
881
|
-
};
|
|
882
|
-
if (isRequest(stream)) {
|
|
883
|
-
stream.on("complete", onfinish);
|
|
884
|
-
stream.on("abort", onclose);
|
|
885
|
-
if (stream.req)
|
|
886
|
-
onrequest();
|
|
887
|
-
else
|
|
888
|
-
stream.on("request", onrequest);
|
|
889
|
-
} else if (writable && !ws) {
|
|
890
|
-
stream.on("end", onlegacyfinish);
|
|
891
|
-
stream.on("close", onlegacyfinish);
|
|
892
|
-
}
|
|
893
|
-
if (isChildProcess(stream))
|
|
894
|
-
stream.on("exit", onexit);
|
|
895
|
-
stream.on("end", onend);
|
|
896
|
-
stream.on("finish", onfinish);
|
|
897
|
-
if (opts.error !== false)
|
|
898
|
-
stream.on("error", onerror);
|
|
899
|
-
stream.on("close", onclose);
|
|
900
|
-
return function() {
|
|
901
|
-
cancelled = true;
|
|
902
|
-
stream.removeListener("complete", onfinish);
|
|
903
|
-
stream.removeListener("abort", onclose);
|
|
904
|
-
stream.removeListener("request", onrequest);
|
|
905
|
-
if (stream.req)
|
|
906
|
-
stream.req.removeListener("finish", onfinish);
|
|
907
|
-
stream.removeListener("end", onlegacyfinish);
|
|
908
|
-
stream.removeListener("close", onlegacyfinish);
|
|
909
|
-
stream.removeListener("finish", onfinish);
|
|
910
|
-
stream.removeListener("exit", onexit);
|
|
911
|
-
stream.removeListener("end", onend);
|
|
912
|
-
stream.removeListener("error", onerror);
|
|
913
|
-
stream.removeListener("close", onclose);
|
|
914
|
-
};
|
|
915
|
-
};
|
|
916
|
-
module.exports = eos;
|
|
917
|
-
});
|
|
918
|
-
|
|
919
|
-
// ../../node_modules/.bun/pump@3.0.0/node_modules/pump/index.js
|
|
920
|
-
var require_pump = __commonJS((exports, module) => {
|
|
921
|
-
var once = require_once();
|
|
922
|
-
var eos = require_end_of_stream();
|
|
923
|
-
var fs = __require("fs");
|
|
924
|
-
var noop = function() {};
|
|
925
|
-
var ancient = /^v?\.0/.test(process.version);
|
|
926
|
-
var isFn = function(fn) {
|
|
927
|
-
return typeof fn === "function";
|
|
928
|
-
};
|
|
929
|
-
var isFS = function(stream) {
|
|
930
|
-
if (!ancient)
|
|
931
|
-
return false;
|
|
932
|
-
if (!fs)
|
|
933
|
-
return false;
|
|
934
|
-
return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close);
|
|
935
|
-
};
|
|
936
|
-
var isRequest = function(stream) {
|
|
937
|
-
return stream.setHeader && isFn(stream.abort);
|
|
938
|
-
};
|
|
939
|
-
var destroyer = function(stream, reading, writing, callback) {
|
|
940
|
-
callback = once(callback);
|
|
941
|
-
var closed = false;
|
|
942
|
-
stream.on("close", function() {
|
|
943
|
-
closed = true;
|
|
944
|
-
});
|
|
945
|
-
eos(stream, { readable: reading, writable: writing }, function(err) {
|
|
946
|
-
if (err)
|
|
947
|
-
return callback(err);
|
|
948
|
-
closed = true;
|
|
949
|
-
callback();
|
|
950
|
-
});
|
|
951
|
-
var destroyed = false;
|
|
952
|
-
return function(err) {
|
|
953
|
-
if (closed)
|
|
954
|
-
return;
|
|
955
|
-
if (destroyed)
|
|
956
|
-
return;
|
|
957
|
-
destroyed = true;
|
|
958
|
-
if (isFS(stream))
|
|
959
|
-
return stream.close(noop);
|
|
960
|
-
if (isRequest(stream))
|
|
961
|
-
return stream.abort();
|
|
962
|
-
if (isFn(stream.destroy))
|
|
963
|
-
return stream.destroy();
|
|
964
|
-
callback(err || new Error("stream was destroyed"));
|
|
965
|
-
};
|
|
966
|
-
};
|
|
967
|
-
var call = function(fn) {
|
|
968
|
-
fn();
|
|
969
|
-
};
|
|
970
|
-
var pipe = function(from, to) {
|
|
971
|
-
return from.pipe(to);
|
|
972
|
-
};
|
|
973
|
-
var pump = function() {
|
|
974
|
-
var streams = Array.prototype.slice.call(arguments);
|
|
975
|
-
var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop;
|
|
976
|
-
if (Array.isArray(streams[0]))
|
|
977
|
-
streams = streams[0];
|
|
978
|
-
if (streams.length < 2)
|
|
979
|
-
throw new Error("pump requires two streams per minimum");
|
|
980
|
-
var error;
|
|
981
|
-
var destroys = streams.map(function(stream, i) {
|
|
982
|
-
var reading = i < streams.length - 1;
|
|
983
|
-
var writing = i > 0;
|
|
984
|
-
return destroyer(stream, reading, writing, function(err) {
|
|
985
|
-
if (!error)
|
|
986
|
-
error = err;
|
|
987
|
-
if (err)
|
|
988
|
-
destroys.forEach(call);
|
|
989
|
-
if (reading)
|
|
990
|
-
return;
|
|
991
|
-
destroys.forEach(call);
|
|
992
|
-
callback(error);
|
|
993
|
-
});
|
|
994
|
-
});
|
|
995
|
-
return streams.reduce(pipe);
|
|
996
|
-
};
|
|
997
|
-
module.exports = pump;
|
|
998
|
-
});
|
|
999
|
-
|
|
1000
|
-
// ../../node_modules/.bun/get-stream@5.2.0/node_modules/get-stream/buffer-stream.js
|
|
1001
|
-
var require_buffer_stream = __commonJS((exports, module) => {
|
|
1002
|
-
var { PassThrough: PassThroughStream } = __require("stream");
|
|
1003
|
-
module.exports = (options) => {
|
|
1004
|
-
options = { ...options };
|
|
1005
|
-
const { array } = options;
|
|
1006
|
-
let { encoding } = options;
|
|
1007
|
-
const isBuffer = encoding === "buffer";
|
|
1008
|
-
let objectMode = false;
|
|
1009
|
-
if (array) {
|
|
1010
|
-
objectMode = !(encoding || isBuffer);
|
|
1011
|
-
} else {
|
|
1012
|
-
encoding = encoding || "utf8";
|
|
1013
|
-
}
|
|
1014
|
-
if (isBuffer) {
|
|
1015
|
-
encoding = null;
|
|
1016
|
-
}
|
|
1017
|
-
const stream = new PassThroughStream({ objectMode });
|
|
1018
|
-
if (encoding) {
|
|
1019
|
-
stream.setEncoding(encoding);
|
|
1020
|
-
}
|
|
1021
|
-
let length = 0;
|
|
1022
|
-
const chunks = [];
|
|
1023
|
-
stream.on("data", (chunk) => {
|
|
1024
|
-
chunks.push(chunk);
|
|
1025
|
-
if (objectMode) {
|
|
1026
|
-
length = chunks.length;
|
|
1027
|
-
} else {
|
|
1028
|
-
length += chunk.length;
|
|
1029
|
-
}
|
|
1030
|
-
});
|
|
1031
|
-
stream.getBufferedValue = () => {
|
|
1032
|
-
if (array) {
|
|
1033
|
-
return chunks;
|
|
1034
|
-
}
|
|
1035
|
-
return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
|
|
1036
|
-
};
|
|
1037
|
-
stream.getBufferedLength = () => length;
|
|
1038
|
-
return stream;
|
|
1039
|
-
};
|
|
1040
|
-
});
|
|
1041
|
-
|
|
1042
|
-
// ../../node_modules/.bun/get-stream@5.2.0/node_modules/get-stream/index.js
|
|
1043
|
-
var require_get_stream = __commonJS((exports, module) => {
|
|
1044
|
-
var { constants: BufferConstants } = __require("buffer");
|
|
1045
|
-
var pump = require_pump();
|
|
1046
|
-
var bufferStream = require_buffer_stream();
|
|
1047
|
-
|
|
1048
|
-
class MaxBufferError extends Error {
|
|
1049
|
-
constructor() {
|
|
1050
|
-
super("maxBuffer exceeded");
|
|
1051
|
-
this.name = "MaxBufferError";
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
async function getStream(inputStream, options) {
|
|
1055
|
-
if (!inputStream) {
|
|
1056
|
-
return Promise.reject(new Error("Expected a stream"));
|
|
1057
|
-
}
|
|
1058
|
-
options = {
|
|
1059
|
-
maxBuffer: Infinity,
|
|
1060
|
-
...options
|
|
1061
|
-
};
|
|
1062
|
-
const { maxBuffer } = options;
|
|
1063
|
-
let stream;
|
|
1064
|
-
await new Promise((resolve, reject) => {
|
|
1065
|
-
const rejectPromise = (error) => {
|
|
1066
|
-
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
1067
|
-
error.bufferedData = stream.getBufferedValue();
|
|
1068
|
-
}
|
|
1069
|
-
reject(error);
|
|
1070
|
-
};
|
|
1071
|
-
stream = pump(inputStream, bufferStream(options), (error) => {
|
|
1072
|
-
if (error) {
|
|
1073
|
-
rejectPromise(error);
|
|
1074
|
-
return;
|
|
1075
|
-
}
|
|
1076
|
-
resolve();
|
|
1077
|
-
});
|
|
1078
|
-
stream.on("data", () => {
|
|
1079
|
-
if (stream.getBufferedLength() > maxBuffer) {
|
|
1080
|
-
rejectPromise(new MaxBufferError);
|
|
1081
|
-
}
|
|
1082
|
-
});
|
|
1083
|
-
});
|
|
1084
|
-
return stream.getBufferedValue();
|
|
1085
|
-
}
|
|
1086
|
-
module.exports = getStream;
|
|
1087
|
-
module.exports.default = getStream;
|
|
1088
|
-
module.exports.buffer = (stream, options) => getStream(stream, { ...options, encoding: "buffer" });
|
|
1089
|
-
module.exports.array = (stream, options) => getStream(stream, { ...options, array: true });
|
|
1090
|
-
module.exports.MaxBufferError = MaxBufferError;
|
|
1091
|
-
});
|
|
1092
|
-
|
|
1093
|
-
// ../../node_modules/.bun/pend@1.2.0/node_modules/pend/index.js
|
|
1094
|
-
var require_pend = __commonJS((exports, module) => {
|
|
1095
|
-
module.exports = Pend;
|
|
1096
|
-
function Pend() {
|
|
1097
|
-
this.pending = 0;
|
|
1098
|
-
this.max = Infinity;
|
|
1099
|
-
this.listeners = [];
|
|
1100
|
-
this.waiting = [];
|
|
1101
|
-
this.error = null;
|
|
1102
|
-
}
|
|
1103
|
-
Pend.prototype.go = function(fn) {
|
|
1104
|
-
if (this.pending < this.max) {
|
|
1105
|
-
pendGo(this, fn);
|
|
1106
|
-
} else {
|
|
1107
|
-
this.waiting.push(fn);
|
|
1108
|
-
}
|
|
1109
|
-
};
|
|
1110
|
-
Pend.prototype.wait = function(cb) {
|
|
1111
|
-
if (this.pending === 0) {
|
|
1112
|
-
cb(this.error);
|
|
1113
|
-
} else {
|
|
1114
|
-
this.listeners.push(cb);
|
|
1115
|
-
}
|
|
1116
|
-
};
|
|
1117
|
-
Pend.prototype.hold = function() {
|
|
1118
|
-
return pendHold(this);
|
|
1119
|
-
};
|
|
1120
|
-
function pendHold(self) {
|
|
1121
|
-
self.pending += 1;
|
|
1122
|
-
var called = false;
|
|
1123
|
-
return onCb;
|
|
1124
|
-
function onCb(err) {
|
|
1125
|
-
if (called)
|
|
1126
|
-
throw new Error("callback called twice");
|
|
1127
|
-
called = true;
|
|
1128
|
-
self.error = self.error || err;
|
|
1129
|
-
self.pending -= 1;
|
|
1130
|
-
if (self.waiting.length > 0 && self.pending < self.max) {
|
|
1131
|
-
pendGo(self, self.waiting.shift());
|
|
1132
|
-
} else if (self.pending === 0) {
|
|
1133
|
-
var listeners = self.listeners;
|
|
1134
|
-
self.listeners = [];
|
|
1135
|
-
listeners.forEach(cbListener);
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
function cbListener(listener) {
|
|
1139
|
-
listener(self.error);
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
function pendGo(self, fn) {
|
|
1143
|
-
fn(pendHold(self));
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
|
|
1147
|
-
// ../../node_modules/.bun/fd-slicer@1.1.0/node_modules/fd-slicer/index.js
|
|
1148
|
-
var require_fd_slicer = __commonJS((exports) => {
|
|
1149
|
-
var fs = __require("fs");
|
|
1150
|
-
var util = __require("util");
|
|
1151
|
-
var stream = __require("stream");
|
|
1152
|
-
var Readable = stream.Readable;
|
|
1153
|
-
var Writable = stream.Writable;
|
|
1154
|
-
var PassThrough = stream.PassThrough;
|
|
1155
|
-
var Pend = require_pend();
|
|
1156
|
-
var EventEmitter = __require("events").EventEmitter;
|
|
1157
|
-
exports.createFromBuffer = createFromBuffer;
|
|
1158
|
-
exports.createFromFd = createFromFd;
|
|
1159
|
-
exports.BufferSlicer = BufferSlicer;
|
|
1160
|
-
exports.FdSlicer = FdSlicer;
|
|
1161
|
-
util.inherits(FdSlicer, EventEmitter);
|
|
1162
|
-
function FdSlicer(fd, options) {
|
|
1163
|
-
options = options || {};
|
|
1164
|
-
EventEmitter.call(this);
|
|
1165
|
-
this.fd = fd;
|
|
1166
|
-
this.pend = new Pend;
|
|
1167
|
-
this.pend.max = 1;
|
|
1168
|
-
this.refCount = 0;
|
|
1169
|
-
this.autoClose = !!options.autoClose;
|
|
1170
|
-
}
|
|
1171
|
-
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
1172
|
-
var self = this;
|
|
1173
|
-
self.pend.go(function(cb) {
|
|
1174
|
-
fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
|
|
1175
|
-
cb();
|
|
1176
|
-
callback(err, bytesRead, buffer2);
|
|
1177
|
-
});
|
|
1178
|
-
});
|
|
1179
|
-
};
|
|
1180
|
-
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
1181
|
-
var self = this;
|
|
1182
|
-
self.pend.go(function(cb) {
|
|
1183
|
-
fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) {
|
|
1184
|
-
cb();
|
|
1185
|
-
callback(err, written, buffer2);
|
|
1186
|
-
});
|
|
1187
|
-
});
|
|
1188
|
-
};
|
|
1189
|
-
FdSlicer.prototype.createReadStream = function(options) {
|
|
1190
|
-
return new ReadStream(this, options);
|
|
1191
|
-
};
|
|
1192
|
-
FdSlicer.prototype.createWriteStream = function(options) {
|
|
1193
|
-
return new WriteStream(this, options);
|
|
1194
|
-
};
|
|
1195
|
-
FdSlicer.prototype.ref = function() {
|
|
1196
|
-
this.refCount += 1;
|
|
1197
|
-
};
|
|
1198
|
-
FdSlicer.prototype.unref = function() {
|
|
1199
|
-
var self = this;
|
|
1200
|
-
self.refCount -= 1;
|
|
1201
|
-
if (self.refCount > 0)
|
|
1202
|
-
return;
|
|
1203
|
-
if (self.refCount < 0)
|
|
1204
|
-
throw new Error("invalid unref");
|
|
1205
|
-
if (self.autoClose) {
|
|
1206
|
-
fs.close(self.fd, onCloseDone);
|
|
1207
|
-
}
|
|
1208
|
-
function onCloseDone(err) {
|
|
1209
|
-
if (err) {
|
|
1210
|
-
self.emit("error", err);
|
|
1211
|
-
} else {
|
|
1212
|
-
self.emit("close");
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
};
|
|
1216
|
-
util.inherits(ReadStream, Readable);
|
|
1217
|
-
function ReadStream(context, options) {
|
|
1218
|
-
options = options || {};
|
|
1219
|
-
Readable.call(this, options);
|
|
1220
|
-
this.context = context;
|
|
1221
|
-
this.context.ref();
|
|
1222
|
-
this.start = options.start || 0;
|
|
1223
|
-
this.endOffset = options.end;
|
|
1224
|
-
this.pos = this.start;
|
|
1225
|
-
this.destroyed = false;
|
|
1226
|
-
}
|
|
1227
|
-
ReadStream.prototype._read = function(n) {
|
|
1228
|
-
var self = this;
|
|
1229
|
-
if (self.destroyed)
|
|
1230
|
-
return;
|
|
1231
|
-
var toRead = Math.min(self._readableState.highWaterMark, n);
|
|
1232
|
-
if (self.endOffset != null) {
|
|
1233
|
-
toRead = Math.min(toRead, self.endOffset - self.pos);
|
|
1234
|
-
}
|
|
1235
|
-
if (toRead <= 0) {
|
|
1236
|
-
self.destroyed = true;
|
|
1237
|
-
self.push(null);
|
|
1238
|
-
self.context.unref();
|
|
1239
|
-
return;
|
|
1240
|
-
}
|
|
1241
|
-
self.context.pend.go(function(cb) {
|
|
1242
|
-
if (self.destroyed)
|
|
1243
|
-
return cb();
|
|
1244
|
-
var buffer = new Buffer(toRead);
|
|
1245
|
-
fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
1246
|
-
if (err) {
|
|
1247
|
-
self.destroy(err);
|
|
1248
|
-
} else if (bytesRead === 0) {
|
|
1249
|
-
self.destroyed = true;
|
|
1250
|
-
self.push(null);
|
|
1251
|
-
self.context.unref();
|
|
1252
|
-
} else {
|
|
1253
|
-
self.pos += bytesRead;
|
|
1254
|
-
self.push(buffer.slice(0, bytesRead));
|
|
1255
|
-
}
|
|
1256
|
-
cb();
|
|
1257
|
-
});
|
|
1258
|
-
});
|
|
1259
|
-
};
|
|
1260
|
-
ReadStream.prototype.destroy = function(err) {
|
|
1261
|
-
if (this.destroyed)
|
|
1262
|
-
return;
|
|
1263
|
-
err = err || new Error("stream destroyed");
|
|
1264
|
-
this.destroyed = true;
|
|
1265
|
-
this.emit("error", err);
|
|
1266
|
-
this.context.unref();
|
|
1267
|
-
};
|
|
1268
|
-
util.inherits(WriteStream, Writable);
|
|
1269
|
-
function WriteStream(context, options) {
|
|
1270
|
-
options = options || {};
|
|
1271
|
-
Writable.call(this, options);
|
|
1272
|
-
this.context = context;
|
|
1273
|
-
this.context.ref();
|
|
1274
|
-
this.start = options.start || 0;
|
|
1275
|
-
this.endOffset = options.end == null ? Infinity : +options.end;
|
|
1276
|
-
this.bytesWritten = 0;
|
|
1277
|
-
this.pos = this.start;
|
|
1278
|
-
this.destroyed = false;
|
|
1279
|
-
this.on("finish", this.destroy.bind(this));
|
|
1280
|
-
}
|
|
1281
|
-
WriteStream.prototype._write = function(buffer, encoding, callback) {
|
|
1282
|
-
var self = this;
|
|
1283
|
-
if (self.destroyed)
|
|
1284
|
-
return;
|
|
1285
|
-
if (self.pos + buffer.length > self.endOffset) {
|
|
1286
|
-
var err = new Error("maximum file length exceeded");
|
|
1287
|
-
err.code = "ETOOBIG";
|
|
1288
|
-
self.destroy();
|
|
1289
|
-
callback(err);
|
|
1290
|
-
return;
|
|
1291
|
-
}
|
|
1292
|
-
self.context.pend.go(function(cb) {
|
|
1293
|
-
if (self.destroyed)
|
|
1294
|
-
return cb();
|
|
1295
|
-
fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) {
|
|
1296
|
-
if (err2) {
|
|
1297
|
-
self.destroy();
|
|
1298
|
-
cb();
|
|
1299
|
-
callback(err2);
|
|
1300
|
-
} else {
|
|
1301
|
-
self.bytesWritten += bytes;
|
|
1302
|
-
self.pos += bytes;
|
|
1303
|
-
self.emit("progress");
|
|
1304
|
-
cb();
|
|
1305
|
-
callback();
|
|
1306
|
-
}
|
|
1307
|
-
});
|
|
1308
|
-
});
|
|
1309
|
-
};
|
|
1310
|
-
WriteStream.prototype.destroy = function() {
|
|
1311
|
-
if (this.destroyed)
|
|
1312
|
-
return;
|
|
1313
|
-
this.destroyed = true;
|
|
1314
|
-
this.context.unref();
|
|
1315
|
-
};
|
|
1316
|
-
util.inherits(BufferSlicer, EventEmitter);
|
|
1317
|
-
function BufferSlicer(buffer, options) {
|
|
1318
|
-
EventEmitter.call(this);
|
|
1319
|
-
options = options || {};
|
|
1320
|
-
this.refCount = 0;
|
|
1321
|
-
this.buffer = buffer;
|
|
1322
|
-
this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;
|
|
1323
|
-
}
|
|
1324
|
-
BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
1325
|
-
var end = position + length;
|
|
1326
|
-
var delta = end - this.buffer.length;
|
|
1327
|
-
var written = delta > 0 ? delta : length;
|
|
1328
|
-
this.buffer.copy(buffer, offset, position, end);
|
|
1329
|
-
setImmediate(function() {
|
|
1330
|
-
callback(null, written);
|
|
1331
|
-
});
|
|
1332
|
-
};
|
|
1333
|
-
BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
1334
|
-
buffer.copy(this.buffer, position, offset, offset + length);
|
|
1335
|
-
setImmediate(function() {
|
|
1336
|
-
callback(null, length, buffer);
|
|
1337
|
-
});
|
|
1338
|
-
};
|
|
1339
|
-
BufferSlicer.prototype.createReadStream = function(options) {
|
|
1340
|
-
options = options || {};
|
|
1341
|
-
var readStream = new PassThrough(options);
|
|
1342
|
-
readStream.destroyed = false;
|
|
1343
|
-
readStream.start = options.start || 0;
|
|
1344
|
-
readStream.endOffset = options.end;
|
|
1345
|
-
readStream.pos = readStream.endOffset || this.buffer.length;
|
|
1346
|
-
var entireSlice = this.buffer.slice(readStream.start, readStream.pos);
|
|
1347
|
-
var offset = 0;
|
|
1348
|
-
while (true) {
|
|
1349
|
-
var nextOffset = offset + this.maxChunkSize;
|
|
1350
|
-
if (nextOffset >= entireSlice.length) {
|
|
1351
|
-
if (offset < entireSlice.length) {
|
|
1352
|
-
readStream.write(entireSlice.slice(offset, entireSlice.length));
|
|
1353
|
-
}
|
|
1354
|
-
break;
|
|
1355
|
-
}
|
|
1356
|
-
readStream.write(entireSlice.slice(offset, nextOffset));
|
|
1357
|
-
offset = nextOffset;
|
|
1358
|
-
}
|
|
1359
|
-
readStream.end();
|
|
1360
|
-
readStream.destroy = function() {
|
|
1361
|
-
readStream.destroyed = true;
|
|
1362
|
-
};
|
|
1363
|
-
return readStream;
|
|
1364
|
-
};
|
|
1365
|
-
BufferSlicer.prototype.createWriteStream = function(options) {
|
|
1366
|
-
var bufferSlicer = this;
|
|
1367
|
-
options = options || {};
|
|
1368
|
-
var writeStream = new Writable(options);
|
|
1369
|
-
writeStream.start = options.start || 0;
|
|
1370
|
-
writeStream.endOffset = options.end == null ? this.buffer.length : +options.end;
|
|
1371
|
-
writeStream.bytesWritten = 0;
|
|
1372
|
-
writeStream.pos = writeStream.start;
|
|
1373
|
-
writeStream.destroyed = false;
|
|
1374
|
-
writeStream._write = function(buffer, encoding, callback) {
|
|
1375
|
-
if (writeStream.destroyed)
|
|
1376
|
-
return;
|
|
1377
|
-
var end = writeStream.pos + buffer.length;
|
|
1378
|
-
if (end > writeStream.endOffset) {
|
|
1379
|
-
var err = new Error("maximum file length exceeded");
|
|
1380
|
-
err.code = "ETOOBIG";
|
|
1381
|
-
writeStream.destroyed = true;
|
|
1382
|
-
callback(err);
|
|
1383
|
-
return;
|
|
1384
|
-
}
|
|
1385
|
-
buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length);
|
|
1386
|
-
writeStream.bytesWritten += buffer.length;
|
|
1387
|
-
writeStream.pos = end;
|
|
1388
|
-
writeStream.emit("progress");
|
|
1389
|
-
callback();
|
|
1390
|
-
};
|
|
1391
|
-
writeStream.destroy = function() {
|
|
1392
|
-
writeStream.destroyed = true;
|
|
1393
|
-
};
|
|
1394
|
-
return writeStream;
|
|
1395
|
-
};
|
|
1396
|
-
BufferSlicer.prototype.ref = function() {
|
|
1397
|
-
this.refCount += 1;
|
|
1398
|
-
};
|
|
1399
|
-
BufferSlicer.prototype.unref = function() {
|
|
1400
|
-
this.refCount -= 1;
|
|
1401
|
-
if (this.refCount < 0) {
|
|
1402
|
-
throw new Error("invalid unref");
|
|
1403
|
-
}
|
|
1404
|
-
};
|
|
1405
|
-
function createFromBuffer(buffer, options) {
|
|
1406
|
-
return new BufferSlicer(buffer, options);
|
|
1407
|
-
}
|
|
1408
|
-
function createFromFd(fd, options) {
|
|
1409
|
-
return new FdSlicer(fd, options);
|
|
1410
|
-
}
|
|
1411
|
-
});
|
|
1412
|
-
|
|
1413
|
-
// ../../node_modules/.bun/buffer-crc32@0.2.13/node_modules/buffer-crc32/index.js
|
|
1414
|
-
var require_buffer_crc32 = __commonJS((exports, module) => {
|
|
1415
|
-
var Buffer2 = __require("buffer").Buffer;
|
|
1416
|
-
var CRC_TABLE = [
|
|
1417
|
-
0,
|
|
1418
|
-
1996959894,
|
|
1419
|
-
3993919788,
|
|
1420
|
-
2567524794,
|
|
1421
|
-
124634137,
|
|
1422
|
-
1886057615,
|
|
1423
|
-
3915621685,
|
|
1424
|
-
2657392035,
|
|
1425
|
-
249268274,
|
|
1426
|
-
2044508324,
|
|
1427
|
-
3772115230,
|
|
1428
|
-
2547177864,
|
|
1429
|
-
162941995,
|
|
1430
|
-
2125561021,
|
|
1431
|
-
3887607047,
|
|
1432
|
-
2428444049,
|
|
1433
|
-
498536548,
|
|
1434
|
-
1789927666,
|
|
1435
|
-
4089016648,
|
|
1436
|
-
2227061214,
|
|
1437
|
-
450548861,
|
|
1438
|
-
1843258603,
|
|
1439
|
-
4107580753,
|
|
1440
|
-
2211677639,
|
|
1441
|
-
325883990,
|
|
1442
|
-
1684777152,
|
|
1443
|
-
4251122042,
|
|
1444
|
-
2321926636,
|
|
1445
|
-
335633487,
|
|
1446
|
-
1661365465,
|
|
1447
|
-
4195302755,
|
|
1448
|
-
2366115317,
|
|
1449
|
-
997073096,
|
|
1450
|
-
1281953886,
|
|
1451
|
-
3579855332,
|
|
1452
|
-
2724688242,
|
|
1453
|
-
1006888145,
|
|
1454
|
-
1258607687,
|
|
1455
|
-
3524101629,
|
|
1456
|
-
2768942443,
|
|
1457
|
-
901097722,
|
|
1458
|
-
1119000684,
|
|
1459
|
-
3686517206,
|
|
1460
|
-
2898065728,
|
|
1461
|
-
853044451,
|
|
1462
|
-
1172266101,
|
|
1463
|
-
3705015759,
|
|
1464
|
-
2882616665,
|
|
1465
|
-
651767980,
|
|
1466
|
-
1373503546,
|
|
1467
|
-
3369554304,
|
|
1468
|
-
3218104598,
|
|
1469
|
-
565507253,
|
|
1470
|
-
1454621731,
|
|
1471
|
-
3485111705,
|
|
1472
|
-
3099436303,
|
|
1473
|
-
671266974,
|
|
1474
|
-
1594198024,
|
|
1475
|
-
3322730930,
|
|
1476
|
-
2970347812,
|
|
1477
|
-
795835527,
|
|
1478
|
-
1483230225,
|
|
1479
|
-
3244367275,
|
|
1480
|
-
3060149565,
|
|
1481
|
-
1994146192,
|
|
1482
|
-
31158534,
|
|
1483
|
-
2563907772,
|
|
1484
|
-
4023717930,
|
|
1485
|
-
1907459465,
|
|
1486
|
-
112637215,
|
|
1487
|
-
2680153253,
|
|
1488
|
-
3904427059,
|
|
1489
|
-
2013776290,
|
|
1490
|
-
251722036,
|
|
1491
|
-
2517215374,
|
|
1492
|
-
3775830040,
|
|
1493
|
-
2137656763,
|
|
1494
|
-
141376813,
|
|
1495
|
-
2439277719,
|
|
1496
|
-
3865271297,
|
|
1497
|
-
1802195444,
|
|
1498
|
-
476864866,
|
|
1499
|
-
2238001368,
|
|
1500
|
-
4066508878,
|
|
1501
|
-
1812370925,
|
|
1502
|
-
453092731,
|
|
1503
|
-
2181625025,
|
|
1504
|
-
4111451223,
|
|
1505
|
-
1706088902,
|
|
1506
|
-
314042704,
|
|
1507
|
-
2344532202,
|
|
1508
|
-
4240017532,
|
|
1509
|
-
1658658271,
|
|
1510
|
-
366619977,
|
|
1511
|
-
2362670323,
|
|
1512
|
-
4224994405,
|
|
1513
|
-
1303535960,
|
|
1514
|
-
984961486,
|
|
1515
|
-
2747007092,
|
|
1516
|
-
3569037538,
|
|
1517
|
-
1256170817,
|
|
1518
|
-
1037604311,
|
|
1519
|
-
2765210733,
|
|
1520
|
-
3554079995,
|
|
1521
|
-
1131014506,
|
|
1522
|
-
879679996,
|
|
1523
|
-
2909243462,
|
|
1524
|
-
3663771856,
|
|
1525
|
-
1141124467,
|
|
1526
|
-
855842277,
|
|
1527
|
-
2852801631,
|
|
1528
|
-
3708648649,
|
|
1529
|
-
1342533948,
|
|
1530
|
-
654459306,
|
|
1531
|
-
3188396048,
|
|
1532
|
-
3373015174,
|
|
1533
|
-
1466479909,
|
|
1534
|
-
544179635,
|
|
1535
|
-
3110523913,
|
|
1536
|
-
3462522015,
|
|
1537
|
-
1591671054,
|
|
1538
|
-
702138776,
|
|
1539
|
-
2966460450,
|
|
1540
|
-
3352799412,
|
|
1541
|
-
1504918807,
|
|
1542
|
-
783551873,
|
|
1543
|
-
3082640443,
|
|
1544
|
-
3233442989,
|
|
1545
|
-
3988292384,
|
|
1546
|
-
2596254646,
|
|
1547
|
-
62317068,
|
|
1548
|
-
1957810842,
|
|
1549
|
-
3939845945,
|
|
1550
|
-
2647816111,
|
|
1551
|
-
81470997,
|
|
1552
|
-
1943803523,
|
|
1553
|
-
3814918930,
|
|
1554
|
-
2489596804,
|
|
1555
|
-
225274430,
|
|
1556
|
-
2053790376,
|
|
1557
|
-
3826175755,
|
|
1558
|
-
2466906013,
|
|
1559
|
-
167816743,
|
|
1560
|
-
2097651377,
|
|
1561
|
-
4027552580,
|
|
1562
|
-
2265490386,
|
|
1563
|
-
503444072,
|
|
1564
|
-
1762050814,
|
|
1565
|
-
4150417245,
|
|
1566
|
-
2154129355,
|
|
1567
|
-
426522225,
|
|
1568
|
-
1852507879,
|
|
1569
|
-
4275313526,
|
|
1570
|
-
2312317920,
|
|
1571
|
-
282753626,
|
|
1572
|
-
1742555852,
|
|
1573
|
-
4189708143,
|
|
1574
|
-
2394877945,
|
|
1575
|
-
397917763,
|
|
1576
|
-
1622183637,
|
|
1577
|
-
3604390888,
|
|
1578
|
-
2714866558,
|
|
1579
|
-
953729732,
|
|
1580
|
-
1340076626,
|
|
1581
|
-
3518719985,
|
|
1582
|
-
2797360999,
|
|
1583
|
-
1068828381,
|
|
1584
|
-
1219638859,
|
|
1585
|
-
3624741850,
|
|
1586
|
-
2936675148,
|
|
1587
|
-
906185462,
|
|
1588
|
-
1090812512,
|
|
1589
|
-
3747672003,
|
|
1590
|
-
2825379669,
|
|
1591
|
-
829329135,
|
|
1592
|
-
1181335161,
|
|
1593
|
-
3412177804,
|
|
1594
|
-
3160834842,
|
|
1595
|
-
628085408,
|
|
1596
|
-
1382605366,
|
|
1597
|
-
3423369109,
|
|
1598
|
-
3138078467,
|
|
1599
|
-
570562233,
|
|
1600
|
-
1426400815,
|
|
1601
|
-
3317316542,
|
|
1602
|
-
2998733608,
|
|
1603
|
-
733239954,
|
|
1604
|
-
1555261956,
|
|
1605
|
-
3268935591,
|
|
1606
|
-
3050360625,
|
|
1607
|
-
752459403,
|
|
1608
|
-
1541320221,
|
|
1609
|
-
2607071920,
|
|
1610
|
-
3965973030,
|
|
1611
|
-
1969922972,
|
|
1612
|
-
40735498,
|
|
1613
|
-
2617837225,
|
|
1614
|
-
3943577151,
|
|
1615
|
-
1913087877,
|
|
1616
|
-
83908371,
|
|
1617
|
-
2512341634,
|
|
1618
|
-
3803740692,
|
|
1619
|
-
2075208622,
|
|
1620
|
-
213261112,
|
|
1621
|
-
2463272603,
|
|
1622
|
-
3855990285,
|
|
1623
|
-
2094854071,
|
|
1624
|
-
198958881,
|
|
1625
|
-
2262029012,
|
|
1626
|
-
4057260610,
|
|
1627
|
-
1759359992,
|
|
1628
|
-
534414190,
|
|
1629
|
-
2176718541,
|
|
1630
|
-
4139329115,
|
|
1631
|
-
1873836001,
|
|
1632
|
-
414664567,
|
|
1633
|
-
2282248934,
|
|
1634
|
-
4279200368,
|
|
1635
|
-
1711684554,
|
|
1636
|
-
285281116,
|
|
1637
|
-
2405801727,
|
|
1638
|
-
4167216745,
|
|
1639
|
-
1634467795,
|
|
1640
|
-
376229701,
|
|
1641
|
-
2685067896,
|
|
1642
|
-
3608007406,
|
|
1643
|
-
1308918612,
|
|
1644
|
-
956543938,
|
|
1645
|
-
2808555105,
|
|
1646
|
-
3495958263,
|
|
1647
|
-
1231636301,
|
|
1648
|
-
1047427035,
|
|
1649
|
-
2932959818,
|
|
1650
|
-
3654703836,
|
|
1651
|
-
1088359270,
|
|
1652
|
-
936918000,
|
|
1653
|
-
2847714899,
|
|
1654
|
-
3736837829,
|
|
1655
|
-
1202900863,
|
|
1656
|
-
817233897,
|
|
1657
|
-
3183342108,
|
|
1658
|
-
3401237130,
|
|
1659
|
-
1404277552,
|
|
1660
|
-
615818150,
|
|
1661
|
-
3134207493,
|
|
1662
|
-
3453421203,
|
|
1663
|
-
1423857449,
|
|
1664
|
-
601450431,
|
|
1665
|
-
3009837614,
|
|
1666
|
-
3294710456,
|
|
1667
|
-
1567103746,
|
|
1668
|
-
711928724,
|
|
1669
|
-
3020668471,
|
|
1670
|
-
3272380065,
|
|
1671
|
-
1510334235,
|
|
1672
|
-
755167117
|
|
1673
|
-
];
|
|
1674
|
-
if (typeof Int32Array !== "undefined") {
|
|
1675
|
-
CRC_TABLE = new Int32Array(CRC_TABLE);
|
|
1676
|
-
}
|
|
1677
|
-
function ensureBuffer(input) {
|
|
1678
|
-
if (Buffer2.isBuffer(input)) {
|
|
1679
|
-
return input;
|
|
1680
|
-
}
|
|
1681
|
-
var hasNewBufferAPI = typeof Buffer2.alloc === "function" && typeof Buffer2.from === "function";
|
|
1682
|
-
if (typeof input === "number") {
|
|
1683
|
-
return hasNewBufferAPI ? Buffer2.alloc(input) : new Buffer2(input);
|
|
1684
|
-
} else if (typeof input === "string") {
|
|
1685
|
-
return hasNewBufferAPI ? Buffer2.from(input) : new Buffer2(input);
|
|
1686
|
-
} else {
|
|
1687
|
-
throw new Error("input must be buffer, number, or string, received " + typeof input);
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
function bufferizeInt(num) {
|
|
1691
|
-
var tmp = ensureBuffer(4);
|
|
1692
|
-
tmp.writeInt32BE(num, 0);
|
|
1693
|
-
return tmp;
|
|
1694
|
-
}
|
|
1695
|
-
function _crc32(buf, previous) {
|
|
1696
|
-
buf = ensureBuffer(buf);
|
|
1697
|
-
if (Buffer2.isBuffer(previous)) {
|
|
1698
|
-
previous = previous.readUInt32BE(0);
|
|
1699
|
-
}
|
|
1700
|
-
var crc = ~~previous ^ -1;
|
|
1701
|
-
for (var n = 0;n < buf.length; n++) {
|
|
1702
|
-
crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
|
|
1703
|
-
}
|
|
1704
|
-
return crc ^ -1;
|
|
1705
|
-
}
|
|
1706
|
-
function crc32() {
|
|
1707
|
-
return bufferizeInt(_crc32.apply(null, arguments));
|
|
1708
|
-
}
|
|
1709
|
-
crc32.signed = function() {
|
|
1710
|
-
return _crc32.apply(null, arguments);
|
|
1711
|
-
};
|
|
1712
|
-
crc32.unsigned = function() {
|
|
1713
|
-
return _crc32.apply(null, arguments) >>> 0;
|
|
1714
|
-
};
|
|
1715
|
-
module.exports = crc32;
|
|
1716
|
-
});
|
|
1717
|
-
|
|
1718
|
-
// ../../node_modules/.bun/yauzl@2.10.0/node_modules/yauzl/index.js
|
|
1719
|
-
var require_yauzl = __commonJS((exports) => {
|
|
1720
|
-
var fs = __require("fs");
|
|
1721
|
-
var zlib = __require("zlib");
|
|
1722
|
-
var fd_slicer = require_fd_slicer();
|
|
1723
|
-
var crc32 = require_buffer_crc32();
|
|
1724
|
-
var util = __require("util");
|
|
1725
|
-
var EventEmitter = __require("events").EventEmitter;
|
|
1726
|
-
var Transform = __require("stream").Transform;
|
|
1727
|
-
var PassThrough = __require("stream").PassThrough;
|
|
1728
|
-
var Writable = __require("stream").Writable;
|
|
1729
|
-
exports.open = open;
|
|
1730
|
-
exports.fromFd = fromFd;
|
|
1731
|
-
exports.fromBuffer = fromBuffer;
|
|
1732
|
-
exports.fromRandomAccessReader = fromRandomAccessReader;
|
|
1733
|
-
exports.dosDateTimeToDate = dosDateTimeToDate;
|
|
1734
|
-
exports.validateFileName = validateFileName;
|
|
1735
|
-
exports.ZipFile = ZipFile;
|
|
1736
|
-
exports.Entry = Entry;
|
|
1737
|
-
exports.RandomAccessReader = RandomAccessReader;
|
|
1738
|
-
function open(path, options, callback) {
|
|
1739
|
-
if (typeof options === "function") {
|
|
1740
|
-
callback = options;
|
|
1741
|
-
options = null;
|
|
1742
|
-
}
|
|
1743
|
-
if (options == null)
|
|
1744
|
-
options = {};
|
|
1745
|
-
if (options.autoClose == null)
|
|
1746
|
-
options.autoClose = true;
|
|
1747
|
-
if (options.lazyEntries == null)
|
|
1748
|
-
options.lazyEntries = false;
|
|
1749
|
-
if (options.decodeStrings == null)
|
|
1750
|
-
options.decodeStrings = true;
|
|
1751
|
-
if (options.validateEntrySizes == null)
|
|
1752
|
-
options.validateEntrySizes = true;
|
|
1753
|
-
if (options.strictFileNames == null)
|
|
1754
|
-
options.strictFileNames = false;
|
|
1755
|
-
if (callback == null)
|
|
1756
|
-
callback = defaultCallback;
|
|
1757
|
-
fs.open(path, "r", function(err, fd) {
|
|
1758
|
-
if (err)
|
|
1759
|
-
return callback(err);
|
|
1760
|
-
fromFd(fd, options, function(err2, zipfile) {
|
|
1761
|
-
if (err2)
|
|
1762
|
-
fs.close(fd, defaultCallback);
|
|
1763
|
-
callback(err2, zipfile);
|
|
1764
|
-
});
|
|
1765
|
-
});
|
|
1766
|
-
}
|
|
1767
|
-
function fromFd(fd, options, callback) {
|
|
1768
|
-
if (typeof options === "function") {
|
|
1769
|
-
callback = options;
|
|
1770
|
-
options = null;
|
|
1771
|
-
}
|
|
1772
|
-
if (options == null)
|
|
1773
|
-
options = {};
|
|
1774
|
-
if (options.autoClose == null)
|
|
1775
|
-
options.autoClose = false;
|
|
1776
|
-
if (options.lazyEntries == null)
|
|
1777
|
-
options.lazyEntries = false;
|
|
1778
|
-
if (options.decodeStrings == null)
|
|
1779
|
-
options.decodeStrings = true;
|
|
1780
|
-
if (options.validateEntrySizes == null)
|
|
1781
|
-
options.validateEntrySizes = true;
|
|
1782
|
-
if (options.strictFileNames == null)
|
|
1783
|
-
options.strictFileNames = false;
|
|
1784
|
-
if (callback == null)
|
|
1785
|
-
callback = defaultCallback;
|
|
1786
|
-
fs.fstat(fd, function(err, stats) {
|
|
1787
|
-
if (err)
|
|
1788
|
-
return callback(err);
|
|
1789
|
-
var reader = fd_slicer.createFromFd(fd, { autoClose: true });
|
|
1790
|
-
fromRandomAccessReader(reader, stats.size, options, callback);
|
|
1791
|
-
});
|
|
1792
|
-
}
|
|
1793
|
-
function fromBuffer(buffer, options, callback) {
|
|
1794
|
-
if (typeof options === "function") {
|
|
1795
|
-
callback = options;
|
|
1796
|
-
options = null;
|
|
1797
|
-
}
|
|
1798
|
-
if (options == null)
|
|
1799
|
-
options = {};
|
|
1800
|
-
options.autoClose = false;
|
|
1801
|
-
if (options.lazyEntries == null)
|
|
1802
|
-
options.lazyEntries = false;
|
|
1803
|
-
if (options.decodeStrings == null)
|
|
1804
|
-
options.decodeStrings = true;
|
|
1805
|
-
if (options.validateEntrySizes == null)
|
|
1806
|
-
options.validateEntrySizes = true;
|
|
1807
|
-
if (options.strictFileNames == null)
|
|
1808
|
-
options.strictFileNames = false;
|
|
1809
|
-
var reader = fd_slicer.createFromBuffer(buffer, { maxChunkSize: 65536 });
|
|
1810
|
-
fromRandomAccessReader(reader, buffer.length, options, callback);
|
|
1811
|
-
}
|
|
1812
|
-
function fromRandomAccessReader(reader, totalSize, options, callback) {
|
|
1813
|
-
if (typeof options === "function") {
|
|
1814
|
-
callback = options;
|
|
1815
|
-
options = null;
|
|
1816
|
-
}
|
|
1817
|
-
if (options == null)
|
|
1818
|
-
options = {};
|
|
1819
|
-
if (options.autoClose == null)
|
|
1820
|
-
options.autoClose = true;
|
|
1821
|
-
if (options.lazyEntries == null)
|
|
1822
|
-
options.lazyEntries = false;
|
|
1823
|
-
if (options.decodeStrings == null)
|
|
1824
|
-
options.decodeStrings = true;
|
|
1825
|
-
var decodeStrings = !!options.decodeStrings;
|
|
1826
|
-
if (options.validateEntrySizes == null)
|
|
1827
|
-
options.validateEntrySizes = true;
|
|
1828
|
-
if (options.strictFileNames == null)
|
|
1829
|
-
options.strictFileNames = false;
|
|
1830
|
-
if (callback == null)
|
|
1831
|
-
callback = defaultCallback;
|
|
1832
|
-
if (typeof totalSize !== "number")
|
|
1833
|
-
throw new Error("expected totalSize parameter to be a number");
|
|
1834
|
-
if (totalSize > Number.MAX_SAFE_INTEGER) {
|
|
1835
|
-
throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
|
|
1836
|
-
}
|
|
1837
|
-
reader.ref();
|
|
1838
|
-
var eocdrWithoutCommentSize = 22;
|
|
1839
|
-
var maxCommentSize = 65535;
|
|
1840
|
-
var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize);
|
|
1841
|
-
var buffer = newBuffer(bufferSize);
|
|
1842
|
-
var bufferReadStart = totalSize - buffer.length;
|
|
1843
|
-
readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {
|
|
1844
|
-
if (err)
|
|
1845
|
-
return callback(err);
|
|
1846
|
-
for (var i = bufferSize - eocdrWithoutCommentSize;i >= 0; i -= 1) {
|
|
1847
|
-
if (buffer.readUInt32LE(i) !== 101010256)
|
|
1848
|
-
continue;
|
|
1849
|
-
var eocdrBuffer = buffer.slice(i);
|
|
1850
|
-
var diskNumber = eocdrBuffer.readUInt16LE(4);
|
|
1851
|
-
if (diskNumber !== 0) {
|
|
1852
|
-
return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
|
|
1853
|
-
}
|
|
1854
|
-
var entryCount = eocdrBuffer.readUInt16LE(10);
|
|
1855
|
-
var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
|
|
1856
|
-
var commentLength = eocdrBuffer.readUInt16LE(20);
|
|
1857
|
-
var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
|
|
1858
|
-
if (commentLength !== expectedCommentLength) {
|
|
1859
|
-
return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength));
|
|
1860
|
-
}
|
|
1861
|
-
var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false) : eocdrBuffer.slice(22);
|
|
1862
|
-
if (!(entryCount === 65535 || centralDirectoryOffset === 4294967295)) {
|
|
1863
|
-
return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
|
|
1864
|
-
}
|
|
1865
|
-
var zip64EocdlBuffer = newBuffer(20);
|
|
1866
|
-
var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length;
|
|
1867
|
-
readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err2) {
|
|
1868
|
-
if (err2)
|
|
1869
|
-
return callback(err2);
|
|
1870
|
-
if (zip64EocdlBuffer.readUInt32LE(0) !== 117853008) {
|
|
1871
|
-
return callback(new Error("invalid zip64 end of central directory locator signature"));
|
|
1872
|
-
}
|
|
1873
|
-
var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
|
|
1874
|
-
var zip64EocdrBuffer = newBuffer(56);
|
|
1875
|
-
readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err3) {
|
|
1876
|
-
if (err3)
|
|
1877
|
-
return callback(err3);
|
|
1878
|
-
if (zip64EocdrBuffer.readUInt32LE(0) !== 101075792) {
|
|
1879
|
-
return callback(new Error("invalid zip64 end of central directory record signature"));
|
|
1880
|
-
}
|
|
1881
|
-
entryCount = readUInt64LE(zip64EocdrBuffer, 32);
|
|
1882
|
-
centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
|
|
1883
|
-
return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
|
|
1884
|
-
});
|
|
1885
|
-
});
|
|
1886
|
-
return;
|
|
1887
|
-
}
|
|
1888
|
-
callback(new Error("end of central directory record signature not found"));
|
|
1889
|
-
});
|
|
1890
|
-
}
|
|
1891
|
-
util.inherits(ZipFile, EventEmitter);
|
|
1892
|
-
function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
|
|
1893
|
-
var self = this;
|
|
1894
|
-
EventEmitter.call(self);
|
|
1895
|
-
self.reader = reader;
|
|
1896
|
-
self.reader.on("error", function(err) {
|
|
1897
|
-
emitError(self, err);
|
|
1898
|
-
});
|
|
1899
|
-
self.reader.once("close", function() {
|
|
1900
|
-
self.emit("close");
|
|
1901
|
-
});
|
|
1902
|
-
self.readEntryCursor = centralDirectoryOffset;
|
|
1903
|
-
self.fileSize = fileSize;
|
|
1904
|
-
self.entryCount = entryCount;
|
|
1905
|
-
self.comment = comment;
|
|
1906
|
-
self.entriesRead = 0;
|
|
1907
|
-
self.autoClose = !!autoClose;
|
|
1908
|
-
self.lazyEntries = !!lazyEntries;
|
|
1909
|
-
self.decodeStrings = !!decodeStrings;
|
|
1910
|
-
self.validateEntrySizes = !!validateEntrySizes;
|
|
1911
|
-
self.strictFileNames = !!strictFileNames;
|
|
1912
|
-
self.isOpen = true;
|
|
1913
|
-
self.emittedError = false;
|
|
1914
|
-
if (!self.lazyEntries)
|
|
1915
|
-
self._readEntry();
|
|
1916
|
-
}
|
|
1917
|
-
ZipFile.prototype.close = function() {
|
|
1918
|
-
if (!this.isOpen)
|
|
1919
|
-
return;
|
|
1920
|
-
this.isOpen = false;
|
|
1921
|
-
this.reader.unref();
|
|
1922
|
-
};
|
|
1923
|
-
function emitErrorAndAutoClose(self, err) {
|
|
1924
|
-
if (self.autoClose)
|
|
1925
|
-
self.close();
|
|
1926
|
-
emitError(self, err);
|
|
1927
|
-
}
|
|
1928
|
-
function emitError(self, err) {
|
|
1929
|
-
if (self.emittedError)
|
|
1930
|
-
return;
|
|
1931
|
-
self.emittedError = true;
|
|
1932
|
-
self.emit("error", err);
|
|
1933
|
-
}
|
|
1934
|
-
ZipFile.prototype.readEntry = function() {
|
|
1935
|
-
if (!this.lazyEntries)
|
|
1936
|
-
throw new Error("readEntry() called without lazyEntries:true");
|
|
1937
|
-
this._readEntry();
|
|
1938
|
-
};
|
|
1939
|
-
ZipFile.prototype._readEntry = function() {
|
|
1940
|
-
var self = this;
|
|
1941
|
-
if (self.entryCount === self.entriesRead) {
|
|
1942
|
-
setImmediate(function() {
|
|
1943
|
-
if (self.autoClose)
|
|
1944
|
-
self.close();
|
|
1945
|
-
if (self.emittedError)
|
|
1946
|
-
return;
|
|
1947
|
-
self.emit("end");
|
|
1948
|
-
});
|
|
1949
|
-
return;
|
|
1950
|
-
}
|
|
1951
|
-
if (self.emittedError)
|
|
1952
|
-
return;
|
|
1953
|
-
var buffer = newBuffer(46);
|
|
1954
|
-
readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
|
|
1955
|
-
if (err)
|
|
1956
|
-
return emitErrorAndAutoClose(self, err);
|
|
1957
|
-
if (self.emittedError)
|
|
1958
|
-
return;
|
|
1959
|
-
var entry = new Entry;
|
|
1960
|
-
var signature = buffer.readUInt32LE(0);
|
|
1961
|
-
if (signature !== 33639248)
|
|
1962
|
-
return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
|
|
1963
|
-
entry.versionMadeBy = buffer.readUInt16LE(4);
|
|
1964
|
-
entry.versionNeededToExtract = buffer.readUInt16LE(6);
|
|
1965
|
-
entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
|
|
1966
|
-
entry.compressionMethod = buffer.readUInt16LE(10);
|
|
1967
|
-
entry.lastModFileTime = buffer.readUInt16LE(12);
|
|
1968
|
-
entry.lastModFileDate = buffer.readUInt16LE(14);
|
|
1969
|
-
entry.crc32 = buffer.readUInt32LE(16);
|
|
1970
|
-
entry.compressedSize = buffer.readUInt32LE(20);
|
|
1971
|
-
entry.uncompressedSize = buffer.readUInt32LE(24);
|
|
1972
|
-
entry.fileNameLength = buffer.readUInt16LE(28);
|
|
1973
|
-
entry.extraFieldLength = buffer.readUInt16LE(30);
|
|
1974
|
-
entry.fileCommentLength = buffer.readUInt16LE(32);
|
|
1975
|
-
entry.internalFileAttributes = buffer.readUInt16LE(36);
|
|
1976
|
-
entry.externalFileAttributes = buffer.readUInt32LE(38);
|
|
1977
|
-
entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
|
|
1978
|
-
if (entry.generalPurposeBitFlag & 64)
|
|
1979
|
-
return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
|
|
1980
|
-
self.readEntryCursor += 46;
|
|
1981
|
-
buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
|
|
1982
|
-
readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err2) {
|
|
1983
|
-
if (err2)
|
|
1984
|
-
return emitErrorAndAutoClose(self, err2);
|
|
1985
|
-
if (self.emittedError)
|
|
1986
|
-
return;
|
|
1987
|
-
var isUtf8 = (entry.generalPurposeBitFlag & 2048) !== 0;
|
|
1988
|
-
entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8) : buffer.slice(0, entry.fileNameLength);
|
|
1989
|
-
var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
|
|
1990
|
-
var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);
|
|
1991
|
-
entry.extraFields = [];
|
|
1992
|
-
var i = 0;
|
|
1993
|
-
while (i < extraFieldBuffer.length - 3) {
|
|
1994
|
-
var headerId = extraFieldBuffer.readUInt16LE(i + 0);
|
|
1995
|
-
var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
|
|
1996
|
-
var dataStart = i + 4;
|
|
1997
|
-
var dataEnd = dataStart + dataSize;
|
|
1998
|
-
if (dataEnd > extraFieldBuffer.length)
|
|
1999
|
-
return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size"));
|
|
2000
|
-
var dataBuffer = newBuffer(dataSize);
|
|
2001
|
-
extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd);
|
|
2002
|
-
entry.extraFields.push({
|
|
2003
|
-
id: headerId,
|
|
2004
|
-
data: dataBuffer
|
|
2005
|
-
});
|
|
2006
|
-
i = dataEnd;
|
|
2007
|
-
}
|
|
2008
|
-
entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8) : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);
|
|
2009
|
-
entry.comment = entry.fileComment;
|
|
2010
|
-
self.readEntryCursor += buffer.length;
|
|
2011
|
-
self.entriesRead += 1;
|
|
2012
|
-
if (entry.uncompressedSize === 4294967295 || entry.compressedSize === 4294967295 || entry.relativeOffsetOfLocalHeader === 4294967295) {
|
|
2013
|
-
var zip64EiefBuffer = null;
|
|
2014
|
-
for (var i = 0;i < entry.extraFields.length; i++) {
|
|
2015
|
-
var extraField = entry.extraFields[i];
|
|
2016
|
-
if (extraField.id === 1) {
|
|
2017
|
-
zip64EiefBuffer = extraField.data;
|
|
2018
|
-
break;
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
if (zip64EiefBuffer == null) {
|
|
2022
|
-
return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field"));
|
|
2023
|
-
}
|
|
2024
|
-
var index = 0;
|
|
2025
|
-
if (entry.uncompressedSize === 4294967295) {
|
|
2026
|
-
if (index + 8 > zip64EiefBuffer.length) {
|
|
2027
|
-
return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
|
|
2028
|
-
}
|
|
2029
|
-
entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
|
|
2030
|
-
index += 8;
|
|
2031
|
-
}
|
|
2032
|
-
if (entry.compressedSize === 4294967295) {
|
|
2033
|
-
if (index + 8 > zip64EiefBuffer.length) {
|
|
2034
|
-
return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
|
|
2035
|
-
}
|
|
2036
|
-
entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
|
|
2037
|
-
index += 8;
|
|
2038
|
-
}
|
|
2039
|
-
if (entry.relativeOffsetOfLocalHeader === 4294967295) {
|
|
2040
|
-
if (index + 8 > zip64EiefBuffer.length) {
|
|
2041
|
-
return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
|
|
2042
|
-
}
|
|
2043
|
-
entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
|
|
2044
|
-
index += 8;
|
|
2045
|
-
}
|
|
2046
|
-
}
|
|
2047
|
-
if (self.decodeStrings) {
|
|
2048
|
-
for (var i = 0;i < entry.extraFields.length; i++) {
|
|
2049
|
-
var extraField = entry.extraFields[i];
|
|
2050
|
-
if (extraField.id === 28789) {
|
|
2051
|
-
if (extraField.data.length < 6) {
|
|
2052
|
-
continue;
|
|
2053
|
-
}
|
|
2054
|
-
if (extraField.data.readUInt8(0) !== 1) {
|
|
2055
|
-
continue;
|
|
2056
|
-
}
|
|
2057
|
-
var oldNameCrc32 = extraField.data.readUInt32LE(1);
|
|
2058
|
-
if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) {
|
|
2059
|
-
continue;
|
|
2060
|
-
}
|
|
2061
|
-
entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true);
|
|
2062
|
-
break;
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
if (self.validateEntrySizes && entry.compressionMethod === 0) {
|
|
2067
|
-
var expectedCompressedSize = entry.uncompressedSize;
|
|
2068
|
-
if (entry.isEncrypted()) {
|
|
2069
|
-
expectedCompressedSize += 12;
|
|
2070
|
-
}
|
|
2071
|
-
if (entry.compressedSize !== expectedCompressedSize) {
|
|
2072
|
-
var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
|
|
2073
|
-
return emitErrorAndAutoClose(self, new Error(msg));
|
|
2074
|
-
}
|
|
2075
|
-
}
|
|
2076
|
-
if (self.decodeStrings) {
|
|
2077
|
-
if (!self.strictFileNames) {
|
|
2078
|
-
entry.fileName = entry.fileName.replace(/\\/g, "/");
|
|
2079
|
-
}
|
|
2080
|
-
var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions);
|
|
2081
|
-
if (errorMessage != null)
|
|
2082
|
-
return emitErrorAndAutoClose(self, new Error(errorMessage));
|
|
2083
|
-
}
|
|
2084
|
-
self.emit("entry", entry);
|
|
2085
|
-
if (!self.lazyEntries)
|
|
2086
|
-
self._readEntry();
|
|
2087
|
-
});
|
|
2088
|
-
});
|
|
2089
|
-
};
|
|
2090
|
-
ZipFile.prototype.openReadStream = function(entry, options, callback) {
|
|
2091
|
-
var self = this;
|
|
2092
|
-
var relativeStart = 0;
|
|
2093
|
-
var relativeEnd = entry.compressedSize;
|
|
2094
|
-
if (callback == null) {
|
|
2095
|
-
callback = options;
|
|
2096
|
-
options = {};
|
|
2097
|
-
} else {
|
|
2098
|
-
if (options.decrypt != null) {
|
|
2099
|
-
if (!entry.isEncrypted()) {
|
|
2100
|
-
throw new Error("options.decrypt can only be specified for encrypted entries");
|
|
2101
|
-
}
|
|
2102
|
-
if (options.decrypt !== false)
|
|
2103
|
-
throw new Error("invalid options.decrypt value: " + options.decrypt);
|
|
2104
|
-
if (entry.isCompressed()) {
|
|
2105
|
-
if (options.decompress !== false)
|
|
2106
|
-
throw new Error("entry is encrypted and compressed, and options.decompress !== false");
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
if (options.decompress != null) {
|
|
2110
|
-
if (!entry.isCompressed()) {
|
|
2111
|
-
throw new Error("options.decompress can only be specified for compressed entries");
|
|
2112
|
-
}
|
|
2113
|
-
if (!(options.decompress === false || options.decompress === true)) {
|
|
2114
|
-
throw new Error("invalid options.decompress value: " + options.decompress);
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
if (options.start != null || options.end != null) {
|
|
2118
|
-
if (entry.isCompressed() && options.decompress !== false) {
|
|
2119
|
-
throw new Error("start/end range not allowed for compressed entry without options.decompress === false");
|
|
2120
|
-
}
|
|
2121
|
-
if (entry.isEncrypted() && options.decrypt !== false) {
|
|
2122
|
-
throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false");
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
if (options.start != null) {
|
|
2126
|
-
relativeStart = options.start;
|
|
2127
|
-
if (relativeStart < 0)
|
|
2128
|
-
throw new Error("options.start < 0");
|
|
2129
|
-
if (relativeStart > entry.compressedSize)
|
|
2130
|
-
throw new Error("options.start > entry.compressedSize");
|
|
2131
|
-
}
|
|
2132
|
-
if (options.end != null) {
|
|
2133
|
-
relativeEnd = options.end;
|
|
2134
|
-
if (relativeEnd < 0)
|
|
2135
|
-
throw new Error("options.end < 0");
|
|
2136
|
-
if (relativeEnd > entry.compressedSize)
|
|
2137
|
-
throw new Error("options.end > entry.compressedSize");
|
|
2138
|
-
if (relativeEnd < relativeStart)
|
|
2139
|
-
throw new Error("options.end < options.start");
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
if (!self.isOpen)
|
|
2143
|
-
return callback(new Error("closed"));
|
|
2144
|
-
if (entry.isEncrypted()) {
|
|
2145
|
-
if (options.decrypt !== false)
|
|
2146
|
-
return callback(new Error("entry is encrypted, and options.decrypt !== false"));
|
|
2147
|
-
}
|
|
2148
|
-
self.reader.ref();
|
|
2149
|
-
var buffer = newBuffer(30);
|
|
2150
|
-
readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {
|
|
2151
|
-
try {
|
|
2152
|
-
if (err)
|
|
2153
|
-
return callback(err);
|
|
2154
|
-
var signature = buffer.readUInt32LE(0);
|
|
2155
|
-
if (signature !== 67324752) {
|
|
2156
|
-
return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
|
|
2157
|
-
}
|
|
2158
|
-
var fileNameLength = buffer.readUInt16LE(26);
|
|
2159
|
-
var extraFieldLength = buffer.readUInt16LE(28);
|
|
2160
|
-
var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;
|
|
2161
|
-
var decompress;
|
|
2162
|
-
if (entry.compressionMethod === 0) {
|
|
2163
|
-
decompress = false;
|
|
2164
|
-
} else if (entry.compressionMethod === 8) {
|
|
2165
|
-
decompress = options.decompress != null ? options.decompress : true;
|
|
2166
|
-
} else {
|
|
2167
|
-
return callback(new Error("unsupported compression method: " + entry.compressionMethod));
|
|
2168
|
-
}
|
|
2169
|
-
var fileDataStart = localFileHeaderEnd;
|
|
2170
|
-
var fileDataEnd = fileDataStart + entry.compressedSize;
|
|
2171
|
-
if (entry.compressedSize !== 0) {
|
|
2172
|
-
if (fileDataEnd > self.fileSize) {
|
|
2173
|
-
return callback(new Error("file data overflows file bounds: " + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
|
|
2174
|
-
}
|
|
2175
|
-
}
|
|
2176
|
-
var readStream = self.reader.createReadStream({
|
|
2177
|
-
start: fileDataStart + relativeStart,
|
|
2178
|
-
end: fileDataStart + relativeEnd
|
|
2179
|
-
});
|
|
2180
|
-
var endpointStream = readStream;
|
|
2181
|
-
if (decompress) {
|
|
2182
|
-
var destroyed = false;
|
|
2183
|
-
var inflateFilter = zlib.createInflateRaw();
|
|
2184
|
-
readStream.on("error", function(err2) {
|
|
2185
|
-
setImmediate(function() {
|
|
2186
|
-
if (!destroyed)
|
|
2187
|
-
inflateFilter.emit("error", err2);
|
|
2188
|
-
});
|
|
2189
|
-
});
|
|
2190
|
-
readStream.pipe(inflateFilter);
|
|
2191
|
-
if (self.validateEntrySizes) {
|
|
2192
|
-
endpointStream = new AssertByteCountStream(entry.uncompressedSize);
|
|
2193
|
-
inflateFilter.on("error", function(err2) {
|
|
2194
|
-
setImmediate(function() {
|
|
2195
|
-
if (!destroyed)
|
|
2196
|
-
endpointStream.emit("error", err2);
|
|
2197
|
-
});
|
|
2198
|
-
});
|
|
2199
|
-
inflateFilter.pipe(endpointStream);
|
|
2200
|
-
} else {
|
|
2201
|
-
endpointStream = inflateFilter;
|
|
2202
|
-
}
|
|
2203
|
-
endpointStream.destroy = function() {
|
|
2204
|
-
destroyed = true;
|
|
2205
|
-
if (inflateFilter !== endpointStream)
|
|
2206
|
-
inflateFilter.unpipe(endpointStream);
|
|
2207
|
-
readStream.unpipe(inflateFilter);
|
|
2208
|
-
readStream.destroy();
|
|
2209
|
-
};
|
|
2210
|
-
}
|
|
2211
|
-
callback(null, endpointStream);
|
|
2212
|
-
} finally {
|
|
2213
|
-
self.reader.unref();
|
|
2214
|
-
}
|
|
2215
|
-
});
|
|
2216
|
-
};
|
|
2217
|
-
function Entry() {}
|
|
2218
|
-
Entry.prototype.getLastModDate = function() {
|
|
2219
|
-
return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
|
|
2220
|
-
};
|
|
2221
|
-
Entry.prototype.isEncrypted = function() {
|
|
2222
|
-
return (this.generalPurposeBitFlag & 1) !== 0;
|
|
2223
|
-
};
|
|
2224
|
-
Entry.prototype.isCompressed = function() {
|
|
2225
|
-
return this.compressionMethod === 8;
|
|
2226
|
-
};
|
|
2227
|
-
function dosDateTimeToDate(date, time) {
|
|
2228
|
-
var day = date & 31;
|
|
2229
|
-
var month = (date >> 5 & 15) - 1;
|
|
2230
|
-
var year = (date >> 9 & 127) + 1980;
|
|
2231
|
-
var millisecond = 0;
|
|
2232
|
-
var second = (time & 31) * 2;
|
|
2233
|
-
var minute = time >> 5 & 63;
|
|
2234
|
-
var hour = time >> 11 & 31;
|
|
2235
|
-
return new Date(year, month, day, hour, minute, second, millisecond);
|
|
2236
|
-
}
|
|
2237
|
-
function validateFileName(fileName) {
|
|
2238
|
-
if (fileName.indexOf("\\") !== -1) {
|
|
2239
|
-
return "invalid characters in fileName: " + fileName;
|
|
2240
|
-
}
|
|
2241
|
-
if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
|
|
2242
|
-
return "absolute path: " + fileName;
|
|
2243
|
-
}
|
|
2244
|
-
if (fileName.split("/").indexOf("..") !== -1) {
|
|
2245
|
-
return "invalid relative path: " + fileName;
|
|
2246
|
-
}
|
|
2247
|
-
return null;
|
|
2248
|
-
}
|
|
2249
|
-
function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
|
|
2250
|
-
if (length === 0) {
|
|
2251
|
-
return setImmediate(function() {
|
|
2252
|
-
callback(null, newBuffer(0));
|
|
2253
|
-
});
|
|
2254
|
-
}
|
|
2255
|
-
reader.read(buffer, offset, length, position, function(err, bytesRead) {
|
|
2256
|
-
if (err)
|
|
2257
|
-
return callback(err);
|
|
2258
|
-
if (bytesRead < length) {
|
|
2259
|
-
return callback(new Error("unexpected EOF"));
|
|
2260
|
-
}
|
|
2261
|
-
callback();
|
|
2262
|
-
});
|
|
2263
|
-
}
|
|
2264
|
-
util.inherits(AssertByteCountStream, Transform);
|
|
2265
|
-
function AssertByteCountStream(byteCount) {
|
|
2266
|
-
Transform.call(this);
|
|
2267
|
-
this.actualByteCount = 0;
|
|
2268
|
-
this.expectedByteCount = byteCount;
|
|
2269
|
-
}
|
|
2270
|
-
AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
|
|
2271
|
-
this.actualByteCount += chunk.length;
|
|
2272
|
-
if (this.actualByteCount > this.expectedByteCount) {
|
|
2273
|
-
var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
|
|
2274
|
-
return cb(new Error(msg));
|
|
2275
|
-
}
|
|
2276
|
-
cb(null, chunk);
|
|
2277
|
-
};
|
|
2278
|
-
AssertByteCountStream.prototype._flush = function(cb) {
|
|
2279
|
-
if (this.actualByteCount < this.expectedByteCount) {
|
|
2280
|
-
var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
|
|
2281
|
-
return cb(new Error(msg));
|
|
2282
|
-
}
|
|
2283
|
-
cb();
|
|
2284
|
-
};
|
|
2285
|
-
util.inherits(RandomAccessReader, EventEmitter);
|
|
2286
|
-
function RandomAccessReader() {
|
|
2287
|
-
EventEmitter.call(this);
|
|
2288
|
-
this.refCount = 0;
|
|
2289
|
-
}
|
|
2290
|
-
RandomAccessReader.prototype.ref = function() {
|
|
2291
|
-
this.refCount += 1;
|
|
2292
|
-
};
|
|
2293
|
-
RandomAccessReader.prototype.unref = function() {
|
|
2294
|
-
var self = this;
|
|
2295
|
-
self.refCount -= 1;
|
|
2296
|
-
if (self.refCount > 0)
|
|
2297
|
-
return;
|
|
2298
|
-
if (self.refCount < 0)
|
|
2299
|
-
throw new Error("invalid unref");
|
|
2300
|
-
self.close(onCloseDone);
|
|
2301
|
-
function onCloseDone(err) {
|
|
2302
|
-
if (err)
|
|
2303
|
-
return self.emit("error", err);
|
|
2304
|
-
self.emit("close");
|
|
2305
|
-
}
|
|
2306
|
-
};
|
|
2307
|
-
RandomAccessReader.prototype.createReadStream = function(options) {
|
|
2308
|
-
var start = options.start;
|
|
2309
|
-
var end = options.end;
|
|
2310
|
-
if (start === end) {
|
|
2311
|
-
var emptyStream = new PassThrough;
|
|
2312
|
-
setImmediate(function() {
|
|
2313
|
-
emptyStream.end();
|
|
2314
|
-
});
|
|
2315
|
-
return emptyStream;
|
|
2316
|
-
}
|
|
2317
|
-
var stream = this._readStreamForRange(start, end);
|
|
2318
|
-
var destroyed = false;
|
|
2319
|
-
var refUnrefFilter = new RefUnrefFilter(this);
|
|
2320
|
-
stream.on("error", function(err) {
|
|
2321
|
-
setImmediate(function() {
|
|
2322
|
-
if (!destroyed)
|
|
2323
|
-
refUnrefFilter.emit("error", err);
|
|
2324
|
-
});
|
|
2325
|
-
});
|
|
2326
|
-
refUnrefFilter.destroy = function() {
|
|
2327
|
-
stream.unpipe(refUnrefFilter);
|
|
2328
|
-
refUnrefFilter.unref();
|
|
2329
|
-
stream.destroy();
|
|
2330
|
-
};
|
|
2331
|
-
var byteCounter = new AssertByteCountStream(end - start);
|
|
2332
|
-
refUnrefFilter.on("error", function(err) {
|
|
2333
|
-
setImmediate(function() {
|
|
2334
|
-
if (!destroyed)
|
|
2335
|
-
byteCounter.emit("error", err);
|
|
2336
|
-
});
|
|
2337
|
-
});
|
|
2338
|
-
byteCounter.destroy = function() {
|
|
2339
|
-
destroyed = true;
|
|
2340
|
-
refUnrefFilter.unpipe(byteCounter);
|
|
2341
|
-
refUnrefFilter.destroy();
|
|
2342
|
-
};
|
|
2343
|
-
return stream.pipe(refUnrefFilter).pipe(byteCounter);
|
|
2344
|
-
};
|
|
2345
|
-
RandomAccessReader.prototype._readStreamForRange = function(start, end) {
|
|
2346
|
-
throw new Error("not implemented");
|
|
2347
|
-
};
|
|
2348
|
-
RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
|
|
2349
|
-
var readStream = this.createReadStream({ start: position, end: position + length });
|
|
2350
|
-
var writeStream = new Writable;
|
|
2351
|
-
var written = 0;
|
|
2352
|
-
writeStream._write = function(chunk, encoding, cb) {
|
|
2353
|
-
chunk.copy(buffer, offset + written, 0, chunk.length);
|
|
2354
|
-
written += chunk.length;
|
|
2355
|
-
cb();
|
|
2356
|
-
};
|
|
2357
|
-
writeStream.on("finish", callback);
|
|
2358
|
-
readStream.on("error", function(error) {
|
|
2359
|
-
callback(error);
|
|
2360
|
-
});
|
|
2361
|
-
readStream.pipe(writeStream);
|
|
2362
|
-
};
|
|
2363
|
-
RandomAccessReader.prototype.close = function(callback) {
|
|
2364
|
-
setImmediate(callback);
|
|
2365
|
-
};
|
|
2366
|
-
util.inherits(RefUnrefFilter, PassThrough);
|
|
2367
|
-
function RefUnrefFilter(context) {
|
|
2368
|
-
PassThrough.call(this);
|
|
2369
|
-
this.context = context;
|
|
2370
|
-
this.context.ref();
|
|
2371
|
-
this.unreffedYet = false;
|
|
2372
|
-
}
|
|
2373
|
-
RefUnrefFilter.prototype._flush = function(cb) {
|
|
2374
|
-
this.unref();
|
|
2375
|
-
cb();
|
|
2376
|
-
};
|
|
2377
|
-
RefUnrefFilter.prototype.unref = function(cb) {
|
|
2378
|
-
if (this.unreffedYet)
|
|
2379
|
-
return;
|
|
2380
|
-
this.unreffedYet = true;
|
|
2381
|
-
this.context.unref();
|
|
2382
|
-
};
|
|
2383
|
-
var cp437 = "\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";
|
|
2384
|
-
function decodeBuffer(buffer, start, end, isUtf8) {
|
|
2385
|
-
if (isUtf8) {
|
|
2386
|
-
return buffer.toString("utf8", start, end);
|
|
2387
|
-
} else {
|
|
2388
|
-
var result = "";
|
|
2389
|
-
for (var i = start;i < end; i++) {
|
|
2390
|
-
result += cp437[buffer[i]];
|
|
2391
|
-
}
|
|
2392
|
-
return result;
|
|
2393
|
-
}
|
|
2394
|
-
}
|
|
2395
|
-
function readUInt64LE(buffer, offset) {
|
|
2396
|
-
var lower32 = buffer.readUInt32LE(offset);
|
|
2397
|
-
var upper32 = buffer.readUInt32LE(offset + 4);
|
|
2398
|
-
return upper32 * 4294967296 + lower32;
|
|
2399
|
-
}
|
|
2400
|
-
var newBuffer;
|
|
2401
|
-
if (typeof Buffer.allocUnsafe === "function") {
|
|
2402
|
-
newBuffer = function(len) {
|
|
2403
|
-
return Buffer.allocUnsafe(len);
|
|
2404
|
-
};
|
|
2405
|
-
} else {
|
|
2406
|
-
newBuffer = function(len) {
|
|
2407
|
-
return new Buffer(len);
|
|
2408
|
-
};
|
|
2409
|
-
}
|
|
2410
|
-
function defaultCallback(err) {
|
|
2411
|
-
if (err)
|
|
2412
|
-
throw err;
|
|
2413
|
-
}
|
|
2414
|
-
});
|
|
2415
|
-
|
|
2416
|
-
// ../../node_modules/.bun/extract-zip@2.0.1/node_modules/extract-zip/index.js
|
|
2417
|
-
var require_extract_zip = __commonJS((exports, module) => {
|
|
2418
|
-
var debug = require_src()("extract-zip");
|
|
2419
|
-
var { createWriteStream, promises: fs } = __require("fs");
|
|
2420
|
-
var getStream = require_get_stream();
|
|
2421
|
-
var path = __require("path");
|
|
2422
|
-
var { promisify } = __require("util");
|
|
2423
|
-
var stream = __require("stream");
|
|
2424
|
-
var yauzl = require_yauzl();
|
|
2425
|
-
var openZip = promisify(yauzl.open);
|
|
2426
|
-
var pipeline = promisify(stream.pipeline);
|
|
2427
|
-
|
|
2428
|
-
class Extractor {
|
|
2429
|
-
constructor(zipPath, opts) {
|
|
2430
|
-
this.zipPath = zipPath;
|
|
2431
|
-
this.opts = opts;
|
|
2432
|
-
}
|
|
2433
|
-
async extract() {
|
|
2434
|
-
debug("opening", this.zipPath, "with opts", this.opts);
|
|
2435
|
-
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
2436
|
-
this.canceled = false;
|
|
2437
|
-
return new Promise((resolve, reject) => {
|
|
2438
|
-
this.zipfile.on("error", (err) => {
|
|
2439
|
-
this.canceled = true;
|
|
2440
|
-
reject(err);
|
|
2441
|
-
});
|
|
2442
|
-
this.zipfile.readEntry();
|
|
2443
|
-
this.zipfile.on("close", () => {
|
|
2444
|
-
if (!this.canceled) {
|
|
2445
|
-
debug("zip extraction complete");
|
|
2446
|
-
resolve();
|
|
2447
|
-
}
|
|
2448
|
-
});
|
|
2449
|
-
this.zipfile.on("entry", async (entry) => {
|
|
2450
|
-
if (this.canceled) {
|
|
2451
|
-
debug("skipping entry", entry.fileName, { cancelled: this.canceled });
|
|
2452
|
-
return;
|
|
2453
|
-
}
|
|
2454
|
-
debug("zipfile entry", entry.fileName);
|
|
2455
|
-
if (entry.fileName.startsWith("__MACOSX/")) {
|
|
2456
|
-
this.zipfile.readEntry();
|
|
2457
|
-
return;
|
|
2458
|
-
}
|
|
2459
|
-
const destDir = path.dirname(path.join(this.opts.dir, entry.fileName));
|
|
2460
|
-
try {
|
|
2461
|
-
await fs.mkdir(destDir, { recursive: true });
|
|
2462
|
-
const canonicalDestDir = await fs.realpath(destDir);
|
|
2463
|
-
const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir);
|
|
2464
|
-
if (relativeDestDir.split(path.sep).includes("..")) {
|
|
2465
|
-
throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
|
|
2466
|
-
}
|
|
2467
|
-
await this.extractEntry(entry);
|
|
2468
|
-
debug("finished processing", entry.fileName);
|
|
2469
|
-
this.zipfile.readEntry();
|
|
2470
|
-
} catch (err) {
|
|
2471
|
-
this.canceled = true;
|
|
2472
|
-
this.zipfile.close();
|
|
2473
|
-
reject(err);
|
|
2474
|
-
}
|
|
2475
|
-
});
|
|
2476
|
-
});
|
|
2477
|
-
}
|
|
2478
|
-
async extractEntry(entry) {
|
|
2479
|
-
if (this.canceled) {
|
|
2480
|
-
debug("skipping entry extraction", entry.fileName, { cancelled: this.canceled });
|
|
2481
|
-
return;
|
|
2482
|
-
}
|
|
2483
|
-
if (this.opts.onEntry) {
|
|
2484
|
-
this.opts.onEntry(entry, this.zipfile);
|
|
2485
|
-
}
|
|
2486
|
-
const dest = path.join(this.opts.dir, entry.fileName);
|
|
2487
|
-
const mode = entry.externalFileAttributes >> 16 & 65535;
|
|
2488
|
-
const IFMT = 61440;
|
|
2489
|
-
const IFDIR = 16384;
|
|
2490
|
-
const IFLNK = 40960;
|
|
2491
|
-
const symlink = (mode & IFMT) === IFLNK;
|
|
2492
|
-
let isDir = (mode & IFMT) === IFDIR;
|
|
2493
|
-
if (!isDir && entry.fileName.endsWith("/")) {
|
|
2494
|
-
isDir = true;
|
|
2495
|
-
}
|
|
2496
|
-
const madeBy = entry.versionMadeBy >> 8;
|
|
2497
|
-
if (!isDir)
|
|
2498
|
-
isDir = madeBy === 0 && entry.externalFileAttributes === 16;
|
|
2499
|
-
debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink });
|
|
2500
|
-
const procMode = this.getExtractedMode(mode, isDir) & 511;
|
|
2501
|
-
const destDir = isDir ? dest : path.dirname(dest);
|
|
2502
|
-
const mkdirOptions = { recursive: true };
|
|
2503
|
-
if (isDir) {
|
|
2504
|
-
mkdirOptions.mode = procMode;
|
|
2505
|
-
}
|
|
2506
|
-
debug("mkdir", { dir: destDir, ...mkdirOptions });
|
|
2507
|
-
await fs.mkdir(destDir, mkdirOptions);
|
|
2508
|
-
if (isDir)
|
|
2509
|
-
return;
|
|
2510
|
-
debug("opening read stream", dest);
|
|
2511
|
-
const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry);
|
|
2512
|
-
if (symlink) {
|
|
2513
|
-
const link = await getStream(readStream);
|
|
2514
|
-
debug("creating symlink", link, dest);
|
|
2515
|
-
await fs.symlink(link, dest);
|
|
2516
|
-
} else {
|
|
2517
|
-
await pipeline(readStream, createWriteStream(dest, { mode: procMode }));
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
getExtractedMode(entryMode, isDir) {
|
|
2521
|
-
let mode = entryMode;
|
|
2522
|
-
if (mode === 0) {
|
|
2523
|
-
if (isDir) {
|
|
2524
|
-
if (this.opts.defaultDirMode) {
|
|
2525
|
-
mode = parseInt(this.opts.defaultDirMode, 10);
|
|
2526
|
-
}
|
|
2527
|
-
if (!mode) {
|
|
2528
|
-
mode = 493;
|
|
2529
|
-
}
|
|
2530
|
-
} else {
|
|
2531
|
-
if (this.opts.defaultFileMode) {
|
|
2532
|
-
mode = parseInt(this.opts.defaultFileMode, 10);
|
|
2533
|
-
}
|
|
2534
|
-
if (!mode) {
|
|
2535
|
-
mode = 420;
|
|
2536
|
-
}
|
|
2537
|
-
}
|
|
2538
|
-
}
|
|
2539
|
-
return mode;
|
|
2540
|
-
}
|
|
2541
|
-
}
|
|
2542
|
-
module.exports = async function(zipPath, opts) {
|
|
2543
|
-
debug("creating target directory", opts.dir);
|
|
2544
|
-
if (!path.isAbsolute(opts.dir)) {
|
|
2545
|
-
throw new Error("Target directory is expected to be absolute");
|
|
2546
|
-
}
|
|
2547
|
-
await fs.mkdir(opts.dir, { recursive: true });
|
|
2548
|
-
opts.dir = await fs.realpath(opts.dir);
|
|
2549
|
-
return new Extractor(zipPath, opts).extract();
|
|
2550
|
-
};
|
|
2551
|
-
});
|
|
2552
|
-
|
|
2553
|
-
// src/ensure-browser.ts
|
|
2554
|
-
import fs4 from "fs";
|
|
2555
|
-
|
|
2556
|
-
// src/browser/BrowserFetcher.ts
|
|
2557
|
-
var import_extract_zip = __toESM(require_extract_zip(), 1);
|
|
2558
|
-
import * as fs3 from "node:fs";
|
|
2559
|
-
import * as os from "node:os";
|
|
2560
|
-
import * as path3 from "node:path";
|
|
2561
|
-
import { promisify } from "node:util";
|
|
2562
|
-
|
|
2563
|
-
// src/assets/download-file.ts
|
|
2564
|
-
import { createWriteStream } from "node:fs";
|
|
2565
|
-
|
|
2566
|
-
// src/ensure-output-directory.ts
|
|
2567
|
-
import fs from "node:fs";
|
|
2568
|
-
import path from "node:path";
|
|
2569
|
-
var ensureOutputDirectory = (outputLocation) => {
|
|
2570
|
-
const dirName = path.dirname(outputLocation);
|
|
2571
|
-
if (!fs.existsSync(dirName)) {
|
|
2572
|
-
fs.mkdirSync(dirName, {
|
|
2573
|
-
recursive: true
|
|
2574
|
-
});
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
|
|
2578
|
-
// src/chalk/is-color-supported.ts
|
|
2579
|
-
import * as tty from "tty";
|
|
2580
|
-
var isColorSupported = () => {
|
|
2581
|
-
const env = process.env || {};
|
|
2582
|
-
const isForceDisabled = "NO_COLOR" in env;
|
|
2583
|
-
if (isForceDisabled) {
|
|
2584
|
-
return false;
|
|
2585
|
-
}
|
|
2586
|
-
const isForced = "FORCE_COLOR" in env;
|
|
2587
|
-
if (isForced) {
|
|
2588
|
-
return true;
|
|
2589
|
-
}
|
|
2590
|
-
const isWindows = process.platform === "win32";
|
|
2591
|
-
const isCompatibleTerminal = tty?.isatty?.(1) && env.TERM && env.TERM !== "dumb";
|
|
2592
|
-
const isCI = "CI" in env && (("GITHUB_ACTIONS" in env) || ("GITLAB_CI" in env) || ("CIRCLECI" in env));
|
|
2593
|
-
return isWindows || isCompatibleTerminal || isCI;
|
|
2594
|
-
};
|
|
2595
|
-
|
|
2596
|
-
// src/chalk/index.ts
|
|
2597
|
-
var chalk = (() => {
|
|
2598
|
-
const colors = {
|
|
2599
|
-
enabled: () => isColorSupported(),
|
|
2600
|
-
visible: true,
|
|
2601
|
-
styles: {},
|
|
2602
|
-
keys: {}
|
|
2603
|
-
};
|
|
2604
|
-
const ansi = (st) => {
|
|
2605
|
-
const open = `\x1B[${st.codes[0]}m`;
|
|
2606
|
-
const close = `\x1B[${st.codes[1]}m`;
|
|
2607
|
-
const regex = new RegExp(`\\u001b\\[${st.codes[1]}m`, "g");
|
|
2608
|
-
st.wrap = (input, newline) => {
|
|
2609
|
-
if (input.includes(close))
|
|
2610
|
-
input = input.replace(regex, close + open);
|
|
2611
|
-
const output = open + input + close;
|
|
2612
|
-
return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output;
|
|
2613
|
-
};
|
|
2614
|
-
return st;
|
|
2615
|
-
};
|
|
2616
|
-
const wrap = (sty, input, newline) => {
|
|
2617
|
-
return sty.wrap?.(input, newline);
|
|
2618
|
-
};
|
|
2619
|
-
const style = (input, stack) => {
|
|
2620
|
-
if (input === "" || input === null || input === undefined)
|
|
2621
|
-
return "";
|
|
2622
|
-
if (colors.enabled() === false)
|
|
2623
|
-
return input;
|
|
2624
|
-
if (colors.visible === false)
|
|
2625
|
-
return "";
|
|
2626
|
-
let str = String(input);
|
|
2627
|
-
const nl = str.includes(`
|
|
2628
|
-
`);
|
|
2629
|
-
let n = stack.length;
|
|
2630
|
-
while (n-- > 0)
|
|
2631
|
-
str = wrap(colors.styles[stack[n]], str, nl);
|
|
2632
|
-
return str;
|
|
2633
|
-
};
|
|
2634
|
-
const define = (name, codes, type) => {
|
|
2635
|
-
colors.styles[name] = ansi({ name, codes });
|
|
2636
|
-
const keys = colors.keys[type] || (colors.keys[type] = []);
|
|
2637
|
-
keys.push(name);
|
|
2638
|
-
Reflect.defineProperty(colors, name, {
|
|
2639
|
-
configurable: true,
|
|
2640
|
-
enumerable: true,
|
|
2641
|
-
set(value) {
|
|
2642
|
-
colors.alias?.(name, value);
|
|
2643
|
-
},
|
|
2644
|
-
get() {
|
|
2645
|
-
const color = (input) => style(input, color.stack);
|
|
2646
|
-
Reflect.setPrototypeOf(color, colors);
|
|
2647
|
-
color.stack = this.stack ? this.stack.concat(name) : [name];
|
|
2648
|
-
return color;
|
|
2649
|
-
}
|
|
2650
|
-
});
|
|
2651
|
-
};
|
|
2652
|
-
define("reset", [0, 0], "modifier");
|
|
2653
|
-
define("bold", [1, 22], "modifier");
|
|
2654
|
-
define("dim", [2, 22], "modifier");
|
|
2655
|
-
define("italic", [3, 23], "modifier");
|
|
2656
|
-
define("underline", [4, 24], "modifier");
|
|
2657
|
-
define("inverse", [7, 27], "modifier");
|
|
2658
|
-
define("hidden", [8, 28], "modifier");
|
|
2659
|
-
define("strikethrough", [9, 29], "modifier");
|
|
2660
|
-
define("black", [30, 39], "color");
|
|
2661
|
-
define("red", [31, 39], "color");
|
|
2662
|
-
define("green", [32, 39], "color");
|
|
2663
|
-
define("yellow", [33, 39], "color");
|
|
2664
|
-
define("blue", [34, 39], "color");
|
|
2665
|
-
define("magenta", [35, 39], "color");
|
|
2666
|
-
define("cyan", [36, 39], "color");
|
|
2667
|
-
define("white", [37, 39], "color");
|
|
2668
|
-
define("gray", [90, 39], "color");
|
|
2669
|
-
define("grey", [90, 39], "color");
|
|
2670
|
-
define("bgBlack", [40, 49], "bg");
|
|
2671
|
-
define("bgRed", [41, 49], "bg");
|
|
2672
|
-
define("bgGreen", [42, 49], "bg");
|
|
2673
|
-
define("bgYellow", [43, 49], "bg");
|
|
2674
|
-
define("bgBlue", [44, 49], "bg");
|
|
2675
|
-
define("bgMagenta", [45, 49], "bg");
|
|
2676
|
-
define("bgWhite", [47, 49], "bg");
|
|
2677
|
-
define("blackBright", [90, 39], "bright");
|
|
2678
|
-
define("redBright", [91, 39], "bright");
|
|
2679
|
-
define("greenBright", [92, 39], "bright");
|
|
2680
|
-
define("yellowBright", [93, 39], "bright");
|
|
2681
|
-
define("blueBright", [94, 39], "bright");
|
|
2682
|
-
define("magentaBright", [95, 39], "bright");
|
|
2683
|
-
define("whiteBright", [97, 39], "bright");
|
|
2684
|
-
define("bgBlackBright", [100, 49], "bgBright");
|
|
2685
|
-
define("bgRedBright", [101, 49], "bgBright");
|
|
2686
|
-
define("bgGreenBright", [102, 49], "bgBright");
|
|
2687
|
-
define("bgYellowBright", [103, 49], "bgBright");
|
|
2688
|
-
define("bgBlueBright", [104, 49], "bgBright");
|
|
2689
|
-
define("bgMagentaBright", [105, 49], "bgBright");
|
|
2690
|
-
define("bgWhiteBright", [107, 49], "bgBright");
|
|
2691
|
-
colors.alias = (name, color) => {
|
|
2692
|
-
const fn = colors[color];
|
|
2693
|
-
if (typeof fn !== "function") {
|
|
2694
|
-
throw new TypeError("Expected alias to be the name of an existing color (string) or a function");
|
|
2695
|
-
}
|
|
2696
|
-
if (!fn.stack) {
|
|
2697
|
-
Reflect.defineProperty(fn, "name", { value: name });
|
|
2698
|
-
colors.styles[name] = fn;
|
|
2699
|
-
fn.stack = [name];
|
|
2700
|
-
}
|
|
2701
|
-
Reflect.defineProperty(colors, name, {
|
|
2702
|
-
configurable: true,
|
|
2703
|
-
enumerable: true,
|
|
2704
|
-
set(value) {
|
|
2705
|
-
colors.alias?.(name, value);
|
|
2706
|
-
},
|
|
2707
|
-
get() {
|
|
2708
|
-
const col = (input) => style(input, col.stack);
|
|
2709
|
-
Reflect.setPrototypeOf(col, colors);
|
|
2710
|
-
col.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack;
|
|
2711
|
-
return col;
|
|
2712
|
-
}
|
|
2713
|
-
});
|
|
2714
|
-
};
|
|
2715
|
-
return colors;
|
|
2716
|
-
})();
|
|
2717
|
-
|
|
2718
|
-
// src/log-level.ts
|
|
2719
|
-
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
2720
|
-
var getNumberForLogLevel = (level) => {
|
|
2721
|
-
return logLevels.indexOf(level);
|
|
2722
|
-
};
|
|
2723
|
-
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
2724
|
-
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
2725
|
-
};
|
|
2726
|
-
|
|
2727
|
-
// src/repro.ts
|
|
2728
|
-
var reproWriteInstance = null;
|
|
2729
|
-
var getReproWriter = () => {
|
|
2730
|
-
if (!reproWriteInstance) {
|
|
2731
|
-
throw new Error("reproWriteInstance is not initialized");
|
|
2732
|
-
}
|
|
2733
|
-
return reproWriteInstance;
|
|
2734
|
-
};
|
|
2735
|
-
var writeInRepro = (level, ...args) => {
|
|
2736
|
-
if (isReproEnabled()) {
|
|
2737
|
-
getReproWriter().writeLine(level, ...args);
|
|
2738
|
-
}
|
|
2739
|
-
};
|
|
2740
|
-
var shouldRepro = false;
|
|
2741
|
-
var isReproEnabled = () => shouldRepro;
|
|
2742
|
-
|
|
2743
|
-
// src/truthy.ts
|
|
2744
|
-
function truthy(value) {
|
|
2745
|
-
return Boolean(value);
|
|
2746
|
-
}
|
|
2747
|
-
|
|
2748
|
-
// src/logger.ts
|
|
2749
|
-
var INDENT_TOKEN = chalk.gray("│");
|
|
2750
|
-
var verboseTag = (str) => {
|
|
2751
|
-
return isColorSupported() ? chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
2752
|
-
};
|
|
2753
|
-
var Log = {
|
|
2754
|
-
formatLogs: (logLevel, options, args) => {
|
|
2755
|
-
return [
|
|
2756
|
-
options.indent ? INDENT_TOKEN : null,
|
|
2757
|
-
options.tag ? verboseTag(options.tag) : null
|
|
2758
|
-
].filter(truthy).concat(args.map((a) => {
|
|
2759
|
-
if (logLevel === "warn") {
|
|
2760
|
-
return chalk.yellow(a);
|
|
2761
|
-
}
|
|
2762
|
-
if (logLevel === "error") {
|
|
2763
|
-
return chalk.red(a);
|
|
2764
|
-
}
|
|
2765
|
-
if (logLevel === "verbose" || logLevel === "trace") {
|
|
2766
|
-
return chalk.gray(a);
|
|
2767
|
-
}
|
|
2768
|
-
return a;
|
|
2769
|
-
}));
|
|
2770
|
-
},
|
|
2771
|
-
trace: (options, ...args) => {
|
|
2772
|
-
writeInRepro("trace", ...args);
|
|
2773
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
2774
|
-
if (args.length === 0) {
|
|
2775
|
-
return process.stdout.write(`
|
|
2776
|
-
`);
|
|
2777
|
-
}
|
|
2778
|
-
return console.log(...Log.formatLogs("trace", options, args));
|
|
2779
|
-
}
|
|
2780
|
-
},
|
|
2781
|
-
verbose: (options, ...args) => {
|
|
2782
|
-
writeInRepro("verbose", ...args);
|
|
2783
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
2784
|
-
if (args.length === 0) {
|
|
2785
|
-
return process.stdout.write(`
|
|
2786
|
-
`);
|
|
2787
|
-
}
|
|
2788
|
-
return console.log(...Log.formatLogs("verbose", options, args));
|
|
2789
|
-
}
|
|
2790
|
-
},
|
|
2791
|
-
info: (options, ...args) => {
|
|
2792
|
-
writeInRepro("info", ...args);
|
|
2793
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
2794
|
-
if (args.length === 0) {
|
|
2795
|
-
return process.stdout.write(`
|
|
2796
|
-
`);
|
|
2797
|
-
}
|
|
2798
|
-
return console.log(...Log.formatLogs("info", options, args));
|
|
2799
|
-
}
|
|
2800
|
-
},
|
|
2801
|
-
warn: (options, ...args) => {
|
|
2802
|
-
writeInRepro("warn", ...args);
|
|
2803
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
2804
|
-
if (args.length === 0) {
|
|
2805
|
-
return process.stdout.write(`
|
|
2806
|
-
`);
|
|
2807
|
-
}
|
|
2808
|
-
return console.warn(...Log.formatLogs("warn", options, args));
|
|
2809
|
-
}
|
|
2810
|
-
},
|
|
2811
|
-
error: (options, ...args) => {
|
|
2812
|
-
writeInRepro("error", ...args);
|
|
2813
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "error")) {
|
|
2814
|
-
if (args.length === 0) {
|
|
2815
|
-
return process.stdout.write(`
|
|
2816
|
-
`);
|
|
2817
|
-
}
|
|
2818
|
-
return console.error(...Log.formatLogs("error", options, args));
|
|
2819
|
-
}
|
|
2820
|
-
}
|
|
2821
|
-
};
|
|
2822
|
-
|
|
2823
|
-
// src/assets/read-file.ts
|
|
2824
|
-
import https from "https";
|
|
2825
|
-
import http from "node:http";
|
|
2826
|
-
|
|
2827
|
-
// src/redirect-status-codes.ts
|
|
2828
|
-
var redirectStatusCodes = [301, 302, 303, 307, 308];
|
|
2829
|
-
|
|
2830
|
-
// src/assets/read-file.ts
|
|
2831
|
-
var getClient = (url) => {
|
|
2832
|
-
if (url.startsWith("https://")) {
|
|
2833
|
-
return https.get;
|
|
2834
|
-
}
|
|
2835
|
-
if (url.startsWith("http://")) {
|
|
2836
|
-
return http.get;
|
|
2837
|
-
}
|
|
2838
|
-
throw new Error(`Can only download URLs starting with http:// or https://, got "${url}"`);
|
|
2839
|
-
};
|
|
2840
|
-
var readFileWithoutRedirect = (url) => {
|
|
2841
|
-
return new Promise((resolve, reject) => {
|
|
2842
|
-
const client = getClient(url);
|
|
2843
|
-
const req = client(url, typeof Bun === "undefined" ? {
|
|
2844
|
-
headers: {
|
|
2845
|
-
"user-agent": "Mozilla/5.0 (@remotion/renderer - https://remotion.dev)"
|
|
2846
|
-
}
|
|
2847
|
-
} : {}, (res) => {
|
|
2848
|
-
resolve({ request: req, response: res });
|
|
2849
|
-
});
|
|
2850
|
-
req.on("error", (err) => {
|
|
2851
|
-
req.destroy();
|
|
2852
|
-
return reject(err);
|
|
2853
|
-
});
|
|
2854
|
-
});
|
|
2855
|
-
};
|
|
2856
|
-
var readFile = async (url, redirectsSoFar = 0) => {
|
|
2857
|
-
if (redirectsSoFar > 10) {
|
|
2858
|
-
throw new Error(`Too many redirects while downloading ${url}`);
|
|
2859
|
-
}
|
|
2860
|
-
const { request, response } = await readFileWithoutRedirect(url);
|
|
2861
|
-
if (redirectStatusCodes.includes(response.statusCode)) {
|
|
2862
|
-
if (!response.headers.location) {
|
|
2863
|
-
throw new Error(`Received a status code ${response.statusCode} but no "Location" header while calling ${response.headers.location}`);
|
|
2864
|
-
}
|
|
2865
|
-
const { origin } = new URL(url);
|
|
2866
|
-
const redirectUrl = new URL(response.headers.location, origin).toString();
|
|
2867
|
-
request.destroy();
|
|
2868
|
-
response.destroy();
|
|
2869
|
-
return readFile(redirectUrl, redirectsSoFar + 1);
|
|
2870
|
-
}
|
|
2871
|
-
if (response.statusCode >= 400) {
|
|
2872
|
-
const body = await tryToObtainBody(response);
|
|
2873
|
-
request.destroy();
|
|
2874
|
-
response.destroy();
|
|
2875
|
-
throw new Error([
|
|
2876
|
-
`Received a status code of ${response.statusCode} while downloading file ${url}.`,
|
|
2877
|
-
body ? `The response body was:` : null,
|
|
2878
|
-
body ? `---` : null,
|
|
2879
|
-
body ? body : null,
|
|
2880
|
-
body ? `---` : null
|
|
2881
|
-
].filter(truthy).join(`
|
|
2882
|
-
`));
|
|
2883
|
-
}
|
|
2884
|
-
return { request, response };
|
|
2885
|
-
};
|
|
2886
|
-
var tryToObtainBody = async (file) => {
|
|
2887
|
-
const success = new Promise((resolve) => {
|
|
2888
|
-
let data = "";
|
|
2889
|
-
file.on("data", (chunk) => {
|
|
2890
|
-
data += chunk;
|
|
2891
|
-
});
|
|
2892
|
-
file.on("end", () => {
|
|
2893
|
-
resolve(data);
|
|
2894
|
-
});
|
|
2895
|
-
file.on("error", () => resolve(data));
|
|
2896
|
-
});
|
|
2897
|
-
let timeout = null;
|
|
2898
|
-
const body = await Promise.race([
|
|
2899
|
-
success,
|
|
2900
|
-
new Promise((resolve) => {
|
|
2901
|
-
timeout = setTimeout(() => {
|
|
2902
|
-
resolve(null);
|
|
2903
|
-
}, 5000);
|
|
2904
|
-
})
|
|
2905
|
-
]);
|
|
2906
|
-
if (timeout) {
|
|
2907
|
-
clearTimeout(timeout);
|
|
2908
|
-
}
|
|
2909
|
-
return body;
|
|
2910
|
-
};
|
|
2911
|
-
|
|
2912
|
-
// src/assets/download-file.ts
|
|
2913
|
-
var incorrectContentLengthToken = "Download finished with";
|
|
2914
|
-
var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
|
|
2915
|
-
return new Promise((resolve, reject) => {
|
|
2916
|
-
let rejected = false;
|
|
2917
|
-
let resolved = false;
|
|
2918
|
-
let timeout;
|
|
2919
|
-
const resolveAndFlag = (val) => {
|
|
2920
|
-
resolved = true;
|
|
2921
|
-
resolve(val);
|
|
2922
|
-
if (timeout) {
|
|
2923
|
-
clearTimeout(timeout);
|
|
2924
|
-
}
|
|
2925
|
-
};
|
|
2926
|
-
const rejectAndFlag = (err) => {
|
|
2927
|
-
if (timeout) {
|
|
2928
|
-
clearTimeout(timeout);
|
|
2929
|
-
}
|
|
2930
|
-
reject(err);
|
|
2931
|
-
rejected = true;
|
|
2932
|
-
};
|
|
2933
|
-
const refreshTimeout = () => {
|
|
2934
|
-
if (timeout) {
|
|
2935
|
-
clearTimeout(timeout);
|
|
2936
|
-
}
|
|
2937
|
-
timeout = setTimeout(() => {
|
|
2938
|
-
if (resolved) {
|
|
2939
|
-
return;
|
|
2940
|
-
}
|
|
2941
|
-
rejectAndFlag(new Error(`Tried to download file ${url}, but the server sent no data for 20 seconds`));
|
|
2942
|
-
}, 20000);
|
|
2943
|
-
};
|
|
2944
|
-
refreshTimeout();
|
|
2945
|
-
let finishEventSent = false;
|
|
2946
|
-
let closeConnection = () => {
|
|
2947
|
-
return;
|
|
2948
|
-
};
|
|
2949
|
-
readFile(url).then(({ response, request }) => {
|
|
2950
|
-
closeConnection = () => {
|
|
2951
|
-
request.destroy();
|
|
2952
|
-
response.destroy();
|
|
2953
|
-
};
|
|
2954
|
-
const contentDisposition = response.headers["content-disposition"] ?? null;
|
|
2955
|
-
const contentType = response.headers["content-type"] ?? null;
|
|
2956
|
-
const to = toFn(contentDisposition, contentType);
|
|
2957
|
-
ensureOutputDirectory(to);
|
|
2958
|
-
const sizeHeader = response.headers["content-length"];
|
|
2959
|
-
const totalSize = typeof sizeHeader === "undefined" ? null : Number(sizeHeader);
|
|
2960
|
-
const writeStream = createWriteStream(to);
|
|
2961
|
-
let downloaded = 0;
|
|
2962
|
-
writeStream.on("close", () => {
|
|
2963
|
-
if (rejected) {
|
|
2964
|
-
return;
|
|
2965
|
-
}
|
|
2966
|
-
if (!finishEventSent) {
|
|
2967
|
-
onProgress?.({
|
|
2968
|
-
downloaded,
|
|
2969
|
-
percent: 1,
|
|
2970
|
-
totalSize: downloaded
|
|
2971
|
-
});
|
|
2972
|
-
}
|
|
2973
|
-
refreshTimeout();
|
|
2974
|
-
return resolveAndFlag({ sizeInBytes: downloaded, to });
|
|
2975
|
-
});
|
|
2976
|
-
writeStream.on("error", (err) => rejectAndFlag(err));
|
|
2977
|
-
response.on("error", (err) => {
|
|
2978
|
-
closeConnection();
|
|
2979
|
-
rejectAndFlag(err);
|
|
2980
|
-
});
|
|
2981
|
-
response.pipe(writeStream).on("error", (err) => rejectAndFlag(err));
|
|
2982
|
-
response.on("data", (d) => {
|
|
2983
|
-
refreshTimeout();
|
|
2984
|
-
downloaded += d.length;
|
|
2985
|
-
refreshTimeout();
|
|
2986
|
-
const percent = totalSize === null ? null : downloaded / totalSize;
|
|
2987
|
-
onProgress?.({
|
|
2988
|
-
downloaded,
|
|
2989
|
-
percent,
|
|
2990
|
-
totalSize
|
|
2991
|
-
});
|
|
2992
|
-
if (percent === 1) {
|
|
2993
|
-
finishEventSent = true;
|
|
2994
|
-
}
|
|
2995
|
-
});
|
|
2996
|
-
response.on("close", () => {
|
|
2997
|
-
if (totalSize !== null && downloaded !== totalSize) {
|
|
2998
|
-
rejectAndFlag(new Error(`${incorrectContentLengthToken} ${downloaded} bytes, but expected ${totalSize} bytes from 'Content-Length'.`));
|
|
2999
|
-
}
|
|
3000
|
-
writeStream.close();
|
|
3001
|
-
closeConnection();
|
|
3002
|
-
});
|
|
3003
|
-
}).catch((err) => {
|
|
3004
|
-
rejectAndFlag(err);
|
|
3005
|
-
});
|
|
3006
|
-
});
|
|
3007
|
-
};
|
|
3008
|
-
var downloadFile = async (options, retries = 2, attempt = 1) => {
|
|
3009
|
-
try {
|
|
3010
|
-
const res = await downloadFileWithoutRetries(options);
|
|
3011
|
-
return res;
|
|
3012
|
-
} catch (err) {
|
|
3013
|
-
const { message } = err;
|
|
3014
|
-
if (message === "aborted" || message.includes("ECONNRESET") || message.includes(incorrectContentLengthToken) || message.includes("503") || message.includes("502") || message.includes("504") || message.includes("500")) {
|
|
3015
|
-
if (retries === 0) {
|
|
3016
|
-
throw err;
|
|
3017
|
-
}
|
|
3018
|
-
Log.warn({ indent: options.indent, logLevel: options.logLevel }, `Downloading ${options.url} failed (will retry): ${message}`);
|
|
3019
|
-
const backoffInSeconds = (attempt + 1) ** 2;
|
|
3020
|
-
await new Promise((resolve) => {
|
|
3021
|
-
setTimeout(() => resolve(), backoffInSeconds * 1000);
|
|
3022
|
-
});
|
|
3023
|
-
return downloadFile(options, retries - 1, attempt + 1);
|
|
3024
|
-
}
|
|
3025
|
-
throw err;
|
|
3026
|
-
}
|
|
3027
|
-
};
|
|
3028
|
-
|
|
3029
|
-
// src/compositor/make-file-executable.ts
|
|
3030
|
-
import { accessSync, chmodSync, constants, statSync } from "node:fs";
|
|
3031
|
-
var hasPermissions = (p) => {
|
|
3032
|
-
if (process.platform !== "linux" && process.platform !== "darwin") {
|
|
3033
|
-
try {
|
|
3034
|
-
accessSync(p, constants.X_OK);
|
|
3035
|
-
return true;
|
|
3036
|
-
} catch {
|
|
3037
|
-
return false;
|
|
3038
|
-
}
|
|
3039
|
-
}
|
|
3040
|
-
const stats = statSync(p);
|
|
3041
|
-
const { mode } = stats;
|
|
3042
|
-
const othersHaveExecutePermission = Boolean(mode & 1);
|
|
3043
|
-
if (othersHaveExecutePermission) {
|
|
3044
|
-
return true;
|
|
3045
|
-
}
|
|
3046
|
-
if (!process.getuid || !process.getgid) {
|
|
3047
|
-
throw new Error("Cannot check permissions on Linux without process.getuid and process.getgid");
|
|
3048
|
-
}
|
|
3049
|
-
const uid = process.getuid();
|
|
3050
|
-
const gid = process.getgid();
|
|
3051
|
-
const isOwner = uid === stats.uid;
|
|
3052
|
-
const isGroup = gid === stats.gid;
|
|
3053
|
-
const ownerHasExecutePermission = Boolean(mode & 64);
|
|
3054
|
-
const groupHasExecutePermission = Boolean(mode & 8);
|
|
3055
|
-
const canExecute = isOwner && ownerHasExecutePermission || isGroup && groupHasExecutePermission;
|
|
3056
|
-
return canExecute;
|
|
3057
|
-
};
|
|
3058
|
-
var makeFileExecutableIfItIsNot = (path2) => {
|
|
3059
|
-
const hasPermissionsResult = hasPermissions(path2);
|
|
3060
|
-
if (!hasPermissionsResult) {
|
|
3061
|
-
chmodSync(path2, 493);
|
|
3062
|
-
}
|
|
3063
|
-
};
|
|
3064
|
-
|
|
3065
|
-
// src/browser/get-download-destination.ts
|
|
3066
|
-
import fs2 from "node:fs";
|
|
3067
|
-
import path2 from "node:path";
|
|
3068
|
-
var getDownloadsCacheDir = () => {
|
|
3069
|
-
const cwd = process.cwd();
|
|
3070
|
-
let dir = cwd;
|
|
3071
|
-
for (;; ) {
|
|
3072
|
-
try {
|
|
3073
|
-
if (fs2.statSync(path2.join(dir, "package.json")).isFile()) {
|
|
3074
|
-
break;
|
|
3075
|
-
}
|
|
3076
|
-
} catch (e) {}
|
|
3077
|
-
const parent = path2.dirname(dir);
|
|
3078
|
-
if (dir === parent) {
|
|
3079
|
-
dir = undefined;
|
|
3080
|
-
break;
|
|
3081
|
-
}
|
|
3082
|
-
dir = parent;
|
|
3083
|
-
}
|
|
3084
|
-
if (!dir) {
|
|
3085
|
-
return path2.resolve(cwd, ".remotion");
|
|
3086
|
-
}
|
|
3087
|
-
if (process.versions.pnp === "1") {
|
|
3088
|
-
return path2.resolve(dir, ".pnp/.remotion");
|
|
3089
|
-
}
|
|
3090
|
-
if (process.versions.pnp === "3") {
|
|
3091
|
-
return path2.resolve(dir, ".yarn/.remotion");
|
|
3092
|
-
}
|
|
3093
|
-
return path2.resolve(dir, "node_modules/.remotion");
|
|
3094
|
-
};
|
|
3095
|
-
|
|
3096
|
-
// src/browser/BrowserFetcher.ts
|
|
3097
|
-
var TESTED_VERSION = "134.0.6998.35";
|
|
3098
|
-
var PLAYWRIGHT_VERSION = "1161";
|
|
3099
|
-
function getChromeDownloadUrl({
|
|
3100
|
-
platform: platform2,
|
|
3101
|
-
version,
|
|
3102
|
-
chromeMode
|
|
3103
|
-
}) {
|
|
3104
|
-
if (platform2 === "linux-arm64") {
|
|
3105
|
-
if (chromeMode === "chrome-for-testing") {
|
|
3106
|
-
return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
|
|
3107
|
-
}
|
|
3108
|
-
return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-headless-shell-linux-arm64.zip`;
|
|
3109
|
-
}
|
|
3110
|
-
if (chromeMode === "headless-shell") {
|
|
3111
|
-
return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-headless-shell-${platform2}.zip`;
|
|
3112
|
-
}
|
|
3113
|
-
return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/chrome-${platform2}.zip`;
|
|
3114
|
-
}
|
|
3115
|
-
var mkdirAsync = fs3.promises.mkdir;
|
|
3116
|
-
var unlinkAsync = promisify(fs3.unlink.bind(fs3));
|
|
3117
|
-
function existsAsync(filePath) {
|
|
3118
|
-
return new Promise((resolve2) => {
|
|
3119
|
-
fs3.access(filePath, (err) => {
|
|
3120
|
-
return resolve2(!err);
|
|
3121
|
-
});
|
|
3122
|
-
});
|
|
3123
|
-
}
|
|
3124
|
-
var getPlatform = () => {
|
|
3125
|
-
const platform2 = os.platform();
|
|
3126
|
-
switch (platform2) {
|
|
3127
|
-
case "darwin":
|
|
3128
|
-
return os.arch() === "arm64" ? "mac-arm64" : "mac-x64";
|
|
3129
|
-
case "linux":
|
|
3130
|
-
return os.arch() === "arm64" ? "linux-arm64" : "linux64";
|
|
3131
|
-
case "win32":
|
|
3132
|
-
return "win64";
|
|
3133
|
-
default:
|
|
3134
|
-
throw new Error("Unsupported platform: " + platform2);
|
|
3135
|
-
}
|
|
3136
|
-
};
|
|
3137
|
-
var getDownloadsFolder = (chromeMode) => {
|
|
3138
|
-
const destination = chromeMode === "headless-shell" ? "chrome-headless-shell" : "chrome-for-testing";
|
|
3139
|
-
return path3.join(getDownloadsCacheDir(), destination);
|
|
3140
|
-
};
|
|
3141
|
-
var downloadBrowser = async ({
|
|
3142
|
-
logLevel,
|
|
3143
|
-
indent,
|
|
3144
|
-
onProgress,
|
|
3145
|
-
version,
|
|
3146
|
-
chromeMode
|
|
3147
|
-
}) => {
|
|
3148
|
-
const platform2 = getPlatform();
|
|
3149
|
-
const downloadURL = getChromeDownloadUrl({ platform: platform2, version, chromeMode });
|
|
3150
|
-
const fileName = downloadURL.split("/").pop();
|
|
3151
|
-
if (!fileName) {
|
|
3152
|
-
throw new Error(`A malformed download URL was found: ${downloadURL}.`);
|
|
3153
|
-
}
|
|
3154
|
-
const downloadsFolder = getDownloadsFolder(chromeMode);
|
|
3155
|
-
const archivePath = path3.join(downloadsFolder, fileName);
|
|
3156
|
-
const outputPath = getFolderPath(downloadsFolder, platform2);
|
|
3157
|
-
if (await existsAsync(outputPath)) {
|
|
3158
|
-
return getRevisionInfo(chromeMode);
|
|
3159
|
-
}
|
|
3160
|
-
if (!await existsAsync(downloadsFolder)) {
|
|
3161
|
-
await mkdirAsync(downloadsFolder, {
|
|
3162
|
-
recursive: true
|
|
3163
|
-
});
|
|
3164
|
-
}
|
|
3165
|
-
if (os.platform() !== "darwin" && os.platform() !== "linux" && os.arch() === "arm64") {
|
|
3166
|
-
throw new Error([
|
|
3167
|
-
"Chrome Headless Shell is not available for Windows for arm64 architecture."
|
|
3168
|
-
].join(`
|
|
3169
|
-
`));
|
|
3170
|
-
}
|
|
3171
|
-
try {
|
|
3172
|
-
await downloadFile({
|
|
3173
|
-
url: downloadURL,
|
|
3174
|
-
to: () => archivePath,
|
|
3175
|
-
onProgress: (progress) => {
|
|
3176
|
-
if (progress.totalSize === null || progress.percent === null) {
|
|
3177
|
-
throw new Error("Expected totalSize and percent to be defined");
|
|
3178
|
-
}
|
|
3179
|
-
onProgress({
|
|
3180
|
-
downloadedBytes: progress.downloaded,
|
|
3181
|
-
totalSizeInBytes: progress.totalSize,
|
|
3182
|
-
percent: progress.percent
|
|
3183
|
-
});
|
|
3184
|
-
},
|
|
3185
|
-
indent,
|
|
3186
|
-
logLevel
|
|
3187
|
-
});
|
|
3188
|
-
await import_extract_zip.default(archivePath, { dir: outputPath });
|
|
3189
|
-
const chromePath = path3.join(outputPath, "chrome-linux", "chrome");
|
|
3190
|
-
const chromeHeadlessShellPath = path3.join(outputPath, "chrome-linux", "chrome-headless-shell");
|
|
3191
|
-
if (fs3.existsSync(chromePath)) {
|
|
3192
|
-
fs3.renameSync(chromePath, chromeHeadlessShellPath);
|
|
3193
|
-
}
|
|
3194
|
-
const chromeLinuxFolder = path3.join(outputPath, "chrome-linux");
|
|
3195
|
-
if (fs3.existsSync(chromeLinuxFolder)) {
|
|
3196
|
-
fs3.renameSync(chromeLinuxFolder, path3.join(outputPath, "chrome-headless-shell-linux-arm64"));
|
|
3197
|
-
}
|
|
3198
|
-
} catch (err) {
|
|
3199
|
-
return Promise.reject(err);
|
|
3200
|
-
} finally {
|
|
3201
|
-
if (await existsAsync(archivePath)) {
|
|
3202
|
-
await unlinkAsync(archivePath);
|
|
3203
|
-
}
|
|
3204
|
-
}
|
|
3205
|
-
const revisionInfo = getRevisionInfo(chromeMode);
|
|
3206
|
-
makeFileExecutableIfItIsNot(revisionInfo.executablePath);
|
|
3207
|
-
return revisionInfo;
|
|
3208
|
-
};
|
|
3209
|
-
var getFolderPath = (downloadsFolder, platform2) => {
|
|
3210
|
-
return path3.resolve(downloadsFolder, platform2);
|
|
3211
|
-
};
|
|
3212
|
-
var getExecutablePath = (chromeMode) => {
|
|
3213
|
-
const downloadsFolder = getDownloadsFolder(chromeMode);
|
|
3214
|
-
const platform2 = getPlatform();
|
|
3215
|
-
const folderPath = getFolderPath(downloadsFolder, platform2);
|
|
3216
|
-
if (chromeMode === "chrome-for-testing") {
|
|
3217
|
-
if (platform2 === "mac-arm64" || platform2 === "mac-x64") {
|
|
3218
|
-
return path3.join(folderPath, `chrome-${platform2}`, "Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing");
|
|
3219
|
-
}
|
|
3220
|
-
if (platform2 === "win64") {
|
|
3221
|
-
return path3.join(folderPath, "chrome-win64", "chrome.exe");
|
|
3222
|
-
}
|
|
3223
|
-
if (platform2 === "linux64" || platform2 === "linux-arm64") {
|
|
3224
|
-
return path3.join(folderPath, "chrome-linux64", "chrome");
|
|
3225
|
-
}
|
|
3226
|
-
throw new Error("unsupported platform" + platform2);
|
|
3227
|
-
}
|
|
3228
|
-
if (chromeMode === "headless-shell") {
|
|
3229
|
-
return path3.join(folderPath, `chrome-headless-shell-${platform2}`, platform2 === "win64" ? "chrome-headless-shell.exe" : platform2 === "linux-arm64" ? "headless_shell" : "chrome-headless-shell");
|
|
3230
|
-
}
|
|
3231
|
-
throw new Error("unsupported chrome mode" + chromeMode);
|
|
3232
|
-
};
|
|
3233
|
-
var getRevisionInfo = (chromeMode) => {
|
|
3234
|
-
const executablePath = getExecutablePath(chromeMode);
|
|
3235
|
-
const downloadsFolder = getDownloadsFolder(chromeMode);
|
|
3236
|
-
const platform2 = getPlatform();
|
|
3237
|
-
const folderPath = getFolderPath(downloadsFolder, platform2);
|
|
3238
|
-
const url = getChromeDownloadUrl({ platform: platform2, version: null, chromeMode });
|
|
3239
|
-
const local = fs3.existsSync(folderPath);
|
|
3240
|
-
return {
|
|
3241
|
-
executablePath,
|
|
3242
|
-
folderPath,
|
|
3243
|
-
local,
|
|
3244
|
-
url
|
|
3245
|
-
};
|
|
3246
|
-
};
|
|
3247
|
-
|
|
3248
|
-
// src/to-megabytes.ts
|
|
3249
|
-
function toMegabytes(bytes) {
|
|
3250
|
-
const mb = bytes / 1024 / 1024;
|
|
3251
|
-
return `${Math.round(mb * 10) / 10} Mb`;
|
|
3252
|
-
}
|
|
3253
|
-
|
|
3254
|
-
// src/browser/browser-download-progress-bar.ts
|
|
3255
|
-
var defaultBrowserDownloadProgress = ({
|
|
3256
|
-
indent,
|
|
3257
|
-
logLevel,
|
|
3258
|
-
api
|
|
3259
|
-
}) => ({ chromeMode }) => {
|
|
3260
|
-
if (chromeMode === "chrome-for-testing") {
|
|
3261
|
-
Log.info({ indent, logLevel }, "Downloading Chrome for Testing https://www.remotion.dev/chrome-for-testing");
|
|
3262
|
-
} else {
|
|
3263
|
-
Log.info({ indent, logLevel }, "Downloading Chrome Headless Shell https://www.remotion.dev/chrome-headless-shell");
|
|
3264
|
-
}
|
|
3265
|
-
Log.info({ indent, logLevel }, `Customize this behavior by adding a onBrowserDownload function to ${api}.`);
|
|
3266
|
-
let lastProgress = 0;
|
|
3267
|
-
return {
|
|
3268
|
-
onProgress: (progress) => {
|
|
3269
|
-
if (progress.downloadedBytes > lastProgress + 1e7 || progress.percent === 1) {
|
|
3270
|
-
lastProgress = progress.downloadedBytes;
|
|
3271
|
-
if (chromeMode === "chrome-for-testing") {
|
|
3272
|
-
Log.info({ indent, logLevel }, `Downloading Chrome for Testing - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
|
|
3273
|
-
} else {
|
|
3274
|
-
Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
|
|
3275
|
-
}
|
|
3276
|
-
}
|
|
3277
|
-
},
|
|
3278
|
-
version: null
|
|
3279
|
-
};
|
|
3280
|
-
};
|
|
3281
|
-
|
|
3282
|
-
// src/ensure-browser.ts
|
|
3283
|
-
var currentEnsureBrowserOperation = Promise.resolve();
|
|
3284
|
-
var internalEnsureBrowserUncapped = async ({
|
|
3285
|
-
indent,
|
|
3286
|
-
logLevel,
|
|
3287
|
-
browserExecutable,
|
|
3288
|
-
onBrowserDownload,
|
|
3289
|
-
chromeMode
|
|
3290
|
-
}) => {
|
|
3291
|
-
const status = getBrowserStatus({ browserExecutable, chromeMode });
|
|
3292
|
-
if (status.type === "no-browser") {
|
|
3293
|
-
const { onProgress, version } = onBrowserDownload({ chromeMode });
|
|
3294
|
-
await downloadBrowser({ indent, logLevel, onProgress, version, chromeMode });
|
|
3295
|
-
}
|
|
3296
|
-
const newStatus = getBrowserStatus({ browserExecutable, chromeMode });
|
|
3297
|
-
return newStatus;
|
|
3298
|
-
};
|
|
3299
|
-
var internalEnsureBrowser = (options) => {
|
|
3300
|
-
currentEnsureBrowserOperation = currentEnsureBrowserOperation.then(() => internalEnsureBrowserUncapped(options));
|
|
3301
|
-
return currentEnsureBrowserOperation;
|
|
3302
|
-
};
|
|
3303
|
-
var getBrowserStatus = ({
|
|
3304
|
-
browserExecutable,
|
|
3305
|
-
chromeMode
|
|
3306
|
-
}) => {
|
|
3307
|
-
if (browserExecutable) {
|
|
3308
|
-
if (!fs4.existsSync(browserExecutable)) {
|
|
3309
|
-
throw new Error(`"browserExecutable" was specified as '${browserExecutable}' but the path doesn't exist. Pass "null" for "browserExecutable" to download a browser automatically.`);
|
|
3310
|
-
}
|
|
3311
|
-
return { path: browserExecutable, type: "user-defined-path" };
|
|
3312
|
-
}
|
|
3313
|
-
const revision = getRevisionInfo(chromeMode);
|
|
3314
|
-
if (revision.local && fs4.existsSync(revision.executablePath)) {
|
|
3315
|
-
return { path: revision.executablePath, type: "local-puppeteer-browser" };
|
|
3316
|
-
}
|
|
3317
|
-
return { type: "no-browser" };
|
|
3318
|
-
};
|
|
3319
|
-
var ensureBrowser = (options) => {
|
|
3320
|
-
const indent = false;
|
|
3321
|
-
const logLevel = options?.logLevel ?? "info";
|
|
3322
|
-
return internalEnsureBrowser({
|
|
3323
|
-
browserExecutable: options?.browserExecutable ?? null,
|
|
3324
|
-
indent,
|
|
3325
|
-
logLevel: options?.logLevel ?? "info",
|
|
3326
|
-
onBrowserDownload: options?.onBrowserDownload ?? defaultBrowserDownloadProgress({
|
|
3327
|
-
api: "ensureBrowser()",
|
|
3328
|
-
indent: false,
|
|
3329
|
-
logLevel
|
|
3330
|
-
}),
|
|
3331
|
-
chromeMode: options?.chromeMode ?? "headless-shell"
|
|
3332
|
-
});
|
|
3333
|
-
};
|
|
3334
|
-
export {
|
|
3335
|
-
internalEnsureBrowser,
|
|
3336
|
-
ensureBrowser
|
|
3337
|
-
};
|