@eggjs/mock 6.0.7 → 6.1.0-beta.10
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/README.md +35 -56
- package/README.zh_CN.md +30 -50
- package/dist/_virtual/rolldown_runtime.js +30 -0
- package/dist/app/extend/agent.d.ts +39 -0
- package/dist/app/extend/agent.js +48 -0
- package/dist/app/extend/application.d.ts +175 -0
- package/dist/app/extend/application.js +385 -0
- package/dist/app/middleware/cluster_app_mock.d.ts +6 -0
- package/dist/app/middleware/cluster_app_mock.js +97 -0
- package/dist/app.d.ts +10 -0
- package/dist/app.js +17 -0
- package/dist/bootstrap.d.ts +9 -0
- package/dist/bootstrap.js +14 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +47 -0
- package/dist/inject_mocha.d.ts +1 -0
- package/dist/inject_mocha.js +35 -0
- package/dist/lib/agent_handler.d.ts +7 -0
- package/dist/lib/agent_handler.js +26 -0
- package/dist/lib/app.d.ts +7 -0
- package/dist/lib/app.js +251 -0
- package/dist/lib/app_handler.d.ts +9 -0
- package/dist/lib/app_handler.js +56 -0
- package/dist/lib/cluster.d.ts +126 -0
- package/dist/lib/cluster.js +283 -0
- package/dist/lib/context.d.ts +4 -0
- package/dist/lib/context.js +12 -0
- package/dist/lib/format_options.d.ts +10 -0
- package/dist/lib/format_options.js +65 -0
- package/dist/lib/inject_context.d.ts +9 -0
- package/dist/lib/inject_context.js +106 -0
- package/dist/lib/mock_agent.d.ts +9 -0
- package/dist/lib/mock_agent.js +45 -0
- package/dist/lib/mock_custom_loader.d.ts +4 -0
- package/dist/lib/mock_custom_loader.js +35 -0
- package/dist/lib/mock_http_server.d.ts +6 -0
- package/dist/lib/mock_http_server.js +17 -0
- package/dist/lib/mock_httpclient.d.ts +40 -0
- package/dist/lib/mock_httpclient.js +110 -0
- package/dist/lib/parallel/agent.d.ts +24 -0
- package/dist/lib/parallel/agent.js +111 -0
- package/dist/lib/parallel/app.d.ts +24 -0
- package/dist/lib/parallel/app.js +99 -0
- package/dist/lib/parallel/util.d.ts +6 -0
- package/dist/lib/parallel/util.js +59 -0
- package/dist/lib/prerequire.d.ts +1 -0
- package/dist/lib/prerequire.js +1 -0
- package/dist/lib/request_call_function.d.ts +1 -0
- package/dist/lib/request_call_function.js +37 -0
- package/dist/lib/restore.d.ts +4 -0
- package/dist/lib/restore.js +16 -0
- package/dist/lib/start-cluster.d.ts +1 -0
- package/dist/lib/start-cluster.js +19 -0
- package/dist/lib/supertest.d.ts +16 -0
- package/dist/lib/supertest.js +39 -0
- package/dist/lib/tmp/empty.d.ts +1 -0
- package/dist/lib/tmp/empty.js +1 -0
- package/{src/lib/types.ts → dist/lib/types.d.ts} +12 -29
- package/dist/lib/types.js +1 -0
- package/dist/lib/utils.d.ts +12 -0
- package/dist/lib/utils.js +40 -0
- package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +142 -0
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +157 -0
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +97 -0
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +40 -0
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +814 -0
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +50 -0
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +68 -0
- package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +752 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js +203 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js +209 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js +18 -0
- package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/node.js +215 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/dmp.js +24 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/xml.js +33 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js +29 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js +185 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js +23 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js +26 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js +83 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js +51 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js +26 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js +151 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/index.js +178 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/apply.js +168 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/create.js +301 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js +137 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js +367 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js +91 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js +99 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js +23 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js +30 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js +22 -0
- package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js +97 -0
- package/dist/node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js +14 -0
- package/dist/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +16 -0
- package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.js +4093 -0
- package/dist/node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +14 -0
- package/dist/node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +27 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js +12 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/context.js +83 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/error-constants.js +35 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/errors.js +392 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/hook.js +86 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js +104 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js +99 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js +65 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js +18 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js +95 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js +105 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocha.js +1037 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocharc.js +24 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +152 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/esm-utils.js +74 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/file-unloader.js +22 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js +329 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/serializer.js +314 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/pending.js +22 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/base.js +417 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/doc.js +79 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/dot.js +75 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/html.js +283 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/index.js +40 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json-stream.js +90 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json.js +145 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/landing.js +107 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/list.js +77 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/markdown.js +106 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/min.js +57 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/nyan.js +233 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/progress.js +92 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/spec.js +91 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/tap.js +261 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/xunit.js +166 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js +346 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runner.js +922 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/stats-collector.js +72 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/suite.js +517 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/test.js +105 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/utils.js +505 -0
- package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/package.js +225 -0
- package/dist/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +124 -0
- package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.js +11 -0
- package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.js +114 -0
- package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +76 -0
- package/dist/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js +89 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Pool.js +366 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Promise.js +248 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/WorkerHandler.js +419 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/debug-port-allocator.js +27 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/environment.js +18 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/generated/embeddedWorker.js +16 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/index.js +63 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/transfer.js +21 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/validateOptions.js +9 -0
- package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js +277 -0
- package/dist/register.d.ts +10 -0
- package/dist/register.js +40 -0
- package/dist/typings/index.d.ts +1 -0
- package/package.json +71 -98
- package/dist/commonjs/app/extend/agent.d.ts +0 -34
- package/dist/commonjs/app/extend/agent.js +0 -49
- package/dist/commonjs/app/extend/application.d.ts +0 -172
- package/dist/commonjs/app/extend/application.js +0 -450
- package/dist/commonjs/app/middleware/cluster_app_mock.d.ts +0 -3
- package/dist/commonjs/app/middleware/cluster_app_mock.js +0 -101
- package/dist/commonjs/app.d.ts +0 -6
- package/dist/commonjs/app.js +0 -20
- package/dist/commonjs/bootstrap.d.ts +0 -5
- package/dist/commonjs/bootstrap.js +0 -59
- package/dist/commonjs/index.d.ts +0 -77
- package/dist/commonjs/index.js +0 -114
- package/dist/commonjs/lib/agent_handler.d.ts +0 -3
- package/dist/commonjs/lib/agent_handler.js +0 -28
- package/dist/commonjs/lib/app.d.ts +0 -3
- package/dist/commonjs/lib/app.js +0 -301
- package/dist/commonjs/lib/app_handler.d.ts +0 -5
- package/dist/commonjs/lib/app_handler.js +0 -71
- package/dist/commonjs/lib/cluster.d.ts +0 -114
- package/dist/commonjs/lib/cluster.js +0 -337
- package/dist/commonjs/lib/context.d.ts +0 -1
- package/dist/commonjs/lib/context.js +0 -16
- package/dist/commonjs/lib/format_options.d.ts +0 -5
- package/dist/commonjs/lib/format_options.js +0 -100
- package/dist/commonjs/lib/inject_context.d.ts +0 -6
- package/dist/commonjs/lib/inject_context.js +0 -132
- package/dist/commonjs/lib/mock_agent.d.ts +0 -5
- package/dist/commonjs/lib/mock_agent.js +0 -49
- package/dist/commonjs/lib/mock_custom_loader.d.ts +0 -1
- package/dist/commonjs/lib/mock_custom_loader.js +0 -37
- package/dist/commonjs/lib/mock_http_server.d.ts +0 -2
- package/dist/commonjs/lib/mock_http_server.js +0 -24
- package/dist/commonjs/lib/mock_httpclient.d.ts +0 -36
- package/dist/commonjs/lib/mock_httpclient.js +0 -147
- package/dist/commonjs/lib/parallel/agent.d.ts +0 -20
- package/dist/commonjs/lib/parallel/agent.js +0 -125
- package/dist/commonjs/lib/parallel/app.d.ts +0 -20
- package/dist/commonjs/lib/parallel/app.js +0 -115
- package/dist/commonjs/lib/parallel/util.d.ts +0 -3
- package/dist/commonjs/lib/parallel/util.js +0 -77
- package/dist/commonjs/lib/prerequire.d.ts +0 -1
- package/dist/commonjs/lib/prerequire.js +0 -26
- package/dist/commonjs/lib/request_call_function.d.ts +0 -1
- package/dist/commonjs/lib/request_call_function.js +0 -52
- package/dist/commonjs/lib/restore.d.ts +0 -1
- package/dist/commonjs/lib/restore.js +0 -16
- package/dist/commonjs/lib/start-cluster.d.ts +0 -2
- package/dist/commonjs/lib/start-cluster.js +0 -23
- package/dist/commonjs/lib/supertest.d.ts +0 -11
- package/dist/commonjs/lib/supertest.js +0 -48
- package/dist/commonjs/lib/tmp/empty.d.ts +0 -1
- package/dist/commonjs/lib/tmp/empty.js +0 -3
- package/dist/commonjs/lib/types.d.ts +0 -68
- package/dist/commonjs/lib/types.js +0 -3
- package/dist/commonjs/lib/utils.d.ts +0 -9
- package/dist/commonjs/lib/utils.js +0 -80
- package/dist/commonjs/package.json +0 -3
- package/dist/commonjs/register.d.ts +0 -8
- package/dist/commonjs/register.js +0 -80
- package/dist/esm/app/extend/agent.d.ts +0 -34
- package/dist/esm/app/extend/agent.js +0 -46
- package/dist/esm/app/extend/application.d.ts +0 -172
- package/dist/esm/app/extend/application.js +0 -444
- package/dist/esm/app/middleware/cluster_app_mock.d.ts +0 -3
- package/dist/esm/app/middleware/cluster_app_mock.js +0 -99
- package/dist/esm/app.d.ts +0 -6
- package/dist/esm/app.js +0 -17
- package/dist/esm/bootstrap.d.ts +0 -5
- package/dist/esm/bootstrap.js +0 -15
- package/dist/esm/index.d.ts +0 -77
- package/dist/esm/index.js +0 -91
- package/dist/esm/lib/agent_handler.d.ts +0 -3
- package/dist/esm/lib/agent_handler.js +0 -24
- package/dist/esm/lib/app.d.ts +0 -3
- package/dist/esm/lib/app.js +0 -295
- package/dist/esm/lib/app_handler.d.ts +0 -5
- package/dist/esm/lib/app_handler.js +0 -65
- package/dist/esm/lib/cluster.d.ts +0 -114
- package/dist/esm/lib/cluster.js +0 -328
- package/dist/esm/lib/context.d.ts +0 -1
- package/dist/esm/lib/context.js +0 -13
- package/dist/esm/lib/format_options.d.ts +0 -5
- package/dist/esm/lib/format_options.js +0 -94
- package/dist/esm/lib/inject_context.d.ts +0 -6
- package/dist/esm/lib/inject_context.js +0 -126
- package/dist/esm/lib/mock_agent.d.ts +0 -5
- package/dist/esm/lib/mock_agent.js +0 -45
- package/dist/esm/lib/mock_custom_loader.d.ts +0 -1
- package/dist/esm/lib/mock_custom_loader.js +0 -34
- package/dist/esm/lib/mock_http_server.d.ts +0 -2
- package/dist/esm/lib/mock_http_server.js +0 -18
- package/dist/esm/lib/mock_httpclient.d.ts +0 -36
- package/dist/esm/lib/mock_httpclient.js +0 -144
- package/dist/esm/lib/parallel/agent.d.ts +0 -20
- package/dist/esm/lib/parallel/agent.js +0 -117
- package/dist/esm/lib/parallel/app.d.ts +0 -20
- package/dist/esm/lib/parallel/app.js +0 -110
- package/dist/esm/lib/parallel/util.d.ts +0 -3
- package/dist/esm/lib/parallel/util.js +0 -73
- package/dist/esm/lib/prerequire.d.ts +0 -1
- package/dist/esm/lib/prerequire.js +0 -25
- package/dist/esm/lib/request_call_function.d.ts +0 -1
- package/dist/esm/lib/request_call_function.js +0 -47
- package/dist/esm/lib/restore.d.ts +0 -1
- package/dist/esm/lib/restore.js +0 -13
- package/dist/esm/lib/start-cluster.d.ts +0 -2
- package/dist/esm/lib/start-cluster.js +0 -18
- package/dist/esm/lib/supertest.d.ts +0 -11
- package/dist/esm/lib/supertest.js +0 -40
- package/dist/esm/lib/tmp/empty.d.ts +0 -1
- package/dist/esm/lib/tmp/empty.js +0 -2
- package/dist/esm/lib/types.d.ts +0 -68
- package/dist/esm/lib/types.js +0 -2
- package/dist/esm/lib/utils.d.ts +0 -9
- package/dist/esm/lib/utils.js +0 -69
- package/dist/esm/package.json +0 -3
- package/dist/esm/register.d.ts +0 -8
- package/dist/esm/register.js +0 -75
- package/dist/package.json +0 -4
- package/src/app/extend/agent.ts +0 -57
- package/src/app/extend/application.ts +0 -512
- package/src/app/middleware/cluster_app_mock.ts +0 -102
- package/src/app.ts +0 -18
- package/src/bootstrap.ts +0 -25
- package/src/index.ts +0 -112
- package/src/lib/agent_handler.ts +0 -28
- package/src/lib/app.ts +0 -314
- package/src/lib/app_handler.ts +0 -77
- package/src/lib/cluster.ts +0 -363
- package/src/lib/context.ts +0 -14
- package/src/lib/format_options.ts +0 -103
- package/src/lib/inject_context.ts +0 -134
- package/src/lib/mock_agent.ts +0 -57
- package/src/lib/mock_custom_loader.ts +0 -36
- package/src/lib/mock_http_server.ts +0 -19
- package/src/lib/mock_httpclient.ts +0 -183
- package/src/lib/parallel/agent.ts +0 -128
- package/src/lib/parallel/app.ts +0 -123
- package/src/lib/parallel/util.ts +0 -66
- package/src/lib/prerequire.ts +0 -25
- package/src/lib/request_call_function.ts +0 -49
- package/src/lib/restore.ts +0 -14
- package/src/lib/start-cluster.ts +0 -23
- package/src/lib/supertest.ts +0 -45
- package/src/lib/tmp/.gitkeep +0 -0
- package/src/lib/tmp/empty.ts +0 -0
- package/src/lib/utils.ts +0 -82
- package/src/register.ts +0 -80
- package/src/typings/index.d.ts +0 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js
|
|
5
|
+
var require_array = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffArrays = diffArrays;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var arrayDiff = exports.arrayDiff = new _base["default"]();
|
|
15
|
+
arrayDiff.tokenize = function(value) {
|
|
16
|
+
return value.slice();
|
|
17
|
+
};
|
|
18
|
+
arrayDiff.join = arrayDiff.removeEmpty = function(value) {
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
function diffArrays(oldArr, newArr, callback) {
|
|
22
|
+
return arrayDiff.diff(oldArr, newArr, callback);
|
|
23
|
+
}
|
|
24
|
+
}) });
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export default require_array();
|
|
28
|
+
|
|
29
|
+
export { require_array };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js
|
|
4
|
+
var require_base = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js": ((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports["default"] = Diff;
|
|
7
|
+
/*istanbul ignore end*/
|
|
8
|
+
function Diff() {}
|
|
9
|
+
Diff.prototype = {
|
|
10
|
+
diff: function diff(oldString, newString) {
|
|
11
|
+
/*istanbul ignore start*/
|
|
12
|
+
var _options$timeout;
|
|
13
|
+
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
14
|
+
var callback = options.callback;
|
|
15
|
+
if (typeof options === "function") {
|
|
16
|
+
callback = options;
|
|
17
|
+
options = {};
|
|
18
|
+
}
|
|
19
|
+
var self = this;
|
|
20
|
+
function done(value) {
|
|
21
|
+
value = self.postProcess(value, options);
|
|
22
|
+
if (callback) {
|
|
23
|
+
setTimeout(function() {
|
|
24
|
+
callback(value);
|
|
25
|
+
}, 0);
|
|
26
|
+
return true;
|
|
27
|
+
} else return value;
|
|
28
|
+
}
|
|
29
|
+
oldString = this.castInput(oldString, options);
|
|
30
|
+
newString = this.castInput(newString, options);
|
|
31
|
+
oldString = this.removeEmpty(this.tokenize(oldString, options));
|
|
32
|
+
newString = this.removeEmpty(this.tokenize(newString, options));
|
|
33
|
+
var newLen = newString.length, oldLen = oldString.length;
|
|
34
|
+
var editLength = 1;
|
|
35
|
+
var maxEditLength = newLen + oldLen;
|
|
36
|
+
if (options.maxEditLength != null) maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
|
37
|
+
var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
|
|
38
|
+
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
|
39
|
+
var bestPath = [{
|
|
40
|
+
oldPos: -1,
|
|
41
|
+
lastComponent: void 0
|
|
42
|
+
}];
|
|
43
|
+
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options);
|
|
44
|
+
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken));
|
|
45
|
+
var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
|
|
46
|
+
function execEditLength() {
|
|
47
|
+
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
|
48
|
+
var basePath = void 0;
|
|
49
|
+
var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
|
|
50
|
+
if (removePath) bestPath[diagonalPath - 1] = void 0;
|
|
51
|
+
var canAdd = false;
|
|
52
|
+
if (addPath) {
|
|
53
|
+
var addPathNewPos = addPath.oldPos - diagonalPath;
|
|
54
|
+
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
|
55
|
+
}
|
|
56
|
+
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
|
57
|
+
if (!canAdd && !canRemove) {
|
|
58
|
+
bestPath[diagonalPath] = void 0;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) basePath = self.addToPath(addPath, true, false, 0, options);
|
|
62
|
+
else basePath = self.addToPath(removePath, false, true, 1, options);
|
|
63
|
+
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options);
|
|
64
|
+
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
|
65
|
+
else {
|
|
66
|
+
bestPath[diagonalPath] = basePath;
|
|
67
|
+
if (basePath.oldPos + 1 >= oldLen) maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
|
68
|
+
if (newPos + 1 >= newLen) minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
editLength++;
|
|
72
|
+
}
|
|
73
|
+
if (callback) (function exec() {
|
|
74
|
+
setTimeout(function() {
|
|
75
|
+
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) return callback();
|
|
76
|
+
if (!execEditLength()) exec();
|
|
77
|
+
}, 0);
|
|
78
|
+
})();
|
|
79
|
+
else while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
|
80
|
+
var ret = execEditLength();
|
|
81
|
+
if (ret) return ret;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
addToPath: function addToPath(path, added, removed, oldPosInc, options) {
|
|
85
|
+
var last = path.lastComponent;
|
|
86
|
+
if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) return {
|
|
87
|
+
oldPos: path.oldPos + oldPosInc,
|
|
88
|
+
lastComponent: {
|
|
89
|
+
count: last.count + 1,
|
|
90
|
+
added,
|
|
91
|
+
removed,
|
|
92
|
+
previousComponent: last.previousComponent
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
else return {
|
|
96
|
+
oldPos: path.oldPos + oldPosInc,
|
|
97
|
+
lastComponent: {
|
|
98
|
+
count: 1,
|
|
99
|
+
added,
|
|
100
|
+
removed,
|
|
101
|
+
previousComponent: last
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) {
|
|
106
|
+
var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
|
|
107
|
+
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) {
|
|
108
|
+
newPos++;
|
|
109
|
+
oldPos++;
|
|
110
|
+
commonCount++;
|
|
111
|
+
if (options.oneChangePerToken) basePath.lastComponent = {
|
|
112
|
+
count: 1,
|
|
113
|
+
previousComponent: basePath.lastComponent,
|
|
114
|
+
added: false,
|
|
115
|
+
removed: false
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (commonCount && !options.oneChangePerToken) basePath.lastComponent = {
|
|
119
|
+
count: commonCount,
|
|
120
|
+
previousComponent: basePath.lastComponent,
|
|
121
|
+
added: false,
|
|
122
|
+
removed: false
|
|
123
|
+
};
|
|
124
|
+
basePath.oldPos = oldPos;
|
|
125
|
+
return newPos;
|
|
126
|
+
},
|
|
127
|
+
equals: function equals(left, right, options) {
|
|
128
|
+
if (options.comparator) return options.comparator(left, right);
|
|
129
|
+
else return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
|
130
|
+
},
|
|
131
|
+
removeEmpty: function removeEmpty(array) {
|
|
132
|
+
var ret = [];
|
|
133
|
+
for (var i = 0; i < array.length; i++) if (array[i]) ret.push(array[i]);
|
|
134
|
+
return ret;
|
|
135
|
+
},
|
|
136
|
+
castInput: function castInput(value) {
|
|
137
|
+
return value;
|
|
138
|
+
},
|
|
139
|
+
tokenize: function tokenize(value) {
|
|
140
|
+
return Array.from(value);
|
|
141
|
+
},
|
|
142
|
+
join: function join(chars) {
|
|
143
|
+
return chars.join("");
|
|
144
|
+
},
|
|
145
|
+
postProcess: function postProcess(changeObjects) {
|
|
146
|
+
return changeObjects;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
|
|
150
|
+
var components = [];
|
|
151
|
+
var nextComponent;
|
|
152
|
+
while (lastComponent) {
|
|
153
|
+
components.push(lastComponent);
|
|
154
|
+
nextComponent = lastComponent.previousComponent;
|
|
155
|
+
delete lastComponent.previousComponent;
|
|
156
|
+
lastComponent = nextComponent;
|
|
157
|
+
}
|
|
158
|
+
components.reverse();
|
|
159
|
+
var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
|
|
160
|
+
for (; componentPos < componentLen; componentPos++) {
|
|
161
|
+
var component = components[componentPos];
|
|
162
|
+
if (!component.removed) {
|
|
163
|
+
if (!component.added && useLongestToken) {
|
|
164
|
+
var value = newString.slice(newPos, newPos + component.count);
|
|
165
|
+
value = value.map(function(value$1, i) {
|
|
166
|
+
var oldValue = oldString[oldPos + i];
|
|
167
|
+
return oldValue.length > value$1.length ? oldValue : value$1;
|
|
168
|
+
});
|
|
169
|
+
component.value = diff.join(value);
|
|
170
|
+
} else component.value = diff.join(newString.slice(newPos, newPos + component.count));
|
|
171
|
+
newPos += component.count;
|
|
172
|
+
if (!component.added) oldPos += component.count;
|
|
173
|
+
} else {
|
|
174
|
+
component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
|
|
175
|
+
oldPos += component.count;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return components;
|
|
179
|
+
}
|
|
180
|
+
}) });
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
export default require_base();
|
|
184
|
+
|
|
185
|
+
export { require_base };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js
|
|
5
|
+
var require_character = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffChars = diffChars;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var characterDiff = exports.characterDiff = new _base["default"]();
|
|
15
|
+
function diffChars(oldStr, newStr, options) {
|
|
16
|
+
return characterDiff.diff(oldStr, newStr, options);
|
|
17
|
+
}
|
|
18
|
+
}) });
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export default require_character();
|
|
22
|
+
|
|
23
|
+
export { require_character };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js
|
|
5
|
+
var require_css = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffCss = diffCss;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var cssDiff = exports.cssDiff = new _base["default"]();
|
|
15
|
+
cssDiff.tokenize = function(value) {
|
|
16
|
+
return value.split(/([{}:;,]|\s+)/);
|
|
17
|
+
};
|
|
18
|
+
function diffCss(oldStr, newStr, callback) {
|
|
19
|
+
return cssDiff.diff(oldStr, newStr, callback);
|
|
20
|
+
}
|
|
21
|
+
}) });
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export default require_css();
|
|
25
|
+
|
|
26
|
+
export { require_css };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
import { require_line } from "./line.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js
|
|
6
|
+
var require_json = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js": ((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.canonicalize = canonicalize;
|
|
9
|
+
exports.diffJson = diffJson;
|
|
10
|
+
/*istanbul ignore end*/
|
|
11
|
+
var _base = _interopRequireDefault(require_base());
|
|
12
|
+
var _line = require_line();
|
|
13
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
15
|
+
}
|
|
16
|
+
function _typeof(o) {
|
|
17
|
+
"@babel/helpers - typeof";
|
|
18
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
19
|
+
return typeof o$1;
|
|
20
|
+
} : function(o$1) {
|
|
21
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
22
|
+
}, _typeof(o);
|
|
23
|
+
}
|
|
24
|
+
/*istanbul ignore end*/
|
|
25
|
+
var jsonDiff = exports.jsonDiff = new _base["default"]();
|
|
26
|
+
jsonDiff.useLongestToken = true;
|
|
27
|
+
jsonDiff.tokenize = _line.lineDiff.tokenize;
|
|
28
|
+
jsonDiff.castInput = function(value, options) {
|
|
29
|
+
var undefinedReplacement = options.undefinedReplacement, _options$stringifyRep = options.stringifyReplacer, stringifyReplacer = _options$stringifyRep === void 0 ? function(k, v) {
|
|
30
|
+
return typeof v === "undefined" ? undefinedReplacement : v;
|
|
31
|
+
} : _options$stringifyRep;
|
|
32
|
+
return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " ");
|
|
33
|
+
};
|
|
34
|
+
jsonDiff.equals = function(left, right, options) {
|
|
35
|
+
return _base["default"].prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options);
|
|
36
|
+
};
|
|
37
|
+
function diffJson(oldObj, newObj, options) {
|
|
38
|
+
return jsonDiff.diff(oldObj, newObj, options);
|
|
39
|
+
}
|
|
40
|
+
function canonicalize(obj, stack, replacementStack, replacer, key) {
|
|
41
|
+
stack = stack || [];
|
|
42
|
+
replacementStack = replacementStack || [];
|
|
43
|
+
if (replacer) obj = replacer(key, obj);
|
|
44
|
+
var i;
|
|
45
|
+
for (i = 0; i < stack.length; i += 1) if (stack[i] === obj) return replacementStack[i];
|
|
46
|
+
var canonicalizedObj;
|
|
47
|
+
if ("[object Array]" === Object.prototype.toString.call(obj)) {
|
|
48
|
+
stack.push(obj);
|
|
49
|
+
canonicalizedObj = new Array(obj.length);
|
|
50
|
+
replacementStack.push(canonicalizedObj);
|
|
51
|
+
for (i = 0; i < obj.length; i += 1) canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
|
|
52
|
+
stack.pop();
|
|
53
|
+
replacementStack.pop();
|
|
54
|
+
return canonicalizedObj;
|
|
55
|
+
}
|
|
56
|
+
if (obj && obj.toJSON) obj = obj.toJSON();
|
|
57
|
+
if (_typeof(
|
|
58
|
+
/*istanbul ignore end*/
|
|
59
|
+
obj
|
|
60
|
+
) === "object" && obj !== null) {
|
|
61
|
+
stack.push(obj);
|
|
62
|
+
canonicalizedObj = {};
|
|
63
|
+
replacementStack.push(canonicalizedObj);
|
|
64
|
+
var sortedKeys = [], _key;
|
|
65
|
+
for (_key in obj)
|
|
66
|
+
/* istanbul ignore else */
|
|
67
|
+
if (Object.prototype.hasOwnProperty.call(obj, _key)) sortedKeys.push(_key);
|
|
68
|
+
sortedKeys.sort();
|
|
69
|
+
for (i = 0; i < sortedKeys.length; i += 1) {
|
|
70
|
+
_key = sortedKeys[i];
|
|
71
|
+
canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
|
|
72
|
+
}
|
|
73
|
+
stack.pop();
|
|
74
|
+
replacementStack.pop();
|
|
75
|
+
} else canonicalizedObj = obj;
|
|
76
|
+
return canonicalizedObj;
|
|
77
|
+
}
|
|
78
|
+
}) });
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export default require_json();
|
|
82
|
+
|
|
83
|
+
export { require_json };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
import { require_params } from "../util/params.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js
|
|
6
|
+
var require_line = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js": ((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.diffLines = diffLines;
|
|
9
|
+
exports.diffTrimmedLines = diffTrimmedLines;
|
|
10
|
+
/*istanbul ignore end*/
|
|
11
|
+
var _base = _interopRequireDefault(require_base());
|
|
12
|
+
var _params = require_params();
|
|
13
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
15
|
+
}
|
|
16
|
+
/*istanbul ignore end*/
|
|
17
|
+
var lineDiff = exports.lineDiff = new _base["default"]();
|
|
18
|
+
lineDiff.tokenize = function(value, options) {
|
|
19
|
+
if (options.stripTrailingCr) value = value.replace(/\r\n/g, "\n");
|
|
20
|
+
var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
|
|
21
|
+
if (!linesAndNewlines[linesAndNewlines.length - 1]) linesAndNewlines.pop();
|
|
22
|
+
for (var i = 0; i < linesAndNewlines.length; i++) {
|
|
23
|
+
var line = linesAndNewlines[i];
|
|
24
|
+
if (i % 2 && !options.newlineIsToken) retLines[retLines.length - 1] += line;
|
|
25
|
+
else retLines.push(line);
|
|
26
|
+
}
|
|
27
|
+
return retLines;
|
|
28
|
+
};
|
|
29
|
+
lineDiff.equals = function(left, right, options) {
|
|
30
|
+
if (options.ignoreWhitespace) {
|
|
31
|
+
if (!options.newlineIsToken || !left.includes("\n")) left = left.trim();
|
|
32
|
+
if (!options.newlineIsToken || !right.includes("\n")) right = right.trim();
|
|
33
|
+
} else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
|
|
34
|
+
if (left.endsWith("\n")) left = left.slice(0, -1);
|
|
35
|
+
if (right.endsWith("\n")) right = right.slice(0, -1);
|
|
36
|
+
}
|
|
37
|
+
return _base["default"].prototype.equals.call(this, left, right, options);
|
|
38
|
+
};
|
|
39
|
+
function diffLines(oldStr, newStr, callback) {
|
|
40
|
+
return lineDiff.diff(oldStr, newStr, callback);
|
|
41
|
+
}
|
|
42
|
+
function diffTrimmedLines(oldStr, newStr, callback) {
|
|
43
|
+
var options = (0, _params.generateOptions)(callback, { ignoreWhitespace: true });
|
|
44
|
+
return lineDiff.diff(oldStr, newStr, options);
|
|
45
|
+
}
|
|
46
|
+
}) });
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export default require_line();
|
|
50
|
+
|
|
51
|
+
export { require_line };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js
|
|
5
|
+
var require_sentence = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js": ((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffSentences = diffSentences;
|
|
8
|
+
/*istanbul ignore end*/
|
|
9
|
+
var _base = _interopRequireDefault(require_base());
|
|
10
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12
|
+
}
|
|
13
|
+
/*istanbul ignore end*/
|
|
14
|
+
var sentenceDiff = exports.sentenceDiff = new _base["default"]();
|
|
15
|
+
sentenceDiff.tokenize = function(value) {
|
|
16
|
+
return value.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
17
|
+
};
|
|
18
|
+
function diffSentences(oldStr, newStr, callback) {
|
|
19
|
+
return sentenceDiff.diff(oldStr, newStr, callback);
|
|
20
|
+
}
|
|
21
|
+
}) });
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export default require_sentence();
|
|
25
|
+
|
|
26
|
+
export { require_sentence };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_base } from "./base.js";
|
|
3
|
+
import { require_string } from "../util/string.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js
|
|
6
|
+
var require_word = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js": ((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.diffWords = diffWords;
|
|
9
|
+
exports.diffWordsWithSpace = diffWordsWithSpace;
|
|
10
|
+
/*istanbul ignore end*/
|
|
11
|
+
var _base = _interopRequireDefault(require_base());
|
|
12
|
+
var _string = require_string();
|
|
13
|
+
/*istanbul ignore start*/ function _interopRequireDefault(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : { "default": obj };
|
|
15
|
+
}
|
|
16
|
+
/*istanbul ignore end*/
|
|
17
|
+
var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
|
|
18
|
+
var tokenizeIncludingWhitespace = new RegExp(
|
|
19
|
+
/*istanbul ignore start*/
|
|
20
|
+
"[".concat(
|
|
21
|
+
/*istanbul ignore end*/
|
|
22
|
+
extendedWordChars,
|
|
23
|
+
"]+|\\s+|[^"
|
|
24
|
+
).concat(extendedWordChars, "]"),
|
|
25
|
+
"ug"
|
|
26
|
+
);
|
|
27
|
+
var wordDiff = exports.wordDiff = new _base["default"]();
|
|
28
|
+
wordDiff.equals = function(left, right, options) {
|
|
29
|
+
if (options.ignoreCase) {
|
|
30
|
+
left = left.toLowerCase();
|
|
31
|
+
right = right.toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
return left.trim() === right.trim();
|
|
34
|
+
};
|
|
35
|
+
wordDiff.tokenize = function(value) {
|
|
36
|
+
/*istanbul ignore start*/
|
|
37
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
38
|
+
var parts;
|
|
39
|
+
if (options.intlSegmenter) {
|
|
40
|
+
if (options.intlSegmenter.resolvedOptions().granularity != "word") throw new Error("The segmenter passed must have a granularity of \"word\"");
|
|
41
|
+
parts = Array.from(options.intlSegmenter.segment(value), function(segment) {
|
|
42
|
+
return segment.segment;
|
|
43
|
+
});
|
|
44
|
+
} else parts = value.match(tokenizeIncludingWhitespace) || [];
|
|
45
|
+
var tokens = [];
|
|
46
|
+
var prevPart = null;
|
|
47
|
+
parts.forEach(function(part) {
|
|
48
|
+
if (/\s/.test(part)) if (prevPart == null) tokens.push(part);
|
|
49
|
+
else tokens.push(tokens.pop() + part);
|
|
50
|
+
else if (/\s/.test(prevPart)) if (tokens[tokens.length - 1] == prevPart) tokens.push(tokens.pop() + part);
|
|
51
|
+
else tokens.push(prevPart + part);
|
|
52
|
+
else tokens.push(part);
|
|
53
|
+
prevPart = part;
|
|
54
|
+
});
|
|
55
|
+
return tokens;
|
|
56
|
+
};
|
|
57
|
+
wordDiff.join = function(tokens) {
|
|
58
|
+
return tokens.map(function(token, i) {
|
|
59
|
+
if (i == 0) return token;
|
|
60
|
+
else return token.replace(/^\s+/, "");
|
|
61
|
+
}).join("");
|
|
62
|
+
};
|
|
63
|
+
wordDiff.postProcess = function(changes, options) {
|
|
64
|
+
if (!changes || options.oneChangePerToken) return changes;
|
|
65
|
+
var lastKeep = null;
|
|
66
|
+
var insertion = null;
|
|
67
|
+
var deletion = null;
|
|
68
|
+
changes.forEach(function(change) {
|
|
69
|
+
if (change.added) insertion = change;
|
|
70
|
+
else if (change.removed) deletion = change;
|
|
71
|
+
else {
|
|
72
|
+
if (insertion || deletion) dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
|
|
73
|
+
lastKeep = change;
|
|
74
|
+
insertion = null;
|
|
75
|
+
deletion = null;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
if (insertion || deletion) dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
|
|
79
|
+
return changes;
|
|
80
|
+
};
|
|
81
|
+
function diffWords(oldStr, newStr, options) {
|
|
82
|
+
if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) return diffWordsWithSpace(oldStr, newStr, options);
|
|
83
|
+
return wordDiff.diff(oldStr, newStr, options);
|
|
84
|
+
}
|
|
85
|
+
function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
|
|
86
|
+
if (deletion && insertion) {
|
|
87
|
+
var oldWsPrefix = deletion.value.match(/^\s*/)[0];
|
|
88
|
+
var oldWsSuffix = deletion.value.match(/\s*$/)[0];
|
|
89
|
+
var newWsPrefix = insertion.value.match(/^\s*/)[0];
|
|
90
|
+
var newWsSuffix = insertion.value.match(/\s*$/)[0];
|
|
91
|
+
if (startKeep) {
|
|
92
|
+
var commonWsPrefix = (0, _string.longestCommonPrefix)(oldWsPrefix, newWsPrefix);
|
|
93
|
+
startKeep.value = (0, _string.replaceSuffix)(startKeep.value, newWsPrefix, commonWsPrefix);
|
|
94
|
+
deletion.value = (0, _string.removePrefix)(deletion.value, commonWsPrefix);
|
|
95
|
+
insertion.value = (0, _string.removePrefix)(insertion.value, commonWsPrefix);
|
|
96
|
+
}
|
|
97
|
+
if (endKeep) {
|
|
98
|
+
var commonWsSuffix = (0, _string.longestCommonSuffix)(oldWsSuffix, newWsSuffix);
|
|
99
|
+
endKeep.value = (0, _string.replacePrefix)(endKeep.value, newWsSuffix, commonWsSuffix);
|
|
100
|
+
deletion.value = (0, _string.removeSuffix)(deletion.value, commonWsSuffix);
|
|
101
|
+
insertion.value = (0, _string.removeSuffix)(insertion.value, commonWsSuffix);
|
|
102
|
+
}
|
|
103
|
+
} else if (insertion) {
|
|
104
|
+
if (startKeep) insertion.value = insertion.value.replace(/^\s*/, "");
|
|
105
|
+
if (endKeep) endKeep.value = endKeep.value.replace(/^\s*/, "");
|
|
106
|
+
} else if (startKeep && endKeep) {
|
|
107
|
+
var newWsFull = endKeep.value.match(/^\s*/)[0], delWsStart = deletion.value.match(/^\s*/)[0], delWsEnd = deletion.value.match(/\s*$/)[0];
|
|
108
|
+
var newWsStart = (0, _string.longestCommonPrefix)(newWsFull, delWsStart);
|
|
109
|
+
deletion.value = (0, _string.removePrefix)(deletion.value, newWsStart);
|
|
110
|
+
var newWsEnd = (0, _string.longestCommonSuffix)(
|
|
111
|
+
/*istanbul ignore start*/
|
|
112
|
+
(0, _string.removePrefix)(newWsFull, newWsStart),
|
|
113
|
+
delWsEnd
|
|
114
|
+
);
|
|
115
|
+
deletion.value = (0, _string.removeSuffix)(deletion.value, newWsEnd);
|
|
116
|
+
endKeep.value = (0, _string.replacePrefix)(endKeep.value, newWsFull, newWsEnd);
|
|
117
|
+
startKeep.value = (0, _string.replaceSuffix)(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
|
|
118
|
+
} else if (endKeep) {
|
|
119
|
+
var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0];
|
|
120
|
+
var deletionWsSuffix = deletion.value.match(/\s*$/)[0];
|
|
121
|
+
var overlap = (0, _string.maximumOverlap)(deletionWsSuffix, endKeepWsPrefix);
|
|
122
|
+
deletion.value = (0, _string.removeSuffix)(deletion.value, overlap);
|
|
123
|
+
} else if (startKeep) {
|
|
124
|
+
var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0];
|
|
125
|
+
var deletionWsPrefix = deletion.value.match(/^\s*/)[0];
|
|
126
|
+
var _overlap = (0, _string.maximumOverlap)(startKeepWsSuffix, deletionWsPrefix);
|
|
127
|
+
deletion.value = (0, _string.removePrefix)(deletion.value, _overlap);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
var wordWithSpaceDiff = exports.wordWithSpaceDiff = new _base["default"]();
|
|
131
|
+
wordWithSpaceDiff.tokenize = function(value) {
|
|
132
|
+
var regex = new RegExp(
|
|
133
|
+
/*istanbul ignore start*/
|
|
134
|
+
"(\\r?\\n)|[".concat(
|
|
135
|
+
/*istanbul ignore end*/
|
|
136
|
+
extendedWordChars,
|
|
137
|
+
"]+|[^\\S\\n\\r]+|[^"
|
|
138
|
+
).concat(extendedWordChars, "]"),
|
|
139
|
+
"ug"
|
|
140
|
+
);
|
|
141
|
+
return value.match(regex) || [];
|
|
142
|
+
};
|
|
143
|
+
function diffWordsWithSpace(oldStr, newStr, options) {
|
|
144
|
+
return wordWithSpaceDiff.diff(oldStr, newStr, options);
|
|
145
|
+
}
|
|
146
|
+
}) });
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
export default require_word();
|
|
150
|
+
|
|
151
|
+
export { require_word };
|