ibm-cloud-sdk-core 4.3.3 → 4.3.4
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/iamtest.env +3 -0
- package/package.json +2 -2
- package/sdk-test-utilities/node_modules/.package-lock.json +508 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/lib/index.js +156 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/package.json +30 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/identifier.js +70 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/index.js +57 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/keyword.js +35 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/package.json +31 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/lib/index.js +119 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/index.js +165 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/package.json +56 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md +147 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/index.js +228 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/index.js.flow +93 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/package.json +71 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/readme.md +314 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/templates.js +128 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/types/index.d.ts +97 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/CHANGELOG.md +54 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/README.md +68 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/conversions.js +868 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/index.js +78 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/package.json +46 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/route.js +97 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/.eslintrc.json +43 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/LICENSE +8 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/README.md +11 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/index.js +152 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/package.json +25 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/test.js +7 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js +11 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/license +21 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json +41 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md +27 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/index.js +8 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/package.json +44 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/readme.md +70 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/browser.js +5 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/index.js +131 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/package.json +53 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/readme.md +66 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/package.json +30 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/README.md +5 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/immutableUtils.js +66 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/index.d.ts +94 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/index.js +34 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/jasmineUtils.js +218 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/utils.js +462 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/package.json +35 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/README.md +3 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/build/index.d.ts +63 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/build/index.js +60 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/package.json +29 -0
- package/sdk-test-utilities/node_modules/@jest/types/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/types/README.md +30 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Circus.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Config.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Global.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/TestResult.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/index.d.ts +1204 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/index.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/package.json +38 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/compiler.d.ts +35 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/compiler.js +577 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/index.d.ts +2 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/index.js +47 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/errors.d.ts +88 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/errors.js +609 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/index.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/index.js +44 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/license +23 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/package.json +47 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/readme.md +1424 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/index.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/index.js +44 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/system.d.ts +26 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/system.js +90 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/typebox.d.ts +723 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/typebox.js +2220 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/cast.d.ts +30 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/cast.js +372 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/check.d.ts +12 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/check.js +484 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/clone.d.ts +3 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/clone.js +71 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/convert.d.ts +13 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/convert.js +372 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/create.d.ts +26 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/create.js +480 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/delta.d.ts +43 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/delta.js +204 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/equal.d.ts +3 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/equal.js +80 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/hash.d.ts +8 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/hash.js +208 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/index.d.ts +6 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/index.js +56 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/is.d.ts +11 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/is.js +53 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/mutate.d.ts +13 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/mutate.js +121 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/pointer.d.ts +24 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/pointer.js +142 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/value.d.ts +39 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/value.js +99 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/index.d.ts +111 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/package.json +25 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/index.d.ts +184 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/package.json +32 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/README.md +86 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/index.d.ts +67 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/package.json +32 -0
- package/sdk-test-utilities/node_modules/@types/node/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/node/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/sdk-test-utilities/node_modules/@types/node/assert.d.ts +1040 -0
- package/sdk-test-utilities/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/sdk-test-utilities/node_modules/@types/node/buffer.d.ts +2363 -0
- package/sdk-test-utilities/node_modules/@types/node/child_process.d.ts +1544 -0
- package/sdk-test-utilities/node_modules/@types/node/cluster.d.ts +578 -0
- package/sdk-test-utilities/node_modules/@types/node/console.d.ts +452 -0
- package/sdk-test-utilities/node_modules/@types/node/constants.d.ts +19 -0
- package/sdk-test-utilities/node_modules/@types/node/crypto.d.ts +4523 -0
- package/sdk-test-utilities/node_modules/@types/node/dgram.d.ts +596 -0
- package/sdk-test-utilities/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/sdk-test-utilities/node_modules/@types/node/dns/promises.d.ts +474 -0
- package/sdk-test-utilities/node_modules/@types/node/dns.d.ts +864 -0
- package/sdk-test-utilities/node_modules/@types/node/dom-events.d.ts +124 -0
- package/sdk-test-utilities/node_modules/@types/node/domain.d.ts +170 -0
- package/sdk-test-utilities/node_modules/@types/node/events.d.ts +909 -0
- package/sdk-test-utilities/node_modules/@types/node/fs/promises.d.ts +1245 -0
- package/sdk-test-utilities/node_modules/@types/node/fs.d.ts +4317 -0
- package/sdk-test-utilities/node_modules/@types/node/globals.d.ts +411 -0
- package/sdk-test-utilities/node_modules/@types/node/globals.global.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@types/node/http.d.ts +1908 -0
- package/sdk-test-utilities/node_modules/@types/node/http2.d.ts +2418 -0
- package/sdk-test-utilities/node_modules/@types/node/https.d.ts +550 -0
- package/sdk-test-utilities/node_modules/@types/node/index.d.ts +89 -0
- package/sdk-test-utilities/node_modules/@types/node/inspector.d.ts +2746 -0
- package/sdk-test-utilities/node_modules/@types/node/module.d.ts +315 -0
- package/sdk-test-utilities/node_modules/@types/node/net.d.ts +999 -0
- package/sdk-test-utilities/node_modules/@types/node/os.d.ts +495 -0
- package/sdk-test-utilities/node_modules/@types/node/package.json +217 -0
- package/sdk-test-utilities/node_modules/@types/node/path.d.ts +191 -0
- package/sdk-test-utilities/node_modules/@types/node/perf_hooks.d.ts +905 -0
- package/sdk-test-utilities/node_modules/@types/node/process.d.ts +1754 -0
- package/sdk-test-utilities/node_modules/@types/node/punycode.d.ts +117 -0
- package/sdk-test-utilities/node_modules/@types/node/querystring.d.ts +153 -0
- package/sdk-test-utilities/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/sdk-test-utilities/node_modules/@types/node/readline.d.ts +540 -0
- package/sdk-test-utilities/node_modules/@types/node/repl.d.ts +430 -0
- package/sdk-test-utilities/node_modules/@types/node/sea.d.ts +153 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/web.d.ts +367 -0
- package/sdk-test-utilities/node_modules/@types/node/stream.d.ts +1707 -0
- package/sdk-test-utilities/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/sdk-test-utilities/node_modules/@types/node/test.d.ts +1718 -0
- package/sdk-test-utilities/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/sdk-test-utilities/node_modules/@types/node/timers.d.ts +240 -0
- package/sdk-test-utilities/node_modules/@types/node/tls.d.ts +1217 -0
- package/sdk-test-utilities/node_modules/@types/node/trace_events.d.ts +197 -0
- package/sdk-test-utilities/node_modules/@types/node/tty.d.ts +208 -0
- package/sdk-test-utilities/node_modules/@types/node/url.d.ts +952 -0
- package/sdk-test-utilities/node_modules/@types/node/util.d.ts +2292 -0
- package/sdk-test-utilities/node_modules/@types/node/v8.d.ts +808 -0
- package/sdk-test-utilities/node_modules/@types/node/vm.d.ts +924 -0
- package/sdk-test-utilities/node_modules/@types/node/wasi.d.ts +181 -0
- package/sdk-test-utilities/node_modules/@types/node/worker_threads.d.ts +691 -0
- package/sdk-test-utilities/node_modules/@types/node/zlib.d.ts +530 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/README.md +78 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/index.d.ts +59 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/package.json +25 -0
- package/sdk-test-utilities/node_modules/@types/yargs/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/yargs/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/yargs/helpers.d.mts +1 -0
- package/sdk-test-utilities/node_modules/@types/yargs/helpers.d.ts +5 -0
- package/sdk-test-utilities/node_modules/@types/yargs/index.d.mts +46 -0
- package/sdk-test-utilities/node_modules/@types/yargs/index.d.ts +1031 -0
- package/sdk-test-utilities/node_modules/@types/yargs/package.json +87 -0
- package/sdk-test-utilities/node_modules/@types/yargs/yargs.d.ts +9 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/index.d.ts +112 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/package.json +25 -0
- package/sdk-test-utilities/node_modules/ansi-styles/index.d.ts +345 -0
- package/sdk-test-utilities/node_modules/ansi-styles/index.js +163 -0
- package/sdk-test-utilities/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/ansi-styles/package.json +56 -0
- package/sdk-test-utilities/node_modules/ansi-styles/readme.md +152 -0
- package/sdk-test-utilities/node_modules/braces/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/braces/README.md +586 -0
- package/sdk-test-utilities/node_modules/braces/index.js +170 -0
- package/sdk-test-utilities/node_modules/braces/lib/compile.js +60 -0
- package/sdk-test-utilities/node_modules/braces/lib/constants.js +57 -0
- package/sdk-test-utilities/node_modules/braces/lib/expand.js +113 -0
- package/sdk-test-utilities/node_modules/braces/lib/parse.js +331 -0
- package/sdk-test-utilities/node_modules/braces/lib/stringify.js +32 -0
- package/sdk-test-utilities/node_modules/braces/lib/utils.js +122 -0
- package/sdk-test-utilities/node_modules/braces/package.json +77 -0
- package/sdk-test-utilities/node_modules/chalk/index.d.ts +415 -0
- package/sdk-test-utilities/node_modules/chalk/license +9 -0
- package/sdk-test-utilities/node_modules/chalk/package.json +68 -0
- package/sdk-test-utilities/node_modules/chalk/readme.md +341 -0
- package/sdk-test-utilities/node_modules/chalk/source/index.js +229 -0
- package/sdk-test-utilities/node_modules/chalk/source/templates.js +134 -0
- package/sdk-test-utilities/node_modules/chalk/source/util.js +39 -0
- package/sdk-test-utilities/node_modules/ci-info/CHANGELOG.md +178 -0
- package/sdk-test-utilities/node_modules/ci-info/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/ci-info/README.md +135 -0
- package/sdk-test-utilities/node_modules/ci-info/index.d.ts +75 -0
- package/sdk-test-utilities/node_modules/ci-info/index.js +90 -0
- package/sdk-test-utilities/node_modules/ci-info/package.json +45 -0
- package/sdk-test-utilities/node_modules/ci-info/vendors.json +321 -0
- package/sdk-test-utilities/node_modules/color-convert/CHANGELOG.md +54 -0
- package/sdk-test-utilities/node_modules/color-convert/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/color-convert/README.md +68 -0
- package/sdk-test-utilities/node_modules/color-convert/conversions.js +839 -0
- package/sdk-test-utilities/node_modules/color-convert/index.js +81 -0
- package/sdk-test-utilities/node_modules/color-convert/package.json +48 -0
- package/sdk-test-utilities/node_modules/color-convert/route.js +97 -0
- package/sdk-test-utilities/node_modules/color-name/LICENSE +8 -0
- package/sdk-test-utilities/node_modules/color-name/README.md +11 -0
- package/sdk-test-utilities/node_modules/color-name/index.js +152 -0
- package/sdk-test-utilities/node_modules/color-name/package.json +28 -0
- package/sdk-test-utilities/node_modules/diff-sequences/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/diff-sequences/README.md +404 -0
- package/sdk-test-utilities/node_modules/diff-sequences/build/index.d.ts +38 -0
- package/sdk-test-utilities/node_modules/diff-sequences/build/index.js +798 -0
- package/sdk-test-utilities/node_modules/diff-sequences/package.json +39 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/index.js +11 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/license +9 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/package.json +43 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/readme.md +29 -0
- package/sdk-test-utilities/node_modules/expect/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/expect/README.md +3 -0
- package/sdk-test-utilities/node_modules/expect/build/asymmetricMatchers.js +375 -0
- package/sdk-test-utilities/node_modules/expect/build/extractExpectedAssertionsErrors.js +86 -0
- package/sdk-test-utilities/node_modules/expect/build/index.d.ts +370 -0
- package/sdk-test-utilities/node_modules/expect/build/index.js +410 -0
- package/sdk-test-utilities/node_modules/expect/build/jestMatchersObject.js +123 -0
- package/sdk-test-utilities/node_modules/expect/build/matchers.js +1292 -0
- package/sdk-test-utilities/node_modules/expect/build/print.js +122 -0
- package/sdk-test-utilities/node_modules/expect/build/spyMatchers.js +1254 -0
- package/sdk-test-utilities/node_modules/expect/build/toThrowMatchers.js +481 -0
- package/sdk-test-utilities/node_modules/expect/build/types.js +3 -0
- package/sdk-test-utilities/node_modules/expect/package.json +43 -0
- package/sdk-test-utilities/node_modules/fill-range/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/fill-range/README.md +237 -0
- package/sdk-test-utilities/node_modules/fill-range/index.js +248 -0
- package/sdk-test-utilities/node_modules/fill-range/package.json +74 -0
- package/sdk-test-utilities/node_modules/graceful-fs/LICENSE +15 -0
- package/sdk-test-utilities/node_modules/graceful-fs/README.md +143 -0
- package/sdk-test-utilities/node_modules/graceful-fs/clone.js +23 -0
- package/sdk-test-utilities/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/sdk-test-utilities/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/sdk-test-utilities/node_modules/graceful-fs/package.json +53 -0
- package/sdk-test-utilities/node_modules/graceful-fs/polyfills.js +355 -0
- package/sdk-test-utilities/node_modules/has-flag/index.d.ts +39 -0
- package/sdk-test-utilities/node_modules/has-flag/index.js +8 -0
- package/sdk-test-utilities/node_modules/has-flag/license +9 -0
- package/sdk-test-utilities/node_modules/has-flag/package.json +46 -0
- package/sdk-test-utilities/node_modules/has-flag/readme.md +89 -0
- package/sdk-test-utilities/node_modules/is-number/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/is-number/README.md +187 -0
- package/sdk-test-utilities/node_modules/is-number/index.js +18 -0
- package/sdk-test-utilities/node_modules/is-number/package.json +82 -0
- package/sdk-test-utilities/node_modules/jest-diff/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-diff/README.md +671 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/cleanupSemantic.js +599 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/constants.js +19 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/diffLines.js +193 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/diffStrings.js +66 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/getAlignedDiffs.js +223 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/index.d.ts +93 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/index.js +232 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/joinAlignedDiffs.js +271 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/normalizeDiffOptions.js +59 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/printDiffs.js +79 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/jest-diff/package.json +36 -0
- package/sdk-test-utilities/node_modules/jest-get-type/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-get-type/build/index.d.ts +27 -0
- package/sdk-test-utilities/node_modules/jest-get-type/build/index.js +53 -0
- package/sdk-test-utilities/node_modules/jest-get-type/package.json +27 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/README.md +24 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/Replaceable.js +64 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js +111 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/index.d.ts +138 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/index.js +542 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/package.json +37 -0
- package/sdk-test-utilities/node_modules/jest-message-util/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/index.d.ts +68 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/index.js +518 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/jest-message-util/package.json +43 -0
- package/sdk-test-utilities/node_modules/jest-util/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-util/Readme.md +87 -0
- package/sdk-test-utilities/node_modules/jest-util/build/ErrorWithStack.js +28 -0
- package/sdk-test-utilities/node_modules/jest-util/build/clearLine.js +18 -0
- package/sdk-test-utilities/node_modules/jest-util/build/convertDescriptorToString.js +30 -0
- package/sdk-test-utilities/node_modules/jest-util/build/createDirectory.js +71 -0
- package/sdk-test-utilities/node_modules/jest-util/build/createProcessObject.js +109 -0
- package/sdk-test-utilities/node_modules/jest-util/build/deepCyclicCopy.js +76 -0
- package/sdk-test-utilities/node_modules/jest-util/build/formatTime.js +24 -0
- package/sdk-test-utilities/node_modules/jest-util/build/globsToMatcher.js +98 -0
- package/sdk-test-utilities/node_modules/jest-util/build/index.d.ts +136 -0
- package/sdk-test-utilities/node_modules/jest-util/build/index.js +199 -0
- package/sdk-test-utilities/node_modules/jest-util/build/installCommonGlobals.js +115 -0
- package/sdk-test-utilities/node_modules/jest-util/build/interopRequireDefault.js +22 -0
- package/sdk-test-utilities/node_modules/jest-util/build/invariant.js +18 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isInteractive.js +22 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isNonNullable.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isPromise.js +20 -0
- package/sdk-test-utilities/node_modules/jest-util/build/pluralize.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/preRunMessage.js +38 -0
- package/sdk-test-utilities/node_modules/jest-util/build/replacePathSepForGlob.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/requireOrImportModule.js +77 -0
- package/sdk-test-utilities/node_modules/jest-util/build/setGlobal.js +17 -0
- package/sdk-test-utilities/node_modules/jest-util/build/specialChars.js +25 -0
- package/sdk-test-utilities/node_modules/jest-util/build/testPathPatternToRegExp.js +19 -0
- package/sdk-test-utilities/node_modules/jest-util/build/tryRealpath.js +30 -0
- package/sdk-test-utilities/node_modules/jest-util/package.json +38 -0
- package/sdk-test-utilities/node_modules/js-tokens/CHANGELOG.md +151 -0
- package/sdk-test-utilities/node_modules/js-tokens/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/js-tokens/README.md +240 -0
- package/sdk-test-utilities/node_modules/js-tokens/index.js +23 -0
- package/sdk-test-utilities/node_modules/js-tokens/package.json +30 -0
- package/sdk-test-utilities/node_modules/micromatch/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/micromatch/README.md +1017 -0
- package/sdk-test-utilities/node_modules/micromatch/index.js +467 -0
- package/sdk-test-utilities/node_modules/micromatch/package.json +101 -0
- package/sdk-test-utilities/node_modules/picocolors/LICENSE +15 -0
- package/sdk-test-utilities/node_modules/picocolors/README.md +21 -0
- package/sdk-test-utilities/node_modules/picocolors/package.json +25 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.browser.js +4 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.d.ts +5 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.js +65 -0
- package/sdk-test-utilities/node_modules/picomatch/CHANGELOG.md +136 -0
- package/sdk-test-utilities/node_modules/picomatch/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/picomatch/README.md +708 -0
- package/sdk-test-utilities/node_modules/picomatch/index.js +3 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/constants.js +179 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/parse.js +1091 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/picomatch.js +342 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/scan.js +391 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/utils.js +64 -0
- package/sdk-test-utilities/node_modules/picomatch/package.json +81 -0
- package/sdk-test-utilities/node_modules/pretty-format/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/pretty-format/README.md +463 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/collections.js +180 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/index.d.ts +163 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/index.js +478 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js +89 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/DOMCollection.js +67 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/DOMElement.js +101 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/Immutable.js +217 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/ReactElement.js +143 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/ReactTestComponent.js +66 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/lib/escapeHTML.js +16 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/lib/markup.js +113 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/index.d.ts +167 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/index.js +164 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/package.json +52 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/readme.md +144 -0
- package/sdk-test-utilities/node_modules/pretty-format/package.json +43 -0
- package/sdk-test-utilities/node_modules/react-is/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/react-is/README.md +104 -0
- package/sdk-test-utilities/node_modules/react-is/cjs/react-is.development.js +221 -0
- package/sdk-test-utilities/node_modules/react-is/cjs/react-is.production.min.js +14 -0
- package/sdk-test-utilities/node_modules/react-is/index.js +7 -0
- package/sdk-test-utilities/node_modules/react-is/package.json +26 -0
- package/sdk-test-utilities/node_modules/react-is/umd/react-is.development.js +220 -0
- package/sdk-test-utilities/node_modules/react-is/umd/react-is.production.min.js +15 -0
- package/sdk-test-utilities/node_modules/slash/index.d.ts +25 -0
- package/sdk-test-utilities/node_modules/slash/index.js +11 -0
- package/sdk-test-utilities/node_modules/slash/license +9 -0
- package/sdk-test-utilities/node_modules/slash/package.json +35 -0
- package/sdk-test-utilities/node_modules/slash/readme.md +44 -0
- package/sdk-test-utilities/node_modules/stack-utils/LICENSE.md +21 -0
- package/sdk-test-utilities/node_modules/stack-utils/index.js +344 -0
- package/sdk-test-utilities/node_modules/stack-utils/package.json +39 -0
- package/sdk-test-utilities/node_modules/stack-utils/readme.md +143 -0
- package/sdk-test-utilities/node_modules/supports-color/browser.js +5 -0
- package/sdk-test-utilities/node_modules/supports-color/index.js +135 -0
- package/sdk-test-utilities/node_modules/supports-color/license +9 -0
- package/sdk-test-utilities/node_modules/supports-color/package.json +53 -0
- package/sdk-test-utilities/node_modules/supports-color/readme.md +76 -0
- package/sdk-test-utilities/node_modules/to-regex-range/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/to-regex-range/README.md +305 -0
- package/sdk-test-utilities/node_modules/to-regex-range/index.js +288 -0
- package/sdk-test-utilities/node_modules/to-regex-range/package.json +88 -0
- package/sdk-test-utilities/node_modules/undici-types/README.md +6 -0
- package/sdk-test-utilities/node_modules/undici-types/agent.d.ts +31 -0
- package/sdk-test-utilities/node_modules/undici-types/api.d.ts +43 -0
- package/sdk-test-utilities/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/sdk-test-utilities/node_modules/undici-types/cache.d.ts +36 -0
- package/sdk-test-utilities/node_modules/undici-types/client.d.ts +97 -0
- package/sdk-test-utilities/node_modules/undici-types/connector.d.ts +34 -0
- package/sdk-test-utilities/node_modules/undici-types/content-type.d.ts +21 -0
- package/sdk-test-utilities/node_modules/undici-types/cookies.d.ts +28 -0
- package/sdk-test-utilities/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/sdk-test-utilities/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/sdk-test-utilities/node_modules/undici-types/errors.d.ts +128 -0
- package/sdk-test-utilities/node_modules/undici-types/fetch.d.ts +209 -0
- package/sdk-test-utilities/node_modules/undici-types/file.d.ts +39 -0
- package/sdk-test-utilities/node_modules/undici-types/filereader.d.ts +54 -0
- package/sdk-test-utilities/node_modules/undici-types/formdata.d.ts +108 -0
- package/sdk-test-utilities/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/sdk-test-utilities/node_modules/undici-types/global-origin.d.ts +7 -0
- package/sdk-test-utilities/node_modules/undici-types/handlers.d.ts +9 -0
- package/sdk-test-utilities/node_modules/undici-types/header.d.ts +4 -0
- package/sdk-test-utilities/node_modules/undici-types/index.d.ts +63 -0
- package/sdk-test-utilities/node_modules/undici-types/interceptors.d.ts +5 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-client.d.ts +25 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/sdk-test-utilities/node_modules/undici-types/package.json +55 -0
- package/sdk-test-utilities/node_modules/undici-types/patch.d.ts +71 -0
- package/sdk-test-utilities/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/sdk-test-utilities/node_modules/undici-types/pool.d.ts +28 -0
- package/sdk-test-utilities/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/sdk-test-utilities/node_modules/undici-types/readable.d.ts +61 -0
- package/sdk-test-utilities/node_modules/undici-types/webidl.d.ts +220 -0
- package/sdk-test-utilities/node_modules/undici-types/websocket.d.ts +131 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, 'DIFF_DELETE', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _cleanupSemantic.DIFF_DELETE;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, 'DIFF_EQUAL', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _cleanupSemantic.DIFF_EQUAL;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, 'DIFF_INSERT', {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _cleanupSemantic.DIFF_INSERT;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, 'Diff', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _cleanupSemantic.Diff;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
exports.diff = diff;
|
|
31
|
+
Object.defineProperty(exports, 'diffLinesRaw', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _diffLines.diffLinesRaw;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, 'diffLinesUnified', {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _diffLines.diffLinesUnified;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, 'diffLinesUnified2', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _diffLines.diffLinesUnified2;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, 'diffStringsRaw', {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return _printDiffs.diffStringsRaw;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, 'diffStringsUnified', {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return _printDiffs.diffStringsUnified;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var _chalk = _interopRequireDefault(require('chalk'));
|
|
62
|
+
var _jestGetType = require('jest-get-type');
|
|
63
|
+
var _prettyFormat = require('pretty-format');
|
|
64
|
+
var _cleanupSemantic = require('./cleanupSemantic');
|
|
65
|
+
var _constants = require('./constants');
|
|
66
|
+
var _diffLines = require('./diffLines');
|
|
67
|
+
var _normalizeDiffOptions = require('./normalizeDiffOptions');
|
|
68
|
+
var _printDiffs = require('./printDiffs');
|
|
69
|
+
function _interopRequireDefault(obj) {
|
|
70
|
+
return obj && obj.__esModule ? obj : {default: obj};
|
|
71
|
+
}
|
|
72
|
+
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol;
|
|
73
|
+
/**
|
|
74
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the MIT license found in the
|
|
77
|
+
* LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/
|
|
79
|
+
const getCommonMessage = (message, options) => {
|
|
80
|
+
const {commonColor} = (0, _normalizeDiffOptions.normalizeDiffOptions)(
|
|
81
|
+
options
|
|
82
|
+
);
|
|
83
|
+
return commonColor(message);
|
|
84
|
+
};
|
|
85
|
+
const {
|
|
86
|
+
AsymmetricMatcher,
|
|
87
|
+
DOMCollection,
|
|
88
|
+
DOMElement,
|
|
89
|
+
Immutable,
|
|
90
|
+
ReactElement,
|
|
91
|
+
ReactTestComponent
|
|
92
|
+
} = _prettyFormat.plugins;
|
|
93
|
+
const PLUGINS = [
|
|
94
|
+
ReactTestComponent,
|
|
95
|
+
ReactElement,
|
|
96
|
+
DOMElement,
|
|
97
|
+
DOMCollection,
|
|
98
|
+
Immutable,
|
|
99
|
+
AsymmetricMatcher
|
|
100
|
+
];
|
|
101
|
+
const FORMAT_OPTIONS = {
|
|
102
|
+
plugins: PLUGINS
|
|
103
|
+
};
|
|
104
|
+
const FALLBACK_FORMAT_OPTIONS = {
|
|
105
|
+
callToJSON: false,
|
|
106
|
+
maxDepth: 10,
|
|
107
|
+
plugins: PLUGINS
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// Generate a string that will highlight the difference between two values
|
|
111
|
+
// with green and red. (similar to how github does code diffing)
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
113
|
+
function diff(a, b, options) {
|
|
114
|
+
if (Object.is(a, b)) {
|
|
115
|
+
return getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
|
|
116
|
+
}
|
|
117
|
+
const aType = (0, _jestGetType.getType)(a);
|
|
118
|
+
let expectedType = aType;
|
|
119
|
+
let omitDifference = false;
|
|
120
|
+
if (aType === 'object' && typeof a.asymmetricMatch === 'function') {
|
|
121
|
+
if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {
|
|
122
|
+
// Do not know expected type of user-defined asymmetric matcher.
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
if (typeof a.getExpectedType !== 'function') {
|
|
126
|
+
// For example, expect.anything() matches either null or undefined
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
expectedType = a.getExpectedType();
|
|
130
|
+
// Primitive types boolean and number omit difference below.
|
|
131
|
+
// For example, omit difference for expect.stringMatching(regexp)
|
|
132
|
+
omitDifference = expectedType === 'string';
|
|
133
|
+
}
|
|
134
|
+
if (expectedType !== (0, _jestGetType.getType)(b)) {
|
|
135
|
+
return (
|
|
136
|
+
' Comparing two different types of values.' +
|
|
137
|
+
` Expected ${_chalk.default.green(expectedType)} but ` +
|
|
138
|
+
`received ${_chalk.default.red((0, _jestGetType.getType)(b))}.`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
if (omitDifference) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
switch (aType) {
|
|
145
|
+
case 'string':
|
|
146
|
+
return (0, _diffLines.diffLinesUnified)(
|
|
147
|
+
a.split('\n'),
|
|
148
|
+
b.split('\n'),
|
|
149
|
+
options
|
|
150
|
+
);
|
|
151
|
+
case 'boolean':
|
|
152
|
+
case 'number':
|
|
153
|
+
return comparePrimitive(a, b, options);
|
|
154
|
+
case 'map':
|
|
155
|
+
return compareObjects(sortMap(a), sortMap(b), options);
|
|
156
|
+
case 'set':
|
|
157
|
+
return compareObjects(sortSet(a), sortSet(b), options);
|
|
158
|
+
default:
|
|
159
|
+
return compareObjects(a, b, options);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function comparePrimitive(a, b, options) {
|
|
163
|
+
const aFormat = (0, _prettyFormat.format)(a, FORMAT_OPTIONS);
|
|
164
|
+
const bFormat = (0, _prettyFormat.format)(b, FORMAT_OPTIONS);
|
|
165
|
+
return aFormat === bFormat
|
|
166
|
+
? getCommonMessage(_constants.NO_DIFF_MESSAGE, options)
|
|
167
|
+
: (0, _diffLines.diffLinesUnified)(
|
|
168
|
+
aFormat.split('\n'),
|
|
169
|
+
bFormat.split('\n'),
|
|
170
|
+
options
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
function sortMap(map) {
|
|
174
|
+
return new Map(Array.from(map.entries()).sort());
|
|
175
|
+
}
|
|
176
|
+
function sortSet(set) {
|
|
177
|
+
return new Set(Array.from(set.values()).sort());
|
|
178
|
+
}
|
|
179
|
+
function compareObjects(a, b, options) {
|
|
180
|
+
let difference;
|
|
181
|
+
let hasThrown = false;
|
|
182
|
+
try {
|
|
183
|
+
const formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
|
|
184
|
+
difference = getObjectsDifference(a, b, formatOptions, options);
|
|
185
|
+
} catch {
|
|
186
|
+
hasThrown = true;
|
|
187
|
+
}
|
|
188
|
+
const noDiffMessage = getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
|
|
189
|
+
// If the comparison yields no results, compare again but this time
|
|
190
|
+
// without calling `toJSON`. It's also possible that toJSON might throw.
|
|
191
|
+
if (difference === undefined || difference === noDiffMessage) {
|
|
192
|
+
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
193
|
+
difference = getObjectsDifference(a, b, formatOptions, options);
|
|
194
|
+
if (difference !== noDiffMessage && !hasThrown) {
|
|
195
|
+
difference = `${getCommonMessage(
|
|
196
|
+
_constants.SIMILAR_MESSAGE,
|
|
197
|
+
options
|
|
198
|
+
)}\n\n${difference}`;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return difference;
|
|
202
|
+
}
|
|
203
|
+
function getFormatOptions(formatOptions, options) {
|
|
204
|
+
const {compareKeys} = (0, _normalizeDiffOptions.normalizeDiffOptions)(
|
|
205
|
+
options
|
|
206
|
+
);
|
|
207
|
+
return {
|
|
208
|
+
...formatOptions,
|
|
209
|
+
compareKeys
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function getObjectsDifference(a, b, formatOptions, options) {
|
|
213
|
+
const formatOptionsZeroIndent = {
|
|
214
|
+
...formatOptions,
|
|
215
|
+
indent: 0
|
|
216
|
+
};
|
|
217
|
+
const aCompare = (0, _prettyFormat.format)(a, formatOptionsZeroIndent);
|
|
218
|
+
const bCompare = (0, _prettyFormat.format)(b, formatOptionsZeroIndent);
|
|
219
|
+
if (aCompare === bCompare) {
|
|
220
|
+
return getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
|
|
221
|
+
} else {
|
|
222
|
+
const aDisplay = (0, _prettyFormat.format)(a, formatOptions);
|
|
223
|
+
const bDisplay = (0, _prettyFormat.format)(b, formatOptions);
|
|
224
|
+
return (0, _diffLines.diffLinesUnified2)(
|
|
225
|
+
aDisplay.split('\n'),
|
|
226
|
+
bDisplay.split('\n'),
|
|
227
|
+
aCompare.split('\n'),
|
|
228
|
+
bCompare.split('\n'),
|
|
229
|
+
options
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.joinAlignedDiffsNoExpand = exports.joinAlignedDiffsExpand = void 0;
|
|
7
|
+
var _cleanupSemantic = require('./cleanupSemantic');
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const formatTrailingSpaces = (line, trailingSpaceFormatter) =>
|
|
16
|
+
line.replace(/\s+$/, match => trailingSpaceFormatter(match));
|
|
17
|
+
const printDiffLine = (
|
|
18
|
+
line,
|
|
19
|
+
isFirstOrLast,
|
|
20
|
+
color,
|
|
21
|
+
indicator,
|
|
22
|
+
trailingSpaceFormatter,
|
|
23
|
+
emptyFirstOrLastLinePlaceholder
|
|
24
|
+
) =>
|
|
25
|
+
line.length !== 0
|
|
26
|
+
? color(
|
|
27
|
+
`${indicator} ${formatTrailingSpaces(line, trailingSpaceFormatter)}`
|
|
28
|
+
)
|
|
29
|
+
: indicator !== ' '
|
|
30
|
+
? color(indicator)
|
|
31
|
+
: isFirstOrLast && emptyFirstOrLastLinePlaceholder.length !== 0
|
|
32
|
+
? color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`)
|
|
33
|
+
: '';
|
|
34
|
+
const printDeleteLine = (
|
|
35
|
+
line,
|
|
36
|
+
isFirstOrLast,
|
|
37
|
+
{
|
|
38
|
+
aColor,
|
|
39
|
+
aIndicator,
|
|
40
|
+
changeLineTrailingSpaceColor,
|
|
41
|
+
emptyFirstOrLastLinePlaceholder
|
|
42
|
+
}
|
|
43
|
+
) =>
|
|
44
|
+
printDiffLine(
|
|
45
|
+
line,
|
|
46
|
+
isFirstOrLast,
|
|
47
|
+
aColor,
|
|
48
|
+
aIndicator,
|
|
49
|
+
changeLineTrailingSpaceColor,
|
|
50
|
+
emptyFirstOrLastLinePlaceholder
|
|
51
|
+
);
|
|
52
|
+
const printInsertLine = (
|
|
53
|
+
line,
|
|
54
|
+
isFirstOrLast,
|
|
55
|
+
{
|
|
56
|
+
bColor,
|
|
57
|
+
bIndicator,
|
|
58
|
+
changeLineTrailingSpaceColor,
|
|
59
|
+
emptyFirstOrLastLinePlaceholder
|
|
60
|
+
}
|
|
61
|
+
) =>
|
|
62
|
+
printDiffLine(
|
|
63
|
+
line,
|
|
64
|
+
isFirstOrLast,
|
|
65
|
+
bColor,
|
|
66
|
+
bIndicator,
|
|
67
|
+
changeLineTrailingSpaceColor,
|
|
68
|
+
emptyFirstOrLastLinePlaceholder
|
|
69
|
+
);
|
|
70
|
+
const printCommonLine = (
|
|
71
|
+
line,
|
|
72
|
+
isFirstOrLast,
|
|
73
|
+
{
|
|
74
|
+
commonColor,
|
|
75
|
+
commonIndicator,
|
|
76
|
+
commonLineTrailingSpaceColor,
|
|
77
|
+
emptyFirstOrLastLinePlaceholder
|
|
78
|
+
}
|
|
79
|
+
) =>
|
|
80
|
+
printDiffLine(
|
|
81
|
+
line,
|
|
82
|
+
isFirstOrLast,
|
|
83
|
+
commonColor,
|
|
84
|
+
commonIndicator,
|
|
85
|
+
commonLineTrailingSpaceColor,
|
|
86
|
+
emptyFirstOrLastLinePlaceholder
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// In GNU diff format, indexes are one-based instead of zero-based.
|
|
90
|
+
const createPatchMark = (aStart, aEnd, bStart, bEnd, {patchColor}) =>
|
|
91
|
+
patchColor(
|
|
92
|
+
`@@ -${aStart + 1},${aEnd - aStart} +${bStart + 1},${bEnd - bStart} @@`
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
// jest --no-expand
|
|
96
|
+
//
|
|
97
|
+
// Given array of aligned strings with inverse highlight formatting,
|
|
98
|
+
// return joined lines with diff formatting (and patch marks, if needed).
|
|
99
|
+
const joinAlignedDiffsNoExpand = (diffs, options) => {
|
|
100
|
+
const iLength = diffs.length;
|
|
101
|
+
const nContextLines = options.contextLines;
|
|
102
|
+
const nContextLines2 = nContextLines + nContextLines;
|
|
103
|
+
|
|
104
|
+
// First pass: count output lines and see if it has patches.
|
|
105
|
+
let jLength = iLength;
|
|
106
|
+
let hasExcessAtStartOrEnd = false;
|
|
107
|
+
let nExcessesBetweenChanges = 0;
|
|
108
|
+
let i = 0;
|
|
109
|
+
while (i !== iLength) {
|
|
110
|
+
const iStart = i;
|
|
111
|
+
while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) {
|
|
112
|
+
i += 1;
|
|
113
|
+
}
|
|
114
|
+
if (iStart !== i) {
|
|
115
|
+
if (iStart === 0) {
|
|
116
|
+
// at start
|
|
117
|
+
if (i > nContextLines) {
|
|
118
|
+
jLength -= i - nContextLines; // subtract excess common lines
|
|
119
|
+
hasExcessAtStartOrEnd = true;
|
|
120
|
+
}
|
|
121
|
+
} else if (i === iLength) {
|
|
122
|
+
// at end
|
|
123
|
+
const n = i - iStart;
|
|
124
|
+
if (n > nContextLines) {
|
|
125
|
+
jLength -= n - nContextLines; // subtract excess common lines
|
|
126
|
+
hasExcessAtStartOrEnd = true;
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
// between changes
|
|
130
|
+
const n = i - iStart;
|
|
131
|
+
if (n > nContextLines2) {
|
|
132
|
+
jLength -= n - nContextLines2; // subtract excess common lines
|
|
133
|
+
nExcessesBetweenChanges += 1;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
while (i !== iLength && diffs[i][0] !== _cleanupSemantic.DIFF_EQUAL) {
|
|
138
|
+
i += 1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const hasPatch = nExcessesBetweenChanges !== 0 || hasExcessAtStartOrEnd;
|
|
142
|
+
if (nExcessesBetweenChanges !== 0) {
|
|
143
|
+
jLength += nExcessesBetweenChanges + 1; // add patch lines
|
|
144
|
+
} else if (hasExcessAtStartOrEnd) {
|
|
145
|
+
jLength += 1; // add patch line
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const jLast = jLength - 1;
|
|
149
|
+
const lines = [];
|
|
150
|
+
let jPatchMark = 0; // index of placeholder line for current patch mark
|
|
151
|
+
if (hasPatch) {
|
|
152
|
+
lines.push(''); // placeholder line for first patch mark
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Indexes of expected or received lines in current patch:
|
|
156
|
+
let aStart = 0;
|
|
157
|
+
let bStart = 0;
|
|
158
|
+
let aEnd = 0;
|
|
159
|
+
let bEnd = 0;
|
|
160
|
+
const pushCommonLine = line => {
|
|
161
|
+
const j = lines.length;
|
|
162
|
+
lines.push(printCommonLine(line, j === 0 || j === jLast, options));
|
|
163
|
+
aEnd += 1;
|
|
164
|
+
bEnd += 1;
|
|
165
|
+
};
|
|
166
|
+
const pushDeleteLine = line => {
|
|
167
|
+
const j = lines.length;
|
|
168
|
+
lines.push(printDeleteLine(line, j === 0 || j === jLast, options));
|
|
169
|
+
aEnd += 1;
|
|
170
|
+
};
|
|
171
|
+
const pushInsertLine = line => {
|
|
172
|
+
const j = lines.length;
|
|
173
|
+
lines.push(printInsertLine(line, j === 0 || j === jLast, options));
|
|
174
|
+
bEnd += 1;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// Second pass: push lines with diff formatting (and patch marks, if needed).
|
|
178
|
+
i = 0;
|
|
179
|
+
while (i !== iLength) {
|
|
180
|
+
let iStart = i;
|
|
181
|
+
while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) {
|
|
182
|
+
i += 1;
|
|
183
|
+
}
|
|
184
|
+
if (iStart !== i) {
|
|
185
|
+
if (iStart === 0) {
|
|
186
|
+
// at beginning
|
|
187
|
+
if (i > nContextLines) {
|
|
188
|
+
iStart = i - nContextLines;
|
|
189
|
+
aStart = iStart;
|
|
190
|
+
bStart = iStart;
|
|
191
|
+
aEnd = aStart;
|
|
192
|
+
bEnd = bStart;
|
|
193
|
+
}
|
|
194
|
+
for (let iCommon = iStart; iCommon !== i; iCommon += 1) {
|
|
195
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
196
|
+
}
|
|
197
|
+
} else if (i === iLength) {
|
|
198
|
+
// at end
|
|
199
|
+
const iEnd = i - iStart > nContextLines ? iStart + nContextLines : i;
|
|
200
|
+
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) {
|
|
201
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
202
|
+
}
|
|
203
|
+
} else {
|
|
204
|
+
// between changes
|
|
205
|
+
const nCommon = i - iStart;
|
|
206
|
+
if (nCommon > nContextLines2) {
|
|
207
|
+
const iEnd = iStart + nContextLines;
|
|
208
|
+
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) {
|
|
209
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
210
|
+
}
|
|
211
|
+
lines[jPatchMark] = createPatchMark(
|
|
212
|
+
aStart,
|
|
213
|
+
aEnd,
|
|
214
|
+
bStart,
|
|
215
|
+
bEnd,
|
|
216
|
+
options
|
|
217
|
+
);
|
|
218
|
+
jPatchMark = lines.length;
|
|
219
|
+
lines.push(''); // placeholder line for next patch mark
|
|
220
|
+
|
|
221
|
+
const nOmit = nCommon - nContextLines2;
|
|
222
|
+
aStart = aEnd + nOmit;
|
|
223
|
+
bStart = bEnd + nOmit;
|
|
224
|
+
aEnd = aStart;
|
|
225
|
+
bEnd = bStart;
|
|
226
|
+
for (let iCommon = i - nContextLines; iCommon !== i; iCommon += 1) {
|
|
227
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
for (let iCommon = iStart; iCommon !== i; iCommon += 1) {
|
|
231
|
+
pushCommonLine(diffs[iCommon][1]);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_DELETE) {
|
|
237
|
+
pushDeleteLine(diffs[i][1]);
|
|
238
|
+
i += 1;
|
|
239
|
+
}
|
|
240
|
+
while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_INSERT) {
|
|
241
|
+
pushInsertLine(diffs[i][1]);
|
|
242
|
+
i += 1;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (hasPatch) {
|
|
246
|
+
lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options);
|
|
247
|
+
}
|
|
248
|
+
return lines.join('\n');
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// jest --expand
|
|
252
|
+
//
|
|
253
|
+
// Given array of aligned strings with inverse highlight formatting,
|
|
254
|
+
// return joined lines with diff formatting.
|
|
255
|
+
exports.joinAlignedDiffsNoExpand = joinAlignedDiffsNoExpand;
|
|
256
|
+
const joinAlignedDiffsExpand = (diffs, options) =>
|
|
257
|
+
diffs
|
|
258
|
+
.map((diff, i, diffs) => {
|
|
259
|
+
const line = diff[1];
|
|
260
|
+
const isFirstOrLast = i === 0 || i === diffs.length - 1;
|
|
261
|
+
switch (diff[0]) {
|
|
262
|
+
case _cleanupSemantic.DIFF_DELETE:
|
|
263
|
+
return printDeleteLine(line, isFirstOrLast, options);
|
|
264
|
+
case _cleanupSemantic.DIFF_INSERT:
|
|
265
|
+
return printInsertLine(line, isFirstOrLast, options);
|
|
266
|
+
default:
|
|
267
|
+
return printCommonLine(line, isFirstOrLast, options);
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
.join('\n');
|
|
271
|
+
exports.joinAlignedDiffsExpand = joinAlignedDiffsExpand;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.normalizeDiffOptions = exports.noColor = void 0;
|
|
7
|
+
var _chalk = _interopRequireDefault(require('chalk'));
|
|
8
|
+
function _interopRequireDefault(obj) {
|
|
9
|
+
return obj && obj.__esModule ? obj : {default: obj};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const noColor = string => string;
|
|
19
|
+
exports.noColor = noColor;
|
|
20
|
+
const DIFF_CONTEXT_DEFAULT = 5;
|
|
21
|
+
const OPTIONS_DEFAULT = {
|
|
22
|
+
aAnnotation: 'Expected',
|
|
23
|
+
aColor: _chalk.default.green,
|
|
24
|
+
aIndicator: '-',
|
|
25
|
+
bAnnotation: 'Received',
|
|
26
|
+
bColor: _chalk.default.red,
|
|
27
|
+
bIndicator: '+',
|
|
28
|
+
changeColor: _chalk.default.inverse,
|
|
29
|
+
changeLineTrailingSpaceColor: noColor,
|
|
30
|
+
commonColor: _chalk.default.dim,
|
|
31
|
+
commonIndicator: ' ',
|
|
32
|
+
commonLineTrailingSpaceColor: noColor,
|
|
33
|
+
compareKeys: undefined,
|
|
34
|
+
contextLines: DIFF_CONTEXT_DEFAULT,
|
|
35
|
+
emptyFirstOrLastLinePlaceholder: '',
|
|
36
|
+
expand: true,
|
|
37
|
+
includeChangeCounts: false,
|
|
38
|
+
omitAnnotationLines: false,
|
|
39
|
+
patchColor: _chalk.default.yellow
|
|
40
|
+
};
|
|
41
|
+
const getCompareKeys = compareKeys =>
|
|
42
|
+
compareKeys && typeof compareKeys === 'function'
|
|
43
|
+
? compareKeys
|
|
44
|
+
: OPTIONS_DEFAULT.compareKeys;
|
|
45
|
+
const getContextLines = contextLines =>
|
|
46
|
+
typeof contextLines === 'number' &&
|
|
47
|
+
Number.isSafeInteger(contextLines) &&
|
|
48
|
+
contextLines >= 0
|
|
49
|
+
? contextLines
|
|
50
|
+
: DIFF_CONTEXT_DEFAULT;
|
|
51
|
+
|
|
52
|
+
// Pure function returns options with all properties.
|
|
53
|
+
const normalizeDiffOptions = (options = {}) => ({
|
|
54
|
+
...OPTIONS_DEFAULT,
|
|
55
|
+
...options,
|
|
56
|
+
compareKeys: getCompareKeys(options.compareKeys),
|
|
57
|
+
contextLines: getContextLines(options.contextLines)
|
|
58
|
+
});
|
|
59
|
+
exports.normalizeDiffOptions = normalizeDiffOptions;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.diffStringsUnified = exports.diffStringsRaw = void 0;
|
|
7
|
+
var _cleanupSemantic = require('./cleanupSemantic');
|
|
8
|
+
var _diffLines = require('./diffLines');
|
|
9
|
+
var _diffStrings = _interopRequireDefault(require('./diffStrings'));
|
|
10
|
+
var _getAlignedDiffs = _interopRequireDefault(require('./getAlignedDiffs'));
|
|
11
|
+
var _normalizeDiffOptions = require('./normalizeDiffOptions');
|
|
12
|
+
function _interopRequireDefault(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {default: obj};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const hasCommonDiff = (diffs, isMultiline) => {
|
|
23
|
+
if (isMultiline) {
|
|
24
|
+
// Important: Ignore common newline that was appended to multiline strings!
|
|
25
|
+
const iLast = diffs.length - 1;
|
|
26
|
+
return diffs.some(
|
|
27
|
+
(diff, i) =>
|
|
28
|
+
diff[0] === _cleanupSemantic.DIFF_EQUAL &&
|
|
29
|
+
(i !== iLast || diff[1] !== '\n')
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return diffs.some(diff => diff[0] === _cleanupSemantic.DIFF_EQUAL);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Compare two strings character-by-character.
|
|
36
|
+
// Format as comparison lines in which changed substrings have inverse colors.
|
|
37
|
+
const diffStringsUnified = (a, b, options) => {
|
|
38
|
+
if (a !== b && a.length !== 0 && b.length !== 0) {
|
|
39
|
+
const isMultiline = a.includes('\n') || b.includes('\n');
|
|
40
|
+
|
|
41
|
+
// getAlignedDiffs assumes that a newline was appended to the strings.
|
|
42
|
+
const diffs = diffStringsRaw(
|
|
43
|
+
isMultiline ? `${a}\n` : a,
|
|
44
|
+
isMultiline ? `${b}\n` : b,
|
|
45
|
+
true // cleanupSemantic
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
if (hasCommonDiff(diffs, isMultiline)) {
|
|
49
|
+
const optionsNormalized = (0, _normalizeDiffOptions.normalizeDiffOptions)(
|
|
50
|
+
options
|
|
51
|
+
);
|
|
52
|
+
const lines = (0, _getAlignedDiffs.default)(
|
|
53
|
+
diffs,
|
|
54
|
+
optionsNormalized.changeColor
|
|
55
|
+
);
|
|
56
|
+
return (0, _diffLines.printDiffLines)(lines, optionsNormalized);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Fall back to line-by-line diff.
|
|
61
|
+
return (0, _diffLines.diffLinesUnified)(
|
|
62
|
+
a.split('\n'),
|
|
63
|
+
b.split('\n'),
|
|
64
|
+
options
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Compare two strings character-by-character.
|
|
69
|
+
// Optionally clean up small common substrings, also known as chaff.
|
|
70
|
+
exports.diffStringsUnified = diffStringsUnified;
|
|
71
|
+
const diffStringsRaw = (a, b, cleanup) => {
|
|
72
|
+
const diffs = (0, _diffStrings.default)(a, b);
|
|
73
|
+
if (cleanup) {
|
|
74
|
+
(0, _cleanupSemantic.cleanupSemantic)(diffs); // impure function
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return diffs;
|
|
78
|
+
};
|
|
79
|
+
exports.diffStringsRaw = diffStringsRaw;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jest-diff",
|
|
3
|
+
"version": "29.7.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/jestjs/jest.git",
|
|
7
|
+
"directory": "packages/jest-diff"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"main": "./build/index.js",
|
|
11
|
+
"types": "./build/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./build/index.d.ts",
|
|
15
|
+
"default": "./build/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"chalk": "^4.0.0",
|
|
21
|
+
"diff-sequences": "^29.6.3",
|
|
22
|
+
"jest-get-type": "^29.6.3",
|
|
23
|
+
"pretty-format": "^29.7.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@jest/test-utils": "^29.7.0",
|
|
27
|
+
"strip-ansi": "^6.0.0"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630"
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|