veryfront 0.1.323 → 0.1.326
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/esm/cli/commands/extension/init-command.js +2 -2
- package/esm/cli/commands/extension/validate-command.js +1 -1
- package/esm/deno.d.ts +7 -0
- package/esm/deno.js +8 -1
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.2.4/client.js +5 -0
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts +2 -0
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts.map +1 -0
- package/esm/deps/esm.sh/scheduler@^0.27.0.js +3 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.js +47 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.js +65 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.js +194 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +37 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +61 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.js +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.js +52 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.js +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts +44 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.js +39 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.js +177 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts +42 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.js +58 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.js +44 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.js +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.js +20 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/assertion_state.d.ts +150 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/assertion_state.js +224 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/build_message.d.ts +80 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/build_message.js +116 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff.js +276 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/diff_str.js +182 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/format.d.ts +29 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/format.js +70 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/types.d.ts +25 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.13/types.js +3 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/_test_suite.d.ts +80 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/_test_suite.js +348 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/bdd.d.ts +738 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.18/bdd.js +656 -0
- package/esm/src/agent/chat-ui-message-stream.d.ts +45 -0
- package/esm/src/agent/chat-ui-message-stream.d.ts.map +1 -0
- package/esm/src/agent/chat-ui-message-stream.js +442 -0
- package/esm/src/agent/fork-runtime-stream.d.ts +143 -0
- package/esm/src/agent/fork-runtime-stream.d.ts.map +1 -0
- package/esm/src/agent/fork-runtime-stream.js +505 -0
- package/esm/src/agent/index.d.ts +2 -0
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +2 -0
- package/esm/src/chat/conversation.d.ts +5 -5
- package/esm/src/modules/index.d.ts +12 -0
- package/esm/src/modules/index.d.ts.map +1 -0
- package/esm/src/modules/index.js +10 -0
- package/esm/src/modules/module-resolver.d.ts +28 -0
- package/esm/src/modules/module-resolver.d.ts.map +1 -0
- package/esm/src/modules/module-resolver.js +106 -0
- package/esm/src/rendering/cleanup.d.ts +7 -0
- package/esm/src/rendering/cleanup.d.ts.map +1 -0
- package/esm/src/rendering/cleanup.js +22 -0
- package/esm/src/rendering/ssr/index.d.ts +10 -0
- package/esm/src/rendering/ssr/index.d.ts.map +1 -0
- package/esm/src/rendering/ssr/index.js +8 -0
- package/esm/src/rendering/ssr/mdx-module-loader.d.ts +5 -0
- package/esm/src/rendering/ssr/mdx-module-loader.d.ts.map +1 -0
- package/esm/src/rendering/ssr/mdx-module-loader.js +150 -0
- package/esm/src/rendering/ssr/mdx-renderer.d.ts +4 -0
- package/esm/src/rendering/ssr/mdx-renderer.d.ts.map +1 -0
- package/esm/src/rendering/ssr/mdx-renderer.js +44 -0
- package/esm/src/rendering/ssr/types.d.ts +13 -0
- package/esm/src/rendering/ssr/types.d.ts.map +1 -0
- package/esm/src/rendering/ssr/types.js +1 -0
- package/esm/src/sandbox/index.d.ts +1 -0
- package/esm/src/sandbox/index.d.ts.map +1 -1
- package/esm/src/sandbox/index.js +1 -0
- package/esm/src/sandbox/shell-tools.d.ts +39 -0
- package/esm/src/sandbox/shell-tools.d.ts.map +1 -0
- package/esm/src/sandbox/shell-tools.js +177 -0
- package/esm/src/server/shared/index.d.ts +7 -0
- package/esm/src/server/shared/index.d.ts.map +1 -0
- package/esm/src/server/shared/index.js +6 -0
- package/esm/src/testing/assert.d.ts +22 -0
- package/esm/src/testing/assert.d.ts.map +1 -0
- package/esm/src/testing/assert.js +217 -0
- package/esm/src/testing/bdd.d.ts +67 -0
- package/esm/src/testing/bdd.d.ts.map +1 -0
- package/esm/src/testing/bdd.js +401 -0
- package/esm/src/testing/deno-compat.d.ts +26 -0
- package/esm/src/testing/deno-compat.d.ts.map +1 -0
- package/esm/src/testing/deno-compat.js +146 -0
- package/esm/src/testing/index.d.ts +28 -0
- package/esm/src/testing/index.d.ts.map +1 -0
- package/esm/src/testing/index.js +27 -0
- package/esm/src/testing/init.d.ts +2 -0
- package/esm/src/testing/init.d.ts.map +1 -0
- package/esm/src/testing/init.js +18 -0
- package/esm/src/testing/isolation.d.ts +30 -0
- package/esm/src/testing/isolation.d.ts.map +1 -0
- package/esm/src/testing/isolation.js +151 -0
- package/esm/src/testing/timing.d.ts +4 -0
- package/esm/src/testing/timing.d.ts.map +1 -0
- package/esm/src/testing/timing.js +22 -0
- package/esm/src/testing/utils.d.ts +6 -0
- package/esm/src/testing/utils.d.ts.map +1 -0
- package/esm/src/testing/utils.js +49 -0
- package/esm/src/types/global-guards.d.ts +11 -0
- package/esm/src/types/global-guards.d.ts.map +1 -0
- package/esm/src/types/global-guards.js +12 -0
- package/esm/src/utils/cache/keys/namespace.d.ts +3 -0
- package/esm/src/utils/cache/keys/namespace.d.ts.map +1 -0
- package/esm/src/utils/cache/keys/namespace.js +19 -0
- package/esm/src/utils/clsx.d.ts +3 -3
- package/esm/src/utils/clsx.d.ts.map +1 -1
- package/esm/src/utils/clsx.js +2 -3
- package/esm/src/utils/mime-types.d.ts +0 -6
- package/esm/src/utils/mime-types.d.ts.map +1 -1
- package/esm/src/utils/mime-types.js +0 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +14 -1
- package/src/cli/commands/extension/init-command.ts +2 -2
- package/src/cli/commands/extension/validate-command.ts +1 -1
- package/src/deno.js +8 -1
- package/src/deps/esm.sh/@types/react-dom@19.2.3/client.d.ts +105 -0
- package/src/deps/esm.sh/@types/react@19.2.3/global.d.ts +165 -0
- package/src/deps/esm.sh/@types/react@19.2.3/index.d.ts +4301 -0
- package/src/deps/esm.sh/@types/scheduler@0.26.0/index.d.ts +30 -0
- package/src/deps/esm.sh/csstype@3.2.3/index.d.ts +22569 -0
- package/src/deps/esm.sh/react-dom@19.2.4/client.d.ts +105 -0
- package/src/deps/esm.sh/react-dom@19.2.4/client.js +5 -0
- package/src/deps/esm.sh/scheduler@^0.27.0.d.ts +30 -0
- package/src/deps/esm.sh/scheduler@^0.27.0.js +3 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/almost_equals.ts +56 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/array_includes.ts +76 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/assert.ts +24 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/equal.ts +226 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/equals.ts +68 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/exists.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/fail.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/false.ts +27 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/greater.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/less.ts +29 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/less_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/mod.ts +47 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_equals.ts +43 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/object_match.ts +224 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/rejects.ts +123 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/strict_equals.ts +68 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/string_includes.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/throws.ts +111 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/unimplemented.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.19/unreachable.ts +21 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/assertion_state.ts +248 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/build_message.ts +147 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/diff_str.ts +208 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/format.ts +89 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.13/types.ts +30 -0
- package/src/deps/jsr.io/@std/testing/1.0.18/_test_suite.ts +461 -0
- package/src/deps/jsr.io/@std/testing/1.0.18/bdd.ts +1294 -0
- package/src/src/agent/chat-ui-message-stream.ts +596 -0
- package/src/src/agent/fork-runtime-stream.ts +780 -0
- package/src/src/agent/index.ts +22 -0
- package/src/src/modules/index.ts +43 -0
- package/src/src/modules/module-resolver.ts +145 -0
- package/src/src/rendering/cleanup.ts +27 -0
- package/src/src/rendering/ssr/index.ts +10 -0
- package/src/src/rendering/ssr/mdx-module-loader.ts +185 -0
- package/src/src/rendering/ssr/mdx-renderer.ts +66 -0
- package/src/src/rendering/ssr/types.ts +14 -0
- package/src/src/sandbox/index.ts +9 -0
- package/src/src/sandbox/shell-tools.ts +242 -0
- package/src/src/server/shared/index.ts +12 -0
- package/src/src/testing/assert.ts +352 -0
- package/src/src/testing/bdd.ts +618 -0
- package/src/src/testing/deno-compat.ts +206 -0
- package/src/src/testing/index.ts +92 -0
- package/src/src/testing/init.ts +21 -0
- package/src/src/testing/isolation.ts +177 -0
- package/src/src/testing/timing.ts +27 -0
- package/src/src/testing/utils.ts +44 -0
- package/src/src/types/global-guards.ts +21 -0
- package/src/src/utils/cache/keys/namespace.ts +25 -0
- package/src/src/utils/clsx.ts +2 -4
- package/src/src/utils/mime-types.ts +0 -2
- package/src/src/utils/version-constant.ts +1 -1
|
@@ -63,8 +63,8 @@ export default ${camelCase(name)};
|
|
|
63
63
|
* @module extensions/${name}/test
|
|
64
64
|
*/
|
|
65
65
|
|
|
66
|
-
import { assertEquals } from "
|
|
67
|
-
import { describe, it } from "
|
|
66
|
+
import { assertEquals } from "veryfront/testing/assert";
|
|
67
|
+
import { describe, it } from "veryfront/testing/bdd";
|
|
68
68
|
import factory from "./index.ts";
|
|
69
69
|
|
|
70
70
|
describe("${name} extension", () => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module cli/commands/extension/validate-command
|
|
5
5
|
*/
|
|
6
6
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
7
|
-
import { validateExtension } from "../../../src/extensions/
|
|
7
|
+
import { validateExtension } from "../../../src/extensions/index.js";
|
|
8
8
|
/**
|
|
9
9
|
* Validate an extension at the given directory path.
|
|
10
10
|
*/
|
package/esm/deno.d.ts
CHANGED
|
@@ -43,6 +43,9 @@ declare namespace _default {
|
|
|
43
43
|
"./embedding": string;
|
|
44
44
|
"./extensions": string;
|
|
45
45
|
"./extensions/interfaces": string;
|
|
46
|
+
"./testing": string;
|
|
47
|
+
"./testing/assert": string;
|
|
48
|
+
"./testing/bdd": string;
|
|
46
49
|
"./cli": string;
|
|
47
50
|
"./chat/conversation": string;
|
|
48
51
|
"./chat/message-prep": string;
|
|
@@ -117,6 +120,9 @@ declare namespace _default {
|
|
|
117
120
|
"veryfront/tool/schema": string;
|
|
118
121
|
"veryfront/agent/composition": string;
|
|
119
122
|
"veryfront/extensions": string;
|
|
123
|
+
"veryfront/testing": string;
|
|
124
|
+
"veryfront/testing/assert": string;
|
|
125
|
+
"veryfront/testing/bdd": string;
|
|
120
126
|
"#veryfront": string;
|
|
121
127
|
"#veryfront/agent": string;
|
|
122
128
|
"#veryfront/agent/react": string;
|
|
@@ -235,6 +241,7 @@ declare namespace _default {
|
|
|
235
241
|
"react/jsx-dev-runtime": string;
|
|
236
242
|
"@mdx-js/mdx": string;
|
|
237
243
|
"@mdx-js/react": string;
|
|
244
|
+
"@babel/parser": string;
|
|
238
245
|
"unist-util-visit": string;
|
|
239
246
|
"mdast-util-to-string": string;
|
|
240
247
|
"github-slugger": string;
|
package/esm/deno.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.326",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"nodeModulesDir": "auto",
|
|
6
6
|
"workspace": [
|
|
@@ -63,6 +63,9 @@ export default {
|
|
|
63
63
|
"./embedding": "./src/embedding/index.ts",
|
|
64
64
|
"./extensions": "./src/extensions/index.ts",
|
|
65
65
|
"./extensions/interfaces": "./src/extensions/interfaces/index.ts",
|
|
66
|
+
"./testing": "./src/testing/index.ts",
|
|
67
|
+
"./testing/assert": "./src/testing/assert.ts",
|
|
68
|
+
"./testing/bdd": "./src/testing/bdd.ts",
|
|
66
69
|
"./cli": "./cli/main.ts",
|
|
67
70
|
"./chat/conversation": "./src/chat/conversation.ts",
|
|
68
71
|
"./chat/message-prep": "./src/chat/message-prep.ts",
|
|
@@ -137,6 +140,9 @@ export default {
|
|
|
137
140
|
"veryfront/tool/schema": "./src/tool/schema/index.ts",
|
|
138
141
|
"veryfront/agent/composition": "./src/agent/composition/index.ts",
|
|
139
142
|
"veryfront/extensions": "./src/extensions/index.ts",
|
|
143
|
+
"veryfront/testing": "./src/testing/index.ts",
|
|
144
|
+
"veryfront/testing/assert": "./src/testing/assert.ts",
|
|
145
|
+
"veryfront/testing/bdd": "./src/testing/bdd.ts",
|
|
140
146
|
"#veryfront": "./src/index.ts",
|
|
141
147
|
"#veryfront/agent": "./src/agent/index.ts",
|
|
142
148
|
"#veryfront/agent/react": "./src/agent/react/index.ts",
|
|
@@ -255,6 +261,7 @@ export default {
|
|
|
255
261
|
"react/jsx-dev-runtime": "https://esm.sh/react@19.2.4/jsx-dev-runtime?external=react&target=es2022&deps=csstype@3.2.3",
|
|
256
262
|
"@mdx-js/mdx": "npm:@mdx-js/mdx@3.1.1",
|
|
257
263
|
"@mdx-js/react": "npm:@mdx-js/react@3.1.1",
|
|
264
|
+
"@babel/parser": "npm:@babel/parser@7.29.2",
|
|
258
265
|
"unist-util-visit": "npm:unist-util-visit@5.1.0",
|
|
259
266
|
"mdast-util-to-string": "npm:mdast-util-to-string@4.0.0",
|
|
260
267
|
"github-slugger": "npm:github-slugger@2.0.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/deps/esm.sh/react-dom@19.2.4/client.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* esm.sh - react-dom@19.2.4/client */
|
|
2
|
+
import "react-dom/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/es2022/react-dom.mjs";
|
|
3
|
+
import "../scheduler@^0.27.0.js";
|
|
4
|
+
export * from "react-dom/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/es2022/client.mjs";
|
|
5
|
+
export { default } from "react-dom/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/es2022/client.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler@^0.27.0.d.ts","sourceRoot":"","sources":["../../../src/deps/esm.sh/scheduler@^0.27.0.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an assertion that `actual` and `expected` are almost equal numbers
|
|
3
|
+
* through a given tolerance. It can be used to take into account IEEE-754
|
|
4
|
+
* double-precision floating-point representation limitations. If the values
|
|
5
|
+
* are not almost equal then throw.
|
|
6
|
+
*
|
|
7
|
+
* The default tolerance is one hundred thousandth of a percent of the
|
|
8
|
+
* expected value.
|
|
9
|
+
*
|
|
10
|
+
* @example Usage
|
|
11
|
+
* ```ts ignore
|
|
12
|
+
* import { assertAlmostEquals } from "@std/assert";
|
|
13
|
+
*
|
|
14
|
+
* assertAlmostEquals(0.01, 0.02); // Throws
|
|
15
|
+
* assertAlmostEquals(1e-8, 1e-9); // Throws
|
|
16
|
+
* assertAlmostEquals(1.000000001e-8, 1.000000002e-8); // Doesn't throw
|
|
17
|
+
* assertAlmostEquals(0.01, 0.02, 0.1); // Doesn't throw
|
|
18
|
+
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16); // Doesn't throw
|
|
19
|
+
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17); // Throws
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param actual The actual value to compare.
|
|
23
|
+
* @param expected The expected value to compare.
|
|
24
|
+
* @param tolerance The tolerance to consider the values almost equal. The
|
|
25
|
+
* default is one hundred thousandth of a percent of the expected value.
|
|
26
|
+
* @param msg The optional message to include in the error.
|
|
27
|
+
* @throws {AssertionError} If the values are not almost equal.
|
|
28
|
+
*/
|
|
29
|
+
export declare function assertAlmostEquals(actual: number, expected: number, tolerance?: number, msg?: string): void;
|
|
30
|
+
//# sourceMappingURL=almost_equals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"almost_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.19/almost_equals.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,QAmBb"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { AssertionError } from "./assertion_error.js";
|
|
4
|
+
/**
|
|
5
|
+
* Make an assertion that `actual` and `expected` are almost equal numbers
|
|
6
|
+
* through a given tolerance. It can be used to take into account IEEE-754
|
|
7
|
+
* double-precision floating-point representation limitations. If the values
|
|
8
|
+
* are not almost equal then throw.
|
|
9
|
+
*
|
|
10
|
+
* The default tolerance is one hundred thousandth of a percent of the
|
|
11
|
+
* expected value.
|
|
12
|
+
*
|
|
13
|
+
* @example Usage
|
|
14
|
+
* ```ts ignore
|
|
15
|
+
* import { assertAlmostEquals } from "@std/assert";
|
|
16
|
+
*
|
|
17
|
+
* assertAlmostEquals(0.01, 0.02); // Throws
|
|
18
|
+
* assertAlmostEquals(1e-8, 1e-9); // Throws
|
|
19
|
+
* assertAlmostEquals(1.000000001e-8, 1.000000002e-8); // Doesn't throw
|
|
20
|
+
* assertAlmostEquals(0.01, 0.02, 0.1); // Doesn't throw
|
|
21
|
+
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16); // Doesn't throw
|
|
22
|
+
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17); // Throws
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param actual The actual value to compare.
|
|
26
|
+
* @param expected The expected value to compare.
|
|
27
|
+
* @param tolerance The tolerance to consider the values almost equal. The
|
|
28
|
+
* default is one hundred thousandth of a percent of the expected value.
|
|
29
|
+
* @param msg The optional message to include in the error.
|
|
30
|
+
* @throws {AssertionError} If the values are not almost equal.
|
|
31
|
+
*/
|
|
32
|
+
export function assertAlmostEquals(actual, expected, tolerance, msg) {
|
|
33
|
+
if (Object.is(actual, expected)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const delta = Math.abs(expected - actual);
|
|
37
|
+
if (tolerance === undefined) {
|
|
38
|
+
tolerance = isFinite(expected) ? Math.abs(expected * 1e-7) : 1e-7;
|
|
39
|
+
}
|
|
40
|
+
if (delta <= tolerance) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
44
|
+
const f = (n) => Number.isInteger(n) ? n : n.toExponential();
|
|
45
|
+
throw new AssertionError(`Expected actual: "${f(actual)}" to be close to "${f(expected)}": \
|
|
46
|
+
delta "${f(delta)}" is greater than "${f(tolerance)}"${msgSuffix}`);
|
|
47
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** An array-like object (`Array`, `Uint8Array`, `NodeList`, etc.) that is not a string */
|
|
2
|
+
export type ArrayLikeArg<T> = ArrayLike<T> & object;
|
|
3
|
+
/**
|
|
4
|
+
* Asserts that `actual` contains all values in `expected`, using deep equality
|
|
5
|
+
* for non-primitive values.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage with primitives
|
|
8
|
+
* ```ts ignore
|
|
9
|
+
* import { assertArrayIncludes } from "@std/assert";
|
|
10
|
+
*
|
|
11
|
+
* assertArrayIncludes([1, 2, 3], [2, 3]); // Passes
|
|
12
|
+
* assertArrayIncludes([1, 2, 3], [4]); // Throws
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example Usage with objects (deep equality)
|
|
16
|
+
* ```ts ignore
|
|
17
|
+
* import { assertArrayIncludes } from "@std/assert";
|
|
18
|
+
*
|
|
19
|
+
* assertArrayIncludes([{ a: 1 }, { b: 2 }], [{ a: 1 }]); // Passes
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @typeParam T The element type of the arrays.
|
|
23
|
+
* @param actual The array-like object to search within.
|
|
24
|
+
* @param expected The values that must be present in `actual`.
|
|
25
|
+
* @param msg Optional message to display on failure.
|
|
26
|
+
* @throws {AssertionError} If any value in `expected` is not found in `actual`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function assertArrayIncludes<T>(actual: ArrayLikeArg<T>, expected: ArrayLikeArg<T>, msg?: string): void;
|
|
29
|
+
//# sourceMappingURL=array_includes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.19/array_includes.ts"],"names":[],"mappings":"AAMA,0FAA0F;AAC1F,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAOpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EACzB,GAAG,CAAC,EAAE,MAAM,GACX,IAAI,CAgCN"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { equal } from "./equal.js";
|
|
4
|
+
import { format } from "../../internal/1.0.13/format.js";
|
|
5
|
+
import { AssertionError } from "./assertion_error.js";
|
|
6
|
+
function isPrimitive(value) {
|
|
7
|
+
return value === null ||
|
|
8
|
+
typeof value !== "object" && typeof value !== "function";
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Asserts that `actual` contains all values in `expected`, using deep equality
|
|
12
|
+
* for non-primitive values.
|
|
13
|
+
*
|
|
14
|
+
* @example Usage with primitives
|
|
15
|
+
* ```ts ignore
|
|
16
|
+
* import { assertArrayIncludes } from "@std/assert";
|
|
17
|
+
*
|
|
18
|
+
* assertArrayIncludes([1, 2, 3], [2, 3]); // Passes
|
|
19
|
+
* assertArrayIncludes([1, 2, 3], [4]); // Throws
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example Usage with objects (deep equality)
|
|
23
|
+
* ```ts ignore
|
|
24
|
+
* import { assertArrayIncludes } from "@std/assert";
|
|
25
|
+
*
|
|
26
|
+
* assertArrayIncludes([{ a: 1 }, { b: 2 }], [{ a: 1 }]); // Passes
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @typeParam T The element type of the arrays.
|
|
30
|
+
* @param actual The array-like object to search within.
|
|
31
|
+
* @param expected The values that must be present in `actual`.
|
|
32
|
+
* @param msg Optional message to display on failure.
|
|
33
|
+
* @throws {AssertionError} If any value in `expected` is not found in `actual`.
|
|
34
|
+
*/
|
|
35
|
+
export function assertArrayIncludes(actual, expected, msg) {
|
|
36
|
+
const missing = [];
|
|
37
|
+
const expectedLen = expected.length;
|
|
38
|
+
const actualLen = actual.length;
|
|
39
|
+
for (let i = 0; i < expectedLen; i++) {
|
|
40
|
+
const item = expected[i];
|
|
41
|
+
let found;
|
|
42
|
+
if (isPrimitive(item)) {
|
|
43
|
+
// Fast path
|
|
44
|
+
found = Array.prototype.includes.call(actual, item);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
found = false;
|
|
48
|
+
for (let j = 0; j < actualLen; j++) {
|
|
49
|
+
if (equal(item, actual[j])) {
|
|
50
|
+
found = true;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (!found) {
|
|
56
|
+
missing.push(item);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (missing.length === 0) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
63
|
+
msg = `Expected actual: "${format(actual)}" to include: "${format(expected)}"${msgSuffix}\nmissing: ${format(missing)}`;
|
|
64
|
+
throw new AssertionError(msg);
|
|
65
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an assertion, an error will be thrown if `expr` does not have a truthy value.
|
|
3
|
+
*
|
|
4
|
+
* @example Usage
|
|
5
|
+
* ```ts ignore
|
|
6
|
+
* import { assert } from "@std/assert";
|
|
7
|
+
*
|
|
8
|
+
* assert("hello".includes("ello")); // Doesn't throw
|
|
9
|
+
* assert("hello".includes("world")); // Throws
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @param expr The expression to test.
|
|
13
|
+
* @param msg The optional message to display if the assertion fails.
|
|
14
|
+
* @throws {AssertionError} If `expr` is falsy.
|
|
15
|
+
*/
|
|
16
|
+
export declare function assert(expr: unknown, msg?: string): asserts expr;
|
|
17
|
+
//# sourceMappingURL=assert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.19/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { AssertionError } from "./assertion_error.js";
|
|
4
|
+
/**
|
|
5
|
+
* Make an assertion, an error will be thrown if `expr` does not have a truthy value.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage
|
|
8
|
+
* ```ts ignore
|
|
9
|
+
* import { assert } from "@std/assert";
|
|
10
|
+
*
|
|
11
|
+
* assert("hello".includes("ello")); // Doesn't throw
|
|
12
|
+
* assert("hello".includes("world")); // Throws
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param expr The expression to test.
|
|
16
|
+
* @param msg The optional message to display if the assertion fails.
|
|
17
|
+
* @throws {AssertionError} If `expr` is falsy.
|
|
18
|
+
*/
|
|
19
|
+
export function assert(expr, msg = "") {
|
|
20
|
+
if (!expr) {
|
|
21
|
+
throw new AssertionError(msg);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when an assertion fails.
|
|
3
|
+
*
|
|
4
|
+
* @example Usage
|
|
5
|
+
* ```ts ignore
|
|
6
|
+
* import { AssertionError } from "@std/assert";
|
|
7
|
+
*
|
|
8
|
+
* try {
|
|
9
|
+
* throw new AssertionError("foo", { cause: "bar" });
|
|
10
|
+
* } catch (error) {
|
|
11
|
+
* if (error instanceof AssertionError) {
|
|
12
|
+
* error.message === "foo"; // true
|
|
13
|
+
* error.cause === "bar"; // true
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class AssertionError extends Error {
|
|
19
|
+
/** Constructs a new instance.
|
|
20
|
+
*
|
|
21
|
+
* @param message The error message.
|
|
22
|
+
* @param options Additional options. This argument is still unstable. It may change in the future release.
|
|
23
|
+
*/
|
|
24
|
+
constructor(message: string, options?: ErrorOptions);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=assertion_error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.19/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when an assertion fails.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts ignore
|
|
8
|
+
* import { AssertionError } from "@std/assert";
|
|
9
|
+
*
|
|
10
|
+
* try {
|
|
11
|
+
* throw new AssertionError("foo", { cause: "bar" });
|
|
12
|
+
* } catch (error) {
|
|
13
|
+
* if (error instanceof AssertionError) {
|
|
14
|
+
* error.message === "foo"; // true
|
|
15
|
+
* error.cause === "bar"; // true
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class AssertionError extends Error {
|
|
21
|
+
/** Constructs a new instance.
|
|
22
|
+
*
|
|
23
|
+
* @param message The error message.
|
|
24
|
+
* @param options Additional options. This argument is still unstable. It may change in the future release.
|
|
25
|
+
*/
|
|
26
|
+
constructor(message, options) {
|
|
27
|
+
super(message, options);
|
|
28
|
+
this.name = "AssertionError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep equality comparison used in assertions.
|
|
3
|
+
*
|
|
4
|
+
* This function is based on value equality, but for some cases (such as data
|
|
5
|
+
* that can only be read asynchronously or function properties) value equality
|
|
6
|
+
* is not possible to determine. In such cases, reference equality is used
|
|
7
|
+
* instead, which may cause false negatives for objects such as `Blob`s or
|
|
8
|
+
* `Request`s.
|
|
9
|
+
*
|
|
10
|
+
* @param a The actual value
|
|
11
|
+
* @param b The expected value
|
|
12
|
+
* @returns `true` if the values are deeply equal, `false` otherwise
|
|
13
|
+
*
|
|
14
|
+
* @throws {TypeError} If either value is a `WeakMap` or `WeakSet`.
|
|
15
|
+
*
|
|
16
|
+
* @example Usage
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { equal } from "@std/assert/equal";
|
|
19
|
+
*
|
|
20
|
+
* equal({ foo: "bar" }, { foo: "bar" }); // Returns `true`
|
|
21
|
+
* equal({ foo: "bar" }, { foo: "baz" }); // Returns `false`
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function equal(a: unknown, b: unknown): boolean;
|
|
25
|
+
//# sourceMappingURL=equal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.19/equal.ts"],"names":[],"mappings":"AA0FA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAgHrD"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
4
|
+
function isKeyedCollection(x) {
|
|
5
|
+
return x instanceof Set || x instanceof Map;
|
|
6
|
+
}
|
|
7
|
+
function prototypesEqual(a, b) {
|
|
8
|
+
const pa = Object.getPrototypeOf(a);
|
|
9
|
+
const pb = Object.getPrototypeOf(b);
|
|
10
|
+
return pa === pb ||
|
|
11
|
+
pa === Object.prototype && pb === null ||
|
|
12
|
+
pa === null && pb === Object.prototype;
|
|
13
|
+
}
|
|
14
|
+
function isBasicObjectOrArray(obj) {
|
|
15
|
+
const proto = Object.getPrototypeOf(obj);
|
|
16
|
+
return proto === null || proto === Object.prototype ||
|
|
17
|
+
proto === Array.prototype;
|
|
18
|
+
}
|
|
19
|
+
// Slightly faster than Reflect.ownKeys in V8 as of 12.9.202.13-rusty (2024-10-28)
|
|
20
|
+
function ownKeys(obj) {
|
|
21
|
+
return [
|
|
22
|
+
...Object.getOwnPropertyNames(obj),
|
|
23
|
+
...Object.getOwnPropertySymbols(obj),
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
function getKeysDeep(obj) {
|
|
27
|
+
const keys = new Set();
|
|
28
|
+
while (obj !== Object.prototype && obj !== Array.prototype && obj != null) {
|
|
29
|
+
for (const key of ownKeys(obj)) {
|
|
30
|
+
keys.add(key);
|
|
31
|
+
}
|
|
32
|
+
obj = Object.getPrototypeOf(obj);
|
|
33
|
+
}
|
|
34
|
+
return keys;
|
|
35
|
+
}
|
|
36
|
+
// deno-lint-ignore no-explicit-any
|
|
37
|
+
const Temporal = dntShim.dntGlobalThis.Temporal ?? Object.create(null);
|
|
38
|
+
/** A non-exhaustive list of prototypes that can be accurately fast-path compared with `String(instance)` */
|
|
39
|
+
const stringComparablePrototypes = new Set([
|
|
40
|
+
Intl.Locale,
|
|
41
|
+
RegExp,
|
|
42
|
+
Temporal.Duration,
|
|
43
|
+
Temporal.Instant,
|
|
44
|
+
Temporal.PlainDate,
|
|
45
|
+
Temporal.PlainDateTime,
|
|
46
|
+
Temporal.PlainTime,
|
|
47
|
+
Temporal.PlainYearMonth,
|
|
48
|
+
Temporal.PlainMonthDay,
|
|
49
|
+
Temporal.ZonedDateTime,
|
|
50
|
+
URL,
|
|
51
|
+
URLSearchParams,
|
|
52
|
+
].filter((x) => x != null).map((x) => x.prototype));
|
|
53
|
+
function isPrimitive(x) {
|
|
54
|
+
return typeof x === "string" ||
|
|
55
|
+
typeof x === "number" ||
|
|
56
|
+
typeof x === "boolean" ||
|
|
57
|
+
typeof x === "bigint" ||
|
|
58
|
+
typeof x === "symbol" ||
|
|
59
|
+
x == null;
|
|
60
|
+
}
|
|
61
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
62
|
+
function compareTypedArrays(a, b) {
|
|
63
|
+
if (a.length !== b.length)
|
|
64
|
+
return false;
|
|
65
|
+
for (let i = 0; i < b.length; i++) {
|
|
66
|
+
if (!sameValueZero(a[i], b[i]))
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
/** Check both strict equality (`0 == -0`) and `Object.is` (`NaN == NaN`) */
|
|
72
|
+
function sameValueZero(a, b) {
|
|
73
|
+
return a === b || Object.is(a, b);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Deep equality comparison used in assertions.
|
|
77
|
+
*
|
|
78
|
+
* This function is based on value equality, but for some cases (such as data
|
|
79
|
+
* that can only be read asynchronously or function properties) value equality
|
|
80
|
+
* is not possible to determine. In such cases, reference equality is used
|
|
81
|
+
* instead, which may cause false negatives for objects such as `Blob`s or
|
|
82
|
+
* `Request`s.
|
|
83
|
+
*
|
|
84
|
+
* @param a The actual value
|
|
85
|
+
* @param b The expected value
|
|
86
|
+
* @returns `true` if the values are deeply equal, `false` otherwise
|
|
87
|
+
*
|
|
88
|
+
* @throws {TypeError} If either value is a `WeakMap` or `WeakSet`.
|
|
89
|
+
*
|
|
90
|
+
* @example Usage
|
|
91
|
+
* ```ts
|
|
92
|
+
* import { equal } from "@std/assert/equal";
|
|
93
|
+
*
|
|
94
|
+
* equal({ foo: "bar" }, { foo: "bar" }); // Returns `true`
|
|
95
|
+
* equal({ foo: "bar" }, { foo: "baz" }); // Returns `false`
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export function equal(a, b) {
|
|
99
|
+
const seen = new Map();
|
|
100
|
+
return (function compare(a, b) {
|
|
101
|
+
if (sameValueZero(a, b))
|
|
102
|
+
return true;
|
|
103
|
+
if (isPrimitive(a) || isPrimitive(b))
|
|
104
|
+
return false;
|
|
105
|
+
if (a instanceof Date && b instanceof Date) {
|
|
106
|
+
return Object.is(a.getTime(), b.getTime());
|
|
107
|
+
}
|
|
108
|
+
if (a && typeof a === "object" && b && typeof b === "object") {
|
|
109
|
+
if (!prototypesEqual(a, b)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (a instanceof TypedArray) {
|
|
113
|
+
return compareTypedArrays(a, b);
|
|
114
|
+
}
|
|
115
|
+
if (a instanceof ArrayBuffer ||
|
|
116
|
+
(globalThis.SharedArrayBuffer && a instanceof SharedArrayBuffer)) {
|
|
117
|
+
return compareTypedArrays(new Uint8Array(a), new Uint8Array(b));
|
|
118
|
+
}
|
|
119
|
+
if (a instanceof WeakMap) {
|
|
120
|
+
throw new TypeError("Cannot compare WeakMap instances");
|
|
121
|
+
}
|
|
122
|
+
if (a instanceof WeakSet) {
|
|
123
|
+
throw new TypeError("Cannot compare WeakSet instances");
|
|
124
|
+
}
|
|
125
|
+
if (a instanceof WeakRef) {
|
|
126
|
+
return compare(a.deref(), b.deref());
|
|
127
|
+
}
|
|
128
|
+
if (seen.get(a) === b) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
if (Object.keys(a).length !== Object.keys(b).length) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
seen.set(a, b);
|
|
135
|
+
if (isKeyedCollection(a) && isKeyedCollection(b)) {
|
|
136
|
+
if (a.size !== b.size) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const aKeys = [...a.keys()];
|
|
140
|
+
const primitiveKeysFastPath = aKeys.every(isPrimitive);
|
|
141
|
+
if (primitiveKeysFastPath) {
|
|
142
|
+
if (a instanceof Set) {
|
|
143
|
+
return a.symmetricDifference(b).size === 0;
|
|
144
|
+
}
|
|
145
|
+
for (const key of aKeys) {
|
|
146
|
+
if (!b.has(key) ||
|
|
147
|
+
!compare(a.get(key), b.get(key))) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
let unmatchedEntries = a.size;
|
|
154
|
+
for (const [aKey, aValue] of a.entries()) {
|
|
155
|
+
for (const [bKey, bValue] of b.entries()) {
|
|
156
|
+
/* Given that Map keys can be references, we need
|
|
157
|
+
* to ensure that they are also deeply equal */
|
|
158
|
+
if (!compare(aKey, bKey))
|
|
159
|
+
continue;
|
|
160
|
+
if ((aKey === aValue && bKey === bValue) ||
|
|
161
|
+
(compare(aValue, bValue))) {
|
|
162
|
+
unmatchedEntries--;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return unmatchedEntries === 0;
|
|
168
|
+
}
|
|
169
|
+
let keys;
|
|
170
|
+
if (isBasicObjectOrArray(a)) {
|
|
171
|
+
// fast path
|
|
172
|
+
keys = ownKeys({ ...a, ...b });
|
|
173
|
+
}
|
|
174
|
+
else if (stringComparablePrototypes.has(Object.getPrototypeOf(a))) {
|
|
175
|
+
// medium path
|
|
176
|
+
return String(a) === String(b);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
// slow path
|
|
180
|
+
keys = getKeysDeep(a).union(getKeysDeep(b));
|
|
181
|
+
}
|
|
182
|
+
for (const key of keys) {
|
|
183
|
+
if (!compare(a[key], b[key])) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
if (((key in a) && (!(key in b))) || ((key in b) && (!(key in a)))) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
})(a, b);
|
|
194
|
+
}
|