@goast/core 0.4.1 → 0.5.0-beta.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/esm/mod.d.ts +1 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -0
- package/esm/src/codegen/config.d.ts +11 -0
- package/esm/src/codegen/config.d.ts.map +1 -1
- package/esm/src/codegen/config.js +1 -0
- package/esm/src/transform/helpers.d.ts.map +1 -1
- package/esm/src/transform/helpers.js +5 -1
- package/esm/src/utils/file-system.utils.d.ts +2 -0
- package/esm/src/utils/file-system.utils.d.ts.map +1 -1
- package/esm/src/utils/file-system.utils.js +11 -1
- package/esm/src/utils/schema.utils.d.ts +1 -0
- package/esm/src/utils/schema.utils.d.ts.map +1 -1
- package/esm/src/utils/schema.utils.js +5 -0
- package/esm/src/utils/source-builder.d.ts +2 -0
- package/esm/src/utils/source-builder.d.ts.map +1 -1
- package/esm/src/utils/source-builder.js +7 -1
- package/package.json +2 -5
- package/script/mod.d.ts +1 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -0
- package/script/src/codegen/config.d.ts +11 -0
- package/script/src/codegen/config.d.ts.map +1 -1
- package/script/src/codegen/config.js +1 -0
- package/script/src/transform/helpers.d.ts.map +1 -1
- package/script/src/transform/helpers.js +5 -1
- package/script/src/utils/file-system.utils.d.ts +2 -0
- package/script/src/utils/file-system.utils.d.ts.map +1 -1
- package/script/src/utils/file-system.utils.js +11 -0
- package/script/src/utils/schema.utils.d.ts +1 -0
- package/script/src/utils/schema.utils.d.ts.map +1 -1
- package/script/src/utils/schema.utils.js +6 -0
- package/script/src/utils/source-builder.d.ts +2 -0
- package/script/src/utils/source-builder.d.ts.map +1 -1
- package/script/src/utils/source-builder.js +8 -1
- package/esm/_dnt.test_polyfills.d.ts +0 -29
- package/esm/_dnt.test_polyfills.d.ts.map +0 -1
- package/esm/_dnt.test_polyfills.js +0 -31
- package/esm/_dnt.test_shims.d.ts +0 -14
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/_dnt.test_shims.js +0 -69
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -57
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +0 -20
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +0 -14
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +0 -43
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +0 -17
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +0 -26
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.js +0 -13
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +0 -46
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +0 -161
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +0 -6
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.js +0 -191
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +0 -12
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +0 -34
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.js +0 -714
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +0 -843
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.js +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.js +0 -218
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +0 -60
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.js +0 -523
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.js +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +0 -86
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.js +0 -88
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +0 -160
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +0 -199
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -111
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -277
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -180
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +0 -37
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -207
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -2
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +0 -79
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +0 -380
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +0 -738
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.js +0 -654
- package/esm/src/collect/helpers.test.d.ts +0 -2
- package/esm/src/collect/helpers.test.d.ts.map +0 -1
- package/esm/src/collect/helpers.test.js +0 -77
- package/esm/src/transform/helpers.test.d.ts +0 -2
- package/esm/src/transform/helpers.test.d.ts.map +0 -1
- package/esm/src/transform/helpers.test.js +0 -265
- package/esm/src/utils/action-provider.test.d.ts +0 -2
- package/esm/src/utils/action-provider.test.d.ts.map +0 -1
- package/esm/src/utils/action-provider.test.js +0 -28
- package/esm/src/utils/common.utils.test.d.ts +0 -2
- package/esm/src/utils/common.utils.test.d.ts.map +0 -1
- package/esm/src/utils/common.utils.test.js +0 -18
- package/esm/src/utils/condition.test.d.ts +0 -2
- package/esm/src/utils/condition.test.d.ts.map +0 -1
- package/esm/src/utils/condition.test.js +0 -31
- package/esm/src/utils/endpoint.utils.test.d.ts +0 -2
- package/esm/src/utils/endpoint.utils.test.d.ts.map +0 -1
- package/esm/src/utils/endpoint.utils.test.js +0 -31
- package/esm/src/utils/factory.test.d.ts +0 -2
- package/esm/src/utils/factory.test.d.ts.map +0 -1
- package/esm/src/utils/factory.test.js +0 -34
- package/esm/src/utils/generator.utils.test.d.ts +0 -2
- package/esm/src/utils/generator.utils.test.d.ts.map +0 -1
- package/esm/src/utils/generator.utils.test.js +0 -13
- package/esm/src/utils/object.utils.test.d.ts +0 -2
- package/esm/src/utils/object.utils.test.d.ts.map +0 -1
- package/esm/src/utils/object.utils.test.js +0 -29
- package/esm/src/utils/schema.utils.test.d.ts +0 -2
- package/esm/src/utils/schema.utils.test.d.ts.map +0 -1
- package/esm/src/utils/schema.utils.test.js +0 -70
- package/esm/src/utils/source-builder.test.d.ts +0 -2
- package/esm/src/utils/source-builder.test.d.ts.map +0 -1
- package/esm/src/utils/source-builder.test.js +0 -505
- package/esm/src/utils/string-builder/string-builder.test.d.ts +0 -2
- package/esm/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
- package/esm/src/utils/string-builder/string-builder.test.js +0 -163
- package/esm/src/utils/string.utils.test.d.ts +0 -2
- package/esm/src/utils/string.utils.test.d.ts.map +0 -1
- package/esm/src/utils/string.utils.test.js +0 -528
- package/esm/tests/openapi.test.d.ts +0 -2
- package/esm/tests/openapi.test.d.ts.map +0 -1
- package/esm/tests/openapi.test.js +0 -33
- package/esm/tests/schema-factory.d.ts +0 -42
- package/esm/tests/schema-factory.d.ts.map +0 -1
- package/esm/tests/schema-factory.js +0 -138
- package/script/_dnt.test_polyfills.d.ts +0 -29
- package/script/_dnt.test_polyfills.d.ts.map +0 -1
- package/script/_dnt.test_polyfills.js +0 -32
- package/script/_dnt.test_shims.d.ts +0 -14
- package/script/_dnt.test_shims.d.ts.map +0 -1
- package/script/_dnt.test_shims.js +0 -79
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +0 -26
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/false.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +0 -20
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +0 -32
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +0 -46
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.js +0 -18
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +0 -46
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +0 -183
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +0 -6
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.js +0 -33
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.js +0 -194
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +0 -34
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.js +0 -748
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +0 -11
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +0 -843
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.js +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.js +0 -226
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.js +0 -527
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.js +0 -88
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +0 -86
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.js +0 -91
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +0 -160
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +0 -204
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -116
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -284
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -186
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/format.js +0 -41
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -220
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +0 -79
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +0 -385
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +0 -738
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.js +0 -665
- package/script/src/collect/helpers.test.d.ts +0 -2
- package/script/src/collect/helpers.test.d.ts.map +0 -1
- package/script/src/collect/helpers.test.js +0 -79
- package/script/src/transform/helpers.test.d.ts +0 -2
- package/script/src/transform/helpers.test.d.ts.map +0 -1
- package/script/src/transform/helpers.test.js +0 -267
- package/script/src/utils/action-provider.test.d.ts +0 -2
- package/script/src/utils/action-provider.test.d.ts.map +0 -1
- package/script/src/utils/action-provider.test.js +0 -30
- package/script/src/utils/common.utils.test.d.ts +0 -2
- package/script/src/utils/common.utils.test.d.ts.map +0 -1
- package/script/src/utils/common.utils.test.js +0 -20
- package/script/src/utils/condition.test.d.ts +0 -2
- package/script/src/utils/condition.test.d.ts.map +0 -1
- package/script/src/utils/condition.test.js +0 -33
- package/script/src/utils/endpoint.utils.test.d.ts +0 -2
- package/script/src/utils/endpoint.utils.test.d.ts.map +0 -1
- package/script/src/utils/endpoint.utils.test.js +0 -33
- package/script/src/utils/factory.test.d.ts +0 -2
- package/script/src/utils/factory.test.d.ts.map +0 -1
- package/script/src/utils/factory.test.js +0 -36
- package/script/src/utils/generator.utils.test.d.ts +0 -2
- package/script/src/utils/generator.utils.test.d.ts.map +0 -1
- package/script/src/utils/generator.utils.test.js +0 -15
- package/script/src/utils/object.utils.test.d.ts +0 -2
- package/script/src/utils/object.utils.test.d.ts.map +0 -1
- package/script/src/utils/object.utils.test.js +0 -31
- package/script/src/utils/schema.utils.test.d.ts +0 -2
- package/script/src/utils/schema.utils.test.d.ts.map +0 -1
- package/script/src/utils/schema.utils.test.js +0 -72
- package/script/src/utils/source-builder.test.d.ts +0 -2
- package/script/src/utils/source-builder.test.d.ts.map +0 -1
- package/script/src/utils/source-builder.test.js +0 -507
- package/script/src/utils/string-builder/string-builder.test.d.ts +0 -2
- package/script/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
- package/script/src/utils/string-builder/string-builder.test.js +0 -165
- package/script/src/utils/string.utils.test.d.ts +0 -2
- package/script/src/utils/string.utils.test.d.ts.map +0 -1
- package/script/src/utils/string.utils.test.js +0 -530
- package/script/tests/openapi.test.d.ts +0 -2
- package/script/tests/openapi.test.d.ts.map +0 -1
- package/script/tests/openapi.test.js +0 -35
- package/script/tests/schema-factory.d.ts +0 -42
- package/script/tests/schema-factory.d.ts.map +0 -1
- package/script/tests/schema-factory.js +0 -162
- package/src/_dnt.shims.ts +0 -69
- package/src/_dnt.test_polyfills.ts +0 -70
- package/src/_dnt.test_shims.ts +0 -72
- package/src/deps/jsr.io/@std/assert/1.0.11/assertion_error.ts +0 -31
- package/src/deps/jsr.io/@std/assert/1.0.11/false.ts +0 -26
- package/src/deps/jsr.io/@std/assert/1.0.11/instance_of.ts +0 -64
- package/src/deps/jsr.io/@std/assert/1.0.11/match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.11/not_instance_of.ts +0 -33
- package/src/deps/jsr.io/@std/assert/1.0.11/not_match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.ts +0 -42
- package/src/deps/jsr.io/@std/assert/1.0.11/strict_equals.ts +0 -67
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_equals.ts +0 -38
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.ts +0 -54
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.ts +0 -35
- package/src/deps/jsr.io/@std/expect/1.0.12/_assertions.ts +0 -18
- package/src/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.ts +0 -198
- package/src/deps/jsr.io/@std/expect/1.0.12/_build_message.ts +0 -51
- package/src/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.ts +0 -19
- package/src/deps/jsr.io/@std/expect/1.0.12/_equal.ts +0 -230
- package/src/deps/jsr.io/@std/expect/1.0.12/_extend.ts +0 -16
- package/src/deps/jsr.io/@std/expect/1.0.12/_inspect_args.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.12/_matchers.ts +0 -1028
- package/src/deps/jsr.io/@std/expect/1.0.12/_mock_util.ts +0 -22
- package/src/deps/jsr.io/@std/expect/1.0.12/_serializer.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.12/_types.ts +0 -923
- package/src/deps/jsr.io/@std/expect/1.0.12/_utils.ts +0 -283
- package/src/deps/jsr.io/@std/expect/1.0.12/expect.ts +0 -620
- package/src/deps/jsr.io/@std/expect/1.0.12/fn.ts +0 -91
- package/src/deps/jsr.io/@std/expect/1.0.12/mod.ts +0 -89
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +0 -214
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +0 -134
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +0 -317
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +0 -204
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +0 -39
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +0 -233
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +0 -18
- package/src/deps/jsr.io/@std/testing/1.0.9/_test_suite.ts +0 -448
- package/src/deps/jsr.io/@std/testing/1.0.9/bdd.ts +0 -1288
- package/src/mod.ts +0 -33
- package/src/src/ast/node.ts +0 -46
- package/src/src/codegen/config.ts +0 -28
- package/src/src/codegen/endpoints-generator.ts +0 -72
- package/src/src/codegen/generator.ts +0 -181
- package/src/src/codegen/internal-utils.ts +0 -6
- package/src/src/codegen/schemas-generator.ts +0 -87
- package/src/src/codegen/services-generator.ts +0 -77
- package/src/src/codegen/types.ts +0 -37
- package/src/src/collect/collector.ts +0 -142
- package/src/src/collect/helpers.test.ts +0 -91
- package/src/src/collect/helpers.ts +0 -36
- package/src/src/collect/types.ts +0 -21
- package/src/src/internal-utils.ts +0 -5
- package/src/src/parse/deref-proxy.ts +0 -64
- package/src/src/parse/openapi-types.ts +0 -949
- package/src/src/parse/parser.ts +0 -220
- package/src/src/parse/types.ts +0 -27
- package/src/src/transform/api-types.ts +0 -243
- package/src/src/transform/helpers.test.ts +0 -316
- package/src/src/transform/helpers.ts +0 -211
- package/src/src/transform/transform-document.ts +0 -35
- package/src/src/transform/transform-endpoint.ts +0 -331
- package/src/src/transform/transform-schema.ts +0 -217
- package/src/src/transform/transformer.ts +0 -52
- package/src/src/transform/types.ts +0 -52
- package/src/src/utils/action-provider.test.ts +0 -32
- package/src/src/utils/action-provider.ts +0 -58
- package/src/src/utils/array.utils.ts +0 -7
- package/src/src/utils/asset-manager.ts +0 -51
- package/src/src/utils/class.utils.ts +0 -40
- package/src/src/utils/common.utils.test.ts +0 -22
- package/src/src/utils/common.utils.ts +0 -86
- package/src/src/utils/condition.test.ts +0 -36
- package/src/src/utils/condition.ts +0 -7
- package/src/src/utils/endpoint.utils.test.ts +0 -36
- package/src/src/utils/endpoint.utils.ts +0 -10
- package/src/src/utils/error.utils.ts +0 -3
- package/src/src/utils/factory.test.ts +0 -31
- package/src/src/utils/factory.ts +0 -42
- package/src/src/utils/file-system.utils.ts +0 -48
- package/src/src/utils/generator.utils.test.ts +0 -16
- package/src/src/utils/generator.utils.ts +0 -6
- package/src/src/utils/object.utils.test.ts +0 -33
- package/src/src/utils/object.utils.ts +0 -32
- package/src/src/utils/schema.utils.test.ts +0 -88
- package/src/src/utils/schema.utils.ts +0 -142
- package/src/src/utils/source-builder.test.ts +0 -657
- package/src/src/utils/source-builder.ts +0 -589
- package/src/src/utils/string-builder/options.ts +0 -19
- package/src/src/utils/string-builder/string-builder.test.ts +0 -188
- package/src/src/utils/string-builder/string-builder.ts +0 -165
- package/src/src/utils/string-builder/utils.ts +0 -69
- package/src/src/utils/string.utils.test.ts +0 -691
- package/src/src/utils/string.utils.ts +0 -369
- package/src/src/utils/string.utils.types.ts +0 -179
- package/src/src/utils/type.utils.ts +0 -93
- package/src/tests/openapi.test.ts +0 -50
- package/src/tests/schema-factory.ts +0 -185
- package/test_runner.js +0 -221
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { buildMessage } from "../../internal/1.0.5/build_message.js";
|
|
4
|
-
import { diff } from "../../internal/1.0.5/diff.js";
|
|
5
|
-
import { diffStr } from "../../internal/1.0.5/diff_str.js";
|
|
6
|
-
import { format } from "../../internal/1.0.5/format.js";
|
|
7
|
-
import { red } from "../../internal/1.0.5/styles.js";
|
|
8
|
-
import { AssertionError } from "./assertion_error.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Make an assertion that `actual` and `expected` are strictly equal, using
|
|
12
|
-
* {@linkcode Object.is} for equality comparison. If not, then throw.
|
|
13
|
-
*
|
|
14
|
-
* @example Usage
|
|
15
|
-
* ```ts ignore
|
|
16
|
-
* import { assertStrictEquals } from "@std/assert";
|
|
17
|
-
*
|
|
18
|
-
* const a = {};
|
|
19
|
-
* const b = a;
|
|
20
|
-
* assertStrictEquals(a, b); // Doesn't throw
|
|
21
|
-
*
|
|
22
|
-
* const c = {};
|
|
23
|
-
* const d = {};
|
|
24
|
-
* assertStrictEquals(c, d); // Throws
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @typeParam T The type of the expected value.
|
|
28
|
-
* @param actual The actual value to compare.
|
|
29
|
-
* @param expected The expected value to compare.
|
|
30
|
-
* @param msg The optional message to display if the assertion fails.
|
|
31
|
-
*/
|
|
32
|
-
export function assertStrictEquals<T>(
|
|
33
|
-
actual: unknown,
|
|
34
|
-
expected: T,
|
|
35
|
-
msg?: string,
|
|
36
|
-
): asserts actual is T {
|
|
37
|
-
if (Object.is(actual, expected)) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
42
|
-
let message: string;
|
|
43
|
-
|
|
44
|
-
const actualString = format(actual);
|
|
45
|
-
const expectedString = format(expected);
|
|
46
|
-
|
|
47
|
-
if (actualString === expectedString) {
|
|
48
|
-
const withOffset = actualString
|
|
49
|
-
.split("\n")
|
|
50
|
-
.map((l) => ` ${l}`)
|
|
51
|
-
.join("\n");
|
|
52
|
-
message =
|
|
53
|
-
`Values have the same structure but are not reference-equal${msgSuffix}\n\n${
|
|
54
|
-
red(withOffset)
|
|
55
|
-
}\n`;
|
|
56
|
-
} else {
|
|
57
|
-
const stringDiff = (typeof actual === "string") &&
|
|
58
|
-
(typeof expected === "string");
|
|
59
|
-
const diffResult = stringDiff
|
|
60
|
-
? diffStr(actual as string, expected as string)
|
|
61
|
-
: diff(actualString.split("\n"), expectedString.split("\n"));
|
|
62
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
63
|
-
message = `Values are not strictly equal${msgSuffix}\n${diffMsg}`;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
throw new AssertionError(message);
|
|
67
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
|
|
3
|
-
// This file is copied from `std/assert`.
|
|
4
|
-
|
|
5
|
-
import { AssertionError } from "../../assert/1.0.11/assertion_error.js";
|
|
6
|
-
import { buildEqualErrorMessage } from "./_build_message.js";
|
|
7
|
-
import { equal } from "./_equal.js";
|
|
8
|
-
import type { EqualOptions } from "./_types.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Make an assertion that `actual` and `expected` are equal, deeply. If not
|
|
12
|
-
* deeply equal, then throw.
|
|
13
|
-
*
|
|
14
|
-
* Type parameter can be specified to ensure values under comparison have the
|
|
15
|
-
* same type.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts ignore
|
|
19
|
-
* import { assertEquals } from "@std/assert";
|
|
20
|
-
*
|
|
21
|
-
* assertEquals("world", "world"); // Doesn't throw
|
|
22
|
-
* assertEquals("hello", "world"); // Throws
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* Note: formatter option is experimental and may be removed in the future.
|
|
26
|
-
*/
|
|
27
|
-
export function assertEquals<T>(
|
|
28
|
-
actual: T,
|
|
29
|
-
expected: T,
|
|
30
|
-
options?: EqualOptions,
|
|
31
|
-
) {
|
|
32
|
-
if (equal(actual, expected, options)) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const message = buildEqualErrorMessage(actual, expected, options ?? {});
|
|
37
|
-
throw new AssertionError(message);
|
|
38
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { AssertionError } from "../../assert/1.0.11/assertion_error.js";
|
|
4
|
-
import { stripAnsiCode } from "../../internal/1.0.5/styles.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Make an assertion that `error` is an `Error`.
|
|
8
|
-
* If not then an error will be thrown.
|
|
9
|
-
* An error class and a string that should be included in the
|
|
10
|
-
* error message can also be asserted.
|
|
11
|
-
*
|
|
12
|
-
* @typeParam E The type of the error to assert.
|
|
13
|
-
* @param error The error to assert.
|
|
14
|
-
* @param ErrorClass The optional error class to assert.
|
|
15
|
-
* @param msgMatches The optional string or RegExp to assert in the error message.
|
|
16
|
-
* @param msg The optional message to display if the assertion fails.
|
|
17
|
-
*/
|
|
18
|
-
export function assertIsError<E extends Error = Error>(
|
|
19
|
-
error: unknown,
|
|
20
|
-
// deno-lint-ignore no-explicit-any
|
|
21
|
-
ErrorClass?: abstract new (...args: any[]) => E,
|
|
22
|
-
msgMatches?: string | RegExp,
|
|
23
|
-
msg?: string,
|
|
24
|
-
): asserts error is E {
|
|
25
|
-
const msgPrefix = msg ? `${msg}: ` : "";
|
|
26
|
-
if (!(error instanceof Error)) {
|
|
27
|
-
throw new AssertionError(
|
|
28
|
-
`${msgPrefix}Expected "error" to be an Error object.`,
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
if (ErrorClass && !(error instanceof ErrorClass)) {
|
|
32
|
-
msg =
|
|
33
|
-
`${msgPrefix}Expected error to be instance of "${ErrorClass.name}", but was "${error?.constructor?.name}".`;
|
|
34
|
-
throw new AssertionError(msg);
|
|
35
|
-
}
|
|
36
|
-
let msgCheck;
|
|
37
|
-
if (typeof msgMatches === "string") {
|
|
38
|
-
msgCheck = stripAnsiCode(error.message).includes(
|
|
39
|
-
stripAnsiCode(msgMatches),
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
if (msgMatches instanceof RegExp) {
|
|
43
|
-
msgCheck = msgMatches.test(stripAnsiCode(error.message));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (msgMatches && !msgCheck) {
|
|
47
|
-
msg = `${msgPrefix}Expected error message to include ${
|
|
48
|
-
msgMatches instanceof RegExp
|
|
49
|
-
? msgMatches.toString()
|
|
50
|
-
: JSON.stringify(msgMatches)
|
|
51
|
-
}, but got ${JSON.stringify(error?.message)}.`;
|
|
52
|
-
throw new AssertionError(msg);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
|
|
3
|
-
// This file is copied from `std/assert`.
|
|
4
|
-
|
|
5
|
-
import { AssertionError } from "../../assert/1.0.11/assertion_error.js";
|
|
6
|
-
import { buildNotEqualErrorMessage } from "./_build_message.js";
|
|
7
|
-
import { equal } from "./_equal.js";
|
|
8
|
-
import type { EqualOptions } from "./_types.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Make an assertion that `actual` and `expected` are not equal, deeply.
|
|
12
|
-
* If not then throw.
|
|
13
|
-
*
|
|
14
|
-
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts ignore
|
|
18
|
-
* import { assertNotEquals } from "@std/assert";
|
|
19
|
-
*
|
|
20
|
-
* assertNotEquals(1, 2); // Doesn't throw
|
|
21
|
-
* assertNotEquals(1, 1); // Throws
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export function assertNotEquals<T>(
|
|
25
|
-
actual: T,
|
|
26
|
-
expected: T,
|
|
27
|
-
options: EqualOptions = {},
|
|
28
|
-
) {
|
|
29
|
-
if (!equal(actual, expected, options)) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const message = buildNotEqualErrorMessage(actual, expected, options ?? {});
|
|
34
|
-
throw new AssertionError(message);
|
|
35
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
|
|
3
|
-
import { getAssertionState } from "../../internal/1.0.5/assertion_state.js";
|
|
4
|
-
|
|
5
|
-
const assertionState = getAssertionState();
|
|
6
|
-
|
|
7
|
-
export function hasAssertions() {
|
|
8
|
-
assertionState.setAssertionCheck(true);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function assertions(num: number) {
|
|
12
|
-
assertionState.setAssertionCount(num);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function emitAssertionTrigger() {
|
|
16
|
-
assertionState.setAssertionTriggered(true);
|
|
17
|
-
assertionState.updateAssertionTriggerCount();
|
|
18
|
-
}
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// deno-lint-ignore-file no-explicit-any
|
|
3
|
-
|
|
4
|
-
import { getCustomEqualityTesters } from "./_custom_equality_tester.js";
|
|
5
|
-
import { equal } from "./_equal.js";
|
|
6
|
-
|
|
7
|
-
export abstract class AsymmetricMatcher<T> {
|
|
8
|
-
constructor(
|
|
9
|
-
protected value: T,
|
|
10
|
-
protected inverse: boolean = false,
|
|
11
|
-
) {}
|
|
12
|
-
abstract equals(other: unknown): boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export class Anything extends AsymmetricMatcher<void> {
|
|
16
|
-
equals(other: unknown): boolean {
|
|
17
|
-
return other !== null && other !== undefined;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function anything(): Anything {
|
|
22
|
-
return new Anything();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export class Any extends AsymmetricMatcher<any> {
|
|
26
|
-
constructor(value: unknown) {
|
|
27
|
-
if (value === undefined) {
|
|
28
|
-
throw new TypeError("Expected a constructor function");
|
|
29
|
-
}
|
|
30
|
-
super(value);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
equals(other: unknown): boolean {
|
|
34
|
-
if (typeof other === "object") {
|
|
35
|
-
return other instanceof this.value;
|
|
36
|
-
} else {
|
|
37
|
-
if (this.value === Number) {
|
|
38
|
-
return typeof other === "number";
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (this.value === String) {
|
|
42
|
-
return typeof other === "string";
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (this.value === Number) {
|
|
46
|
-
return typeof other === "number";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (this.value === Function) {
|
|
50
|
-
return typeof other === "function";
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (this.value === Boolean) {
|
|
54
|
-
return typeof other === "boolean";
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (this.value === BigInt) {
|
|
58
|
-
return typeof other === "bigint";
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (this.value === Symbol) {
|
|
62
|
-
return typeof other === "symbol";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function any(c: unknown): Any {
|
|
70
|
-
return new Any(c);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export class ArrayContaining extends AsymmetricMatcher<any[]> {
|
|
74
|
-
constructor(arr: any[], inverse = false) {
|
|
75
|
-
super(arr, inverse);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
equals(other: any[]): boolean {
|
|
79
|
-
const res = Array.isArray(other) &&
|
|
80
|
-
this.value.every((e) =>
|
|
81
|
-
other.some((another) =>
|
|
82
|
-
equal(e, another, { customTesters: getCustomEqualityTesters() })
|
|
83
|
-
)
|
|
84
|
-
);
|
|
85
|
-
return this.inverse ? !res : res;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function arrayContaining(c: any[]): ArrayContaining {
|
|
90
|
-
return new ArrayContaining(c);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function arrayNotContaining(c: any[]): ArrayContaining {
|
|
94
|
-
return new ArrayContaining(c, true);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export class CloseTo extends AsymmetricMatcher<number> {
|
|
98
|
-
readonly #precision: number;
|
|
99
|
-
|
|
100
|
-
constructor(num: number, precision: number = 2) {
|
|
101
|
-
super(num);
|
|
102
|
-
this.#precision = precision;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
equals(other: number): boolean {
|
|
106
|
-
if (typeof other !== "number") {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (
|
|
111
|
-
(this.value === Number.POSITIVE_INFINITY &&
|
|
112
|
-
other === Number.POSITIVE_INFINITY) ||
|
|
113
|
-
(this.value === Number.NEGATIVE_INFINITY &&
|
|
114
|
-
other === Number.NEGATIVE_INFINITY)
|
|
115
|
-
) {
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return Math.abs(this.value - other) < Math.pow(10, -this.#precision) / 2;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export function closeTo(num: number, numDigits?: number): CloseTo {
|
|
124
|
-
return new CloseTo(num, numDigits);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export class StringContaining extends AsymmetricMatcher<string> {
|
|
128
|
-
constructor(str: string, inverse = false) {
|
|
129
|
-
super(str, inverse);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
equals(other: string): boolean {
|
|
133
|
-
const res = typeof other !== "string" ? false : other.includes(this.value);
|
|
134
|
-
return this.inverse ? !res : res;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export function stringContaining(str: string): StringContaining {
|
|
139
|
-
return new StringContaining(str);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function stringNotContaining(str: string): StringContaining {
|
|
143
|
-
return new StringContaining(str, true);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export class StringMatching extends AsymmetricMatcher<RegExp> {
|
|
147
|
-
constructor(pattern: string | RegExp, inverse = false) {
|
|
148
|
-
super(new RegExp(pattern), inverse);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
equals(other: string): boolean {
|
|
152
|
-
const res = typeof other !== "string" ? false : this.value.test(other);
|
|
153
|
-
return this.inverse ? !res : res;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export function stringMatching(pattern: string | RegExp): StringMatching {
|
|
158
|
-
return new StringMatching(pattern);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export function stringNotMatching(pattern: string | RegExp): StringMatching {
|
|
162
|
-
return new StringMatching(pattern, true);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export class ObjectContaining
|
|
166
|
-
extends AsymmetricMatcher<Record<string, unknown>> {
|
|
167
|
-
constructor(obj: Record<string, unknown>, inverse = false) {
|
|
168
|
-
super(obj, inverse);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
equals(other: Record<string, unknown>): boolean {
|
|
172
|
-
const keys = Object.keys(this.value);
|
|
173
|
-
let res = true;
|
|
174
|
-
|
|
175
|
-
for (const key of keys) {
|
|
176
|
-
if (
|
|
177
|
-
!Object.hasOwn(other, key) ||
|
|
178
|
-
!equal(this.value[key], other[key])
|
|
179
|
-
) {
|
|
180
|
-
res = false;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return this.inverse ? !res : res;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export function objectContaining(
|
|
189
|
-
obj: Record<string, unknown>,
|
|
190
|
-
): ObjectContaining {
|
|
191
|
-
return new ObjectContaining(obj);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function objectNotContaining(
|
|
195
|
-
obj: Record<string, unknown>,
|
|
196
|
-
): ObjectContaining {
|
|
197
|
-
return new ObjectContaining(obj, true);
|
|
198
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
|
|
3
|
-
import { buildMessage } from "../../internal/1.0.5/build_message.js";
|
|
4
|
-
import { diff } from "../../internal/1.0.5/diff.js";
|
|
5
|
-
import { diffStr } from "../../internal/1.0.5/diff_str.js";
|
|
6
|
-
import { format } from "../../internal/1.0.5/format.js";
|
|
7
|
-
import type { EqualOptions } from "./_types.js";
|
|
8
|
-
|
|
9
|
-
type EqualErrorMessageOptions = Pick<
|
|
10
|
-
EqualOptions,
|
|
11
|
-
"formatter" | "msg"
|
|
12
|
-
>;
|
|
13
|
-
|
|
14
|
-
function isString(value: unknown): value is string {
|
|
15
|
-
return typeof value === "string";
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function buildEqualErrorMessage<T>(
|
|
19
|
-
actual: T,
|
|
20
|
-
expected: T,
|
|
21
|
-
options: EqualErrorMessageOptions,
|
|
22
|
-
): string {
|
|
23
|
-
const { formatter = format, msg } = options ?? {};
|
|
24
|
-
const msgPrefix = msg ? `${msg}: ` : "";
|
|
25
|
-
const actualString = formatter(actual);
|
|
26
|
-
const expectedString = formatter(expected);
|
|
27
|
-
|
|
28
|
-
let message = `${msgPrefix}Values are not equal.`;
|
|
29
|
-
|
|
30
|
-
const stringDiff = isString(actual) && isString(expected);
|
|
31
|
-
const diffResult = stringDiff
|
|
32
|
-
? diffStr(actual, expected)
|
|
33
|
-
: diff(actualString.split("\n"), expectedString.split("\n"));
|
|
34
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
35
|
-
message = `${message}\n${diffMsg}`;
|
|
36
|
-
|
|
37
|
-
return message;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function buildNotEqualErrorMessage<T>(
|
|
41
|
-
actual: T,
|
|
42
|
-
expected: T,
|
|
43
|
-
options: EqualErrorMessageOptions,
|
|
44
|
-
): string {
|
|
45
|
-
const { msg } = options ?? {};
|
|
46
|
-
const actualString = String(actual);
|
|
47
|
-
const expectedString = String(expected);
|
|
48
|
-
|
|
49
|
-
const msgPrefix = msg ? `${msg}: ` : "";
|
|
50
|
-
return `${msgPrefix}Expected actual: ${actualString} not to be: ${expectedString}.`;
|
|
51
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
|
|
3
|
-
import type { Tester } from "./_types.js";
|
|
4
|
-
|
|
5
|
-
const customEqualityTesters: Tester[] = [];
|
|
6
|
-
|
|
7
|
-
export function addCustomEqualityTesters(newTesters: Tester[]) {
|
|
8
|
-
if (!Array.isArray(newTesters)) {
|
|
9
|
-
throw new TypeError(
|
|
10
|
-
`customEqualityTester expects an array of Testers. But got ${typeof newTesters}`,
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
customEqualityTesters.push(...newTesters);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function getCustomEqualityTesters() {
|
|
18
|
-
return customEqualityTesters;
|
|
19
|
-
}
|