@goast/core 0.4.0-beta4 → 0.4.1
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/LICENSE +21 -21
- package/README.md +4 -0
- package/esm/_dnt.shims.d.ts +1 -1
- package/esm/_dnt.test_polyfills.d.ts +29 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/_dnt.test_polyfills.js +31 -0
- package/esm/_dnt.test_shims.d.ts +14 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/_dnt.test_shims.js +69 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.js +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +57 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +20 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +14 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +43 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +17 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +26 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.js +13 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +46 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +161 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +6 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.js +191 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +12 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +34 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.js +714 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +843 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.js +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.js +218 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +60 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.js +523 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.js +85 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +86 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.js +88 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +199 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +111 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +180 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +37 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +2 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +79 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +380 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +738 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.js +654 -0
- package/esm/mod.d.ts +30 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +29 -0
- package/esm/src/ast/node.d.ts +17 -0
- package/esm/src/ast/node.d.ts.map +1 -0
- package/esm/src/codegen/config.d.ts +16 -0
- package/esm/src/codegen/config.d.ts.map +1 -0
- package/esm/src/codegen/endpoints-generator.d.ts +18 -0
- package/esm/src/codegen/endpoints-generator.d.ts.map +1 -0
- package/esm/src/codegen/generator.d.ts +39 -0
- package/esm/src/codegen/generator.d.ts.map +1 -0
- package/esm/src/codegen/generator.js +117 -0
- package/esm/src/codegen/internal-utils.d.ts.map +1 -0
- package/esm/src/codegen/internal-utils.js +6 -0
- package/esm/src/codegen/schemas-generator.d.ts +19 -0
- package/esm/src/codegen/schemas-generator.d.ts.map +1 -0
- package/esm/src/codegen/schemas-generator.js +45 -0
- package/esm/src/codegen/services-generator.d.ts +18 -0
- package/esm/src/codegen/services-generator.d.ts.map +1 -0
- package/esm/src/codegen/types.d.ts +19 -0
- package/esm/src/codegen/types.d.ts.map +1 -0
- package/esm/src/collect/collector.d.ts +5 -0
- package/esm/src/collect/collector.d.ts.map +1 -0
- package/esm/src/collect/helpers.d.ts +5 -0
- package/esm/src/collect/helpers.d.ts.map +1 -0
- package/esm/src/collect/helpers.test.d.ts +2 -0
- package/esm/src/collect/helpers.test.d.ts.map +1 -0
- package/esm/src/collect/helpers.test.js +77 -0
- package/esm/src/collect/types.d.ts +14 -0
- package/esm/src/collect/types.d.ts.map +1 -0
- package/esm/src/internal-utils.d.ts.map +1 -0
- package/esm/src/parse/deref-proxy.d.ts.map +1 -0
- package/esm/src/parse/deref-proxy.js +62 -0
- package/esm/src/parse/openapi-types.d.ts.map +1 -0
- package/esm/src/parse/parser.d.ts +19 -0
- package/esm/src/parse/parser.d.ts.map +1 -0
- package/esm/src/parse/parser.js +195 -0
- package/esm/src/parse/types.d.ts.map +1 -0
- package/esm/src/transform/api-types.d.ts +196 -0
- package/esm/src/transform/api-types.d.ts.map +1 -0
- package/esm/src/transform/helpers.d.ts +52 -0
- package/esm/src/transform/helpers.d.ts.map +1 -0
- package/esm/src/transform/helpers.js +160 -0
- package/esm/src/transform/helpers.test.d.ts +2 -0
- package/esm/src/transform/helpers.test.d.ts.map +1 -0
- package/esm/src/transform/helpers.test.js +265 -0
- package/esm/src/transform/transform-document.d.ts +5 -0
- package/esm/src/transform/transform-document.d.ts.map +1 -0
- package/esm/src/transform/transform-endpoint.d.ts +5 -0
- package/esm/src/transform/transform-endpoint.d.ts.map +1 -0
- package/esm/src/transform/transform-endpoint.js +269 -0
- package/esm/src/transform/transform-schema.d.ts +6 -0
- package/esm/src/transform/transform-schema.d.ts.map +1 -0
- package/esm/src/transform/transform-schema.js +182 -0
- package/esm/src/transform/transformer.d.ts +5 -0
- package/esm/src/transform/transformer.d.ts.map +1 -0
- package/esm/src/transform/types.d.ts.map +1 -0
- package/esm/src/utils/action-provider.d.ts.map +1 -0
- package/esm/src/utils/action-provider.js +29 -0
- package/esm/src/utils/action-provider.test.d.ts +2 -0
- package/esm/src/utils/action-provider.test.d.ts.map +1 -0
- package/esm/src/utils/action-provider.test.js +28 -0
- package/esm/src/utils/array.utils.d.ts.map +1 -0
- package/esm/src/utils/asset-manager.d.ts +9 -0
- package/esm/src/utils/asset-manager.d.ts.map +1 -0
- package/esm/src/utils/asset-manager.js +50 -0
- package/esm/src/utils/class.utils.d.ts.map +1 -0
- package/esm/src/utils/class.utils.js +28 -0
- package/esm/src/utils/common.utils.d.ts.map +1 -0
- package/esm/src/utils/common.utils.test.d.ts +2 -0
- package/esm/src/utils/common.utils.test.d.ts.map +1 -0
- package/esm/src/utils/common.utils.test.js +18 -0
- package/esm/src/utils/condition.d.ts.map +1 -0
- package/esm/src/utils/condition.test.d.ts +2 -0
- package/esm/src/utils/condition.test.d.ts.map +1 -0
- package/esm/src/utils/condition.test.js +31 -0
- package/esm/src/utils/endpoint.utils.d.ts +3 -0
- package/esm/src/utils/endpoint.utils.d.ts.map +1 -0
- package/esm/src/utils/endpoint.utils.test.d.ts +2 -0
- package/esm/src/utils/endpoint.utils.test.d.ts.map +1 -0
- package/esm/src/utils/endpoint.utils.test.js +31 -0
- package/esm/src/utils/error.utils.d.ts.map +1 -0
- package/esm/src/utils/factory.d.ts +21 -0
- package/esm/src/utils/factory.d.ts.map +1 -0
- package/esm/src/utils/factory.test.d.ts +2 -0
- package/esm/src/utils/factory.test.d.ts.map +1 -0
- package/esm/src/utils/factory.test.js +34 -0
- package/esm/src/utils/file-system.utils.d.ts.map +1 -0
- package/esm/src/utils/generator.utils.d.ts.map +1 -0
- package/esm/src/utils/generator.utils.test.d.ts +2 -0
- package/esm/src/utils/generator.utils.test.d.ts.map +1 -0
- package/esm/src/utils/generator.utils.test.js +13 -0
- package/esm/src/utils/object.utils.d.ts.map +1 -0
- package/esm/src/utils/object.utils.js +36 -0
- package/esm/src/utils/object.utils.test.d.ts +2 -0
- package/esm/src/utils/object.utils.test.d.ts.map +1 -0
- package/esm/src/utils/object.utils.test.js +29 -0
- package/esm/src/utils/schema.utils.d.ts +11 -0
- package/esm/src/utils/schema.utils.d.ts.map +1 -0
- package/esm/src/utils/schema.utils.test.d.ts +2 -0
- package/esm/src/utils/schema.utils.test.d.ts.map +1 -0
- package/esm/src/utils/schema.utils.test.js +70 -0
- package/esm/src/utils/source-builder.d.ts +234 -0
- package/esm/src/utils/source-builder.d.ts.map +1 -0
- package/esm/src/utils/source-builder.js +447 -0
- package/esm/src/utils/source-builder.test.d.ts +2 -0
- package/esm/src/utils/source-builder.test.d.ts.map +1 -0
- package/esm/src/utils/source-builder.test.js +505 -0
- package/esm/src/utils/string-builder/options.d.ts.map +1 -0
- package/esm/src/utils/string-builder/string-builder.d.ts +73 -0
- package/esm/src/utils/string-builder/string-builder.d.ts.map +1 -0
- package/esm/src/utils/string-builder/string-builder.js +149 -0
- package/esm/src/utils/string-builder/string-builder.test.d.ts +2 -0
- package/esm/src/utils/string-builder/string-builder.test.d.ts.map +1 -0
- package/esm/src/utils/string-builder/string-builder.test.js +163 -0
- package/esm/src/utils/string-builder/utils.d.ts.map +1 -0
- package/esm/src/utils/string.utils.d.ts.map +1 -0
- package/esm/src/utils/string.utils.test.d.ts +2 -0
- package/esm/src/utils/string.utils.test.d.ts.map +1 -0
- package/esm/src/utils/string.utils.test.js +528 -0
- package/esm/src/utils/string.utils.types.d.ts.map +1 -0
- package/esm/src/utils/type.utils.d.ts.map +1 -0
- package/esm/tests/openapi.test.d.ts +2 -0
- package/esm/tests/openapi.test.d.ts.map +1 -0
- package/esm/tests/openapi.test.js +33 -0
- package/esm/tests/schema-factory.d.ts +42 -0
- package/esm/tests/schema-factory.d.ts.map +1 -0
- package/esm/tests/schema-factory.js +138 -0
- package/package.json +6 -6
- package/script/_dnt.shims.d.ts +1 -1
- package/script/_dnt.test_polyfills.d.ts +29 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/_dnt.test_polyfills.js +32 -0
- package/script/_dnt.test_shims.d.ts +14 -0
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/_dnt.test_shims.js +79 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.js +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +20 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +32 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +35 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +24 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +20 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +32 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +46 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.js +18 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +46 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +183 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +6 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.js +33 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.js +194 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +34 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.js +748 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +11 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +843 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.js +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.js +226 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.js +527 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.js +88 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +86 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.js +91 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +204 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.js +116 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.js +284 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.js +186 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.js +41 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.js +220 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +3 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +79 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +385 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +738 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.js +665 -0
- package/script/mod.d.ts +30 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +34 -0
- package/script/src/ast/node.d.ts +17 -0
- package/script/src/ast/node.d.ts.map +1 -0
- package/script/src/codegen/config.d.ts +16 -0
- package/script/src/codegen/config.d.ts.map +1 -0
- package/script/src/codegen/endpoints-generator.d.ts +18 -0
- package/script/src/codegen/endpoints-generator.d.ts.map +1 -0
- package/script/src/codegen/generator.d.ts +39 -0
- package/script/src/codegen/generator.d.ts.map +1 -0
- package/script/src/codegen/generator.js +123 -0
- package/script/src/codegen/internal-utils.d.ts.map +1 -0
- package/script/src/codegen/internal-utils.js +9 -0
- package/script/src/codegen/schemas-generator.d.ts +19 -0
- package/script/src/codegen/schemas-generator.d.ts.map +1 -0
- package/script/src/codegen/schemas-generator.js +49 -0
- package/script/src/codegen/services-generator.d.ts +18 -0
- package/script/src/codegen/services-generator.d.ts.map +1 -0
- package/script/src/codegen/types.d.ts +19 -0
- package/script/src/codegen/types.d.ts.map +1 -0
- package/script/src/collect/collector.d.ts +5 -0
- package/script/src/collect/collector.d.ts.map +1 -0
- package/script/src/collect/helpers.d.ts +5 -0
- package/script/src/collect/helpers.d.ts.map +1 -0
- package/script/src/collect/helpers.test.d.ts +2 -0
- package/script/src/collect/helpers.test.d.ts.map +1 -0
- package/script/src/collect/helpers.test.js +79 -0
- package/script/src/collect/types.d.ts +14 -0
- package/script/src/collect/types.d.ts.map +1 -0
- package/script/src/internal-utils.d.ts.map +1 -0
- package/script/src/parse/deref-proxy.d.ts.map +1 -0
- package/script/src/parse/deref-proxy.js +65 -0
- package/script/src/parse/openapi-types.d.ts.map +1 -0
- package/script/src/parse/parser.d.ts +19 -0
- package/script/src/parse/parser.d.ts.map +1 -0
- package/script/src/parse/parser.js +200 -0
- package/script/src/parse/types.d.ts.map +1 -0
- package/script/src/transform/api-types.d.ts +196 -0
- package/script/src/transform/api-types.d.ts.map +1 -0
- package/script/src/transform/helpers.d.ts +52 -0
- package/script/src/transform/helpers.d.ts.map +1 -0
- package/script/src/transform/helpers.js +173 -0
- package/script/src/transform/helpers.test.d.ts +2 -0
- package/script/src/transform/helpers.test.d.ts.map +1 -0
- package/script/src/transform/helpers.test.js +267 -0
- package/script/src/transform/transform-document.d.ts +5 -0
- package/script/src/transform/transform-document.d.ts.map +1 -0
- package/script/src/transform/transform-endpoint.d.ts +5 -0
- package/script/src/transform/transform-endpoint.d.ts.map +1 -0
- package/script/src/transform/transform-endpoint.js +272 -0
- package/script/src/transform/transform-schema.d.ts +6 -0
- package/script/src/transform/transform-schema.d.ts.map +1 -0
- package/script/src/transform/transform-schema.js +185 -0
- package/script/src/transform/transformer.d.ts +5 -0
- package/script/src/transform/transformer.d.ts.map +1 -0
- package/script/src/transform/types.d.ts.map +1 -0
- package/script/src/utils/action-provider.d.ts.map +1 -0
- package/script/src/utils/action-provider.js +33 -0
- package/script/src/utils/action-provider.test.d.ts +2 -0
- package/script/src/utils/action-provider.test.d.ts.map +1 -0
- package/script/src/utils/action-provider.test.js +30 -0
- package/script/src/utils/array.utils.d.ts.map +1 -0
- package/script/src/utils/asset-manager.d.ts +9 -0
- package/script/src/utils/asset-manager.d.ts.map +1 -0
- package/script/src/utils/asset-manager.js +55 -0
- package/script/src/utils/class.utils.d.ts.map +1 -0
- package/script/src/utils/class.utils.js +33 -0
- package/script/src/utils/common.utils.d.ts.map +1 -0
- package/script/src/utils/common.utils.test.d.ts +2 -0
- package/script/src/utils/common.utils.test.d.ts.map +1 -0
- package/script/src/utils/common.utils.test.js +20 -0
- package/script/src/utils/condition.d.ts.map +1 -0
- package/script/src/utils/condition.test.d.ts +2 -0
- package/script/src/utils/condition.test.d.ts.map +1 -0
- package/script/src/utils/condition.test.js +33 -0
- package/script/src/utils/endpoint.utils.d.ts +3 -0
- package/script/src/utils/endpoint.utils.d.ts.map +1 -0
- package/script/src/utils/endpoint.utils.test.d.ts +2 -0
- package/script/src/utils/endpoint.utils.test.d.ts.map +1 -0
- package/script/src/utils/endpoint.utils.test.js +33 -0
- package/script/src/utils/error.utils.d.ts.map +1 -0
- package/script/src/utils/factory.d.ts +21 -0
- package/script/src/utils/factory.d.ts.map +1 -0
- package/script/src/utils/factory.test.d.ts +2 -0
- package/script/src/utils/factory.test.d.ts.map +1 -0
- package/script/src/utils/factory.test.js +36 -0
- package/script/src/utils/file-system.utils.d.ts.map +1 -0
- package/script/src/utils/generator.utils.d.ts.map +1 -0
- package/script/src/utils/generator.utils.test.d.ts +2 -0
- package/script/src/utils/generator.utils.test.d.ts.map +1 -0
- package/script/src/utils/generator.utils.test.js +15 -0
- package/script/src/utils/object.utils.d.ts.map +1 -0
- package/script/src/utils/object.utils.js +40 -0
- package/script/src/utils/object.utils.test.d.ts +2 -0
- package/script/src/utils/object.utils.test.d.ts.map +1 -0
- package/script/src/utils/object.utils.test.js +31 -0
- package/script/src/utils/schema.utils.d.ts +11 -0
- package/script/src/utils/schema.utils.d.ts.map +1 -0
- package/script/src/utils/schema.utils.test.d.ts +2 -0
- package/script/src/utils/schema.utils.test.d.ts.map +1 -0
- package/script/src/utils/schema.utils.test.js +72 -0
- package/script/src/utils/source-builder.d.ts +234 -0
- package/script/src/utils/source-builder.d.ts.map +1 -0
- package/script/src/utils/source-builder.js +451 -0
- package/script/src/utils/source-builder.test.d.ts +2 -0
- package/script/src/utils/source-builder.test.d.ts.map +1 -0
- package/script/src/utils/source-builder.test.js +507 -0
- package/script/src/utils/string-builder/options.d.ts.map +1 -0
- package/script/src/utils/string-builder/string-builder.d.ts +73 -0
- package/script/src/utils/string-builder/string-builder.d.ts.map +1 -0
- package/script/src/utils/string-builder/string-builder.js +153 -0
- package/script/src/utils/string-builder/string-builder.test.d.ts +2 -0
- package/script/src/utils/string-builder/string-builder.test.d.ts.map +1 -0
- package/script/src/utils/string-builder/string-builder.test.js +165 -0
- package/script/src/utils/string-builder/utils.d.ts.map +1 -0
- package/script/src/utils/string.utils.d.ts.map +1 -0
- package/script/src/utils/string.utils.test.d.ts +2 -0
- package/script/src/utils/string.utils.test.d.ts.map +1 -0
- package/script/src/utils/string.utils.test.js +530 -0
- package/script/src/utils/string.utils.types.d.ts.map +1 -0
- package/script/src/utils/type.utils.d.ts.map +1 -0
- package/script/tests/openapi.test.d.ts +2 -0
- package/script/tests/openapi.test.d.ts.map +1 -0
- package/script/tests/openapi.test.js +35 -0
- package/script/tests/schema-factory.d.ts +42 -0
- package/script/tests/schema-factory.d.ts.map +1 -0
- package/script/tests/schema-factory.js +162 -0
- package/src/_dnt.shims.ts +69 -0
- package/src/_dnt.test_polyfills.ts +70 -0
- package/src/_dnt.test_shims.ts +72 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_equals.ts +38 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.ts +54 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.ts +35 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assertions.ts +18 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.ts +198 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_build_message.ts +51 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.ts +19 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_equal.ts +230 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_extend.ts +16 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_inspect_args.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_matchers.ts +1028 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_mock_util.ts +22 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_serializer.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_types.ts +923 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_utils.ts +283 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/expect.ts +620 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/fn.ts +91 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/mod.ts +89 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +214 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +134 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +204 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +39 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +18 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/_test_suite.ts +448 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/bdd.ts +1288 -0
- package/src/mod.ts +33 -0
- package/src/src/ast/node.ts +46 -0
- package/src/src/codegen/config.ts +28 -0
- package/src/src/codegen/endpoints-generator.ts +72 -0
- package/src/src/codegen/generator.ts +181 -0
- package/src/src/codegen/internal-utils.ts +6 -0
- package/src/src/codegen/schemas-generator.ts +87 -0
- package/src/src/codegen/services-generator.ts +77 -0
- package/src/src/codegen/types.ts +37 -0
- package/src/src/collect/collector.ts +142 -0
- package/src/src/collect/helpers.test.ts +91 -0
- package/src/src/collect/helpers.ts +36 -0
- package/src/src/collect/types.ts +21 -0
- package/src/src/internal-utils.ts +5 -0
- package/src/src/parse/deref-proxy.ts +64 -0
- package/src/src/parse/openapi-types.ts +949 -0
- package/src/src/parse/parser.ts +220 -0
- package/src/src/parse/types.ts +27 -0
- package/src/src/transform/api-types.ts +243 -0
- package/src/src/transform/helpers.test.ts +316 -0
- package/src/src/transform/helpers.ts +211 -0
- package/src/src/transform/transform-document.ts +35 -0
- package/src/src/transform/transform-endpoint.ts +331 -0
- package/src/src/transform/transform-schema.ts +217 -0
- package/src/src/transform/transformer.ts +52 -0
- package/src/src/transform/types.ts +52 -0
- package/src/src/utils/action-provider.test.ts +32 -0
- package/src/src/utils/action-provider.ts +58 -0
- package/src/src/utils/array.utils.ts +7 -0
- package/src/src/utils/asset-manager.ts +51 -0
- package/src/src/utils/class.utils.ts +40 -0
- package/src/src/utils/common.utils.test.ts +22 -0
- package/src/src/utils/common.utils.ts +86 -0
- package/src/src/utils/condition.test.ts +36 -0
- package/src/src/utils/condition.ts +7 -0
- package/src/src/utils/endpoint.utils.test.ts +36 -0
- package/src/src/utils/endpoint.utils.ts +10 -0
- package/src/src/utils/error.utils.ts +3 -0
- package/src/src/utils/factory.test.ts +31 -0
- package/src/src/utils/factory.ts +42 -0
- package/src/src/utils/file-system.utils.ts +48 -0
- package/src/src/utils/generator.utils.test.ts +16 -0
- package/src/src/utils/generator.utils.ts +6 -0
- package/src/src/utils/object.utils.test.ts +33 -0
- package/src/src/utils/object.utils.ts +32 -0
- package/src/src/utils/schema.utils.test.ts +88 -0
- package/src/src/utils/schema.utils.ts +142 -0
- package/src/src/utils/source-builder.test.ts +657 -0
- package/src/src/utils/source-builder.ts +589 -0
- package/src/src/utils/string-builder/options.ts +19 -0
- package/src/src/utils/string-builder/string-builder.test.ts +188 -0
- package/src/src/utils/string-builder/string-builder.ts +165 -0
- package/src/src/utils/string-builder/utils.ts +69 -0
- package/src/src/utils/string.utils.test.ts +691 -0
- package/src/src/utils/string.utils.ts +369 -0
- package/src/src/utils/string.utils.types.ts +179 -0
- package/src/src/utils/type.utils.ts +93 -0
- package/src/tests/openapi.test.ts +50 -0
- package/src/tests/schema-factory.ts +185 -0
- package/test_runner.js +221 -0
- package/esm/index.d.ts +0 -6
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -5
- package/esm/lib/ast/index.d.ts +0 -2
- package/esm/lib/ast/index.d.ts.map +0 -1
- package/esm/lib/ast/index.js +0 -1
- package/esm/lib/ast/node.d.ts +0 -15
- package/esm/lib/ast/node.d.ts.map +0 -1
- package/esm/lib/codegen/config.d.ts +0 -16
- package/esm/lib/codegen/config.d.ts.map +0 -1
- package/esm/lib/codegen/endpoints-generator.d.ts +0 -18
- package/esm/lib/codegen/endpoints-generator.d.ts.map +0 -1
- package/esm/lib/codegen/generator.d.ts +0 -39
- package/esm/lib/codegen/generator.d.ts.map +0 -1
- package/esm/lib/codegen/generator.js +0 -115
- package/esm/lib/codegen/index.d.ts +0 -7
- package/esm/lib/codegen/index.d.ts.map +0 -1
- package/esm/lib/codegen/index.js +0 -6
- package/esm/lib/codegen/internal-utils.d.ts.map +0 -1
- package/esm/lib/codegen/internal-utils.js +0 -5
- package/esm/lib/codegen/schemas-generator.d.ts +0 -19
- package/esm/lib/codegen/schemas-generator.d.ts.map +0 -1
- package/esm/lib/codegen/schemas-generator.js +0 -45
- package/esm/lib/codegen/services-generator.d.ts +0 -18
- package/esm/lib/codegen/services-generator.d.ts.map +0 -1
- package/esm/lib/codegen/types.d.ts +0 -19
- package/esm/lib/codegen/types.d.ts.map +0 -1
- package/esm/lib/collect/collector.d.ts +0 -4
- package/esm/lib/collect/collector.d.ts.map +0 -1
- package/esm/lib/collect/helpers.d.ts +0 -5
- package/esm/lib/collect/helpers.d.ts.map +0 -1
- package/esm/lib/collect/index.d.ts +0 -4
- package/esm/lib/collect/index.d.ts.map +0 -1
- package/esm/lib/collect/index.js +0 -3
- package/esm/lib/collect/types.d.ts +0 -13
- package/esm/lib/collect/types.d.ts.map +0 -1
- package/esm/lib/internal-utils.d.ts.map +0 -1
- package/esm/lib/parse/deref-proxy.d.ts.map +0 -1
- package/esm/lib/parse/deref-proxy.js +0 -62
- package/esm/lib/parse/index.d.ts +0 -4
- package/esm/lib/parse/index.d.ts.map +0 -1
- package/esm/lib/parse/index.js +0 -3
- package/esm/lib/parse/openapi-types.d.ts.map +0 -1
- package/esm/lib/parse/parser.d.ts +0 -19
- package/esm/lib/parse/parser.d.ts.map +0 -1
- package/esm/lib/parse/parser.js +0 -190
- package/esm/lib/parse/types.d.ts.map +0 -1
- package/esm/lib/transform/api-types.d.ts +0 -195
- package/esm/lib/transform/api-types.d.ts.map +0 -1
- package/esm/lib/transform/helpers.d.ts +0 -51
- package/esm/lib/transform/helpers.d.ts.map +0 -1
- package/esm/lib/transform/helpers.js +0 -158
- package/esm/lib/transform/index.d.ts +0 -3
- package/esm/lib/transform/index.d.ts.map +0 -1
- package/esm/lib/transform/index.js +0 -2
- package/esm/lib/transform/transform-document.d.ts +0 -4
- package/esm/lib/transform/transform-document.d.ts.map +0 -1
- package/esm/lib/transform/transform-endpoint.d.ts +0 -5
- package/esm/lib/transform/transform-endpoint.d.ts.map +0 -1
- package/esm/lib/transform/transform-endpoint.js +0 -275
- package/esm/lib/transform/transform-schema.d.ts +0 -5
- package/esm/lib/transform/transform-schema.d.ts.map +0 -1
- package/esm/lib/transform/transform-schema.js +0 -182
- package/esm/lib/transform/transformer.d.ts +0 -5
- package/esm/lib/transform/transformer.d.ts.map +0 -1
- package/esm/lib/transform/types.d.ts.map +0 -1
- package/esm/lib/utils/action-provider.d.ts.map +0 -1
- package/esm/lib/utils/action-provider.js +0 -35
- package/esm/lib/utils/array.utils.d.ts.map +0 -1
- package/esm/lib/utils/asset-manager.d.ts +0 -8
- package/esm/lib/utils/asset-manager.d.ts.map +0 -1
- package/esm/lib/utils/asset-manager.js +0 -49
- package/esm/lib/utils/class.utils.d.ts.map +0 -1
- package/esm/lib/utils/class.utils.js +0 -27
- package/esm/lib/utils/common.utils.d.ts.map +0 -1
- package/esm/lib/utils/condition.d.ts.map +0 -1
- package/esm/lib/utils/endpoint.utils.d.ts +0 -3
- package/esm/lib/utils/endpoint.utils.d.ts.map +0 -1
- package/esm/lib/utils/error.utils.d.ts.map +0 -1
- package/esm/lib/utils/factory.d.ts +0 -21
- package/esm/lib/utils/factory.d.ts.map +0 -1
- package/esm/lib/utils/file-system.utils.d.ts.map +0 -1
- package/esm/lib/utils/generator.utils.d.ts.map +0 -1
- package/esm/lib/utils/index.d.ts +0 -16
- package/esm/lib/utils/index.d.ts.map +0 -1
- package/esm/lib/utils/index.js +0 -15
- package/esm/lib/utils/object.utils.d.ts.map +0 -1
- package/esm/lib/utils/object.utils.js +0 -35
- package/esm/lib/utils/schema.utils.d.ts +0 -11
- package/esm/lib/utils/schema.utils.d.ts.map +0 -1
- package/esm/lib/utils/source-builder.d.ts +0 -233
- package/esm/lib/utils/source-builder.d.ts.map +0 -1
- package/esm/lib/utils/source-builder.js +0 -446
- package/esm/lib/utils/string-builder/index.d.ts +0 -4
- package/esm/lib/utils/string-builder/index.d.ts.map +0 -1
- package/esm/lib/utils/string-builder/index.js +0 -3
- package/esm/lib/utils/string-builder/options.d.ts.map +0 -1
- package/esm/lib/utils/string-builder/string-builder.d.ts +0 -73
- package/esm/lib/utils/string-builder/string-builder.d.ts.map +0 -1
- package/esm/lib/utils/string-builder/string-builder.js +0 -149
- package/esm/lib/utils/string-builder/utils.d.ts.map +0 -1
- package/esm/lib/utils/string.utils.d.ts.map +0 -1
- package/esm/lib/utils/string.utils.types.d.ts.map +0 -1
- package/esm/lib/utils/type.utils.d.ts.map +0 -1
- package/script/index.d.ts +0 -6
- package/script/index.d.ts.map +0 -1
- package/script/index.js +0 -8
- package/script/lib/ast/index.d.ts +0 -2
- package/script/lib/ast/index.d.ts.map +0 -1
- package/script/lib/ast/index.js +0 -4
- package/script/lib/ast/node.d.ts +0 -15
- package/script/lib/ast/node.d.ts.map +0 -1
- package/script/lib/codegen/config.d.ts +0 -16
- package/script/lib/codegen/config.d.ts.map +0 -1
- package/script/lib/codegen/endpoints-generator.d.ts +0 -18
- package/script/lib/codegen/endpoints-generator.d.ts.map +0 -1
- package/script/lib/codegen/generator.d.ts +0 -39
- package/script/lib/codegen/generator.d.ts.map +0 -1
- package/script/lib/codegen/generator.js +0 -121
- package/script/lib/codegen/index.d.ts +0 -7
- package/script/lib/codegen/index.d.ts.map +0 -1
- package/script/lib/codegen/index.js +0 -9
- package/script/lib/codegen/internal-utils.d.ts.map +0 -1
- package/script/lib/codegen/internal-utils.js +0 -8
- package/script/lib/codegen/schemas-generator.d.ts +0 -19
- package/script/lib/codegen/schemas-generator.d.ts.map +0 -1
- package/script/lib/codegen/schemas-generator.js +0 -49
- package/script/lib/codegen/services-generator.d.ts +0 -18
- package/script/lib/codegen/services-generator.d.ts.map +0 -1
- package/script/lib/codegen/types.d.ts +0 -19
- package/script/lib/codegen/types.d.ts.map +0 -1
- package/script/lib/collect/collector.d.ts +0 -4
- package/script/lib/collect/collector.d.ts.map +0 -1
- package/script/lib/collect/helpers.d.ts +0 -5
- package/script/lib/collect/helpers.d.ts.map +0 -1
- package/script/lib/collect/index.d.ts +0 -4
- package/script/lib/collect/index.d.ts.map +0 -1
- package/script/lib/collect/index.js +0 -6
- package/script/lib/collect/types.d.ts +0 -13
- package/script/lib/collect/types.d.ts.map +0 -1
- package/script/lib/internal-utils.d.ts.map +0 -1
- package/script/lib/parse/deref-proxy.d.ts.map +0 -1
- package/script/lib/parse/deref-proxy.js +0 -65
- package/script/lib/parse/index.d.ts +0 -4
- package/script/lib/parse/index.d.ts.map +0 -1
- package/script/lib/parse/index.js +0 -6
- package/script/lib/parse/openapi-types.d.ts.map +0 -1
- package/script/lib/parse/parser.d.ts +0 -19
- package/script/lib/parse/parser.d.ts.map +0 -1
- package/script/lib/parse/parser.js +0 -195
- package/script/lib/parse/types.d.ts.map +0 -1
- package/script/lib/transform/api-types.d.ts +0 -195
- package/script/lib/transform/api-types.d.ts.map +0 -1
- package/script/lib/transform/helpers.d.ts +0 -51
- package/script/lib/transform/helpers.d.ts.map +0 -1
- package/script/lib/transform/helpers.js +0 -171
- package/script/lib/transform/index.d.ts +0 -3
- package/script/lib/transform/index.d.ts.map +0 -1
- package/script/lib/transform/index.js +0 -5
- package/script/lib/transform/transform-document.d.ts +0 -4
- package/script/lib/transform/transform-document.d.ts.map +0 -1
- package/script/lib/transform/transform-endpoint.d.ts +0 -5
- package/script/lib/transform/transform-endpoint.d.ts.map +0 -1
- package/script/lib/transform/transform-endpoint.js +0 -278
- package/script/lib/transform/transform-schema.d.ts +0 -5
- package/script/lib/transform/transform-schema.d.ts.map +0 -1
- package/script/lib/transform/transform-schema.js +0 -185
- package/script/lib/transform/transformer.d.ts +0 -5
- package/script/lib/transform/transformer.d.ts.map +0 -1
- package/script/lib/transform/types.d.ts.map +0 -1
- package/script/lib/utils/action-provider.d.ts.map +0 -1
- package/script/lib/utils/action-provider.js +0 -39
- package/script/lib/utils/array.utils.d.ts.map +0 -1
- package/script/lib/utils/asset-manager.d.ts +0 -8
- package/script/lib/utils/asset-manager.d.ts.map +0 -1
- package/script/lib/utils/asset-manager.js +0 -54
- package/script/lib/utils/class.utils.d.ts.map +0 -1
- package/script/lib/utils/class.utils.js +0 -32
- package/script/lib/utils/common.utils.d.ts.map +0 -1
- package/script/lib/utils/condition.d.ts.map +0 -1
- package/script/lib/utils/endpoint.utils.d.ts +0 -3
- package/script/lib/utils/endpoint.utils.d.ts.map +0 -1
- package/script/lib/utils/error.utils.d.ts.map +0 -1
- package/script/lib/utils/factory.d.ts +0 -21
- package/script/lib/utils/factory.d.ts.map +0 -1
- package/script/lib/utils/file-system.utils.d.ts.map +0 -1
- package/script/lib/utils/generator.utils.d.ts.map +0 -1
- package/script/lib/utils/index.d.ts +0 -16
- package/script/lib/utils/index.d.ts.map +0 -1
- package/script/lib/utils/index.js +0 -18
- package/script/lib/utils/object.utils.d.ts.map +0 -1
- package/script/lib/utils/object.utils.js +0 -39
- package/script/lib/utils/schema.utils.d.ts +0 -11
- package/script/lib/utils/schema.utils.d.ts.map +0 -1
- package/script/lib/utils/source-builder.d.ts +0 -233
- package/script/lib/utils/source-builder.d.ts.map +0 -1
- package/script/lib/utils/source-builder.js +0 -450
- package/script/lib/utils/string-builder/index.d.ts +0 -4
- package/script/lib/utils/string-builder/index.d.ts.map +0 -1
- package/script/lib/utils/string-builder/index.js +0 -8
- package/script/lib/utils/string-builder/options.d.ts.map +0 -1
- package/script/lib/utils/string-builder/string-builder.d.ts +0 -73
- package/script/lib/utils/string-builder/string-builder.d.ts.map +0 -1
- package/script/lib/utils/string-builder/string-builder.js +0 -153
- package/script/lib/utils/string-builder/utils.d.ts.map +0 -1
- package/script/lib/utils/string.utils.d.ts.map +0 -1
- package/script/lib/utils/string.utils.types.d.ts.map +0 -1
- package/script/lib/utils/type.utils.d.ts.map +0 -1
- /package/esm/{lib → src}/ast/node.js +0 -0
- /package/esm/{lib → src}/codegen/config.js +0 -0
- /package/esm/{lib → src}/codegen/endpoints-generator.js +0 -0
- /package/esm/{lib → src}/codegen/internal-utils.d.ts +0 -0
- /package/esm/{lib → src}/codegen/services-generator.js +0 -0
- /package/esm/{lib → src}/codegen/types.js +0 -0
- /package/esm/{lib → src}/collect/collector.js +0 -0
- /package/esm/{lib → src}/collect/helpers.js +0 -0
- /package/esm/{lib → src}/collect/types.js +0 -0
- /package/esm/{lib → src}/internal-utils.d.ts +0 -0
- /package/esm/{lib → src}/internal-utils.js +0 -0
- /package/esm/{lib → src}/parse/deref-proxy.d.ts +0 -0
- /package/esm/{lib → src}/parse/openapi-types.d.ts +0 -0
- /package/esm/{lib → src}/parse/openapi-types.js +0 -0
- /package/esm/{lib → src}/parse/types.d.ts +0 -0
- /package/esm/{lib → src}/parse/types.js +0 -0
- /package/esm/{lib → src}/transform/api-types.js +0 -0
- /package/esm/{lib → src}/transform/transform-document.js +0 -0
- /package/esm/{lib → src}/transform/transformer.js +0 -0
- /package/esm/{lib → src}/transform/types.d.ts +0 -0
- /package/esm/{lib → src}/transform/types.js +0 -0
- /package/esm/{lib → src}/utils/action-provider.d.ts +0 -0
- /package/esm/{lib → src}/utils/array.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/array.utils.js +0 -0
- /package/esm/{lib → src}/utils/class.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/common.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/common.utils.js +0 -0
- /package/esm/{lib → src}/utils/condition.d.ts +0 -0
- /package/esm/{lib → src}/utils/condition.js +0 -0
- /package/esm/{lib → src}/utils/endpoint.utils.js +0 -0
- /package/esm/{lib → src}/utils/error.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/error.utils.js +0 -0
- /package/esm/{lib → src}/utils/factory.js +0 -0
- /package/esm/{lib → src}/utils/file-system.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/file-system.utils.js +0 -0
- /package/esm/{lib → src}/utils/generator.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/generator.utils.js +0 -0
- /package/esm/{lib → src}/utils/object.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/schema.utils.js +0 -0
- /package/esm/{lib → src}/utils/string-builder/options.d.ts +0 -0
- /package/esm/{lib → src}/utils/string-builder/options.js +0 -0
- /package/esm/{lib → src}/utils/string-builder/utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/string-builder/utils.js +0 -0
- /package/esm/{lib → src}/utils/string.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/string.utils.js +0 -0
- /package/esm/{lib → src}/utils/string.utils.types.d.ts +0 -0
- /package/esm/{lib → src}/utils/string.utils.types.js +0 -0
- /package/esm/{lib → src}/utils/type.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/type.utils.js +0 -0
- /package/script/{lib → src}/ast/node.js +0 -0
- /package/script/{lib → src}/codegen/config.js +0 -0
- /package/script/{lib → src}/codegen/endpoints-generator.js +0 -0
- /package/script/{lib → src}/codegen/internal-utils.d.ts +0 -0
- /package/script/{lib → src}/codegen/services-generator.js +0 -0
- /package/script/{lib → src}/codegen/types.js +0 -0
- /package/script/{lib → src}/collect/collector.js +0 -0
- /package/script/{lib → src}/collect/helpers.js +0 -0
- /package/script/{lib → src}/collect/types.js +0 -0
- /package/script/{lib → src}/internal-utils.d.ts +0 -0
- /package/script/{lib → src}/internal-utils.js +0 -0
- /package/script/{lib → src}/parse/deref-proxy.d.ts +0 -0
- /package/script/{lib → src}/parse/openapi-types.d.ts +0 -0
- /package/script/{lib → src}/parse/openapi-types.js +0 -0
- /package/script/{lib → src}/parse/types.d.ts +0 -0
- /package/script/{lib → src}/parse/types.js +0 -0
- /package/script/{lib → src}/transform/api-types.js +0 -0
- /package/script/{lib → src}/transform/transform-document.js +0 -0
- /package/script/{lib → src}/transform/transformer.js +0 -0
- /package/script/{lib → src}/transform/types.d.ts +0 -0
- /package/script/{lib → src}/transform/types.js +0 -0
- /package/script/{lib → src}/utils/action-provider.d.ts +0 -0
- /package/script/{lib → src}/utils/array.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/array.utils.js +0 -0
- /package/script/{lib → src}/utils/class.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/common.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/common.utils.js +0 -0
- /package/script/{lib → src}/utils/condition.d.ts +0 -0
- /package/script/{lib → src}/utils/condition.js +0 -0
- /package/script/{lib → src}/utils/endpoint.utils.js +0 -0
- /package/script/{lib → src}/utils/error.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/error.utils.js +0 -0
- /package/script/{lib → src}/utils/factory.js +0 -0
- /package/script/{lib → src}/utils/file-system.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/file-system.utils.js +0 -0
- /package/script/{lib → src}/utils/generator.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/generator.utils.js +0 -0
- /package/script/{lib → src}/utils/object.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/schema.utils.js +0 -0
- /package/script/{lib → src}/utils/string-builder/options.d.ts +0 -0
- /package/script/{lib → src}/utils/string-builder/options.js +0 -0
- /package/script/{lib → src}/utils/string-builder/utils.d.ts +0 -0
- /package/script/{lib → src}/utils/string-builder/utils.js +0 -0
- /package/script/{lib → src}/utils/string.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/string.utils.js +0 -0
- /package/script/{lib → src}/utils/string.utils.types.d.ts +0 -0
- /package/script/{lib → src}/utils/string.utils.types.js +0 -0
- /package/script/{lib → src}/utils/type.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/type.utils.js +0 -0
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.toBe = toBe;
|
|
5
|
+
exports.toEqual = toEqual;
|
|
6
|
+
exports.toStrictEqual = toStrictEqual;
|
|
7
|
+
exports.toBeCloseTo = toBeCloseTo;
|
|
8
|
+
exports.toBeDefined = toBeDefined;
|
|
9
|
+
exports.toBeUndefined = toBeUndefined;
|
|
10
|
+
exports.toBeFalsy = toBeFalsy;
|
|
11
|
+
exports.toBeTruthy = toBeTruthy;
|
|
12
|
+
exports.toBeGreaterThanOrEqual = toBeGreaterThanOrEqual;
|
|
13
|
+
exports.toBeGreaterThan = toBeGreaterThan;
|
|
14
|
+
exports.toBeInstanceOf = toBeInstanceOf;
|
|
15
|
+
exports.toBeLessThanOrEqual = toBeLessThanOrEqual;
|
|
16
|
+
exports.toBeLessThan = toBeLessThan;
|
|
17
|
+
exports.toBeNaN = toBeNaN;
|
|
18
|
+
exports.toBeNull = toBeNull;
|
|
19
|
+
exports.toHaveLength = toHaveLength;
|
|
20
|
+
exports.toHaveProperty = toHaveProperty;
|
|
21
|
+
exports.toContain = toContain;
|
|
22
|
+
exports.toContainEqual = toContainEqual;
|
|
23
|
+
exports.toMatch = toMatch;
|
|
24
|
+
exports.toMatchObject = toMatchObject;
|
|
25
|
+
exports.toHaveBeenCalled = toHaveBeenCalled;
|
|
26
|
+
exports.toHaveBeenCalledTimes = toHaveBeenCalledTimes;
|
|
27
|
+
exports.toHaveBeenCalledWith = toHaveBeenCalledWith;
|
|
28
|
+
exports.toHaveBeenLastCalledWith = toHaveBeenLastCalledWith;
|
|
29
|
+
exports.toHaveBeenNthCalledWith = toHaveBeenNthCalledWith;
|
|
30
|
+
exports.toHaveReturned = toHaveReturned;
|
|
31
|
+
exports.toHaveReturnedTimes = toHaveReturnedTimes;
|
|
32
|
+
exports.toHaveReturnedWith = toHaveReturnedWith;
|
|
33
|
+
exports.toHaveLastReturnedWith = toHaveLastReturnedWith;
|
|
34
|
+
exports.toHaveNthReturnedWith = toHaveNthReturnedWith;
|
|
35
|
+
exports.toThrow = toThrow;
|
|
36
|
+
const not_strict_equals_js_1 = require("../../assert/1.0.11/not_strict_equals.js");
|
|
37
|
+
const strict_equals_js_1 = require("../../assert/1.0.11/strict_equals.js");
|
|
38
|
+
const instance_of_js_1 = require("../../assert/1.0.11/instance_of.js");
|
|
39
|
+
const _assert_is_error_js_1 = require("./_assert_is_error.js");
|
|
40
|
+
const not_instance_of_js_1 = require("../../assert/1.0.11/not_instance_of.js");
|
|
41
|
+
const match_js_1 = require("../../assert/1.0.11/match.js");
|
|
42
|
+
const not_match_js_1 = require("../../assert/1.0.11/not_match.js");
|
|
43
|
+
const assertion_error_js_1 = require("../../assert/1.0.11/assertion_error.js");
|
|
44
|
+
const _assert_equals_js_1 = require("./_assert_equals.js");
|
|
45
|
+
const _assert_not_equals_js_1 = require("./_assert_not_equals.js");
|
|
46
|
+
const _equal_js_1 = require("./_equal.js");
|
|
47
|
+
const format_js_1 = require("../../internal/1.0.5/format.js");
|
|
48
|
+
const _mock_util_js_1 = require("./_mock_util.js");
|
|
49
|
+
const _inspect_args_js_1 = require("./_inspect_args.js");
|
|
50
|
+
const _utils_js_1 = require("./_utils.js");
|
|
51
|
+
function toBe(context, expect) {
|
|
52
|
+
if (context.isNot) {
|
|
53
|
+
(0, not_strict_equals_js_1.assertNotStrictEquals)(context.value, expect, context.customMessage);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
(0, strict_equals_js_1.assertStrictEquals)(context.value, expect, context.customMessage);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function toEqual(context, expected) {
|
|
60
|
+
const v = context.value;
|
|
61
|
+
const e = expected;
|
|
62
|
+
const equalsOptions = (0, _utils_js_1.buildEqualOptions)({
|
|
63
|
+
...context,
|
|
64
|
+
customTesters: [
|
|
65
|
+
...context.customTesters,
|
|
66
|
+
_utils_js_1.iterableEquality,
|
|
67
|
+
],
|
|
68
|
+
});
|
|
69
|
+
if (context.isNot) {
|
|
70
|
+
(0, _assert_not_equals_js_1.assertNotEquals)(v, e, equalsOptions);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
(0, _assert_equals_js_1.assertEquals)(v, e, equalsOptions);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function toStrictEqual(context, expected) {
|
|
77
|
+
const equalsOptions = (0, _utils_js_1.buildEqualOptions)({
|
|
78
|
+
...context,
|
|
79
|
+
strictCheck: true,
|
|
80
|
+
customTesters: [
|
|
81
|
+
...context.customTesters,
|
|
82
|
+
_utils_js_1.iterableEquality,
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
if (context.isNot) {
|
|
86
|
+
(0, _assert_not_equals_js_1.assertNotEquals)(context.value, expected, equalsOptions);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
(0, _assert_equals_js_1.assertEquals)(context.value, expected, equalsOptions);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function toBeCloseTo(context, expected, numDigits = 2) {
|
|
93
|
+
if (numDigits < 0) {
|
|
94
|
+
throw new Error("toBeCloseTo second argument must be a non-negative integer. Got " +
|
|
95
|
+
numDigits);
|
|
96
|
+
}
|
|
97
|
+
const tolerance = 0.5 * Math.pow(10, -numDigits);
|
|
98
|
+
const value = Number(context.value);
|
|
99
|
+
const pass = Math.abs(expected - value) < tolerance;
|
|
100
|
+
if (context.isNot) {
|
|
101
|
+
if (pass) {
|
|
102
|
+
const defaultMessage = `Expected the value ${value} not to be close to ${expected} (using ${numDigits} digits), but it is`;
|
|
103
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
104
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
105
|
+
: defaultMessage);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
if (!pass) {
|
|
110
|
+
const defaultMessage = `Expected the value ${value} to be close to ${expected} (using ${numDigits} digits), but it is not`;
|
|
111
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
112
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
113
|
+
: defaultMessage);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function toBeDefined(context) {
|
|
118
|
+
if (context.isNot) {
|
|
119
|
+
(0, strict_equals_js_1.assertStrictEquals)(context.value, undefined, context.customMessage);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
(0, not_strict_equals_js_1.assertNotStrictEquals)(context.value, undefined, context.customMessage);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function toBeUndefined(context) {
|
|
126
|
+
if (context.isNot) {
|
|
127
|
+
(0, not_strict_equals_js_1.assertNotStrictEquals)(context.value, undefined, context.customMessage);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
(0, strict_equals_js_1.assertStrictEquals)(context.value, undefined, context.customMessage);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function toBeFalsy(context) {
|
|
134
|
+
const isFalsy = !(context.value);
|
|
135
|
+
if (context.isNot) {
|
|
136
|
+
if (isFalsy) {
|
|
137
|
+
const defaultMessage = `Expected ${context.value} to NOT be falsy`;
|
|
138
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
139
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
140
|
+
: defaultMessage);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
if (!isFalsy) {
|
|
145
|
+
const defaultMessage = `Expected ${context.value} to be falsy`;
|
|
146
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
147
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
148
|
+
: defaultMessage);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function toBeTruthy(context) {
|
|
153
|
+
const isTruthy = !!(context.value);
|
|
154
|
+
if (context.isNot) {
|
|
155
|
+
if (isTruthy) {
|
|
156
|
+
const defaultMessage = `Expected ${context.value} to NOT be truthy`;
|
|
157
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
158
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
159
|
+
: defaultMessage);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
if (!isTruthy) {
|
|
164
|
+
const defaultMessage = `Expected ${context.value} to be truthy`;
|
|
165
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
166
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
167
|
+
: defaultMessage);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function toBeGreaterThanOrEqual(context, expected) {
|
|
172
|
+
const isGreaterOrEqual = Number(context.value) >= Number(expected);
|
|
173
|
+
if (context.isNot) {
|
|
174
|
+
if (isGreaterOrEqual) {
|
|
175
|
+
const defaultMessage = `Expected ${context.value} to NOT be greater than or equal ${expected}`;
|
|
176
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
177
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
178
|
+
: defaultMessage);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
if (!isGreaterOrEqual) {
|
|
183
|
+
const defaultMessage = `Expected ${context.value} to be greater than or equal ${expected}`;
|
|
184
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
185
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
186
|
+
: defaultMessage);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function toBeGreaterThan(context, expected) {
|
|
191
|
+
const isGreater = Number(context.value) > Number(expected);
|
|
192
|
+
if (context.isNot) {
|
|
193
|
+
if (isGreater) {
|
|
194
|
+
const defaultMessage = `Expected ${context.value} to NOT be greater than ${expected}`;
|
|
195
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
196
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
197
|
+
: defaultMessage);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
if (!isGreater) {
|
|
202
|
+
const defaultMessage = `Expected ${context.value} to be greater than ${expected}`;
|
|
203
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
204
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
205
|
+
: defaultMessage);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function toBeInstanceOf(context, expected) {
|
|
210
|
+
if (context.isNot) {
|
|
211
|
+
(0, not_instance_of_js_1.assertNotInstanceOf)(context.value, expected);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
(0, instance_of_js_1.assertInstanceOf)(context.value, expected);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function toBeLessThanOrEqual(context, expected) {
|
|
218
|
+
const isLower = Number(context.value) <= Number(expected);
|
|
219
|
+
if (context.isNot) {
|
|
220
|
+
if (isLower) {
|
|
221
|
+
const defaultMessage = `Expected ${context.value} to NOT be lower than or equal ${expected}`;
|
|
222
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
223
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
224
|
+
: defaultMessage);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
if (!isLower) {
|
|
229
|
+
const defaultMessage = `Expected ${context.value} to be lower than or equal ${expected}`;
|
|
230
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
231
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
232
|
+
: defaultMessage);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function toBeLessThan(context, expected) {
|
|
237
|
+
const isLower = Number(context.value) < Number(expected);
|
|
238
|
+
if (context.isNot) {
|
|
239
|
+
if (isLower) {
|
|
240
|
+
const defaultMessage = `Expected ${context.value} to NOT be lower than ${expected}`;
|
|
241
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
242
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
243
|
+
: defaultMessage);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
if (!isLower) {
|
|
248
|
+
const defaultMessage = `Expected ${context.value} to be lower than ${expected}`;
|
|
249
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
250
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
251
|
+
: defaultMessage);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function toBeNaN(context) {
|
|
256
|
+
const equalsOptions = (0, _utils_js_1.buildEqualOptions)(context);
|
|
257
|
+
if (context.isNot) {
|
|
258
|
+
(0, _assert_not_equals_js_1.assertNotEquals)(isNaN(Number(context.value)), true, {
|
|
259
|
+
...equalsOptions,
|
|
260
|
+
msg: equalsOptions.msg || `Expected ${context.value} to not be NaN`,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
(0, _assert_equals_js_1.assertEquals)(isNaN(Number(context.value)), true, {
|
|
265
|
+
...equalsOptions,
|
|
266
|
+
msg: equalsOptions.msg || `Expected ${context.value} to be NaN`,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function toBeNull(context) {
|
|
271
|
+
if (context.isNot) {
|
|
272
|
+
(0, not_strict_equals_js_1.assertNotStrictEquals)(context.value, null, context.customMessage || `Expected ${context.value} to not be null`);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
(0, strict_equals_js_1.assertStrictEquals)(context.value, null, context.customMessage || `Expected ${context.value} to be null`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function toHaveLength(context, expected) {
|
|
279
|
+
const { value } = context;
|
|
280
|
+
// deno-lint-ignore no-explicit-any
|
|
281
|
+
const maybeLength = value === null || value === void 0 ? void 0 : value.length;
|
|
282
|
+
const hasLength = maybeLength === expected;
|
|
283
|
+
if (context.isNot) {
|
|
284
|
+
if (hasLength) {
|
|
285
|
+
const defaultMessage = `Expected value not to have length ${expected}, but it does`;
|
|
286
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
287
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
288
|
+
: defaultMessage);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
if (!hasLength) {
|
|
293
|
+
const defaultMessage = `Expected value to have length ${expected}, but it does not: the value has length ${maybeLength}`;
|
|
294
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
295
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
296
|
+
: defaultMessage);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function toHaveProperty(context, propName, v) {
|
|
301
|
+
const { value } = context;
|
|
302
|
+
let propPath = [];
|
|
303
|
+
if (Array.isArray(propName)) {
|
|
304
|
+
propPath = propName;
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
propPath = propName.split(".");
|
|
308
|
+
}
|
|
309
|
+
// deno-lint-ignore no-explicit-any
|
|
310
|
+
let current = value;
|
|
311
|
+
while (true) {
|
|
312
|
+
if (current === undefined || current === null) {
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
if (propPath.length === 0) {
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
const prop = propPath.shift();
|
|
319
|
+
current = current[prop];
|
|
320
|
+
}
|
|
321
|
+
let hasProperty;
|
|
322
|
+
if (v) {
|
|
323
|
+
hasProperty = current !== undefined && propPath.length === 0 &&
|
|
324
|
+
(0, _equal_js_1.equal)(current, v, context);
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
hasProperty = current !== undefined && propPath.length === 0;
|
|
328
|
+
}
|
|
329
|
+
let ofValue = "";
|
|
330
|
+
if (v) {
|
|
331
|
+
ofValue = ` of the value ${(0, _inspect_args_js_1.inspectArg)(v)}`;
|
|
332
|
+
}
|
|
333
|
+
if (context.isNot) {
|
|
334
|
+
if (hasProperty) {
|
|
335
|
+
const defaultMessage = `Expected the value not to have the property ${propPath.join(".")}${ofValue}, but it does`;
|
|
336
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
337
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
338
|
+
: defaultMessage);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
if (!hasProperty) {
|
|
343
|
+
const defaultMessage = `Expected the value to have the property ${propPath.join(".")}${ofValue}, but it does not`;
|
|
344
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
345
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
346
|
+
: defaultMessage);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function toContain(context, expected) {
|
|
351
|
+
var _a, _b;
|
|
352
|
+
// deno-lint-ignore no-explicit-any
|
|
353
|
+
const doesContain = (_b = (_a = context.value) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, expected);
|
|
354
|
+
const fmtValue = (0, format_js_1.format)(context.value);
|
|
355
|
+
const fmtExpected = (0, format_js_1.format)(expected);
|
|
356
|
+
if (context.isNot) {
|
|
357
|
+
if (doesContain) {
|
|
358
|
+
const defaultMessage = `The value ${fmtValue} contains the expected item ${fmtExpected}`;
|
|
359
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
360
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
361
|
+
: defaultMessage);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
if (!doesContain) {
|
|
366
|
+
const defaultMessage = `The value ${fmtValue} doesn't contain the expected item ${fmtExpected}`;
|
|
367
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
368
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
369
|
+
: defaultMessage);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function toContainEqual(context, expected) {
|
|
374
|
+
const { value } = context;
|
|
375
|
+
assertIsIterable(value);
|
|
376
|
+
let doesContain = false;
|
|
377
|
+
for (const item of value) {
|
|
378
|
+
if ((0, _equal_js_1.equal)(item, expected, context)) {
|
|
379
|
+
doesContain = true;
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
const prettyStringify = (js) => JSON.stringify(js, null, "\t")
|
|
384
|
+
.replace(/\"|\n|\t/g, "")
|
|
385
|
+
.slice(0, 100);
|
|
386
|
+
const fmtValue = prettyStringify(context.value);
|
|
387
|
+
const fmtExpected = prettyStringify(expected);
|
|
388
|
+
if (context.isNot) {
|
|
389
|
+
if (doesContain) {
|
|
390
|
+
const defaultMessage = `The value contains the expected item:
|
|
391
|
+
Value: ${fmtValue}
|
|
392
|
+
Expected: ${fmtExpected}`;
|
|
393
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
394
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
395
|
+
: defaultMessage);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
if (!doesContain) {
|
|
400
|
+
const defaultMessage = `The value doesn't contain the expected item:
|
|
401
|
+
Value: ${fmtValue}
|
|
402
|
+
Expected: ${fmtExpected}`;
|
|
403
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
404
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
405
|
+
: defaultMessage);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
// deno-lint-ignore no-explicit-any
|
|
410
|
+
function assertIsIterable(value) {
|
|
411
|
+
if (value == null) {
|
|
412
|
+
throw new assertion_error_js_1.AssertionError("The value is null or undefined");
|
|
413
|
+
}
|
|
414
|
+
if (typeof value[Symbol.iterator] !== "function") {
|
|
415
|
+
throw new assertion_error_js_1.AssertionError("The value is not iterable");
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function toMatch(context, expected) {
|
|
419
|
+
if (context.isNot) {
|
|
420
|
+
(0, not_match_js_1.assertNotMatch)(String(context.value), expected, context.customMessage);
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
(0, match_js_1.assertMatch)(String(context.value), expected, context.customMessage);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
function toMatchObject(context, expected) {
|
|
427
|
+
const received = context.value;
|
|
428
|
+
const defaultMsg = "Received value must be an object";
|
|
429
|
+
if (typeof received !== "object" || received === null) {
|
|
430
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
431
|
+
? `${context.customMessage}: ${defaultMsg}`
|
|
432
|
+
: defaultMsg);
|
|
433
|
+
}
|
|
434
|
+
if (typeof expected !== "object" || expected === null) {
|
|
435
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
436
|
+
? `${context.customMessage}: ${defaultMsg}`
|
|
437
|
+
: defaultMsg);
|
|
438
|
+
}
|
|
439
|
+
const pass = (0, _equal_js_1.equal)(context.value, expected, {
|
|
440
|
+
strictCheck: false,
|
|
441
|
+
customTesters: [
|
|
442
|
+
...context.customTesters,
|
|
443
|
+
_utils_js_1.iterableEquality,
|
|
444
|
+
_utils_js_1.subsetEquality,
|
|
445
|
+
],
|
|
446
|
+
});
|
|
447
|
+
const triggerError = () => {
|
|
448
|
+
const actualString = (0, format_js_1.format)(context.value);
|
|
449
|
+
const expectedString = (0, format_js_1.format)(expected);
|
|
450
|
+
if (context.isNot) {
|
|
451
|
+
const defaultMessage = `Expected ${actualString} to NOT match ${expectedString}`;
|
|
452
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
453
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
454
|
+
: defaultMessage);
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
const defaultMessage = `Expected ${actualString} to match ${expectedString}`;
|
|
458
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
459
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
460
|
+
: defaultMessage);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
if (context.isNot && pass || !context.isNot && !pass) {
|
|
464
|
+
triggerError();
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function toHaveBeenCalled(context) {
|
|
468
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
469
|
+
const hasBeenCalled = calls.length > 0;
|
|
470
|
+
if (context.isNot) {
|
|
471
|
+
if (hasBeenCalled) {
|
|
472
|
+
const defaultMessage = `Expected mock function not to be called, but it was called ${calls.length} time(s)`;
|
|
473
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
474
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
475
|
+
: defaultMessage);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
if (!hasBeenCalled) {
|
|
480
|
+
const defaultMessage = "Expected mock function to be called, but it was not called";
|
|
481
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
482
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
483
|
+
: defaultMessage);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function toHaveBeenCalledTimes(context, expected) {
|
|
488
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
489
|
+
if (context.isNot) {
|
|
490
|
+
if (calls.length === expected) {
|
|
491
|
+
const defaultMessage = `Expected mock function not to be called ${expected} time(s), but it was`;
|
|
492
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
493
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
494
|
+
: defaultMessage);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
if (calls.length !== expected) {
|
|
499
|
+
const defaultMessage = `Expected mock function to be called ${expected} time(s), but it was called ${calls.length} time(s)`;
|
|
500
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
501
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
502
|
+
: defaultMessage);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function toHaveBeenCalledWith(context, ...expected) {
|
|
507
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
508
|
+
const hasBeenCalled = calls.some((call) => (0, _equal_js_1.equal)(call.args, expected));
|
|
509
|
+
if (context.isNot) {
|
|
510
|
+
if (hasBeenCalled) {
|
|
511
|
+
const defaultMessage = `Expected mock function not to be called with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but it was`;
|
|
512
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
513
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
514
|
+
: defaultMessage);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
if (!hasBeenCalled) {
|
|
519
|
+
let otherCalls = "";
|
|
520
|
+
if (calls.length > 0) {
|
|
521
|
+
otherCalls = `\n Other calls:\n ${calls.map((call) => (0, _inspect_args_js_1.inspectArgs)(call.args)).join("\n ")}`;
|
|
522
|
+
}
|
|
523
|
+
const defaultMessage = `Expected mock function to be called with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but it was not.${otherCalls}`;
|
|
524
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
525
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
526
|
+
: defaultMessage);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function toHaveBeenLastCalledWith(context, ...expected) {
|
|
531
|
+
var _a;
|
|
532
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
533
|
+
const hasBeenCalled = calls.length > 0 &&
|
|
534
|
+
(0, _equal_js_1.equal)((_a = calls.at(-1)) === null || _a === void 0 ? void 0 : _a.args, expected);
|
|
535
|
+
if (context.isNot) {
|
|
536
|
+
if (hasBeenCalled) {
|
|
537
|
+
const defaultMessage = `Expected mock function not to be last called with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but it was`;
|
|
538
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
539
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
540
|
+
: defaultMessage);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
if (!hasBeenCalled) {
|
|
545
|
+
const lastCall = calls.at(-1);
|
|
546
|
+
if (!lastCall) {
|
|
547
|
+
const defaultMessage = `Expected mock function to be last called with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but it was not`;
|
|
548
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
549
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
550
|
+
: defaultMessage);
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
const defaultMessage = `Expected mock function to be last called with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but it was last called with ${(0, _inspect_args_js_1.inspectArgs)(lastCall.args)}`;
|
|
554
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
555
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
556
|
+
: defaultMessage);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
function toHaveBeenNthCalledWith(context, nth, ...expected) {
|
|
562
|
+
var _a;
|
|
563
|
+
if (nth < 1) {
|
|
564
|
+
throw new Error(`nth must be greater than 0: received ${nth}`);
|
|
565
|
+
}
|
|
566
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
567
|
+
const callIndex = nth - 1;
|
|
568
|
+
const hasBeenCalled = calls.length > callIndex &&
|
|
569
|
+
(0, _equal_js_1.equal)((_a = calls[callIndex]) === null || _a === void 0 ? void 0 : _a.args, expected);
|
|
570
|
+
if (context.isNot) {
|
|
571
|
+
if (hasBeenCalled) {
|
|
572
|
+
const defaultMessage = `Expected the n-th call (n=${nth}) of mock function is not with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but it was`;
|
|
573
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
574
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
575
|
+
: defaultMessage);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
if (!hasBeenCalled) {
|
|
580
|
+
const nthCall = calls[callIndex];
|
|
581
|
+
if (!nthCall) {
|
|
582
|
+
const defaultMessage = `Expected the n-th call (n=${nth}) of mock function is with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but the n-th call does not exist`;
|
|
583
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
584
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
585
|
+
: defaultMessage);
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
const defaultMessage = `Expected the n-th call (n=${nth}) of mock function is with ${(0, _inspect_args_js_1.inspectArgs)(expected)}, but it was with ${(0, _inspect_args_js_1.inspectArgs)(nthCall.args)}`;
|
|
589
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
590
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
591
|
+
: defaultMessage);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function toHaveReturned(context) {
|
|
597
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
598
|
+
const returned = calls.filter((call) => call.returns);
|
|
599
|
+
if (context.isNot) {
|
|
600
|
+
if (returned.length > 0) {
|
|
601
|
+
const defaultMessage = `Expected the mock function to not have returned, but it returned ${returned.length} times`;
|
|
602
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
603
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
604
|
+
: defaultMessage);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
if (returned.length === 0) {
|
|
609
|
+
const defaultMessage = `Expected the mock function to have returned, but it did not return`;
|
|
610
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
611
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
612
|
+
: defaultMessage);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function toHaveReturnedTimes(context, expected) {
|
|
617
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
618
|
+
const returned = calls.filter((call) => call.returns);
|
|
619
|
+
if (context.isNot) {
|
|
620
|
+
if (returned.length === expected) {
|
|
621
|
+
const defaultMessage = `Expected the mock function to not have returned ${expected} times, but it returned ${returned.length} times`;
|
|
622
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
623
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
624
|
+
: defaultMessage);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
if (returned.length !== expected) {
|
|
629
|
+
const defaultMessage = `Expected the mock function to have returned ${expected} times, but it returned ${returned.length} times`;
|
|
630
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
631
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
632
|
+
: defaultMessage);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function toHaveReturnedWith(context, expected) {
|
|
637
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
638
|
+
const returned = calls.filter((call) => call.returns);
|
|
639
|
+
const returnedWithExpected = returned.some((call) => (0, _equal_js_1.equal)(call.returned, expected));
|
|
640
|
+
if (context.isNot) {
|
|
641
|
+
if (returnedWithExpected) {
|
|
642
|
+
const defaultMessage = `Expected the mock function to not have returned with ${(0, _inspect_args_js_1.inspectArg)(expected)}, but it did`;
|
|
643
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
644
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
645
|
+
: defaultMessage);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
else {
|
|
649
|
+
if (!returnedWithExpected) {
|
|
650
|
+
const defaultMessage = `Expected the mock function to have returned with ${(0, _inspect_args_js_1.inspectArg)(expected)}, but it did not`;
|
|
651
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
652
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
653
|
+
: defaultMessage);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
function toHaveLastReturnedWith(context, expected) {
|
|
658
|
+
var _a;
|
|
659
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
660
|
+
const returned = calls.filter((call) => call.returns);
|
|
661
|
+
const lastReturnedWithExpected = returned.length > 0 &&
|
|
662
|
+
(0, _equal_js_1.equal)((_a = returned.at(-1)) === null || _a === void 0 ? void 0 : _a.returned, expected);
|
|
663
|
+
if (context.isNot) {
|
|
664
|
+
if (lastReturnedWithExpected) {
|
|
665
|
+
const defaultMessage = `Expected the mock function to not have last returned with ${(0, _inspect_args_js_1.inspectArg)(expected)}, but it did`;
|
|
666
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
667
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
668
|
+
: defaultMessage);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
if (!lastReturnedWithExpected) {
|
|
673
|
+
const defaultMessage = `Expected the mock function to have last returned with ${(0, _inspect_args_js_1.inspectArg)(expected)}, but it did not`;
|
|
674
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
675
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
676
|
+
: defaultMessage);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
function toHaveNthReturnedWith(context, nth, expected) {
|
|
681
|
+
if (nth < 1) {
|
|
682
|
+
throw new Error(`nth(${nth}) must be greater than 0`);
|
|
683
|
+
}
|
|
684
|
+
const calls = (0, _mock_util_js_1.getMockCalls)(context.value);
|
|
685
|
+
const returned = calls.filter((call) => call.returns);
|
|
686
|
+
const returnIndex = nth - 1;
|
|
687
|
+
const maybeNthReturned = returned[returnIndex];
|
|
688
|
+
const nthReturnedWithExpected = maybeNthReturned &&
|
|
689
|
+
(0, _equal_js_1.equal)(maybeNthReturned.returned, expected);
|
|
690
|
+
if (context.isNot) {
|
|
691
|
+
if (nthReturnedWithExpected) {
|
|
692
|
+
const defaultMessage = `Expected the mock function to not have n-th (n=${nth}) returned with ${(0, _inspect_args_js_1.inspectArg)(expected)}, but it did`;
|
|
693
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
694
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
695
|
+
: defaultMessage);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
if (!nthReturnedWithExpected) {
|
|
700
|
+
const defaultMessage = `Expected the mock function to have n-th (n=${nth}) returned with ${(0, _inspect_args_js_1.inspectArg)(expected)}, but it did not`;
|
|
701
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
702
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
703
|
+
: defaultMessage);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
function toThrow(context,
|
|
708
|
+
// deno-lint-ignore no-explicit-any
|
|
709
|
+
expected) {
|
|
710
|
+
if (typeof context.value === "function") {
|
|
711
|
+
try {
|
|
712
|
+
context.value = context.value();
|
|
713
|
+
}
|
|
714
|
+
catch (err) {
|
|
715
|
+
context.value = err;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
let expectClass = undefined;
|
|
719
|
+
let expectMessage = undefined;
|
|
720
|
+
if (expected instanceof Error) {
|
|
721
|
+
expectClass = expected.constructor;
|
|
722
|
+
expectMessage = expected.message;
|
|
723
|
+
}
|
|
724
|
+
if (expected instanceof Function) {
|
|
725
|
+
expectClass = expected;
|
|
726
|
+
}
|
|
727
|
+
if (typeof expected === "string" || expected instanceof RegExp) {
|
|
728
|
+
expectMessage = expected;
|
|
729
|
+
}
|
|
730
|
+
if (context.isNot) {
|
|
731
|
+
let isError = false;
|
|
732
|
+
try {
|
|
733
|
+
(0, _assert_is_error_js_1.assertIsError)(context.value, expectClass, expectMessage, context.customMessage);
|
|
734
|
+
isError = true;
|
|
735
|
+
const defaultMessage = `Expected to NOT throw ${expected}`;
|
|
736
|
+
throw new assertion_error_js_1.AssertionError(context.customMessage
|
|
737
|
+
? `${context.customMessage}: ${defaultMessage}`
|
|
738
|
+
: defaultMessage);
|
|
739
|
+
}
|
|
740
|
+
catch (e) {
|
|
741
|
+
if (isError) {
|
|
742
|
+
throw e;
|
|
743
|
+
}
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
return (0, _assert_is_error_js_1.assertIsError)(context.value, expectClass, expectMessage, context.customMessage);
|
|
748
|
+
}
|