@samchon/ts-patch 3.2.2-dev.20241204-2 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +371 -0
- package/.gitattributes +2 -0
- package/.github/FUNDING.yml +1 -0
- package/.github/workflows/build.yml +49 -0
- package/.github/workflows/publish.yml +47 -0
- package/.idea/codeStyles/Project.xml +28 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/compiler.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +98 -0
- package/.idea/jsonSchemas.xml +28 -0
- package/.idea/misc.xml +9 -0
- package/.idea/modules.xml +8 -0
- package/.idea/ts-patch.iml +22 -0
- package/.idea/vcs.xml +12 -0
- package/.idea/webResources.xml +15 -0
- package/CHANGELOG.md +7 -0
- package/dist/CHANGELOG.md +275 -0
- package/dist/LICENSE.md +13 -0
- package/dist/README.md +348 -0
- package/dist/actions/check.js +53 -0
- package/dist/actions/check.js.map +1 -0
- package/dist/actions/patch.js +88 -0
- package/dist/actions/patch.js.map +1 -0
- package/dist/actions/unpatch.js +87 -0
- package/dist/actions/unpatch.js.map +1 -0
- package/dist/bin/ts-patch.js +43 -0
- package/dist/bin/ts-patch.js.map +1 -0
- package/dist/cli/cli.js +106 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/commands.js +49 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/config.js +50 -0
- package/dist/config.js.map +1 -0
- package/dist/module/module-file.d.ts +10 -0
- package/dist/module/module-file.js +102 -0
- package/dist/module/module-file.js.map +1 -0
- package/dist/module/ts-module.d.ts +40 -0
- package/dist/module/ts-module.js +131 -0
- package/dist/module/ts-module.js.map +1 -0
- package/dist/node_modules/.bin/resolve +15 -0
- package/dist/node_modules/.bin/resolve.cmd +7 -0
- package/dist/node_modules/.bin/semver +15 -0
- package/dist/node_modules/.bin/semver.cmd +7 -0
- package/dist/package.json +106 -0
- package/dist/patch/get-patched-source.js +69 -0
- package/dist/patch/get-patched-source.js.map +1 -0
- package/dist/patch/transformers/fix-ts-early-return.js +61 -0
- package/dist/patch/transformers/fix-ts-early-return.js.map +1 -0
- package/dist/resources/module-patch.js +623 -0
- package/dist/system/cache.js +79 -0
- package/dist/system/cache.js.map +1 -0
- package/dist/utils/file-utils.js +98 -0
- package/dist/utils/file-utils.js.map +1 -0
- package/jest.config.ts +26 -0
- package/package.json +60 -11
- package/projects/core/plugin.ts +42 -0
- package/projects/core/resolver-hook.js +55 -0
- package/projects/core/shared/plugin-types.ts +159 -0
- package/projects/core/src/actions/check.ts +79 -0
- package/projects/core/src/actions/index.ts +5 -0
- package/projects/core/src/actions/install.ts +23 -0
- package/projects/core/src/actions/patch.ts +110 -0
- package/projects/core/src/actions/uninstall.ts +24 -0
- package/projects/core/src/actions/unpatch.ts +109 -0
- package/projects/core/src/bin/ts-patch.ts +7 -0
- package/projects/core/src/bin/tspc.ts +12 -0
- package/projects/core/src/cli/cli.ts +94 -0
- package/projects/core/src/cli/commands.ts +55 -0
- package/projects/core/src/cli/help-menu.ts +48 -0
- package/projects/core/src/cli/options.ts +83 -0
- package/projects/core/src/compiler/package.json +4 -0
- package/projects/core/src/compiler/tsc.js +19 -0
- package/projects/core/src/compiler/tsserver.js +19 -0
- package/projects/core/src/compiler/tsserverlibrary.js +19 -0
- package/projects/core/src/compiler/typescript.js +19 -0
- package/projects/core/src/config.ts +65 -0
- package/projects/core/src/index.ts +4 -0
- package/projects/core/src/module/get-live-module.ts +25 -0
- package/projects/core/src/module/index.ts +4 -0
- package/projects/core/src/module/module-file.ts +127 -0
- package/projects/core/src/module/module-source.ts +59 -0
- package/projects/core/src/module/source-section.ts +110 -0
- package/projects/core/src/module/ts-module.ts +187 -0
- package/projects/core/src/options.ts +55 -0
- package/projects/core/src/patch/get-patched-source.ts +85 -0
- package/projects/core/src/patch/patch-detail.ts +106 -0
- package/projects/core/src/patch/patch-module.ts +213 -0
- package/projects/core/src/patch/transformers/add-original-create-program.ts +129 -0
- package/projects/core/src/patch/transformers/fix-ts-early-return.ts +46 -0
- package/projects/core/src/patch/transformers/hook-tsc-exec.ts +52 -0
- package/projects/core/src/patch/transformers/index.ts +6 -0
- package/projects/core/src/patch/transformers/merge-statements.ts +61 -0
- package/projects/core/src/patch/transformers/patch-create-program.ts +68 -0
- package/projects/core/src/patch/transformers/patch-emitter.ts +75 -0
- package/projects/core/src/slice/module-slice.ts +59 -0
- package/projects/core/src/slice/ts54.ts +79 -0
- package/projects/core/src/slice/ts55.ts +80 -0
- package/projects/core/src/slice/ts552.ts +80 -0
- package/projects/core/src/system/cache.ts +48 -0
- package/projects/core/src/system/errors.ts +39 -0
- package/projects/core/src/system/index.ts +4 -0
- package/projects/core/src/system/logger.ts +53 -0
- package/projects/core/src/system/types.ts +11 -0
- package/projects/core/src/ts-package.ts +99 -0
- package/projects/core/src/utils/file-utils.ts +104 -0
- package/projects/core/src/utils/find-cache-dir.ts +122 -0
- package/projects/core/src/utils/general.ts +24 -0
- package/projects/core/src/utils/index.ts +3 -0
- package/projects/core/tsconfig.json +20 -0
- package/projects/patch/package.json +8 -0
- package/projects/patch/plugin.ts +128 -0
- package/projects/patch/src/plugin/esm-intercept.ts +141 -0
- package/projects/patch/src/plugin/plugin-creator.ts +254 -0
- package/projects/patch/src/plugin/plugin.ts +193 -0
- package/projects/patch/src/plugin/register-plugin.ts +141 -0
- package/projects/patch/src/shared.ts +59 -0
- package/projects/patch/src/ts/create-program.ts +156 -0
- package/projects/patch/src/ts/shim.ts +43 -0
- package/projects/patch/src/types/plugin-types.ts +51 -0
- package/projects/patch/src/types/typescript.ts +11 -0
- package/projects/patch/tsconfig.json +34 -0
- package/scripts/postbuild.js +66 -0
- package/test/.yarnrc +1 -0
- package/test/assets/projects/main/package.json +5 -0
- package/test/assets/projects/main/src/index.ts +0 -0
- package/test/assets/projects/main/tsconfig.json +16 -0
- package/test/assets/projects/package-config/plugin/package.json +8 -0
- package/test/assets/projects/package-config/plugin/plugin.js +9 -0
- package/test/assets/projects/package-config/plugin/transformers/transformer1.js +28 -0
- package/test/assets/projects/package-config/plugin/transformers/transformer2.js +22 -0
- package/test/assets/projects/package-config/run-transform.js +72 -0
- package/test/assets/projects/package-config/src/index.ts +6 -0
- package/test/assets/projects/package-config/tsconfig.json +13 -0
- package/test/assets/projects/path-mapping/base.ts +1 -0
- package/test/assets/projects/path-mapping/package.json +8 -0
- package/test/assets/projects/path-mapping/src/a/a.ts +1 -0
- package/test/assets/projects/path-mapping/src/b.ts +1 -0
- package/test/assets/projects/path-mapping/src/index.ts +29 -0
- package/test/assets/projects/path-mapping/tsconfig.json +18 -0
- package/test/assets/projects/path-mapping/tsconfig.plugin.json +15 -0
- package/test/assets/projects/transform/package.json +9 -0
- package/test/assets/projects/transform/run-transform.js +56 -0
- package/test/assets/projects/transform/src/index.ts +4 -0
- package/test/assets/projects/transform/transformers/cjs/js-plugin.cjs +19 -0
- package/test/assets/projects/transform/transformers/cjs/package.json +3 -0
- package/test/assets/projects/transform/transformers/cjs/plugin.cts +17 -0
- package/test/assets/projects/transform/transformers/cjs/tsconfig.json +7 -0
- package/test/assets/projects/transform/transformers/esm/js-plugin.mjs +17 -0
- package/test/assets/projects/transform/transformers/esm/package.json +3 -0
- package/test/assets/projects/transform/transformers/esm/plugin.mts +19 -0
- package/test/assets/projects/transform/transformers/esm/plugin.ts +19 -0
- package/test/assets/projects/transform/transformers/esm/tsconfig.json +7 -0
- package/test/assets/projects/transform/tsconfig.cjs.json +12 -0
- package/test/assets/projects/transform/tsconfig.cts.json +12 -0
- package/test/assets/projects/transform/tsconfig.json +9 -0
- package/test/assets/projects/transform/tsconfig.mjs.json +12 -0
- package/test/assets/projects/transform/tsconfig.mts.json +11 -0
- package/test/assets/projects/transform/tsconfig.ts.json +11 -0
- package/test/assets/projects/webpack/esm-plugin.mjs +5 -0
- package/test/assets/projects/webpack/esm-plugin.mts +5 -0
- package/test/assets/projects/webpack/hide-module.js +24 -0
- package/test/assets/projects/webpack/package.json +14 -0
- package/test/assets/projects/webpack/plugin.ts +7 -0
- package/test/assets/projects/webpack/src/index.ts +0 -0
- package/test/assets/projects/webpack/tsconfig.esm.json +8 -0
- package/test/assets/projects/webpack/tsconfig.esmts.json +8 -0
- package/test/assets/projects/webpack/tsconfig.json +14 -0
- package/test/assets/projects/webpack/webpack.config.js +24 -0
- package/test/node_modules/.bin/acorn +15 -0
- package/test/node_modules/.bin/acorn.cmd +7 -0
- package/test/node_modules/.bin/json5 +15 -0
- package/test/node_modules/.bin/json5.cmd +7 -0
- package/test/node_modules/.bin/node-which +15 -0
- package/test/node_modules/.bin/node-which.cmd +7 -0
- package/test/node_modules/.bin/resolve +15 -0
- package/test/node_modules/.bin/resolve.cmd +7 -0
- package/test/node_modules/.bin/semver +15 -0
- package/test/node_modules/.bin/semver.cmd +7 -0
- package/test/node_modules/.bin/ts-node +15 -0
- package/test/node_modules/.bin/ts-node-cwd +15 -0
- package/test/node_modules/.bin/ts-node-cwd.cmd +7 -0
- package/test/node_modules/.bin/ts-node-esm +15 -0
- package/test/node_modules/.bin/ts-node-esm.cmd +7 -0
- package/test/node_modules/.bin/ts-node-script +15 -0
- package/test/node_modules/.bin/ts-node-script.cmd +7 -0
- package/test/node_modules/.bin/ts-node-transpile-only +15 -0
- package/test/node_modules/.bin/ts-node-transpile-only.cmd +7 -0
- package/test/node_modules/.bin/ts-node.cmd +7 -0
- package/test/node_modules/.bin/ts-script +15 -0
- package/test/node_modules/.bin/ts-script.cmd +7 -0
- package/test/node_modules/.bin/tsc +15 -0
- package/test/node_modules/.bin/tsc.cmd +7 -0
- package/test/node_modules/.bin/tsserver +15 -0
- package/test/node_modules/.bin/tsserver.cmd +7 -0
- package/test/node_modules/.yarn-integrity +73 -0
- package/test/node_modules/@cspotcode/source-map-support/LICENSE.md +21 -0
- package/test/node_modules/@cspotcode/source-map-support/README.md +289 -0
- package/test/node_modules/@cspotcode/source-map-support/browser-source-map-support.js +114 -0
- package/test/node_modules/@cspotcode/source-map-support/package.json +50 -0
- package/test/node_modules/@cspotcode/source-map-support/register-hook-require.d.ts +7 -0
- package/test/node_modules/@cspotcode/source-map-support/register-hook-require.js +3 -0
- package/test/node_modules/@cspotcode/source-map-support/register.d.ts +7 -0
- package/test/node_modules/@cspotcode/source-map-support/register.js +1 -0
- package/test/node_modules/@cspotcode/source-map-support/source-map-support.d.ts +76 -0
- package/test/node_modules/@cspotcode/source-map-support/source-map-support.js +938 -0
- package/test/node_modules/@jridgewell/resolve-uri/LICENSE +19 -0
- package/test/node_modules/@jridgewell/resolve-uri/README.md +40 -0
- package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +232 -0
- package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +1 -0
- package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +240 -0
- package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +1 -0
- package/test/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +4 -0
- package/test/node_modules/@jridgewell/resolve-uri/package.json +69 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/LICENSE +19 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/README.md +264 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +423 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +6 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +464 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +6 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/package.json +63 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts +345 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +111 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/src/strings.ts +65 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts +55 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts +50 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map +1 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +50 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map +1 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts +9 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map +1 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +9 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map +1 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts +16 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map +1 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +16 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map +1 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts +7 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map +1 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +7 -0
- package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map +1 -0
- package/test/node_modules/@jridgewell/trace-mapping/LICENSE +19 -0
- package/test/node_modules/@jridgewell/trace-mapping/README.md +193 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +514 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +1 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +528 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +1 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts +8 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts +32 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts +7 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts +1 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts +2 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts +4 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +70 -0
- package/test/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +85 -0
- package/test/node_modules/@jridgewell/trace-mapping/package.json +70 -0
- package/test/node_modules/@tsconfig/node10/LICENSE +21 -0
- package/test/node_modules/@tsconfig/node10/README.md +38 -0
- package/test/node_modules/@tsconfig/node10/package.json +15 -0
- package/test/node_modules/@tsconfig/node10/tsconfig.json +14 -0
- package/test/node_modules/@tsconfig/node12/LICENSE +21 -0
- package/test/node_modules/@tsconfig/node12/README.md +40 -0
- package/test/node_modules/@tsconfig/node12/package.json +1 -0
- package/test/node_modules/@tsconfig/node12/tsconfig.json +16 -0
- package/test/node_modules/@tsconfig/node14/LICENSE +21 -0
- package/test/node_modules/@tsconfig/node14/README.md +40 -0
- package/test/node_modules/@tsconfig/node14/package.json +1 -0
- package/test/node_modules/@tsconfig/node14/tsconfig.json +16 -0
- package/test/node_modules/@tsconfig/node16/LICENSE +21 -0
- package/test/node_modules/@tsconfig/node16/README.md +40 -0
- package/test/node_modules/@tsconfig/node16/package.json +15 -0
- package/test/node_modules/@tsconfig/node16/tsconfig.json +16 -0
- package/test/node_modules/@types/fs-extra/LICENSE +21 -0
- package/test/node_modules/@types/fs-extra/README.md +16 -0
- package/test/node_modules/@types/fs-extra/index.d.ts +563 -0
- package/test/node_modules/@types/fs-extra/package.json +67 -0
- package/test/node_modules/@types/node/LICENSE +21 -0
- package/test/node_modules/@types/node/README.md +15 -0
- package/test/node_modules/@types/node/assert/strict.d.ts +105 -0
- package/test/node_modules/@types/node/assert.d.ts +955 -0
- package/test/node_modules/@types/node/async_hooks.d.ts +623 -0
- package/test/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/test/node_modules/@types/node/buffer.d.ts +1810 -0
- package/test/node_modules/@types/node/child_process.d.ts +1433 -0
- package/test/node_modules/@types/node/cluster.d.ts +486 -0
- package/test/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/test/node_modules/@types/node/console.d.ts +151 -0
- package/test/node_modules/@types/node/constants.d.ts +20 -0
- package/test/node_modules/@types/node/crypto.d.ts +4065 -0
- package/test/node_modules/@types/node/dgram.d.ts +564 -0
- package/test/node_modules/@types/node/diagnostics_channel.d.ts +576 -0
- package/test/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/test/node_modules/@types/node/dns.d.ts +922 -0
- package/test/node_modules/@types/node/domain.d.ts +166 -0
- package/test/node_modules/@types/node/events.d.ts +1047 -0
- package/test/node_modules/@types/node/fs/promises.d.ts +1329 -0
- package/test/node_modules/@types/node/fs.d.ts +4678 -0
- package/test/node_modules/@types/node/globals.d.ts +150 -0
- package/test/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/test/node_modules/@types/node/http.d.ts +2188 -0
- package/test/node_modules/@types/node/http2.d.ts +2480 -0
- package/test/node_modules/@types/node/https.d.ts +405 -0
- package/test/node_modules/@types/node/index.d.ts +115 -0
- package/test/node_modules/@types/node/inspector/promises.d.ts +41 -0
- package/test/node_modules/@types/node/inspector.d.ts +269 -0
- package/test/node_modules/@types/node/inspector.generated.d.ts +4401 -0
- package/test/node_modules/@types/node/module.d.ts +757 -0
- package/test/node_modules/@types/node/net.d.ts +933 -0
- package/test/node_modules/@types/node/os.d.ts +507 -0
- package/test/node_modules/@types/node/package.json +155 -0
- package/test/node_modules/@types/node/path/posix.d.ts +8 -0
- package/test/node_modules/@types/node/path/win32.d.ts +8 -0
- package/test/node_modules/@types/node/path.d.ts +187 -0
- package/test/node_modules/@types/node/perf_hooks.d.ts +643 -0
- package/test/node_modules/@types/node/process.d.ts +2175 -0
- package/test/node_modules/@types/node/punycode.d.ts +117 -0
- package/test/node_modules/@types/node/querystring.d.ts +152 -0
- package/test/node_modules/@types/node/quic.d.ts +910 -0
- package/test/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/test/node_modules/@types/node/readline.d.ts +542 -0
- package/test/node_modules/@types/node/repl.d.ts +415 -0
- package/test/node_modules/@types/node/sea.d.ts +162 -0
- package/test/node_modules/@types/node/sqlite.d.ts +1065 -0
- package/test/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/test/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/test/node_modules/@types/node/stream/web.d.ts +296 -0
- package/test/node_modules/@types/node/stream.d.ts +1770 -0
- package/test/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/test/node_modules/@types/node/test/reporters.d.ts +96 -0
- package/test/node_modules/@types/node/test.d.ts +2275 -0
- package/test/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/test/node_modules/@types/node/timers.d.ts +159 -0
- package/test/node_modules/@types/node/tls.d.ts +1203 -0
- package/test/node_modules/@types/node/trace_events.d.ts +197 -0
- package/test/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/test/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/test/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/test/node_modules/@types/node/ts5.6/index.d.ts +117 -0
- package/test/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/test/node_modules/@types/node/ts5.7/index.d.ts +117 -0
- package/test/node_modules/@types/node/tty.d.ts +250 -0
- package/test/node_modules/@types/node/url.d.ts +541 -0
- package/test/node_modules/@types/node/util/types.d.ts +558 -0
- package/test/node_modules/@types/node/util.d.ts +1687 -0
- package/test/node_modules/@types/node/v8.d.ts +988 -0
- package/test/node_modules/@types/node/vm.d.ts +1208 -0
- package/test/node_modules/@types/node/wasi.d.ts +202 -0
- package/test/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/test/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/test/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/test/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/test/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/test/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/test/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/test/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/test/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/test/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/test/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/test/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/test/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/test/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/test/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/test/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/test/node_modules/@types/node/worker_threads.d.ts +717 -0
- package/test/node_modules/@types/node/zlib.d.ts +682 -0
- package/test/node_modules/acorn/CHANGELOG.md +972 -0
- package/test/node_modules/acorn/LICENSE +21 -0
- package/test/node_modules/acorn/README.md +301 -0
- package/test/node_modules/acorn/bin/acorn +4 -0
- package/test/node_modules/acorn/dist/acorn.d.mts +883 -0
- package/test/node_modules/acorn/dist/acorn.d.ts +883 -0
- package/test/node_modules/acorn/dist/acorn.js +6295 -0
- package/test/node_modules/acorn/dist/acorn.mjs +6266 -0
- package/test/node_modules/acorn/dist/bin.js +90 -0
- package/test/node_modules/acorn/package.json +50 -0
- package/test/node_modules/acorn-walk/CHANGELOG.md +209 -0
- package/test/node_modules/acorn-walk/LICENSE +21 -0
- package/test/node_modules/acorn-walk/README.md +124 -0
- package/test/node_modules/acorn-walk/dist/walk.d.mts +152 -0
- package/test/node_modules/acorn-walk/dist/walk.d.ts +152 -0
- package/test/node_modules/acorn-walk/dist/walk.js +485 -0
- package/test/node_modules/acorn-walk/dist/walk.mjs +467 -0
- package/test/node_modules/acorn-walk/node_modules/.bin/acorn +15 -0
- package/test/node_modules/acorn-walk/node_modules/.bin/acorn.cmd +7 -0
- package/test/node_modules/acorn-walk/package.json +50 -0
- package/test/node_modules/ansi-regex/index.d.ts +37 -0
- package/test/node_modules/ansi-regex/index.js +10 -0
- package/test/node_modules/ansi-regex/license +9 -0
- package/test/node_modules/ansi-regex/package.json +55 -0
- package/test/node_modules/ansi-regex/readme.md +78 -0
- package/test/node_modules/ansi-styles/index.d.ts +345 -0
- package/test/node_modules/ansi-styles/index.js +163 -0
- package/test/node_modules/ansi-styles/license +9 -0
- package/test/node_modules/ansi-styles/package.json +56 -0
- package/test/node_modules/ansi-styles/readme.md +152 -0
- package/test/node_modules/arg/LICENSE.md +21 -0
- package/test/node_modules/arg/README.md +280 -0
- package/test/node_modules/arg/index.d.ts +31 -0
- package/test/node_modules/arg/index.js +144 -0
- package/test/node_modules/arg/package.json +30 -0
- package/test/node_modules/chalk/index.d.ts +415 -0
- package/test/node_modules/chalk/license +9 -0
- package/test/node_modules/chalk/package.json +68 -0
- package/test/node_modules/chalk/readme.md +341 -0
- package/test/node_modules/chalk/source/index.js +229 -0
- package/test/node_modules/chalk/source/templates.js +134 -0
- package/test/node_modules/chalk/source/util.js +39 -0
- package/test/node_modules/color-convert/CHANGELOG.md +54 -0
- package/test/node_modules/color-convert/LICENSE +21 -0
- package/test/node_modules/color-convert/README.md +68 -0
- package/test/node_modules/color-convert/conversions.js +839 -0
- package/test/node_modules/color-convert/index.js +81 -0
- package/test/node_modules/color-convert/package.json +48 -0
- package/test/node_modules/color-convert/route.js +97 -0
- package/test/node_modules/color-name/LICENSE +8 -0
- package/test/node_modules/color-name/README.md +11 -0
- package/test/node_modules/color-name/index.js +152 -0
- package/test/node_modules/color-name/package.json +28 -0
- package/test/node_modules/create-require/CHANGELOG.md +33 -0
- package/test/node_modules/create-require/LICENSE +25 -0
- package/test/node_modules/create-require/README.md +46 -0
- package/test/node_modules/create-require/create-require.d.ts +3 -0
- package/test/node_modules/create-require/create-require.js +49 -0
- package/test/node_modules/create-require/package.json +39 -0
- package/test/node_modules/diff/CONTRIBUTING.md +39 -0
- package/test/node_modules/diff/LICENSE +31 -0
- package/test/node_modules/diff/README.md +207 -0
- package/test/node_modules/diff/dist/diff.js +1548 -0
- package/test/node_modules/diff/dist/diff.min.js +1 -0
- package/test/node_modules/diff/lib/convert/dmp.js +32 -0
- package/test/node_modules/diff/lib/convert/xml.js +42 -0
- package/test/node_modules/diff/lib/diff/array.js +45 -0
- package/test/node_modules/diff/lib/diff/base.js +304 -0
- package/test/node_modules/diff/lib/diff/character.js +37 -0
- package/test/node_modules/diff/lib/diff/css.js +41 -0
- package/test/node_modules/diff/lib/diff/json.js +163 -0
- package/test/node_modules/diff/lib/diff/line.js +89 -0
- package/test/node_modules/diff/lib/diff/sentence.js +41 -0
- package/test/node_modules/diff/lib/diff/word.js +107 -0
- package/test/node_modules/diff/lib/index.es6.js +1519 -0
- package/test/node_modules/diff/lib/index.js +216 -0
- package/test/node_modules/diff/lib/patch/apply.js +243 -0
- package/test/node_modules/diff/lib/patch/create.js +247 -0
- package/test/node_modules/diff/lib/patch/merge.js +609 -0
- package/test/node_modules/diff/lib/patch/parse.js +156 -0
- package/test/node_modules/diff/lib/util/array.js +32 -0
- package/test/node_modules/diff/lib/util/distance-iterator.js +57 -0
- package/test/node_modules/diff/lib/util/params.js +24 -0
- package/test/node_modules/diff/package.json +74 -0
- package/test/node_modules/diff/release-notes.md +261 -0
- package/test/node_modules/diff/runtime.js +3 -0
- package/test/node_modules/fs-extra/LICENSE +15 -0
- package/test/node_modules/fs-extra/README.md +262 -0
- package/test/node_modules/fs-extra/lib/copy/copy-sync.js +169 -0
- package/test/node_modules/fs-extra/lib/copy/copy.js +235 -0
- package/test/node_modules/fs-extra/lib/copy/index.js +7 -0
- package/test/node_modules/fs-extra/lib/empty/index.js +39 -0
- package/test/node_modules/fs-extra/lib/ensure/file.js +69 -0
- package/test/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/test/node_modules/fs-extra/lib/ensure/link.js +64 -0
- package/test/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- package/test/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- package/test/node_modules/fs-extra/lib/ensure/symlink.js +82 -0
- package/test/node_modules/fs-extra/lib/fs/index.js +128 -0
- package/test/node_modules/fs-extra/lib/index.js +16 -0
- package/test/node_modules/fs-extra/lib/json/index.js +16 -0
- package/test/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/test/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/test/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/test/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/test/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
- package/test/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
- package/test/node_modules/fs-extra/lib/move/index.js +7 -0
- package/test/node_modules/fs-extra/lib/move/move-sync.js +54 -0
- package/test/node_modules/fs-extra/lib/move/move.js +75 -0
- package/test/node_modules/fs-extra/lib/output-file/index.js +40 -0
- package/test/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/test/node_modules/fs-extra/lib/remove/index.js +22 -0
- package/test/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
- package/test/node_modules/fs-extra/lib/util/stat.js +154 -0
- package/test/node_modules/fs-extra/lib/util/utimes.js +26 -0
- package/test/node_modules/fs-extra/package.json +67 -0
- package/test/node_modules/function-bind/.eslintrc +21 -0
- package/test/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/test/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/test/node_modules/function-bind/.nycrc +13 -0
- package/test/node_modules/function-bind/CHANGELOG.md +136 -0
- package/test/node_modules/function-bind/LICENSE +20 -0
- package/test/node_modules/function-bind/README.md +46 -0
- package/test/node_modules/function-bind/implementation.js +84 -0
- package/test/node_modules/function-bind/index.js +5 -0
- package/test/node_modules/function-bind/package.json +87 -0
- package/test/node_modules/function-bind/test/.eslintrc +9 -0
- package/test/node_modules/function-bind/test/index.js +252 -0
- package/test/node_modules/global-prefix/LICENSE +21 -0
- package/test/node_modules/global-prefix/README.md +92 -0
- package/test/node_modules/global-prefix/index.js +85 -0
- package/test/node_modules/global-prefix/node_modules/.bin/node-which +15 -0
- package/test/node_modules/global-prefix/node_modules/.bin/node-which.cmd +7 -0
- package/test/node_modules/global-prefix/package.json +49 -0
- package/test/node_modules/graceful-fs/LICENSE +15 -0
- package/test/node_modules/graceful-fs/README.md +143 -0
- package/test/node_modules/graceful-fs/clone.js +23 -0
- package/test/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/test/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/test/node_modules/graceful-fs/package.json +53 -0
- package/test/node_modules/graceful-fs/polyfills.js +355 -0
- package/test/node_modules/has-flag/index.d.ts +39 -0
- package/test/node_modules/has-flag/index.js +8 -0
- package/test/node_modules/has-flag/license +9 -0
- package/test/node_modules/has-flag/package.json +46 -0
- package/test/node_modules/has-flag/readme.md +89 -0
- package/test/node_modules/hasown/.eslintrc +5 -0
- package/test/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/test/node_modules/hasown/.nycrc +13 -0
- package/test/node_modules/hasown/CHANGELOG.md +40 -0
- package/test/node_modules/hasown/LICENSE +21 -0
- package/test/node_modules/hasown/README.md +40 -0
- package/test/node_modules/hasown/index.d.ts +3 -0
- package/test/node_modules/hasown/index.js +8 -0
- package/test/node_modules/hasown/package.json +92 -0
- package/test/node_modules/hasown/tsconfig.json +6 -0
- package/test/node_modules/ini/LICENSE +15 -0
- package/test/node_modules/ini/README.md +180 -0
- package/test/node_modules/ini/lib/ini.js +280 -0
- package/test/node_modules/ini/package.json +45 -0
- package/test/node_modules/is-core-module/.eslintrc +18 -0
- package/test/node_modules/is-core-module/.nycrc +9 -0
- package/test/node_modules/is-core-module/CHANGELOG.md +218 -0
- package/test/node_modules/is-core-module/LICENSE +20 -0
- package/test/node_modules/is-core-module/README.md +40 -0
- package/test/node_modules/is-core-module/core.json +162 -0
- package/test/node_modules/is-core-module/index.js +69 -0
- package/test/node_modules/is-core-module/package.json +76 -0
- package/test/node_modules/is-core-module/test/index.js +157 -0
- package/test/node_modules/isexe/LICENSE.md +55 -0
- package/test/node_modules/isexe/README.md +80 -0
- package/test/node_modules/isexe/dist/commonjs/index.d.ts +14 -0
- package/test/node_modules/isexe/dist/commonjs/index.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/commonjs/index.js +56 -0
- package/test/node_modules/isexe/dist/commonjs/index.js.map +1 -0
- package/test/node_modules/isexe/dist/commonjs/index.min.js +2 -0
- package/test/node_modules/isexe/dist/commonjs/index.min.js.map +7 -0
- package/test/node_modules/isexe/dist/commonjs/options.d.ts +32 -0
- package/test/node_modules/isexe/dist/commonjs/options.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/commonjs/options.js +3 -0
- package/test/node_modules/isexe/dist/commonjs/options.js.map +1 -0
- package/test/node_modules/isexe/dist/commonjs/package.json +3 -0
- package/test/node_modules/isexe/dist/commonjs/posix.d.ts +18 -0
- package/test/node_modules/isexe/dist/commonjs/posix.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/commonjs/posix.js +67 -0
- package/test/node_modules/isexe/dist/commonjs/posix.js.map +1 -0
- package/test/node_modules/isexe/dist/commonjs/win32.d.ts +18 -0
- package/test/node_modules/isexe/dist/commonjs/win32.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/commonjs/win32.js +63 -0
- package/test/node_modules/isexe/dist/commonjs/win32.js.map +1 -0
- package/test/node_modules/isexe/dist/esm/index.d.ts +14 -0
- package/test/node_modules/isexe/dist/esm/index.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/esm/index.js +16 -0
- package/test/node_modules/isexe/dist/esm/index.js.map +1 -0
- package/test/node_modules/isexe/dist/esm/index.min.js +2 -0
- package/test/node_modules/isexe/dist/esm/index.min.js.map +7 -0
- package/test/node_modules/isexe/dist/esm/options.d.ts +32 -0
- package/test/node_modules/isexe/dist/esm/options.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/esm/options.js +2 -0
- package/test/node_modules/isexe/dist/esm/options.js.map +1 -0
- package/test/node_modules/isexe/dist/esm/package.json +3 -0
- package/test/node_modules/isexe/dist/esm/posix.d.ts +18 -0
- package/test/node_modules/isexe/dist/esm/posix.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/esm/posix.js +62 -0
- package/test/node_modules/isexe/dist/esm/posix.js.map +1 -0
- package/test/node_modules/isexe/dist/esm/win32.d.ts +18 -0
- package/test/node_modules/isexe/dist/esm/win32.d.ts.map +1 -0
- package/test/node_modules/isexe/dist/esm/win32.js +58 -0
- package/test/node_modules/isexe/dist/esm/win32.js.map +1 -0
- package/test/node_modules/isexe/package.json +78 -0
- package/test/node_modules/json5/LICENSE.md +23 -0
- package/test/node_modules/json5/README.md +282 -0
- package/test/node_modules/json5/dist/index.js +1737 -0
- package/test/node_modules/json5/dist/index.min.js +1 -0
- package/test/node_modules/json5/dist/index.min.mjs +1 -0
- package/test/node_modules/json5/dist/index.mjs +1426 -0
- package/test/node_modules/json5/lib/cli.js +152 -0
- package/test/node_modules/json5/lib/index.d.ts +4 -0
- package/test/node_modules/json5/lib/index.js +9 -0
- package/test/node_modules/json5/lib/parse.d.ts +15 -0
- package/test/node_modules/json5/lib/parse.js +1114 -0
- package/test/node_modules/json5/lib/register.js +13 -0
- package/test/node_modules/json5/lib/require.js +4 -0
- package/test/node_modules/json5/lib/stringify.d.ts +89 -0
- package/test/node_modules/json5/lib/stringify.js +261 -0
- package/test/node_modules/json5/lib/unicode.d.ts +3 -0
- package/test/node_modules/json5/lib/unicode.js +4 -0
- package/test/node_modules/json5/lib/util.d.ts +5 -0
- package/test/node_modules/json5/lib/util.js +35 -0
- package/test/node_modules/json5/package.json +72 -0
- package/test/node_modules/jsonfile/LICENSE +15 -0
- package/test/node_modules/jsonfile/README.md +230 -0
- package/test/node_modules/jsonfile/index.js +88 -0
- package/test/node_modules/jsonfile/package.json +40 -0
- package/test/node_modules/jsonfile/utils.js +14 -0
- package/test/node_modules/kind-of/CHANGELOG.md +160 -0
- package/test/node_modules/kind-of/LICENSE +21 -0
- package/test/node_modules/kind-of/README.md +367 -0
- package/test/node_modules/kind-of/index.js +129 -0
- package/test/node_modules/kind-of/package.json +88 -0
- package/test/node_modules/make-error/LICENSE +5 -0
- package/test/node_modules/make-error/README.md +112 -0
- package/test/node_modules/make-error/dist/make-error.js +1 -0
- package/test/node_modules/make-error/index.d.ts +47 -0
- package/test/node_modules/make-error/index.js +151 -0
- package/test/node_modules/make-error/package.json +62 -0
- package/test/node_modules/minimist/.eslintrc +29 -0
- package/test/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/test/node_modules/minimist/.nycrc +14 -0
- package/test/node_modules/minimist/CHANGELOG.md +298 -0
- package/test/node_modules/minimist/LICENSE +18 -0
- package/test/node_modules/minimist/README.md +121 -0
- package/test/node_modules/minimist/example/parse.js +4 -0
- package/test/node_modules/minimist/index.js +263 -0
- package/test/node_modules/minimist/package.json +75 -0
- package/test/node_modules/minimist/test/all_bool.js +34 -0
- package/test/node_modules/minimist/test/bool.js +177 -0
- package/test/node_modules/minimist/test/dash.js +43 -0
- package/test/node_modules/minimist/test/default_bool.js +37 -0
- package/test/node_modules/minimist/test/dotted.js +24 -0
- package/test/node_modules/minimist/test/kv_short.js +32 -0
- package/test/node_modules/minimist/test/long.js +33 -0
- package/test/node_modules/minimist/test/num.js +38 -0
- package/test/node_modules/minimist/test/parse.js +209 -0
- package/test/node_modules/minimist/test/parse_modified.js +11 -0
- package/test/node_modules/minimist/test/proto.js +64 -0
- package/test/node_modules/minimist/test/short.js +69 -0
- package/test/node_modules/minimist/test/stop_early.js +17 -0
- package/test/node_modules/minimist/test/unknown.js +104 -0
- package/test/node_modules/minimist/test/whitespace.js +10 -0
- package/test/node_modules/path-parse/LICENSE +21 -0
- package/test/node_modules/path-parse/README.md +42 -0
- package/test/node_modules/path-parse/index.js +75 -0
- package/test/node_modules/path-parse/package.json +33 -0
- package/test/node_modules/resolve/.editorconfig +37 -0
- package/test/node_modules/resolve/.eslintrc +65 -0
- package/test/node_modules/resolve/.github/FUNDING.yml +12 -0
- package/test/node_modules/resolve/.github/INCIDENT_RESPONSE_PROCESS.md +119 -0
- package/test/node_modules/resolve/.github/THREAT_MODEL.md +74 -0
- package/test/node_modules/resolve/LICENSE +21 -0
- package/test/node_modules/resolve/SECURITY.md +11 -0
- package/test/node_modules/resolve/async.js +3 -0
- package/test/node_modules/resolve/bin/resolve +50 -0
- package/test/node_modules/resolve/example/async.js +5 -0
- package/test/node_modules/resolve/example/sync.js +3 -0
- package/test/node_modules/resolve/index.js +6 -0
- package/test/node_modules/resolve/lib/async.js +333 -0
- package/test/node_modules/resolve/lib/caller.js +8 -0
- package/test/node_modules/resolve/lib/core.js +12 -0
- package/test/node_modules/resolve/lib/core.json +162 -0
- package/test/node_modules/resolve/lib/homedir.js +24 -0
- package/test/node_modules/resolve/lib/is-core.js +5 -0
- package/test/node_modules/resolve/lib/node-modules-paths.js +45 -0
- package/test/node_modules/resolve/lib/normalize-options.js +10 -0
- package/test/node_modules/resolve/lib/sync.js +212 -0
- package/test/node_modules/resolve/package.json +75 -0
- package/test/node_modules/resolve/readme.markdown +301 -0
- package/test/node_modules/resolve/sync.js +3 -0
- package/test/node_modules/resolve/test/core.js +88 -0
- package/test/node_modules/resolve/test/dotdot/abc/index.js +2 -0
- package/test/node_modules/resolve/test/dotdot/index.js +1 -0
- package/test/node_modules/resolve/test/dotdot.js +29 -0
- package/test/node_modules/resolve/test/faulty_basedir.js +29 -0
- package/test/node_modules/resolve/test/filter.js +34 -0
- package/test/node_modules/resolve/test/filter_sync.js +33 -0
- package/test/node_modules/resolve/test/home_paths.js +127 -0
- package/test/node_modules/resolve/test/home_paths_sync.js +114 -0
- package/test/node_modules/resolve/test/mock.js +315 -0
- package/test/node_modules/resolve/test/mock_sync.js +214 -0
- package/test/node_modules/resolve/test/module_dir/xmodules/aaa/index.js +1 -0
- package/test/node_modules/resolve/test/module_dir/ymodules/aaa/index.js +1 -0
- package/test/node_modules/resolve/test/module_dir/zmodules/bbb/main.js +1 -0
- package/test/node_modules/resolve/test/module_dir/zmodules/bbb/package.json +3 -0
- package/test/node_modules/resolve/test/module_dir.js +56 -0
- package/test/node_modules/resolve/test/node-modules-paths.js +143 -0
- package/test/node_modules/resolve/test/node_path/x/aaa/index.js +1 -0
- package/test/node_modules/resolve/test/node_path/x/ccc/index.js +1 -0
- package/test/node_modules/resolve/test/node_path/y/bbb/index.js +1 -0
- package/test/node_modules/resolve/test/node_path/y/ccc/index.js +1 -0
- package/test/node_modules/resolve/test/node_path.js +70 -0
- package/test/node_modules/resolve/test/nonstring.js +9 -0
- package/test/node_modules/resolve/test/pathfilter/deep_ref/main.js +0 -0
- package/test/node_modules/resolve/test/pathfilter.js +75 -0
- package/test/node_modules/resolve/test/precedence/aaa/index.js +1 -0
- package/test/node_modules/resolve/test/precedence/aaa/main.js +1 -0
- package/test/node_modules/resolve/test/precedence/aaa.js +1 -0
- package/test/node_modules/resolve/test/precedence/bbb/main.js +1 -0
- package/test/node_modules/resolve/test/precedence/bbb.js +1 -0
- package/test/node_modules/resolve/test/precedence.js +23 -0
- package/test/node_modules/resolve/test/resolver/baz/doom.js +0 -0
- package/test/node_modules/resolve/test/resolver/baz/package.json +4 -0
- package/test/node_modules/resolve/test/resolver/baz/quux.js +1 -0
- package/test/node_modules/resolve/test/resolver/browser_field/a.js +0 -0
- package/test/node_modules/resolve/test/resolver/browser_field/b.js +0 -0
- package/test/node_modules/resolve/test/resolver/browser_field/package.json +5 -0
- package/test/node_modules/resolve/test/resolver/cup.coffee +1 -0
- package/test/node_modules/resolve/test/resolver/dot_main/index.js +1 -0
- package/test/node_modules/resolve/test/resolver/dot_main/package.json +3 -0
- package/test/node_modules/resolve/test/resolver/dot_slash_main/index.js +1 -0
- package/test/node_modules/resolve/test/resolver/dot_slash_main/package.json +3 -0
- package/test/node_modules/resolve/test/resolver/false_main/index.js +0 -0
- package/test/node_modules/resolve/test/resolver/false_main/package.json +4 -0
- package/test/node_modules/resolve/test/resolver/foo.js +1 -0
- package/test/node_modules/resolve/test/resolver/incorrect_main/index.js +2 -0
- package/test/node_modules/resolve/test/resolver/incorrect_main/package.json +3 -0
- package/test/node_modules/resolve/test/resolver/invalid_main/package.json +7 -0
- package/test/node_modules/resolve/test/resolver/mug.coffee +0 -0
- package/test/node_modules/resolve/test/resolver/mug.js +0 -0
- package/test/node_modules/resolve/test/resolver/multirepo/lerna.json +6 -0
- package/test/node_modules/resolve/test/resolver/multirepo/package.json +20 -0
- package/test/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js +35 -0
- package/test/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json +14 -0
- package/test/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js +0 -0
- package/test/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json +14 -0
- package/test/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js +26 -0
- package/test/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json +15 -0
- package/test/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js +12 -0
- package/test/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
- package/test/node_modules/resolve/test/resolver/other_path/root.js +0 -0
- package/test/node_modules/resolve/test/resolver/quux/foo/index.js +1 -0
- package/test/node_modules/resolve/test/resolver/same_names/foo/index.js +1 -0
- package/test/node_modules/resolve/test/resolver/same_names/foo.js +1 -0
- package/test/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js +0 -0
- package/test/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep +0 -0
- package/test/node_modules/resolve/test/resolver/symlinked/package/bar.js +1 -0
- package/test/node_modules/resolve/test/resolver/symlinked/package/package.json +3 -0
- package/test/node_modules/resolve/test/resolver/without_basedir/main.js +5 -0
- package/test/node_modules/resolve/test/resolver.js +597 -0
- package/test/node_modules/resolve/test/resolver_sync.js +730 -0
- package/test/node_modules/resolve/test/shadowed_core/node_modules/util/index.js +0 -0
- package/test/node_modules/resolve/test/shadowed_core.js +54 -0
- package/test/node_modules/resolve/test/subdirs.js +13 -0
- package/test/node_modules/resolve/test/symlinks.js +176 -0
- package/test/node_modules/semver/LICENSE +15 -0
- package/test/node_modules/semver/README.md +665 -0
- package/test/node_modules/semver/bin/semver.js +191 -0
- package/test/node_modules/semver/classes/comparator.js +143 -0
- package/test/node_modules/semver/classes/index.js +7 -0
- package/test/node_modules/semver/classes/range.js +557 -0
- package/test/node_modules/semver/classes/semver.js +333 -0
- package/test/node_modules/semver/functions/clean.js +8 -0
- package/test/node_modules/semver/functions/cmp.js +54 -0
- package/test/node_modules/semver/functions/coerce.js +62 -0
- package/test/node_modules/semver/functions/compare-build.js +9 -0
- package/test/node_modules/semver/functions/compare-loose.js +5 -0
- package/test/node_modules/semver/functions/compare.js +7 -0
- package/test/node_modules/semver/functions/diff.js +60 -0
- package/test/node_modules/semver/functions/eq.js +5 -0
- package/test/node_modules/semver/functions/gt.js +5 -0
- package/test/node_modules/semver/functions/gte.js +5 -0
- package/test/node_modules/semver/functions/inc.js +21 -0
- package/test/node_modules/semver/functions/lt.js +5 -0
- package/test/node_modules/semver/functions/lte.js +5 -0
- package/test/node_modules/semver/functions/major.js +5 -0
- package/test/node_modules/semver/functions/minor.js +5 -0
- package/test/node_modules/semver/functions/neq.js +5 -0
- package/test/node_modules/semver/functions/parse.js +18 -0
- package/test/node_modules/semver/functions/patch.js +5 -0
- package/test/node_modules/semver/functions/prerelease.js +8 -0
- package/test/node_modules/semver/functions/rcompare.js +5 -0
- package/test/node_modules/semver/functions/rsort.js +5 -0
- package/test/node_modules/semver/functions/satisfies.js +12 -0
- package/test/node_modules/semver/functions/sort.js +5 -0
- package/test/node_modules/semver/functions/valid.js +8 -0
- package/test/node_modules/semver/index.js +91 -0
- package/test/node_modules/semver/internal/constants.js +37 -0
- package/test/node_modules/semver/internal/debug.js +11 -0
- package/test/node_modules/semver/internal/identifiers.js +29 -0
- package/test/node_modules/semver/internal/lrucache.js +42 -0
- package/test/node_modules/semver/internal/parse-options.js +17 -0
- package/test/node_modules/semver/internal/re.js +223 -0
- package/test/node_modules/semver/package.json +78 -0
- package/test/node_modules/semver/preload.js +4 -0
- package/test/node_modules/semver/range.bnf +16 -0
- package/test/node_modules/semver/ranges/gtr.js +6 -0
- package/test/node_modules/semver/ranges/intersects.js +9 -0
- package/test/node_modules/semver/ranges/ltr.js +6 -0
- package/test/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/test/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/test/node_modules/semver/ranges/min-version.js +63 -0
- package/test/node_modules/semver/ranges/outside.js +82 -0
- package/test/node_modules/semver/ranges/simplify.js +49 -0
- package/test/node_modules/semver/ranges/subset.js +249 -0
- package/test/node_modules/semver/ranges/to-comparators.js +10 -0
- package/test/node_modules/semver/ranges/valid.js +13 -0
- package/test/node_modules/strip-ansi/index.d.ts +17 -0
- package/test/node_modules/strip-ansi/index.js +4 -0
- package/test/node_modules/strip-ansi/license +9 -0
- package/test/node_modules/strip-ansi/package.json +54 -0
- package/test/node_modules/strip-ansi/readme.md +46 -0
- package/test/node_modules/strip-bom/index.js +14 -0
- package/test/node_modules/strip-bom/license +21 -0
- package/test/node_modules/strip-bom/package.json +40 -0
- package/test/node_modules/strip-bom/readme.md +36 -0
- package/test/node_modules/supports-color/browser.js +5 -0
- package/test/node_modules/supports-color/index.js +135 -0
- package/test/node_modules/supports-color/license +9 -0
- package/test/node_modules/supports-color/package.json +53 -0
- package/test/node_modules/supports-color/readme.md +76 -0
- package/test/node_modules/supports-preserve-symlinks-flag/.eslintrc +14 -0
- package/test/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +12 -0
- package/test/node_modules/supports-preserve-symlinks-flag/.nycrc +9 -0
- package/test/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +22 -0
- package/test/node_modules/supports-preserve-symlinks-flag/LICENSE +21 -0
- package/test/node_modules/supports-preserve-symlinks-flag/README.md +42 -0
- package/test/node_modules/supports-preserve-symlinks-flag/browser.js +3 -0
- package/test/node_modules/supports-preserve-symlinks-flag/index.js +9 -0
- package/test/node_modules/supports-preserve-symlinks-flag/package.json +70 -0
- package/test/node_modules/supports-preserve-symlinks-flag/test/index.js +29 -0
- package/test/node_modules/ts-latest/LICENSE.txt +55 -0
- package/test/node_modules/ts-latest/README.md +50 -0
- package/test/node_modules/ts-latest/SECURITY.md +39 -0
- package/test/node_modules/ts-latest/ThirdPartyNoticeText.txt +193 -0
- package/test/node_modules/ts-latest/bin/tsc +2 -0
- package/test/node_modules/ts-latest/bin/tsserver +2 -0
- package/test/node_modules/ts-latest/lib/_tsc.js +134440 -0
- package/test/node_modules/ts-latest/lib/_tsserver.js +659 -0
- package/test/node_modules/ts-latest/lib/_typingsInstaller.js +222 -0
- package/test/node_modules/ts-latest/lib/cs/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/de/diagnosticMessages.generated.json +2125 -0
- package/test/node_modules/ts-latest/lib/es/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/fr/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/it/diagnosticMessages.generated.json +2125 -0
- package/test/node_modules/ts-latest/lib/ja/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/ko/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/lib.d.ts +20 -0
- package/test/node_modules/ts-latest/lib/lib.decorators.d.ts +382 -0
- package/test/node_modules/ts-latest/lib/lib.decorators.legacy.d.ts +20 -0
- package/test/node_modules/ts-latest/lib/lib.dom.asynciterable.d.ts +18 -0
- package/test/node_modules/ts-latest/lib/lib.dom.d.ts +44303 -0
- package/test/node_modules/ts-latest/lib/lib.dom.iterable.d.ts +18 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.collection.d.ts +150 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.core.d.ts +595 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.d.ts +26 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.generator.d.ts +75 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.iterable.d.ts +603 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.promise.d.ts +79 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.proxy.d.ts +126 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.reflect.d.ts +142 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.symbol.d.ts +44 -0
- package/test/node_modules/ts-latest/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/test/node_modules/ts-latest/lib/lib.es2016.array.include.d.ts +114 -0
- package/test/node_modules/ts-latest/lib/lib.es2016.d.ts +19 -0
- package/test/node_modules/ts-latest/lib/lib.es2016.full.d.ts +21 -0
- package/test/node_modules/ts-latest/lib/lib.es2016.intl.d.ts +29 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.arraybuffer.d.ts +19 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.d.ts +24 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.date.d.ts +29 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.full.d.ts +21 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.intl.d.ts +42 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.object.d.ts +47 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.sharedmemory.d.ts +133 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.string.d.ts +43 -0
- package/test/node_modules/ts-latest/lib/lib.es2017.typedarrays.d.ts +51 -0
- package/test/node_modules/ts-latest/lib/lib.es2018.asyncgenerator.d.ts +75 -0
- package/test/node_modules/ts-latest/lib/lib.es2018.asynciterable.d.ts +51 -0
- package/test/node_modules/ts-latest/lib/lib.es2018.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2018.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2018.intl.d.ts +81 -0
- package/test/node_modules/ts-latest/lib/lib.es2018.promise.d.ts +28 -0
- package/test/node_modules/ts-latest/lib/lib.es2018.regexp.d.ts +35 -0
- package/test/node_modules/ts-latest/lib/lib.es2019.array.d.ts +77 -0
- package/test/node_modules/ts-latest/lib/lib.es2019.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2019.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2019.intl.d.ts +21 -0
- package/test/node_modules/ts-latest/lib/lib.es2019.object.d.ts +31 -0
- package/test/node_modules/ts-latest/lib/lib.es2019.string.d.ts +35 -0
- package/test/node_modules/ts-latest/lib/lib.es2019.symbol.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.bigint.d.ts +763 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.d.ts +25 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.date.d.ts +40 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.intl.d.ts +472 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.number.d.ts +26 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.promise.d.ts +45 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.sharedmemory.d.ts +97 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.string.d.ts +42 -0
- package/test/node_modules/ts-latest/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/test/node_modules/ts-latest/lib/lib.es2021.d.ts +21 -0
- package/test/node_modules/ts-latest/lib/lib.es2021.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2021.intl.d.ts +164 -0
- package/test/node_modules/ts-latest/lib/lib.es2021.promise.d.ts +46 -0
- package/test/node_modules/ts-latest/lib/lib.es2021.string.d.ts +31 -0
- package/test/node_modules/ts-latest/lib/lib.es2021.weakref.d.ts +76 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.array.d.ts +119 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.d.ts +23 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.error.d.ts +73 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.intl.d.ts +143 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.object.d.ts +24 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.regexp.d.ts +37 -0
- package/test/node_modules/ts-latest/lib/lib.es2022.string.d.ts +23 -0
- package/test/node_modules/ts-latest/lib/lib.es2023.array.d.ts +922 -0
- package/test/node_modules/ts-latest/lib/lib.es2023.collection.d.ts +19 -0
- package/test/node_modules/ts-latest/lib/lib.es2023.d.ts +20 -0
- package/test/node_modules/ts-latest/lib/lib.es2023.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2023.intl.d.ts +62 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.arraybuffer.d.ts +63 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.collection.d.ts +27 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.d.ts +24 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.object.d.ts +27 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.promise.d.ts +33 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.regexp.d.ts +23 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.sharedmemory.d.ts +66 -0
- package/test/node_modules/ts-latest/lib/lib.es2024.string.d.ts +27 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.collection.d.ts +94 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.d.ts +23 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.float16.d.ts +443 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.intl.d.ts +200 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.iterator.d.ts +146 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.promise.d.ts +32 -0
- package/test/node_modules/ts-latest/lib/lib.es2025.regexp.d.ts +30 -0
- package/test/node_modules/ts-latest/lib/lib.es5.d.ts +4599 -0
- package/test/node_modules/ts-latest/lib/lib.es6.d.ts +21 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.array.d.ts +33 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.collection.d.ts +47 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.d.ts +27 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.date.d.ts +21 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.decorators.d.ts +26 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.disposable.d.ts +191 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.error.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.full.d.ts +22 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.intl.d.ts +107 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.sharedmemory.d.ts +23 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.temporal.d.ts +473 -0
- package/test/node_modules/ts-latest/lib/lib.esnext.typedarrays.d.ts +90 -0
- package/test/node_modules/ts-latest/lib/lib.scripthost.d.ts +320 -0
- package/test/node_modules/ts-latest/lib/lib.webworker.asynciterable.d.ts +18 -0
- package/test/node_modules/ts-latest/lib/lib.webworker.d.ts +14814 -0
- package/test/node_modules/ts-latest/lib/lib.webworker.importscripts.d.ts +21 -0
- package/test/node_modules/ts-latest/lib/lib.webworker.iterable.d.ts +18 -0
- package/test/node_modules/ts-latest/lib/pl/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/pt-br/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/ru/diagnosticMessages.generated.json +2125 -0
- package/test/node_modules/ts-latest/lib/tr/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/tsc.js +8 -0
- package/test/node_modules/ts-latest/lib/tsserver.js +8 -0
- package/test/node_modules/ts-latest/lib/tsserverlibrary.d.ts +17 -0
- package/test/node_modules/ts-latest/lib/tsserverlibrary.js +21 -0
- package/test/node_modules/ts-latest/lib/typesMap.json +497 -0
- package/test/node_modules/ts-latest/lib/typescript.d.ts +11448 -0
- package/test/node_modules/ts-latest/lib/typescript.js +200997 -0
- package/test/node_modules/ts-latest/lib/typingsInstaller.js +8 -0
- package/test/node_modules/ts-latest/lib/watchGuard.js +53 -0
- package/test/node_modules/ts-latest/lib/zh-cn/diagnosticMessages.generated.json +2129 -0
- package/test/node_modules/ts-latest/lib/zh-tw/diagnosticMessages.generated.json +2125 -0
- package/test/node_modules/ts-latest/package.json +119 -0
- package/test/node_modules/ts-node/LICENSE +21 -0
- package/test/node_modules/ts-node/README.md +1442 -0
- package/test/node_modules/ts-node/child-loader.mjs +8 -0
- package/test/node_modules/ts-node/dist/bin-cwd.d.ts +2 -0
- package/test/node_modules/ts-node/dist/bin-cwd.js +6 -0
- package/test/node_modules/ts-node/dist/bin-cwd.js.map +1 -0
- package/test/node_modules/ts-node/dist/bin-esm.d.ts +2 -0
- package/test/node_modules/ts-node/dist/bin-esm.js +6 -0
- package/test/node_modules/ts-node/dist/bin-esm.js.map +1 -0
- package/test/node_modules/ts-node/dist/bin-script-deprecated.d.ts +2 -0
- package/test/node_modules/ts-node/dist/bin-script-deprecated.js +7 -0
- package/test/node_modules/ts-node/dist/bin-script-deprecated.js.map +1 -0
- package/test/node_modules/ts-node/dist/bin-script.d.ts +2 -0
- package/test/node_modules/ts-node/dist/bin-script.js +6 -0
- package/test/node_modules/ts-node/dist/bin-script.js.map +1 -0
- package/test/node_modules/ts-node/dist/bin-transpile.d.ts +2 -0
- package/test/node_modules/ts-node/dist/bin-transpile.js +6 -0
- package/test/node_modules/ts-node/dist/bin-transpile.js.map +1 -0
- package/test/node_modules/ts-node/dist/bin.d.ts +11 -0
- package/test/node_modules/ts-node/dist/bin.js +581 -0
- package/test/node_modules/ts-node/dist/bin.js.map +1 -0
- package/test/node_modules/ts-node/dist/child/argv-payload.d.ts +1 -0
- package/test/node_modules/ts-node/dist/child/argv-payload.js +19 -0
- package/test/node_modules/ts-node/dist/child/argv-payload.js.map +1 -0
- package/test/node_modules/ts-node/dist/child/child-entrypoint.d.ts +1 -0
- package/test/node_modules/ts-node/dist/child/child-entrypoint.js +24 -0
- package/test/node_modules/ts-node/dist/child/child-entrypoint.js.map +1 -0
- package/test/node_modules/ts-node/dist/child/child-loader.d.ts +1 -0
- package/test/node_modules/ts-node/dist/child/child-loader.js +32 -0
- package/test/node_modules/ts-node/dist/child/child-loader.js.map +1 -0
- package/test/node_modules/ts-node/dist/child/child-require.d.ts +7 -0
- package/test/node_modules/ts-node/dist/child/child-require.js +22 -0
- package/test/node_modules/ts-node/dist/child/child-require.js.map +1 -0
- package/test/node_modules/ts-node/dist/child/spawn-child.d.ts +1 -0
- package/test/node_modules/ts-node/dist/child/spawn-child.js +49 -0
- package/test/node_modules/ts-node/dist/child/spawn-child.js.map +1 -0
- package/test/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts +1 -0
- package/test/node_modules/ts-node/dist/cjs-resolve-hooks.js +29 -0
- package/test/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +1 -0
- package/test/node_modules/ts-node/dist/configuration.d.ts +1 -0
- package/test/node_modules/ts-node/dist/configuration.js +308 -0
- package/test/node_modules/ts-node/dist/configuration.js.map +1 -0
- package/test/node_modules/ts-node/dist/esm.d.ts +53 -0
- package/test/node_modules/ts-node/dist/esm.js +228 -0
- package/test/node_modules/ts-node/dist/esm.js.map +1 -0
- package/test/node_modules/ts-node/dist/file-extensions.d.ts +1 -0
- package/test/node_modules/ts-node/dist/file-extensions.js +133 -0
- package/test/node_modules/ts-node/dist/file-extensions.js.map +1 -0
- package/test/node_modules/ts-node/dist/index.d.ts +332 -0
- package/test/node_modules/ts-node/dist/index.js +953 -0
- package/test/node_modules/ts-node/dist/index.js.map +1 -0
- package/test/node_modules/ts-node/dist/module-type-classifier.d.ts +1 -0
- package/test/node_modules/ts-node/dist/module-type-classifier.js +64 -0
- package/test/node_modules/ts-node/dist/module-type-classifier.js.map +1 -0
- package/test/node_modules/ts-node/dist/node-module-type-classifier.d.ts +1 -0
- package/test/node_modules/ts-node/dist/node-module-type-classifier.js +39 -0
- package/test/node_modules/ts-node/dist/node-module-type-classifier.js.map +1 -0
- package/test/node_modules/ts-node/dist/repl.d.ts +78 -0
- package/test/node_modules/ts-node/dist/repl.js +561 -0
- package/test/node_modules/ts-node/dist/repl.js.map +1 -0
- package/test/node_modules/ts-node/dist/resolver-functions.d.ts +1 -0
- package/test/node_modules/ts-node/dist/resolver-functions.js +143 -0
- package/test/node_modules/ts-node/dist/resolver-functions.js.map +1 -0
- package/test/node_modules/ts-node/dist/transpilers/swc.d.ts +11 -0
- package/test/node_modules/ts-node/dist/transpilers/swc.js +218 -0
- package/test/node_modules/ts-node/dist/transpilers/swc.js.map +1 -0
- package/test/node_modules/ts-node/dist/transpilers/types.d.ts +35 -0
- package/test/node_modules/ts-node/dist/transpilers/types.js +3 -0
- package/test/node_modules/ts-node/dist/transpilers/types.js.map +1 -0
- package/test/node_modules/ts-node/dist/ts-compiler-types.d.ts +63 -0
- package/test/node_modules/ts-node/dist/ts-compiler-types.js +3 -0
- package/test/node_modules/ts-node/dist/ts-compiler-types.js.map +1 -0
- package/test/node_modules/ts-node/dist/ts-internals.d.ts +6 -0
- package/test/node_modules/ts-node/dist/ts-internals.js +321 -0
- package/test/node_modules/ts-node/dist/ts-internals.js.map +1 -0
- package/test/node_modules/ts-node/dist/ts-transpile-module.d.ts +1 -0
- package/test/node_modules/ts-node/dist/ts-transpile-module.js +100 -0
- package/test/node_modules/ts-node/dist/ts-transpile-module.js.map +1 -0
- package/test/node_modules/ts-node/dist/tsconfig-schema.d.ts +13 -0
- package/test/node_modules/ts-node/dist/tsconfig-schema.js +3 -0
- package/test/node_modules/ts-node/dist/tsconfig-schema.js.map +1 -0
- package/test/node_modules/ts-node/dist/tsconfigs.d.ts +1 -0
- package/test/node_modules/ts-node/dist/tsconfigs.js +36 -0
- package/test/node_modules/ts-node/dist/tsconfigs.js.map +1 -0
- package/test/node_modules/ts-node/dist/util.d.ts +4 -0
- package/test/node_modules/ts-node/dist/util.js +175 -0
- package/test/node_modules/ts-node/dist/util.js.map +1 -0
- package/test/node_modules/ts-node/dist-raw/NODE-LICENSE.md +24 -0
- package/test/node_modules/ts-node/dist-raw/README.md +36 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-constants.js +4 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-errors.js +82 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js +89 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js +593 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js +106 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js +962 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js +44 -0
- package/test/node_modules/ts-node/dist-raw/node-internal-repl-await.js +254 -0
- package/test/node_modules/ts-node/dist-raw/node-internalBinding-fs.js +58 -0
- package/test/node_modules/ts-node/dist-raw/node-nativemodule.js +9 -0
- package/test/node_modules/ts-node/dist-raw/node-options.js +103 -0
- package/test/node_modules/ts-node/dist-raw/node-primordials.js +37 -0
- package/test/node_modules/ts-node/dist-raw/runmain-hack.js +9 -0
- package/test/node_modules/ts-node/esm/transpile-only.mjs +8 -0
- package/test/node_modules/ts-node/esm.mjs +8 -0
- package/test/node_modules/ts-node/node10/tsconfig.json +3 -0
- package/test/node_modules/ts-node/node12/tsconfig.json +3 -0
- package/test/node_modules/ts-node/node14/tsconfig.json +3 -0
- package/test/node_modules/ts-node/node16/tsconfig.json +3 -0
- package/test/node_modules/ts-node/node_modules/.bin/acorn +15 -0
- package/test/node_modules/ts-node/node_modules/.bin/acorn.cmd +7 -0
- package/test/node_modules/ts-node/package.json +182 -0
- package/test/node_modules/ts-node/register/files.js +3 -0
- package/test/node_modules/ts-node/register/index.js +1 -0
- package/test/node_modules/ts-node/register/transpile-only.js +3 -0
- package/test/node_modules/ts-node/register/type-check.js +3 -0
- package/test/node_modules/ts-node/transpilers/swc-experimental.js +1 -0
- package/test/node_modules/ts-node/transpilers/swc.js +1 -0
- package/test/node_modules/ts-node/tsconfig.schema.json +183 -0
- package/test/node_modules/ts-node/tsconfig.schemastore-schema.json +1326 -0
- package/test/node_modules/tsconfig-paths/CHANGELOG.md +407 -0
- package/test/node_modules/tsconfig-paths/LICENSE +21 -0
- package/test/node_modules/tsconfig-paths/README.md +269 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/config-loader.test.d.ts +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/config-loader.test.js +87 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/config-loader.test.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/data/match-path-data.d.ts +17 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/data/match-path-data.js +216 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/data/match-path-data.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/filesystem.test.d.ts +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/filesystem.test.js +56 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/filesystem.test.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/mapping-entry.test.d.ts +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/mapping-entry.test.js +39 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/mapping-entry.test.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-async.test.d.ts +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-async.test.js +18 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-async.test.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-sync.test.d.ts +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-sync.test.js +14 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-sync.test.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/try-path.test.d.ts +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/try-path.test.js +124 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/try-path.test.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.d.ts +1 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js +328 -0
- package/test/node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/config-loader.d.ts +33 -0
- package/test/node_modules/tsconfig-paths/lib/config-loader.js +48 -0
- package/test/node_modules/tsconfig-paths/lib/config-loader.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/filesystem.d.ts +34 -0
- package/test/node_modules/tsconfig-paths/lib/filesystem.js +61 -0
- package/test/node_modules/tsconfig-paths/lib/filesystem.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/index.d.ts +5 -0
- package/test/node_modules/tsconfig-paths/lib/index.js +15 -0
- package/test/node_modules/tsconfig-paths/lib/index.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/mapping-entry.d.ts +18 -0
- package/test/node_modules/tsconfig-paths/lib/mapping-entry.js +54 -0
- package/test/node_modules/tsconfig-paths/lib/mapping-entry.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/match-path-async.d.ts +21 -0
- package/test/node_modules/tsconfig-paths/lib/match-path-async.js +116 -0
- package/test/node_modules/tsconfig-paths/lib/match-path-async.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/match-path-sync.d.ts +32 -0
- package/test/node_modules/tsconfig-paths/lib/match-path-sync.js +91 -0
- package/test/node_modules/tsconfig-paths/lib/match-path-sync.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/register.d.ts +12 -0
- package/test/node_modules/tsconfig-paths/lib/register.js +112 -0
- package/test/node_modules/tsconfig-paths/lib/register.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/try-path.d.ts +15 -0
- package/test/node_modules/tsconfig-paths/lib/try-path.js +91 -0
- package/test/node_modules/tsconfig-paths/lib/try-path.js.map +1 -0
- package/test/node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts +28 -0
- package/test/node_modules/tsconfig-paths/lib/tsconfig-loader.js +148 -0
- package/test/node_modules/tsconfig-paths/lib/tsconfig-loader.js.map +1 -0
- package/test/node_modules/tsconfig-paths/node_modules/.bin/json5 +15 -0
- package/test/node_modules/tsconfig-paths/node_modules/.bin/json5.cmd +7 -0
- package/test/node_modules/tsconfig-paths/package.json +74 -0
- package/test/node_modules/tsconfig-paths/register.js +1 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/config-loader.test.ts +101 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/data/match-path-data.ts +230 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/filesystem.test.ts +57 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/mapping-entry.test.ts +43 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/match-path-async.test.ts +26 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/match-path-sync.test.ts +22 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/try-path.test.ts +141 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/tsconfig-loader.test.ts +428 -0
- package/test/node_modules/tsconfig-paths/src/__tests__/tsconfig-named.json +10 -0
- package/test/node_modules/tsconfig-paths/src/config-loader.ts +89 -0
- package/test/node_modules/tsconfig-paths/src/filesystem.ts +93 -0
- package/test/node_modules/tsconfig-paths/src/index.ts +24 -0
- package/test/node_modules/tsconfig-paths/src/mapping-entry.ts +65 -0
- package/test/node_modules/tsconfig-paths/src/match-path-async.ts +223 -0
- package/test/node_modules/tsconfig-paths/src/match-path-sync.ts +146 -0
- package/test/node_modules/tsconfig-paths/src/register.ts +123 -0
- package/test/node_modules/tsconfig-paths/src/try-path.ts +103 -0
- package/test/node_modules/tsconfig-paths/src/tsconfig-loader.ts +229 -0
- package/test/node_modules/undici-types/LICENSE +21 -0
- package/test/node_modules/undici-types/README.md +6 -0
- package/test/node_modules/undici-types/agent.d.ts +32 -0
- package/test/node_modules/undici-types/api.d.ts +43 -0
- package/test/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/test/node_modules/undici-types/cache-interceptor.d.ts +173 -0
- package/test/node_modules/undici-types/cache.d.ts +36 -0
- package/test/node_modules/undici-types/client-stats.d.ts +15 -0
- package/test/node_modules/undici-types/client.d.ts +108 -0
- package/test/node_modules/undici-types/connector.d.ts +34 -0
- package/test/node_modules/undici-types/content-type.d.ts +21 -0
- package/test/node_modules/undici-types/cookies.d.ts +30 -0
- package/test/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/test/node_modules/undici-types/dispatcher.d.ts +276 -0
- package/test/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/test/node_modules/undici-types/errors.d.ts +161 -0
- package/test/node_modules/undici-types/eventsource.d.ts +66 -0
- package/test/node_modules/undici-types/fetch.d.ts +211 -0
- package/test/node_modules/undici-types/formdata.d.ts +108 -0
- package/test/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/test/node_modules/undici-types/global-origin.d.ts +7 -0
- package/test/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/test/node_modules/undici-types/handlers.d.ts +15 -0
- package/test/node_modules/undici-types/header.d.ts +160 -0
- package/test/node_modules/undici-types/index.d.ts +88 -0
- package/test/node_modules/undici-types/interceptors.d.ts +73 -0
- package/test/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/test/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/test/node_modules/undici-types/mock-client.d.ts +27 -0
- package/test/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/test/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/test/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/test/node_modules/undici-types/package.json +55 -0
- package/test/node_modules/undici-types/patch.d.ts +29 -0
- package/test/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/test/node_modules/undici-types/pool.d.ts +41 -0
- package/test/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/test/node_modules/undici-types/readable.d.ts +68 -0
- package/test/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/test/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/test/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/test/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/test/node_modules/undici-types/util.d.ts +18 -0
- package/test/node_modules/undici-types/utility.d.ts +7 -0
- package/test/node_modules/undici-types/webidl.d.ts +341 -0
- package/test/node_modules/undici-types/websocket.d.ts +186 -0
- package/test/node_modules/universalify/LICENSE +20 -0
- package/test/node_modules/universalify/README.md +76 -0
- package/test/node_modules/universalify/index.js +24 -0
- package/test/node_modules/universalify/package.json +34 -0
- package/test/node_modules/v8-compile-cache-lib/CHANGELOG.md +53 -0
- package/test/node_modules/v8-compile-cache-lib/LICENSE +21 -0
- package/test/node_modules/v8-compile-cache-lib/README.md +60 -0
- package/test/node_modules/v8-compile-cache-lib/package.json +35 -0
- package/test/node_modules/v8-compile-cache-lib/v8-compile-cache.d.ts +7 -0
- package/test/node_modules/v8-compile-cache-lib/v8-compile-cache.js +391 -0
- package/test/node_modules/which/LICENSE +15 -0
- package/test/node_modules/which/README.md +51 -0
- package/test/node_modules/which/bin/which.js +52 -0
- package/test/node_modules/which/lib/index.js +111 -0
- package/test/node_modules/which/package.json +57 -0
- package/test/node_modules/yn/index.d.ts +65 -0
- package/test/node_modules/yn/index.js +33 -0
- package/test/node_modules/yn/lenient.js +105 -0
- package/test/node_modules/yn/license +9 -0
- package/test/node_modules/yn/package.json +42 -0
- package/test/node_modules/yn/readme.md +83 -0
- package/test/package.json +14 -0
- package/test/src/cleanup.ts +10 -0
- package/test/src/config.ts +35 -0
- package/test/src/perf.ts +110 -0
- package/test/src/prepare.ts +10 -0
- package/test/src/project.ts +134 -0
- package/test/src/utils/general.ts +8 -0
- package/test/tests/actions.test.ts +274 -0
- package/test/tests/package-config.test.ts +40 -0
- package/test/tests/path-mapping.test.ts +47 -0
- package/test/tests/transformer.test.ts +44 -0
- package/test/tests/webpack.test.ts +71 -0
- package/test/tsconfig.json +12 -0
- package/tsconfig.base.json +21 -0
- package/actions/check.js +0 -45
- package/actions/check.js.map +0 -1
- package/actions/patch.js +0 -82
- package/actions/patch.js.map +0 -1
- package/actions/unpatch.js +0 -82
- package/actions/unpatch.js.map +0 -1
- package/bin/ts-patch.js +0 -33
- package/bin/ts-patch.js.map +0 -1
- package/cli/cli.js +0 -96
- package/cli/cli.js.map +0 -1
- package/cli/commands.js +0 -49
- package/cli/commands.js.map +0 -1
- package/config.js +0 -50
- package/config.js.map +0 -1
- package/module/module-file.d.ts +0 -9
- package/module/module-file.js +0 -97
- package/module/module-file.js.map +0 -1
- package/module/ts-module.d.ts +0 -35
- package/module/ts-module.js +0 -100
- package/module/ts-module.js.map +0 -1
- package/patch/get-patched-source.js +0 -69
- package/patch/get-patched-source.js.map +0 -1
- package/patch/transformers/fix-ts-early-return.js +0 -51
- package/patch/transformers/fix-ts-early-return.js.map +0 -1
- package/resources/module-patch.js +0 -609
- package/system/cache.js +0 -69
- package/system/cache.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
- package/utils/file-utils.js +0 -98
- package/utils/file-utils.js.map +0 -1
- /package/{actions → dist/actions}/check.d.ts +0 -0
- /package/{actions → dist/actions}/index.d.ts +0 -0
- /package/{actions → dist/actions}/index.js +0 -0
- /package/{actions → dist/actions}/index.js.map +0 -0
- /package/{actions → dist/actions}/install.d.ts +0 -0
- /package/{actions → dist/actions}/install.js +0 -0
- /package/{actions → dist/actions}/install.js.map +0 -0
- /package/{actions → dist/actions}/patch.d.ts +0 -0
- /package/{actions → dist/actions}/uninstall.d.ts +0 -0
- /package/{actions → dist/actions}/uninstall.js +0 -0
- /package/{actions → dist/actions}/uninstall.js.map +0 -0
- /package/{actions → dist/actions}/unpatch.d.ts +0 -0
- /package/{bin → dist/bin}/ts-patch.d.ts +0 -0
- /package/{bin → dist/bin}/tspc.d.ts +0 -0
- /package/{bin → dist/bin}/tspc.js +0 -0
- /package/{bin → dist/bin}/tspc.js.map +0 -0
- /package/{cli → dist/cli}/cli.d.ts +0 -0
- /package/{cli → dist/cli}/commands.d.ts +0 -0
- /package/{cli → dist/cli}/help-menu.d.ts +0 -0
- /package/{cli → dist/cli}/help-menu.js +0 -0
- /package/{cli → dist/cli}/help-menu.js.map +0 -0
- /package/{cli → dist/cli}/options.d.ts +0 -0
- /package/{cli → dist/cli}/options.js +0 -0
- /package/{cli → dist/cli}/options.js.map +0 -0
- /package/{compiler → dist/compiler}/package.json +0 -0
- /package/{compiler → dist/compiler}/tsc.js +0 -0
- /package/{compiler → dist/compiler}/tsserver.js +0 -0
- /package/{compiler → dist/compiler}/tsserverlibrary.js +0 -0
- /package/{compiler → dist/compiler}/typescript.js +0 -0
- /package/{config.d.ts → dist/config.d.ts} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{index.js.map → dist/index.js.map} +0 -0
- /package/{module → dist/module}/get-live-module.d.ts +0 -0
- /package/{module → dist/module}/get-live-module.js +0 -0
- /package/{module → dist/module}/get-live-module.js.map +0 -0
- /package/{module → dist/module}/index.d.ts +0 -0
- /package/{module → dist/module}/index.js +0 -0
- /package/{module → dist/module}/index.js.map +0 -0
- /package/{module → dist/module}/module-source.d.ts +0 -0
- /package/{module → dist/module}/module-source.js +0 -0
- /package/{module → dist/module}/module-source.js.map +0 -0
- /package/{module → dist/module}/source-section.d.ts +0 -0
- /package/{module → dist/module}/source-section.js +0 -0
- /package/{module → dist/module}/source-section.js.map +0 -0
- /package/{options.d.ts → dist/options.d.ts} +0 -0
- /package/{options.js → dist/options.js} +0 -0
- /package/{options.js.map → dist/options.js.map} +0 -0
- /package/{patch → dist/patch}/get-patched-source.d.ts +0 -0
- /package/{patch → dist/patch}/patch-detail.d.ts +0 -0
- /package/{patch → dist/patch}/patch-detail.js +0 -0
- /package/{patch → dist/patch}/patch-detail.js.map +0 -0
- /package/{patch → dist/patch}/patch-module.d.ts +0 -0
- /package/{patch → dist/patch}/patch-module.js +0 -0
- /package/{patch → dist/patch}/patch-module.js.map +0 -0
- /package/{patch → dist/patch}/transformers/add-original-create-program.d.ts +0 -0
- /package/{patch → dist/patch}/transformers/add-original-create-program.js +0 -0
- /package/{patch → dist/patch}/transformers/add-original-create-program.js.map +0 -0
- /package/{patch → dist/patch}/transformers/fix-ts-early-return.d.ts +0 -0
- /package/{patch → dist/patch}/transformers/hook-tsc-exec.d.ts +0 -0
- /package/{patch → dist/patch}/transformers/hook-tsc-exec.js +0 -0
- /package/{patch → dist/patch}/transformers/hook-tsc-exec.js.map +0 -0
- /package/{patch → dist/patch}/transformers/index.d.ts +0 -0
- /package/{patch → dist/patch}/transformers/index.js +0 -0
- /package/{patch → dist/patch}/transformers/index.js.map +0 -0
- /package/{patch → dist/patch}/transformers/merge-statements.d.ts +0 -0
- /package/{patch → dist/patch}/transformers/merge-statements.js +0 -0
- /package/{patch → dist/patch}/transformers/merge-statements.js.map +0 -0
- /package/{patch → dist/patch}/transformers/patch-create-program.d.ts +0 -0
- /package/{patch → dist/patch}/transformers/patch-create-program.js +0 -0
- /package/{patch → dist/patch}/transformers/patch-create-program.js.map +0 -0
- /package/{patch → dist/patch}/transformers/patch-emitter.d.ts +0 -0
- /package/{patch → dist/patch}/transformers/patch-emitter.js +0 -0
- /package/{patch → dist/patch}/transformers/patch-emitter.js.map +0 -0
- /package/{plugin-types.d.ts → dist/plugin-types.d.ts} +0 -0
- /package/{plugin-types.js → dist/plugin-types.js} +0 -0
- /package/{plugin-types.js.map → dist/plugin-types.js.map} +0 -0
- /package/{resources → dist/resources}/module-patch.d.ts +0 -0
- /package/{slice → dist/slice}/module-slice.d.ts +0 -0
- /package/{slice → dist/slice}/module-slice.js +0 -0
- /package/{slice → dist/slice}/module-slice.js.map +0 -0
- /package/{slice → dist/slice}/ts54.d.ts +0 -0
- /package/{slice → dist/slice}/ts54.js +0 -0
- /package/{slice → dist/slice}/ts54.js.map +0 -0
- /package/{slice → dist/slice}/ts55.d.ts +0 -0
- /package/{slice → dist/slice}/ts55.js +0 -0
- /package/{slice → dist/slice}/ts55.js.map +0 -0
- /package/{slice → dist/slice}/ts552.d.ts +0 -0
- /package/{slice → dist/slice}/ts552.js +0 -0
- /package/{slice → dist/slice}/ts552.js.map +0 -0
- /package/{system → dist/system}/cache.d.ts +0 -0
- /package/{system → dist/system}/errors.d.ts +0 -0
- /package/{system → dist/system}/errors.js +0 -0
- /package/{system → dist/system}/errors.js.map +0 -0
- /package/{system → dist/system}/index.d.ts +0 -0
- /package/{system → dist/system}/index.js +0 -0
- /package/{system → dist/system}/index.js.map +0 -0
- /package/{system → dist/system}/logger.d.ts +0 -0
- /package/{system → dist/system}/logger.js +0 -0
- /package/{system → dist/system}/logger.js.map +0 -0
- /package/{system → dist/system}/types.d.ts +0 -0
- /package/{system → dist/system}/types.js +0 -0
- /package/{system → dist/system}/types.js.map +0 -0
- /package/{ts-package.d.ts → dist/ts-package.d.ts} +0 -0
- /package/{ts-package.js → dist/ts-package.js} +0 -0
- /package/{ts-package.js.map → dist/ts-package.js.map} +0 -0
- /package/{utils → dist/utils}/file-utils.d.ts +0 -0
- /package/{utils → dist/utils}/find-cache-dir.d.ts +0 -0
- /package/{utils → dist/utils}/find-cache-dir.js +0 -0
- /package/{utils → dist/utils}/find-cache-dir.js.map +0 -0
- /package/{utils → dist/utils}/general.d.ts +0 -0
- /package/{utils → dist/utils}/general.js +0 -0
- /package/{utils → dist/utils}/general.js.map +0 -0
- /package/{utils → dist/utils}/index.d.ts +0 -0
- /package/{utils → dist/utils}/index.js +0 -0
- /package/{utils → dist/utils}/index.js.map +0 -0
|
@@ -0,0 +1,1519 @@
|
|
|
1
|
+
function Diff() {}
|
|
2
|
+
Diff.prototype = {
|
|
3
|
+
diff: function diff(oldString, newString) {
|
|
4
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
5
|
+
var callback = options.callback;
|
|
6
|
+
|
|
7
|
+
if (typeof options === 'function') {
|
|
8
|
+
callback = options;
|
|
9
|
+
options = {};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
this.options = options;
|
|
13
|
+
var self = this;
|
|
14
|
+
|
|
15
|
+
function done(value) {
|
|
16
|
+
if (callback) {
|
|
17
|
+
setTimeout(function () {
|
|
18
|
+
callback(undefined, value);
|
|
19
|
+
}, 0);
|
|
20
|
+
return true;
|
|
21
|
+
} else {
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
} // Allow subclasses to massage the input prior to running
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
oldString = this.castInput(oldString);
|
|
28
|
+
newString = this.castInput(newString);
|
|
29
|
+
oldString = this.removeEmpty(this.tokenize(oldString));
|
|
30
|
+
newString = this.removeEmpty(this.tokenize(newString));
|
|
31
|
+
var newLen = newString.length,
|
|
32
|
+
oldLen = oldString.length;
|
|
33
|
+
var editLength = 1;
|
|
34
|
+
var maxEditLength = newLen + oldLen;
|
|
35
|
+
var bestPath = [{
|
|
36
|
+
newPos: -1,
|
|
37
|
+
components: []
|
|
38
|
+
}]; // Seed editLength = 0, i.e. the content starts with the same values
|
|
39
|
+
|
|
40
|
+
var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
|
41
|
+
|
|
42
|
+
if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
|
|
43
|
+
// Identity per the equality and tokenizer
|
|
44
|
+
return done([{
|
|
45
|
+
value: this.join(newString),
|
|
46
|
+
count: newString.length
|
|
47
|
+
}]);
|
|
48
|
+
} // Main worker method. checks all permutations of a given edit length for acceptance.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
function execEditLength() {
|
|
52
|
+
for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
|
|
53
|
+
var basePath = void 0;
|
|
54
|
+
|
|
55
|
+
var addPath = bestPath[diagonalPath - 1],
|
|
56
|
+
removePath = bestPath[diagonalPath + 1],
|
|
57
|
+
_oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
|
|
58
|
+
|
|
59
|
+
if (addPath) {
|
|
60
|
+
// No one else is going to attempt to use this value, clear it
|
|
61
|
+
bestPath[diagonalPath - 1] = undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var canAdd = addPath && addPath.newPos + 1 < newLen,
|
|
65
|
+
canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
|
|
66
|
+
|
|
67
|
+
if (!canAdd && !canRemove) {
|
|
68
|
+
// If this path is a terminal then prune
|
|
69
|
+
bestPath[diagonalPath] = undefined;
|
|
70
|
+
continue;
|
|
71
|
+
} // Select the diagonal that we want to branch from. We select the prior
|
|
72
|
+
// path whose position in the new string is the farthest from the origin
|
|
73
|
+
// and does not pass the bounds of the diff graph
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
|
|
77
|
+
basePath = clonePath(removePath);
|
|
78
|
+
self.pushComponent(basePath.components, undefined, true);
|
|
79
|
+
} else {
|
|
80
|
+
basePath = addPath; // No need to clone, we've pulled it from the list
|
|
81
|
+
|
|
82
|
+
basePath.newPos++;
|
|
83
|
+
self.pushComponent(basePath.components, true, undefined);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
_oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
|
|
87
|
+
|
|
88
|
+
if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
|
|
89
|
+
return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
|
|
90
|
+
} else {
|
|
91
|
+
// Otherwise track this path as a potential candidate and continue.
|
|
92
|
+
bestPath[diagonalPath] = basePath;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
editLength++;
|
|
97
|
+
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
|
|
98
|
+
// sync and async mode which is never fun. Loops over execEditLength until a value
|
|
99
|
+
// is produced.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
if (callback) {
|
|
103
|
+
(function exec() {
|
|
104
|
+
setTimeout(function () {
|
|
105
|
+
// This should not happen, but we want to be safe.
|
|
106
|
+
|
|
107
|
+
/* istanbul ignore next */
|
|
108
|
+
if (editLength > maxEditLength) {
|
|
109
|
+
return callback();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!execEditLength()) {
|
|
113
|
+
exec();
|
|
114
|
+
}
|
|
115
|
+
}, 0);
|
|
116
|
+
})();
|
|
117
|
+
} else {
|
|
118
|
+
while (editLength <= maxEditLength) {
|
|
119
|
+
var ret = execEditLength();
|
|
120
|
+
|
|
121
|
+
if (ret) {
|
|
122
|
+
return ret;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
pushComponent: function pushComponent(components, added, removed) {
|
|
128
|
+
var last = components[components.length - 1];
|
|
129
|
+
|
|
130
|
+
if (last && last.added === added && last.removed === removed) {
|
|
131
|
+
// We need to clone here as the component clone operation is just
|
|
132
|
+
// as shallow array clone
|
|
133
|
+
components[components.length - 1] = {
|
|
134
|
+
count: last.count + 1,
|
|
135
|
+
added: added,
|
|
136
|
+
removed: removed
|
|
137
|
+
};
|
|
138
|
+
} else {
|
|
139
|
+
components.push({
|
|
140
|
+
count: 1,
|
|
141
|
+
added: added,
|
|
142
|
+
removed: removed
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
|
147
|
+
var newLen = newString.length,
|
|
148
|
+
oldLen = oldString.length,
|
|
149
|
+
newPos = basePath.newPos,
|
|
150
|
+
oldPos = newPos - diagonalPath,
|
|
151
|
+
commonCount = 0;
|
|
152
|
+
|
|
153
|
+
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
|
154
|
+
newPos++;
|
|
155
|
+
oldPos++;
|
|
156
|
+
commonCount++;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (commonCount) {
|
|
160
|
+
basePath.components.push({
|
|
161
|
+
count: commonCount
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
basePath.newPos = newPos;
|
|
166
|
+
return oldPos;
|
|
167
|
+
},
|
|
168
|
+
equals: function equals(left, right) {
|
|
169
|
+
if (this.options.comparator) {
|
|
170
|
+
return this.options.comparator(left, right);
|
|
171
|
+
} else {
|
|
172
|
+
return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
removeEmpty: function removeEmpty(array) {
|
|
176
|
+
var ret = [];
|
|
177
|
+
|
|
178
|
+
for (var i = 0; i < array.length; i++) {
|
|
179
|
+
if (array[i]) {
|
|
180
|
+
ret.push(array[i]);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return ret;
|
|
185
|
+
},
|
|
186
|
+
castInput: function castInput(value) {
|
|
187
|
+
return value;
|
|
188
|
+
},
|
|
189
|
+
tokenize: function tokenize(value) {
|
|
190
|
+
return value.split('');
|
|
191
|
+
},
|
|
192
|
+
join: function join(chars) {
|
|
193
|
+
return chars.join('');
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
function buildValues(diff, components, newString, oldString, useLongestToken) {
|
|
198
|
+
var componentPos = 0,
|
|
199
|
+
componentLen = components.length,
|
|
200
|
+
newPos = 0,
|
|
201
|
+
oldPos = 0;
|
|
202
|
+
|
|
203
|
+
for (; componentPos < componentLen; componentPos++) {
|
|
204
|
+
var component = components[componentPos];
|
|
205
|
+
|
|
206
|
+
if (!component.removed) {
|
|
207
|
+
if (!component.added && useLongestToken) {
|
|
208
|
+
var value = newString.slice(newPos, newPos + component.count);
|
|
209
|
+
value = value.map(function (value, i) {
|
|
210
|
+
var oldValue = oldString[oldPos + i];
|
|
211
|
+
return oldValue.length > value.length ? oldValue : value;
|
|
212
|
+
});
|
|
213
|
+
component.value = diff.join(value);
|
|
214
|
+
} else {
|
|
215
|
+
component.value = diff.join(newString.slice(newPos, newPos + component.count));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
newPos += component.count; // Common case
|
|
219
|
+
|
|
220
|
+
if (!component.added) {
|
|
221
|
+
oldPos += component.count;
|
|
222
|
+
}
|
|
223
|
+
} else {
|
|
224
|
+
component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
|
|
225
|
+
oldPos += component.count; // Reverse add and remove so removes are output first to match common convention
|
|
226
|
+
// The diffing algorithm is tied to add then remove output and this is the simplest
|
|
227
|
+
// route to get the desired output with minimal overhead.
|
|
228
|
+
|
|
229
|
+
if (componentPos && components[componentPos - 1].added) {
|
|
230
|
+
var tmp = components[componentPos - 1];
|
|
231
|
+
components[componentPos - 1] = components[componentPos];
|
|
232
|
+
components[componentPos] = tmp;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
} // Special case handle for when one terminal is ignored (i.e. whitespace).
|
|
236
|
+
// For this case we merge the terminal into the prior string and drop the change.
|
|
237
|
+
// This is only available for string mode.
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
var lastComponent = components[componentLen - 1];
|
|
241
|
+
|
|
242
|
+
if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
|
|
243
|
+
components[componentLen - 2].value += lastComponent.value;
|
|
244
|
+
components.pop();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return components;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function clonePath(path) {
|
|
251
|
+
return {
|
|
252
|
+
newPos: path.newPos,
|
|
253
|
+
components: path.components.slice(0)
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
var characterDiff = new Diff();
|
|
258
|
+
function diffChars(oldStr, newStr, options) {
|
|
259
|
+
return characterDiff.diff(oldStr, newStr, options);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function generateOptions(options, defaults) {
|
|
263
|
+
if (typeof options === 'function') {
|
|
264
|
+
defaults.callback = options;
|
|
265
|
+
} else if (options) {
|
|
266
|
+
for (var name in options) {
|
|
267
|
+
/* istanbul ignore else */
|
|
268
|
+
if (options.hasOwnProperty(name)) {
|
|
269
|
+
defaults[name] = options[name];
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return defaults;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
//
|
|
278
|
+
// Ranges and exceptions:
|
|
279
|
+
// Latin-1 Supplement, 0080–00FF
|
|
280
|
+
// - U+00D7 × Multiplication sign
|
|
281
|
+
// - U+00F7 ÷ Division sign
|
|
282
|
+
// Latin Extended-A, 0100–017F
|
|
283
|
+
// Latin Extended-B, 0180–024F
|
|
284
|
+
// IPA Extensions, 0250–02AF
|
|
285
|
+
// Spacing Modifier Letters, 02B0–02FF
|
|
286
|
+
// - U+02C7 ˇ ˇ Caron
|
|
287
|
+
// - U+02D8 ˘ ˘ Breve
|
|
288
|
+
// - U+02D9 ˙ ˙ Dot Above
|
|
289
|
+
// - U+02DA ˚ ˚ Ring Above
|
|
290
|
+
// - U+02DB ˛ ˛ Ogonek
|
|
291
|
+
// - U+02DC ˜ ˜ Small Tilde
|
|
292
|
+
// - U+02DD ˝ ˝ Double Acute Accent
|
|
293
|
+
// Latin Extended Additional, 1E00–1EFF
|
|
294
|
+
|
|
295
|
+
var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
|
|
296
|
+
var reWhitespace = /\S/;
|
|
297
|
+
var wordDiff = new Diff();
|
|
298
|
+
|
|
299
|
+
wordDiff.equals = function (left, right) {
|
|
300
|
+
if (this.options.ignoreCase) {
|
|
301
|
+
left = left.toLowerCase();
|
|
302
|
+
right = right.toLowerCase();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
wordDiff.tokenize = function (value) {
|
|
309
|
+
var tokens = value.split(/(\s+|[()[\]{}'"]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
|
|
310
|
+
|
|
311
|
+
for (var i = 0; i < tokens.length - 1; i++) {
|
|
312
|
+
// If we have an empty string in the next field and we have only word chars before and after, merge
|
|
313
|
+
if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
|
|
314
|
+
tokens[i] += tokens[i + 2];
|
|
315
|
+
tokens.splice(i + 1, 2);
|
|
316
|
+
i--;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return tokens;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
function diffWords(oldStr, newStr, options) {
|
|
324
|
+
options = generateOptions(options, {
|
|
325
|
+
ignoreWhitespace: true
|
|
326
|
+
});
|
|
327
|
+
return wordDiff.diff(oldStr, newStr, options);
|
|
328
|
+
}
|
|
329
|
+
function diffWordsWithSpace(oldStr, newStr, options) {
|
|
330
|
+
return wordDiff.diff(oldStr, newStr, options);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
var lineDiff = new Diff();
|
|
334
|
+
|
|
335
|
+
lineDiff.tokenize = function (value) {
|
|
336
|
+
var retLines = [],
|
|
337
|
+
linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
|
|
338
|
+
|
|
339
|
+
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
|
|
340
|
+
linesAndNewlines.pop();
|
|
341
|
+
} // Merge the content and line separators into single tokens
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
for (var i = 0; i < linesAndNewlines.length; i++) {
|
|
345
|
+
var line = linesAndNewlines[i];
|
|
346
|
+
|
|
347
|
+
if (i % 2 && !this.options.newlineIsToken) {
|
|
348
|
+
retLines[retLines.length - 1] += line;
|
|
349
|
+
} else {
|
|
350
|
+
if (this.options.ignoreWhitespace) {
|
|
351
|
+
line = line.trim();
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
retLines.push(line);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return retLines;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
function diffLines(oldStr, newStr, callback) {
|
|
362
|
+
return lineDiff.diff(oldStr, newStr, callback);
|
|
363
|
+
}
|
|
364
|
+
function diffTrimmedLines(oldStr, newStr, callback) {
|
|
365
|
+
var options = generateOptions(callback, {
|
|
366
|
+
ignoreWhitespace: true
|
|
367
|
+
});
|
|
368
|
+
return lineDiff.diff(oldStr, newStr, options);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
var sentenceDiff = new Diff();
|
|
372
|
+
|
|
373
|
+
sentenceDiff.tokenize = function (value) {
|
|
374
|
+
return value.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
function diffSentences(oldStr, newStr, callback) {
|
|
378
|
+
return sentenceDiff.diff(oldStr, newStr, callback);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
var cssDiff = new Diff();
|
|
382
|
+
|
|
383
|
+
cssDiff.tokenize = function (value) {
|
|
384
|
+
return value.split(/([{}:;,]|\s+)/);
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
function diffCss(oldStr, newStr, callback) {
|
|
388
|
+
return cssDiff.diff(oldStr, newStr, callback);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function _typeof(obj) {
|
|
392
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
393
|
+
_typeof = function (obj) {
|
|
394
|
+
return typeof obj;
|
|
395
|
+
};
|
|
396
|
+
} else {
|
|
397
|
+
_typeof = function (obj) {
|
|
398
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return _typeof(obj);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function _toConsumableArray(arr) {
|
|
406
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function _arrayWithoutHoles(arr) {
|
|
410
|
+
if (Array.isArray(arr)) {
|
|
411
|
+
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
412
|
+
|
|
413
|
+
return arr2;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
function _iterableToArray(iter) {
|
|
418
|
+
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function _nonIterableSpread() {
|
|
422
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
var objectPrototypeToString = Object.prototype.toString;
|
|
426
|
+
var jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
|
|
427
|
+
// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
|
|
428
|
+
|
|
429
|
+
jsonDiff.useLongestToken = true;
|
|
430
|
+
jsonDiff.tokenize = lineDiff.tokenize;
|
|
431
|
+
|
|
432
|
+
jsonDiff.castInput = function (value) {
|
|
433
|
+
var _this$options = this.options,
|
|
434
|
+
undefinedReplacement = _this$options.undefinedReplacement,
|
|
435
|
+
_this$options$stringi = _this$options.stringifyReplacer,
|
|
436
|
+
stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) {
|
|
437
|
+
return typeof v === 'undefined' ? undefinedReplacement : v;
|
|
438
|
+
} : _this$options$stringi;
|
|
439
|
+
return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' ');
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
jsonDiff.equals = function (left, right) {
|
|
443
|
+
return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'));
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
function diffJson(oldObj, newObj, options) {
|
|
447
|
+
return jsonDiff.diff(oldObj, newObj, options);
|
|
448
|
+
} // This function handles the presence of circular references by bailing out when encountering an
|
|
449
|
+
// object that is already on the "stack" of items being processed. Accepts an optional replacer
|
|
450
|
+
|
|
451
|
+
function canonicalize(obj, stack, replacementStack, replacer, key) {
|
|
452
|
+
stack = stack || [];
|
|
453
|
+
replacementStack = replacementStack || [];
|
|
454
|
+
|
|
455
|
+
if (replacer) {
|
|
456
|
+
obj = replacer(key, obj);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
var i;
|
|
460
|
+
|
|
461
|
+
for (i = 0; i < stack.length; i += 1) {
|
|
462
|
+
if (stack[i] === obj) {
|
|
463
|
+
return replacementStack[i];
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
var canonicalizedObj;
|
|
468
|
+
|
|
469
|
+
if ('[object Array]' === objectPrototypeToString.call(obj)) {
|
|
470
|
+
stack.push(obj);
|
|
471
|
+
canonicalizedObj = new Array(obj.length);
|
|
472
|
+
replacementStack.push(canonicalizedObj);
|
|
473
|
+
|
|
474
|
+
for (i = 0; i < obj.length; i += 1) {
|
|
475
|
+
canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
stack.pop();
|
|
479
|
+
replacementStack.pop();
|
|
480
|
+
return canonicalizedObj;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (obj && obj.toJSON) {
|
|
484
|
+
obj = obj.toJSON();
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (_typeof(obj) === 'object' && obj !== null) {
|
|
488
|
+
stack.push(obj);
|
|
489
|
+
canonicalizedObj = {};
|
|
490
|
+
replacementStack.push(canonicalizedObj);
|
|
491
|
+
|
|
492
|
+
var sortedKeys = [],
|
|
493
|
+
_key;
|
|
494
|
+
|
|
495
|
+
for (_key in obj) {
|
|
496
|
+
/* istanbul ignore else */
|
|
497
|
+
if (obj.hasOwnProperty(_key)) {
|
|
498
|
+
sortedKeys.push(_key);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
sortedKeys.sort();
|
|
503
|
+
|
|
504
|
+
for (i = 0; i < sortedKeys.length; i += 1) {
|
|
505
|
+
_key = sortedKeys[i];
|
|
506
|
+
canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
stack.pop();
|
|
510
|
+
replacementStack.pop();
|
|
511
|
+
} else {
|
|
512
|
+
canonicalizedObj = obj;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return canonicalizedObj;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
var arrayDiff = new Diff();
|
|
519
|
+
|
|
520
|
+
arrayDiff.tokenize = function (value) {
|
|
521
|
+
return value.slice();
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
arrayDiff.join = arrayDiff.removeEmpty = function (value) {
|
|
525
|
+
return value;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
function diffArrays(oldArr, newArr, callback) {
|
|
529
|
+
return arrayDiff.diff(oldArr, newArr, callback);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
function parsePatch(uniDiff) {
|
|
533
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
534
|
+
var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
|
|
535
|
+
delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
|
|
536
|
+
list = [],
|
|
537
|
+
i = 0;
|
|
538
|
+
|
|
539
|
+
function parseIndex() {
|
|
540
|
+
var index = {};
|
|
541
|
+
list.push(index); // Parse diff metadata
|
|
542
|
+
|
|
543
|
+
while (i < diffstr.length) {
|
|
544
|
+
var line = diffstr[i]; // File header found, end parsing diff metadata
|
|
545
|
+
|
|
546
|
+
if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
|
|
547
|
+
break;
|
|
548
|
+
} // Diff index
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
var headerMatch = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
|
|
552
|
+
|
|
553
|
+
if (headerMatch) {
|
|
554
|
+
index.index = line.substring(headerMatch[0].length).trim();
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
i++;
|
|
558
|
+
} // Parse file headers if they are defined. Unified diff requires them, but
|
|
559
|
+
// there's no technical issues to have an isolated hunk without file header
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
parseFileHeader(index);
|
|
563
|
+
parseFileHeader(index); // Parse hunks
|
|
564
|
+
|
|
565
|
+
index.hunks = [];
|
|
566
|
+
|
|
567
|
+
while (i < diffstr.length) {
|
|
568
|
+
var _line = diffstr[i];
|
|
569
|
+
|
|
570
|
+
if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
|
|
571
|
+
break;
|
|
572
|
+
} else if (/^@@/.test(_line)) {
|
|
573
|
+
index.hunks.push(parseHunk());
|
|
574
|
+
} else if (_line && options.strict) {
|
|
575
|
+
// Ignore unexpected content unless in strict mode
|
|
576
|
+
throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
|
|
577
|
+
} else {
|
|
578
|
+
i++;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
} // Parses the --- and +++ headers, if none are found, no lines
|
|
582
|
+
// are consumed.
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
function parseFileHeader(index) {
|
|
586
|
+
var fileHeaderMatch = /^(---|\+\+\+)\s+/.exec(diffstr[i]);
|
|
587
|
+
|
|
588
|
+
if (fileHeaderMatch) {
|
|
589
|
+
var keyPrefix = fileHeaderMatch[1] === '---' ? 'old' : 'new';
|
|
590
|
+
var data = diffstr[i].substring(3).trim().split('\t', 2);
|
|
591
|
+
var fileName = data[0].replace(/\\\\/g, '\\');
|
|
592
|
+
|
|
593
|
+
if (fileName.startsWith('"') && fileName.endsWith('"')) {
|
|
594
|
+
fileName = fileName.substr(1, fileName.length - 2);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
index[keyPrefix + 'FileName'] = fileName;
|
|
598
|
+
index[keyPrefix + 'Header'] = (data[1] || '').trim();
|
|
599
|
+
i++;
|
|
600
|
+
}
|
|
601
|
+
} // Parses a hunk
|
|
602
|
+
// This assumes that we are at the start of a hunk.
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
function parseHunk() {
|
|
606
|
+
var chunkHeaderIndex = i,
|
|
607
|
+
chunkHeaderLine = diffstr[i++],
|
|
608
|
+
chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
|
|
609
|
+
var hunk = {
|
|
610
|
+
oldStart: +chunkHeader[1],
|
|
611
|
+
oldLines: +chunkHeader[2] || 1,
|
|
612
|
+
newStart: +chunkHeader[3],
|
|
613
|
+
newLines: +chunkHeader[4] || 1,
|
|
614
|
+
lines: [],
|
|
615
|
+
linedelimiters: []
|
|
616
|
+
};
|
|
617
|
+
var addCount = 0,
|
|
618
|
+
removeCount = 0;
|
|
619
|
+
|
|
620
|
+
for (; i < diffstr.length; i++) {
|
|
621
|
+
// Lines starting with '---' could be mistaken for the "remove line" operation
|
|
622
|
+
// But they could be the header for the next file. Therefore prune such cases out.
|
|
623
|
+
if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
|
|
628
|
+
|
|
629
|
+
if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
|
|
630
|
+
hunk.lines.push(diffstr[i]);
|
|
631
|
+
hunk.linedelimiters.push(delimiters[i] || '\n');
|
|
632
|
+
|
|
633
|
+
if (operation === '+') {
|
|
634
|
+
addCount++;
|
|
635
|
+
} else if (operation === '-') {
|
|
636
|
+
removeCount++;
|
|
637
|
+
} else if (operation === ' ') {
|
|
638
|
+
addCount++;
|
|
639
|
+
removeCount++;
|
|
640
|
+
}
|
|
641
|
+
} else {
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
} // Handle the empty block count case
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
if (!addCount && hunk.newLines === 1) {
|
|
648
|
+
hunk.newLines = 0;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
if (!removeCount && hunk.oldLines === 1) {
|
|
652
|
+
hunk.oldLines = 0;
|
|
653
|
+
} // Perform optional sanity checking
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
if (options.strict) {
|
|
657
|
+
if (addCount !== hunk.newLines) {
|
|
658
|
+
throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
if (removeCount !== hunk.oldLines) {
|
|
662
|
+
throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
return hunk;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
while (i < diffstr.length) {
|
|
670
|
+
parseIndex();
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
return list;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// Iterator that traverses in the range of [min, max], stepping
|
|
677
|
+
// by distance from a given start position. I.e. for [0, 4], with
|
|
678
|
+
// start of 2, this will iterate 2, 3, 1, 4, 0.
|
|
679
|
+
function distanceIterator (start, minLine, maxLine) {
|
|
680
|
+
var wantForward = true,
|
|
681
|
+
backwardExhausted = false,
|
|
682
|
+
forwardExhausted = false,
|
|
683
|
+
localOffset = 1;
|
|
684
|
+
return function iterator() {
|
|
685
|
+
if (wantForward && !forwardExhausted) {
|
|
686
|
+
if (backwardExhausted) {
|
|
687
|
+
localOffset++;
|
|
688
|
+
} else {
|
|
689
|
+
wantForward = false;
|
|
690
|
+
} // Check if trying to fit beyond text length, and if not, check it fits
|
|
691
|
+
// after offset location (or desired location on first iteration)
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
if (start + localOffset <= maxLine) {
|
|
695
|
+
return localOffset;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
forwardExhausted = true;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
if (!backwardExhausted) {
|
|
702
|
+
if (!forwardExhausted) {
|
|
703
|
+
wantForward = true;
|
|
704
|
+
} // Check if trying to fit before text beginning, and if not, check it fits
|
|
705
|
+
// before offset location
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
if (minLine <= start - localOffset) {
|
|
709
|
+
return -localOffset++;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
backwardExhausted = true;
|
|
713
|
+
return iterator();
|
|
714
|
+
} // We tried to fit hunk before text beginning and beyond text length, then
|
|
715
|
+
// hunk can't fit on the text. Return undefined
|
|
716
|
+
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function applyPatch(source, uniDiff) {
|
|
721
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
722
|
+
|
|
723
|
+
if (typeof uniDiff === 'string') {
|
|
724
|
+
uniDiff = parsePatch(uniDiff);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
if (Array.isArray(uniDiff)) {
|
|
728
|
+
if (uniDiff.length > 1) {
|
|
729
|
+
throw new Error('applyPatch only works with a single input.');
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
uniDiff = uniDiff[0];
|
|
733
|
+
} // Apply the diff to the input
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
|
|
737
|
+
delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
|
|
738
|
+
hunks = uniDiff.hunks,
|
|
739
|
+
compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) {
|
|
740
|
+
return line === patchContent;
|
|
741
|
+
},
|
|
742
|
+
errorCount = 0,
|
|
743
|
+
fuzzFactor = options.fuzzFactor || 0,
|
|
744
|
+
minLine = 0,
|
|
745
|
+
offset = 0,
|
|
746
|
+
removeEOFNL,
|
|
747
|
+
addEOFNL;
|
|
748
|
+
/**
|
|
749
|
+
* Checks if the hunk exactly fits on the provided location
|
|
750
|
+
*/
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
function hunkFits(hunk, toPos) {
|
|
754
|
+
for (var j = 0; j < hunk.lines.length; j++) {
|
|
755
|
+
var line = hunk.lines[j],
|
|
756
|
+
operation = line.length > 0 ? line[0] : ' ',
|
|
757
|
+
content = line.length > 0 ? line.substr(1) : line;
|
|
758
|
+
|
|
759
|
+
if (operation === ' ' || operation === '-') {
|
|
760
|
+
// Context sanity check
|
|
761
|
+
if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
|
|
762
|
+
errorCount++;
|
|
763
|
+
|
|
764
|
+
if (errorCount > fuzzFactor) {
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
toPos++;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
return true;
|
|
774
|
+
} // Search best fit offsets for each hunk based on the previous ones
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
for (var i = 0; i < hunks.length; i++) {
|
|
778
|
+
var hunk = hunks[i],
|
|
779
|
+
maxLine = lines.length - hunk.oldLines,
|
|
780
|
+
localOffset = 0,
|
|
781
|
+
toPos = offset + hunk.oldStart - 1;
|
|
782
|
+
var iterator = distanceIterator(toPos, minLine, maxLine);
|
|
783
|
+
|
|
784
|
+
for (; localOffset !== undefined; localOffset = iterator()) {
|
|
785
|
+
if (hunkFits(hunk, toPos + localOffset)) {
|
|
786
|
+
hunk.offset = offset += localOffset;
|
|
787
|
+
break;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
if (localOffset === undefined) {
|
|
792
|
+
return false;
|
|
793
|
+
} // Set lower text limit to end of the current hunk, so next ones don't try
|
|
794
|
+
// to fit over already patched text
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
|
|
798
|
+
} // Apply patch hunks
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
var diffOffset = 0;
|
|
802
|
+
|
|
803
|
+
for (var _i = 0; _i < hunks.length; _i++) {
|
|
804
|
+
var _hunk = hunks[_i],
|
|
805
|
+
_toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;
|
|
806
|
+
|
|
807
|
+
diffOffset += _hunk.newLines - _hunk.oldLines;
|
|
808
|
+
|
|
809
|
+
if (_toPos < 0) {
|
|
810
|
+
// Creating a new file
|
|
811
|
+
_toPos = 0;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
for (var j = 0; j < _hunk.lines.length; j++) {
|
|
815
|
+
var line = _hunk.lines[j],
|
|
816
|
+
operation = line.length > 0 ? line[0] : ' ',
|
|
817
|
+
content = line.length > 0 ? line.substr(1) : line,
|
|
818
|
+
delimiter = _hunk.linedelimiters[j];
|
|
819
|
+
|
|
820
|
+
if (operation === ' ') {
|
|
821
|
+
_toPos++;
|
|
822
|
+
} else if (operation === '-') {
|
|
823
|
+
lines.splice(_toPos, 1);
|
|
824
|
+
delimiters.splice(_toPos, 1);
|
|
825
|
+
/* istanbul ignore else */
|
|
826
|
+
} else if (operation === '+') {
|
|
827
|
+
lines.splice(_toPos, 0, content);
|
|
828
|
+
delimiters.splice(_toPos, 0, delimiter);
|
|
829
|
+
_toPos++;
|
|
830
|
+
} else if (operation === '\\') {
|
|
831
|
+
var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
|
|
832
|
+
|
|
833
|
+
if (previousOperation === '+') {
|
|
834
|
+
removeEOFNL = true;
|
|
835
|
+
} else if (previousOperation === '-') {
|
|
836
|
+
addEOFNL = true;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
} // Handle EOFNL insertion/removal
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
if (removeEOFNL) {
|
|
844
|
+
while (!lines[lines.length - 1]) {
|
|
845
|
+
lines.pop();
|
|
846
|
+
delimiters.pop();
|
|
847
|
+
}
|
|
848
|
+
} else if (addEOFNL) {
|
|
849
|
+
lines.push('');
|
|
850
|
+
delimiters.push('\n');
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
for (var _k = 0; _k < lines.length - 1; _k++) {
|
|
854
|
+
lines[_k] = lines[_k] + delimiters[_k];
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
return lines.join('');
|
|
858
|
+
} // Wrapper that supports multiple file patches via callbacks.
|
|
859
|
+
|
|
860
|
+
function applyPatches(uniDiff, options) {
|
|
861
|
+
if (typeof uniDiff === 'string') {
|
|
862
|
+
uniDiff = parsePatch(uniDiff);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
var currentIndex = 0;
|
|
866
|
+
|
|
867
|
+
function processIndex() {
|
|
868
|
+
var index = uniDiff[currentIndex++];
|
|
869
|
+
|
|
870
|
+
if (!index) {
|
|
871
|
+
return options.complete();
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
options.loadFile(index, function (err, data) {
|
|
875
|
+
if (err) {
|
|
876
|
+
return options.complete(err);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
var updatedContent = applyPatch(data, index, options);
|
|
880
|
+
options.patched(index, updatedContent, function (err) {
|
|
881
|
+
if (err) {
|
|
882
|
+
return options.complete(err);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
processIndex();
|
|
886
|
+
});
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
processIndex();
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
|
894
|
+
if (!options) {
|
|
895
|
+
options = {};
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
if (typeof options.context === 'undefined') {
|
|
899
|
+
options.context = 4;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
var diff = diffLines(oldStr, newStr, options);
|
|
903
|
+
diff.push({
|
|
904
|
+
value: '',
|
|
905
|
+
lines: []
|
|
906
|
+
}); // Append an empty value to make cleanup easier
|
|
907
|
+
|
|
908
|
+
function contextLines(lines) {
|
|
909
|
+
return lines.map(function (entry) {
|
|
910
|
+
return ' ' + entry;
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
var hunks = [];
|
|
915
|
+
var oldRangeStart = 0,
|
|
916
|
+
newRangeStart = 0,
|
|
917
|
+
curRange = [],
|
|
918
|
+
oldLine = 1,
|
|
919
|
+
newLine = 1;
|
|
920
|
+
|
|
921
|
+
var _loop = function _loop(i) {
|
|
922
|
+
var current = diff[i],
|
|
923
|
+
lines = current.lines || current.value.replace(/\n$/, '').split('\n');
|
|
924
|
+
current.lines = lines;
|
|
925
|
+
|
|
926
|
+
if (current.added || current.removed) {
|
|
927
|
+
var _curRange;
|
|
928
|
+
|
|
929
|
+
// If we have previous context, start with that
|
|
930
|
+
if (!oldRangeStart) {
|
|
931
|
+
var prev = diff[i - 1];
|
|
932
|
+
oldRangeStart = oldLine;
|
|
933
|
+
newRangeStart = newLine;
|
|
934
|
+
|
|
935
|
+
if (prev) {
|
|
936
|
+
curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
|
|
937
|
+
oldRangeStart -= curRange.length;
|
|
938
|
+
newRangeStart -= curRange.length;
|
|
939
|
+
}
|
|
940
|
+
} // Output our changes
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
(_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) {
|
|
944
|
+
return (current.added ? '+' : '-') + entry;
|
|
945
|
+
}))); // Track the updated file position
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
if (current.added) {
|
|
949
|
+
newLine += lines.length;
|
|
950
|
+
} else {
|
|
951
|
+
oldLine += lines.length;
|
|
952
|
+
}
|
|
953
|
+
} else {
|
|
954
|
+
// Identical context lines. Track line changes
|
|
955
|
+
if (oldRangeStart) {
|
|
956
|
+
// Close out any changes that have been output (or join overlapping)
|
|
957
|
+
if (lines.length <= options.context * 2 && i < diff.length - 2) {
|
|
958
|
+
var _curRange2;
|
|
959
|
+
|
|
960
|
+
// Overlapping
|
|
961
|
+
(_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
|
|
962
|
+
} else {
|
|
963
|
+
var _curRange3;
|
|
964
|
+
|
|
965
|
+
// end the range and output
|
|
966
|
+
var contextSize = Math.min(lines.length, options.context);
|
|
967
|
+
|
|
968
|
+
(_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
|
|
969
|
+
|
|
970
|
+
var hunk = {
|
|
971
|
+
oldStart: oldRangeStart,
|
|
972
|
+
oldLines: oldLine - oldRangeStart + contextSize,
|
|
973
|
+
newStart: newRangeStart,
|
|
974
|
+
newLines: newLine - newRangeStart + contextSize,
|
|
975
|
+
lines: curRange
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
if (i >= diff.length - 2 && lines.length <= options.context) {
|
|
979
|
+
// EOF is inside this hunk
|
|
980
|
+
var oldEOFNewline = /\n$/.test(oldStr);
|
|
981
|
+
var newEOFNewline = /\n$/.test(newStr);
|
|
982
|
+
var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
|
|
983
|
+
|
|
984
|
+
if (!oldEOFNewline && noNlBeforeAdds) {
|
|
985
|
+
// special case: old has no eol and no trailing context; no-nl can end up before adds
|
|
986
|
+
curRange.splice(hunk.oldLines, 0, '\');
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
|
|
990
|
+
curRange.push('\');
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
hunks.push(hunk);
|
|
995
|
+
oldRangeStart = 0;
|
|
996
|
+
newRangeStart = 0;
|
|
997
|
+
curRange = [];
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
oldLine += lines.length;
|
|
1002
|
+
newLine += lines.length;
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
for (var i = 0; i < diff.length; i++) {
|
|
1007
|
+
_loop(i);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
return {
|
|
1011
|
+
oldFileName: oldFileName,
|
|
1012
|
+
newFileName: newFileName,
|
|
1013
|
+
oldHeader: oldHeader,
|
|
1014
|
+
newHeader: newHeader,
|
|
1015
|
+
hunks: hunks
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
|
1019
|
+
var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
|
|
1020
|
+
var ret = [];
|
|
1021
|
+
|
|
1022
|
+
if (oldFileName == newFileName) {
|
|
1023
|
+
ret.push('Index: ' + oldFileName);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
ret.push('===================================================================');
|
|
1027
|
+
ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
|
|
1028
|
+
ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
|
|
1029
|
+
|
|
1030
|
+
for (var i = 0; i < diff.hunks.length; i++) {
|
|
1031
|
+
var hunk = diff.hunks[i];
|
|
1032
|
+
ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
|
|
1033
|
+
ret.push.apply(ret, hunk.lines);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
return ret.join('\n') + '\n';
|
|
1037
|
+
}
|
|
1038
|
+
function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
|
|
1039
|
+
return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function arrayEqual(a, b) {
|
|
1043
|
+
if (a.length !== b.length) {
|
|
1044
|
+
return false;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
return arrayStartsWith(a, b);
|
|
1048
|
+
}
|
|
1049
|
+
function arrayStartsWith(array, start) {
|
|
1050
|
+
if (start.length > array.length) {
|
|
1051
|
+
return false;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
for (var i = 0; i < start.length; i++) {
|
|
1055
|
+
if (start[i] !== array[i]) {
|
|
1056
|
+
return false;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
return true;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
function calcLineCount(hunk) {
|
|
1064
|
+
var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines),
|
|
1065
|
+
oldLines = _calcOldNewLineCount.oldLines,
|
|
1066
|
+
newLines = _calcOldNewLineCount.newLines;
|
|
1067
|
+
|
|
1068
|
+
if (oldLines !== undefined) {
|
|
1069
|
+
hunk.oldLines = oldLines;
|
|
1070
|
+
} else {
|
|
1071
|
+
delete hunk.oldLines;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
if (newLines !== undefined) {
|
|
1075
|
+
hunk.newLines = newLines;
|
|
1076
|
+
} else {
|
|
1077
|
+
delete hunk.newLines;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function merge(mine, theirs, base) {
|
|
1081
|
+
mine = loadPatch(mine, base);
|
|
1082
|
+
theirs = loadPatch(theirs, base);
|
|
1083
|
+
var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning.
|
|
1084
|
+
// Leaving sanity checks on this to the API consumer that may know more about the
|
|
1085
|
+
// meaning in their own context.
|
|
1086
|
+
|
|
1087
|
+
if (mine.index || theirs.index) {
|
|
1088
|
+
ret.index = mine.index || theirs.index;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
if (mine.newFileName || theirs.newFileName) {
|
|
1092
|
+
if (!fileNameChanged(mine)) {
|
|
1093
|
+
// No header or no change in ours, use theirs (and ours if theirs does not exist)
|
|
1094
|
+
ret.oldFileName = theirs.oldFileName || mine.oldFileName;
|
|
1095
|
+
ret.newFileName = theirs.newFileName || mine.newFileName;
|
|
1096
|
+
ret.oldHeader = theirs.oldHeader || mine.oldHeader;
|
|
1097
|
+
ret.newHeader = theirs.newHeader || mine.newHeader;
|
|
1098
|
+
} else if (!fileNameChanged(theirs)) {
|
|
1099
|
+
// No header or no change in theirs, use ours
|
|
1100
|
+
ret.oldFileName = mine.oldFileName;
|
|
1101
|
+
ret.newFileName = mine.newFileName;
|
|
1102
|
+
ret.oldHeader = mine.oldHeader;
|
|
1103
|
+
ret.newHeader = mine.newHeader;
|
|
1104
|
+
} else {
|
|
1105
|
+
// Both changed... figure it out
|
|
1106
|
+
ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
|
|
1107
|
+
ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
|
|
1108
|
+
ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
|
|
1109
|
+
ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
ret.hunks = [];
|
|
1114
|
+
var mineIndex = 0,
|
|
1115
|
+
theirsIndex = 0,
|
|
1116
|
+
mineOffset = 0,
|
|
1117
|
+
theirsOffset = 0;
|
|
1118
|
+
|
|
1119
|
+
while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
|
|
1120
|
+
var mineCurrent = mine.hunks[mineIndex] || {
|
|
1121
|
+
oldStart: Infinity
|
|
1122
|
+
},
|
|
1123
|
+
theirsCurrent = theirs.hunks[theirsIndex] || {
|
|
1124
|
+
oldStart: Infinity
|
|
1125
|
+
};
|
|
1126
|
+
|
|
1127
|
+
if (hunkBefore(mineCurrent, theirsCurrent)) {
|
|
1128
|
+
// This patch does not overlap with any of the others, yay.
|
|
1129
|
+
ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
|
|
1130
|
+
mineIndex++;
|
|
1131
|
+
theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
|
|
1132
|
+
} else if (hunkBefore(theirsCurrent, mineCurrent)) {
|
|
1133
|
+
// This patch does not overlap with any of the others, yay.
|
|
1134
|
+
ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
|
|
1135
|
+
theirsIndex++;
|
|
1136
|
+
mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
|
|
1137
|
+
} else {
|
|
1138
|
+
// Overlap, merge as best we can
|
|
1139
|
+
var mergedHunk = {
|
|
1140
|
+
oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
|
|
1141
|
+
oldLines: 0,
|
|
1142
|
+
newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
|
|
1143
|
+
newLines: 0,
|
|
1144
|
+
lines: []
|
|
1145
|
+
};
|
|
1146
|
+
mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
|
|
1147
|
+
theirsIndex++;
|
|
1148
|
+
mineIndex++;
|
|
1149
|
+
ret.hunks.push(mergedHunk);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
return ret;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
function loadPatch(param, base) {
|
|
1157
|
+
if (typeof param === 'string') {
|
|
1158
|
+
if (/^@@/m.test(param) || /^Index:/m.test(param)) {
|
|
1159
|
+
return parsePatch(param)[0];
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
if (!base) {
|
|
1163
|
+
throw new Error('Must provide a base reference or pass in a patch');
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
return structuredPatch(undefined, undefined, base, param);
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
return param;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
function fileNameChanged(patch) {
|
|
1173
|
+
return patch.newFileName && patch.newFileName !== patch.oldFileName;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
function selectField(index, mine, theirs) {
|
|
1177
|
+
if (mine === theirs) {
|
|
1178
|
+
return mine;
|
|
1179
|
+
} else {
|
|
1180
|
+
index.conflict = true;
|
|
1181
|
+
return {
|
|
1182
|
+
mine: mine,
|
|
1183
|
+
theirs: theirs
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
function hunkBefore(test, check) {
|
|
1189
|
+
return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
function cloneHunk(hunk, offset) {
|
|
1193
|
+
return {
|
|
1194
|
+
oldStart: hunk.oldStart,
|
|
1195
|
+
oldLines: hunk.oldLines,
|
|
1196
|
+
newStart: hunk.newStart + offset,
|
|
1197
|
+
newLines: hunk.newLines,
|
|
1198
|
+
lines: hunk.lines
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
|
|
1203
|
+
// This will generally result in a conflicted hunk, but there are cases where the context
|
|
1204
|
+
// is the only overlap where we can successfully merge the content here.
|
|
1205
|
+
var mine = {
|
|
1206
|
+
offset: mineOffset,
|
|
1207
|
+
lines: mineLines,
|
|
1208
|
+
index: 0
|
|
1209
|
+
},
|
|
1210
|
+
their = {
|
|
1211
|
+
offset: theirOffset,
|
|
1212
|
+
lines: theirLines,
|
|
1213
|
+
index: 0
|
|
1214
|
+
}; // Handle any leading content
|
|
1215
|
+
|
|
1216
|
+
insertLeading(hunk, mine, their);
|
|
1217
|
+
insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each.
|
|
1218
|
+
|
|
1219
|
+
while (mine.index < mine.lines.length && their.index < their.lines.length) {
|
|
1220
|
+
var mineCurrent = mine.lines[mine.index],
|
|
1221
|
+
theirCurrent = their.lines[their.index];
|
|
1222
|
+
|
|
1223
|
+
if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
|
|
1224
|
+
// Both modified ...
|
|
1225
|
+
mutualChange(hunk, mine, their);
|
|
1226
|
+
} else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
|
|
1227
|
+
var _hunk$lines;
|
|
1228
|
+
|
|
1229
|
+
// Mine inserted
|
|
1230
|
+
(_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine)));
|
|
1231
|
+
} else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
|
|
1232
|
+
var _hunk$lines2;
|
|
1233
|
+
|
|
1234
|
+
// Theirs inserted
|
|
1235
|
+
(_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their)));
|
|
1236
|
+
} else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
|
|
1237
|
+
// Mine removed or edited
|
|
1238
|
+
removal(hunk, mine, their);
|
|
1239
|
+
} else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
|
|
1240
|
+
// Their removed or edited
|
|
1241
|
+
removal(hunk, their, mine, true);
|
|
1242
|
+
} else if (mineCurrent === theirCurrent) {
|
|
1243
|
+
// Context identity
|
|
1244
|
+
hunk.lines.push(mineCurrent);
|
|
1245
|
+
mine.index++;
|
|
1246
|
+
their.index++;
|
|
1247
|
+
} else {
|
|
1248
|
+
// Context mismatch
|
|
1249
|
+
conflict(hunk, collectChange(mine), collectChange(their));
|
|
1250
|
+
}
|
|
1251
|
+
} // Now push anything that may be remaining
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
insertTrailing(hunk, mine);
|
|
1255
|
+
insertTrailing(hunk, their);
|
|
1256
|
+
calcLineCount(hunk);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
function mutualChange(hunk, mine, their) {
|
|
1260
|
+
var myChanges = collectChange(mine),
|
|
1261
|
+
theirChanges = collectChange(their);
|
|
1262
|
+
|
|
1263
|
+
if (allRemoves(myChanges) && allRemoves(theirChanges)) {
|
|
1264
|
+
// Special case for remove changes that are supersets of one another
|
|
1265
|
+
if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
|
|
1266
|
+
var _hunk$lines3;
|
|
1267
|
+
|
|
1268
|
+
(_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges));
|
|
1269
|
+
|
|
1270
|
+
return;
|
|
1271
|
+
} else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
|
|
1272
|
+
var _hunk$lines4;
|
|
1273
|
+
|
|
1274
|
+
(_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges));
|
|
1275
|
+
|
|
1276
|
+
return;
|
|
1277
|
+
}
|
|
1278
|
+
} else if (arrayEqual(myChanges, theirChanges)) {
|
|
1279
|
+
var _hunk$lines5;
|
|
1280
|
+
|
|
1281
|
+
(_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges));
|
|
1282
|
+
|
|
1283
|
+
return;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
conflict(hunk, myChanges, theirChanges);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
function removal(hunk, mine, their, swap) {
|
|
1290
|
+
var myChanges = collectChange(mine),
|
|
1291
|
+
theirChanges = collectContext(their, myChanges);
|
|
1292
|
+
|
|
1293
|
+
if (theirChanges.merged) {
|
|
1294
|
+
var _hunk$lines6;
|
|
1295
|
+
|
|
1296
|
+
(_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged));
|
|
1297
|
+
} else {
|
|
1298
|
+
conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
function conflict(hunk, mine, their) {
|
|
1303
|
+
hunk.conflict = true;
|
|
1304
|
+
hunk.lines.push({
|
|
1305
|
+
conflict: true,
|
|
1306
|
+
mine: mine,
|
|
1307
|
+
theirs: their
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
function insertLeading(hunk, insert, their) {
|
|
1312
|
+
while (insert.offset < their.offset && insert.index < insert.lines.length) {
|
|
1313
|
+
var line = insert.lines[insert.index++];
|
|
1314
|
+
hunk.lines.push(line);
|
|
1315
|
+
insert.offset++;
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
function insertTrailing(hunk, insert) {
|
|
1320
|
+
while (insert.index < insert.lines.length) {
|
|
1321
|
+
var line = insert.lines[insert.index++];
|
|
1322
|
+
hunk.lines.push(line);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
function collectChange(state) {
|
|
1327
|
+
var ret = [],
|
|
1328
|
+
operation = state.lines[state.index][0];
|
|
1329
|
+
|
|
1330
|
+
while (state.index < state.lines.length) {
|
|
1331
|
+
var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
|
|
1332
|
+
|
|
1333
|
+
if (operation === '-' && line[0] === '+') {
|
|
1334
|
+
operation = '+';
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
if (operation === line[0]) {
|
|
1338
|
+
ret.push(line);
|
|
1339
|
+
state.index++;
|
|
1340
|
+
} else {
|
|
1341
|
+
break;
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
return ret;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
function collectContext(state, matchChanges) {
|
|
1349
|
+
var changes = [],
|
|
1350
|
+
merged = [],
|
|
1351
|
+
matchIndex = 0,
|
|
1352
|
+
contextChanges = false,
|
|
1353
|
+
conflicted = false;
|
|
1354
|
+
|
|
1355
|
+
while (matchIndex < matchChanges.length && state.index < state.lines.length) {
|
|
1356
|
+
var change = state.lines[state.index],
|
|
1357
|
+
match = matchChanges[matchIndex]; // Once we've hit our add, then we are done
|
|
1358
|
+
|
|
1359
|
+
if (match[0] === '+') {
|
|
1360
|
+
break;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
contextChanges = contextChanges || change[0] !== ' ';
|
|
1364
|
+
merged.push(match);
|
|
1365
|
+
matchIndex++; // Consume any additions in the other block as a conflict to attempt
|
|
1366
|
+
// to pull in the remaining context after this
|
|
1367
|
+
|
|
1368
|
+
if (change[0] === '+') {
|
|
1369
|
+
conflicted = true;
|
|
1370
|
+
|
|
1371
|
+
while (change[0] === '+') {
|
|
1372
|
+
changes.push(change);
|
|
1373
|
+
change = state.lines[++state.index];
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
if (match.substr(1) === change.substr(1)) {
|
|
1378
|
+
changes.push(change);
|
|
1379
|
+
state.index++;
|
|
1380
|
+
} else {
|
|
1381
|
+
conflicted = true;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
|
|
1386
|
+
conflicted = true;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
if (conflicted) {
|
|
1390
|
+
return changes;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
while (matchIndex < matchChanges.length) {
|
|
1394
|
+
merged.push(matchChanges[matchIndex++]);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
return {
|
|
1398
|
+
merged: merged,
|
|
1399
|
+
changes: changes
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
function allRemoves(changes) {
|
|
1404
|
+
return changes.reduce(function (prev, change) {
|
|
1405
|
+
return prev && change[0] === '-';
|
|
1406
|
+
}, true);
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
function skipRemoveSuperset(state, removeChanges, delta) {
|
|
1410
|
+
for (var i = 0; i < delta; i++) {
|
|
1411
|
+
var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
|
|
1412
|
+
|
|
1413
|
+
if (state.lines[state.index + i] !== ' ' + changeContent) {
|
|
1414
|
+
return false;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
state.index += delta;
|
|
1419
|
+
return true;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
function calcOldNewLineCount(lines) {
|
|
1423
|
+
var oldLines = 0;
|
|
1424
|
+
var newLines = 0;
|
|
1425
|
+
lines.forEach(function (line) {
|
|
1426
|
+
if (typeof line !== 'string') {
|
|
1427
|
+
var myCount = calcOldNewLineCount(line.mine);
|
|
1428
|
+
var theirCount = calcOldNewLineCount(line.theirs);
|
|
1429
|
+
|
|
1430
|
+
if (oldLines !== undefined) {
|
|
1431
|
+
if (myCount.oldLines === theirCount.oldLines) {
|
|
1432
|
+
oldLines += myCount.oldLines;
|
|
1433
|
+
} else {
|
|
1434
|
+
oldLines = undefined;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
if (newLines !== undefined) {
|
|
1439
|
+
if (myCount.newLines === theirCount.newLines) {
|
|
1440
|
+
newLines += myCount.newLines;
|
|
1441
|
+
} else {
|
|
1442
|
+
newLines = undefined;
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
} else {
|
|
1446
|
+
if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
|
|
1447
|
+
newLines++;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
|
|
1451
|
+
oldLines++;
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
return {
|
|
1456
|
+
oldLines: oldLines,
|
|
1457
|
+
newLines: newLines
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
// See: http://code.google.com/p/google-diff-match-patch/wiki/API
|
|
1462
|
+
function convertChangesToDMP(changes) {
|
|
1463
|
+
var ret = [],
|
|
1464
|
+
change,
|
|
1465
|
+
operation;
|
|
1466
|
+
|
|
1467
|
+
for (var i = 0; i < changes.length; i++) {
|
|
1468
|
+
change = changes[i];
|
|
1469
|
+
|
|
1470
|
+
if (change.added) {
|
|
1471
|
+
operation = 1;
|
|
1472
|
+
} else if (change.removed) {
|
|
1473
|
+
operation = -1;
|
|
1474
|
+
} else {
|
|
1475
|
+
operation = 0;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
ret.push([operation, change.value]);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
return ret;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
function convertChangesToXML(changes) {
|
|
1485
|
+
var ret = [];
|
|
1486
|
+
|
|
1487
|
+
for (var i = 0; i < changes.length; i++) {
|
|
1488
|
+
var change = changes[i];
|
|
1489
|
+
|
|
1490
|
+
if (change.added) {
|
|
1491
|
+
ret.push('<ins>');
|
|
1492
|
+
} else if (change.removed) {
|
|
1493
|
+
ret.push('<del>');
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
ret.push(escapeHTML(change.value));
|
|
1497
|
+
|
|
1498
|
+
if (change.added) {
|
|
1499
|
+
ret.push('</ins>');
|
|
1500
|
+
} else if (change.removed) {
|
|
1501
|
+
ret.push('</del>');
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
return ret.join('');
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
function escapeHTML(s) {
|
|
1509
|
+
var n = s;
|
|
1510
|
+
n = n.replace(/&/g, '&');
|
|
1511
|
+
n = n.replace(/</g, '<');
|
|
1512
|
+
n = n.replace(/>/g, '>');
|
|
1513
|
+
n = n.replace(/"/g, '"');
|
|
1514
|
+
return n;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
/* See LICENSE file for terms of use */
|
|
1518
|
+
|
|
1519
|
+
export { Diff, diffChars, diffWords, diffWordsWithSpace, diffLines, diffTrimmedLines, diffSentences, diffCss, diffJson, diffArrays, structuredPatch, createTwoFilesPatch, createPatch, applyPatch, applyPatches, parsePatch, merge, convertChangesToDMP, convertChangesToXML, canonicalize };
|