@goast/kotlin 0.4.2-beta1 → 0.4.3
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 +45 -45
- package/assets/client/okhttp3/ApiClient.kt +250 -250
- 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 +6 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/_dnt.test_shims.js +61 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equal.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equal.js +136 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equals.d.ts +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equals.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/false.js +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/is_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/is_error.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/rejects.d.ts +42 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/rejects.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/strict_equals.js +57 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assert_equals.d.ts +20 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assert_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assert_equals.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assert_not_equals.d.ts +17 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assert_not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assert_not_equals.js +26 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assertions.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assertions.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_assertions.js +13 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.d.ts +46 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.js +160 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_build_message.d.ts +6 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_build_message.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_custom_equality_tester.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_custom_equality_tester.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_custom_equality_tester.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_equal.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_equal.js +191 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_extend.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_extend.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_extend.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_inspect_args.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_inspect_args.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_inspect_args.js +12 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_matchers.d.ts +34 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_matchers.js +563 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_mock_util.d.ts +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_mock_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_mock_util.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_types.d.ts +838 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_types.js +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_utils.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/_utils.js +218 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/expect.d.ts +59 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/expect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.7/expect.js +506 -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.4/_mock_utils.d.ts +15 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/_mock_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/_mock_utils.js +35 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/_test_suite.d.ts +74 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/_test_suite.js +350 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/bdd.d.ts +731 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/bdd.js +581 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/mock.d.ts +674 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/mock.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.4/mock.js +1083 -0
- package/esm/src/ast/nodes/annotation.test.d.ts +2 -0
- package/esm/src/ast/nodes/annotation.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/annotation.test.js +56 -0
- package/esm/src/ast/nodes/argument.test.d.ts +2 -0
- package/esm/src/ast/nodes/argument.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/argument.test.js +33 -0
- package/esm/src/ast/nodes/call.test.d.ts +2 -0
- package/esm/src/ast/nodes/call.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/call.test.js +35 -0
- package/esm/src/ast/nodes/class.test.d.ts +2 -0
- package/esm/src/ast/nodes/class.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/class.test.js +219 -0
- package/esm/src/ast/nodes/constructor.test.d.ts +2 -0
- package/esm/src/ast/nodes/constructor.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/constructor.test.js +139 -0
- package/esm/src/ast/nodes/doc-tag.test.d.ts +2 -0
- package/esm/src/ast/nodes/doc-tag.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/doc-tag.test.js +67 -0
- package/esm/src/ast/nodes/doc.test.d.ts +2 -0
- package/esm/src/ast/nodes/doc.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/doc.test.js +33 -0
- package/esm/src/ast/nodes/enum-value.test.d.ts +2 -0
- package/esm/src/ast/nodes/enum-value.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/enum-value.test.js +115 -0
- package/esm/src/ast/nodes/enum.test.d.ts +2 -0
- package/esm/src/ast/nodes/enum.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/enum.test.js +129 -0
- package/esm/src/ast/nodes/function.test.d.ts +2 -0
- package/esm/src/ast/nodes/function.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/function.test.js +160 -0
- package/esm/src/ast/nodes/generic-parameter.test.d.ts +2 -0
- package/esm/src/ast/nodes/generic-parameter.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/generic-parameter.test.js +49 -0
- package/esm/src/ast/nodes/init-block.test.d.ts +2 -0
- package/esm/src/ast/nodes/init-block.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/init-block.test.js +28 -0
- package/esm/src/ast/nodes/interface.test.d.ts +2 -0
- package/esm/src/ast/nodes/interface.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/interface.test.js +121 -0
- package/esm/src/ast/nodes/object.test.d.ts +2 -0
- package/esm/src/ast/nodes/object.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/object.test.js +78 -0
- package/esm/src/ast/nodes/parameter.test.d.ts +2 -0
- package/esm/src/ast/nodes/parameter.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/parameter.test.js +152 -0
- package/esm/src/ast/nodes/property.test.d.ts +2 -0
- package/esm/src/ast/nodes/property.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/property.test.js +206 -0
- package/esm/src/ast/nodes/reference.test.d.ts +2 -0
- package/esm/src/ast/nodes/reference.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/reference.test.js +36 -0
- package/esm/src/ast/nodes/string.test.d.ts +2 -0
- package/esm/src/ast/nodes/string.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/string.test.js +48 -0
- package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +26 -26
- package/esm/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
- package/esm/src/generators/services/spring-controllers/spring-controller-generator.js +11 -7
- package/esm/src/import-collection.test.d.ts +2 -0
- package/esm/src/import-collection.test.d.ts.map +1 -0
- package/esm/src/import-collection.test.js +99 -0
- package/esm/tests/openapi-models.test.d.ts +2 -0
- package/esm/tests/openapi-models.test.d.ts.map +1 -0
- package/esm/tests/openapi-models.test.js +45 -0
- package/package.json +2 -2
- 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 +6 -0
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/_dnt.test_shims.js +65 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/assertion_error.d.ts +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/equal.d.ts +17 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/equal.js +139 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/equals.d.ts +22 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/equals.js +48 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/false.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/false.js +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/instance_of.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/instance_of.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/is_error.d.ts +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/is_error.js +57 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_instance_of.d.ts +20 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_instance_of.js +32 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.js +35 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/rejects.d.ts +42 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/rejects.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/rejects.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/strict_equals.d.ts +24 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.7/strict_equals.js +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assert_equals.d.ts +20 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assert_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assert_equals.js +32 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assert_not_equals.d.ts +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assert_not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assert_not_equals.js +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assertions.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assertions.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_assertions.js +18 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.d.ts +46 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.js +182 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_build_message.d.ts +6 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_build_message.js +33 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_custom_equality_tester.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_custom_equality_tester.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_custom_equality_tester.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_equal.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_equal.js +194 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_extend.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_extend.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_extend.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_inspect_args.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_inspect_args.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_inspect_args.js +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_matchers.d.ts +34 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_matchers.js +597 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_mock_util.d.ts +11 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_mock_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_mock_util.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_types.d.ts +838 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_types.js +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_utils.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/_utils.js +226 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/expect.d.ts +59 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/expect.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.7/expect.js +510 -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.4/_mock_utils.d.ts +15 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/_mock_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/_mock_utils.js +41 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/_test_suite.d.ts +74 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/_test_suite.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/_test_suite.js +355 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/bdd.d.ts +731 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/bdd.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/bdd.js +592 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/mock.d.ts +674 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/mock.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.4/mock.js +1102 -0
- package/script/src/ast/nodes/annotation.test.d.ts +2 -0
- package/script/src/ast/nodes/annotation.test.d.ts.map +1 -0
- package/script/src/ast/nodes/annotation.test.js +58 -0
- package/script/src/ast/nodes/argument.test.d.ts +2 -0
- package/script/src/ast/nodes/argument.test.d.ts.map +1 -0
- package/script/src/ast/nodes/argument.test.js +35 -0
- package/script/src/ast/nodes/call.test.d.ts +2 -0
- package/script/src/ast/nodes/call.test.d.ts.map +1 -0
- package/script/src/ast/nodes/call.test.js +37 -0
- package/script/src/ast/nodes/class.test.d.ts +2 -0
- package/script/src/ast/nodes/class.test.d.ts.map +1 -0
- package/script/src/ast/nodes/class.test.js +221 -0
- package/script/src/ast/nodes/constructor.test.d.ts +2 -0
- package/script/src/ast/nodes/constructor.test.d.ts.map +1 -0
- package/script/src/ast/nodes/constructor.test.js +141 -0
- package/script/src/ast/nodes/doc-tag.test.d.ts +2 -0
- package/script/src/ast/nodes/doc-tag.test.d.ts.map +1 -0
- package/script/src/ast/nodes/doc-tag.test.js +69 -0
- package/script/src/ast/nodes/doc.test.d.ts +2 -0
- package/script/src/ast/nodes/doc.test.d.ts.map +1 -0
- package/script/src/ast/nodes/doc.test.js +35 -0
- package/script/src/ast/nodes/enum-value.test.d.ts +2 -0
- package/script/src/ast/nodes/enum-value.test.d.ts.map +1 -0
- package/script/src/ast/nodes/enum-value.test.js +117 -0
- package/script/src/ast/nodes/enum.test.d.ts +2 -0
- package/script/src/ast/nodes/enum.test.d.ts.map +1 -0
- package/script/src/ast/nodes/enum.test.js +131 -0
- package/script/src/ast/nodes/function.test.d.ts +2 -0
- package/script/src/ast/nodes/function.test.d.ts.map +1 -0
- package/script/src/ast/nodes/function.test.js +162 -0
- package/script/src/ast/nodes/generic-parameter.test.d.ts +2 -0
- package/script/src/ast/nodes/generic-parameter.test.d.ts.map +1 -0
- package/script/src/ast/nodes/generic-parameter.test.js +51 -0
- package/script/src/ast/nodes/init-block.test.d.ts +2 -0
- package/script/src/ast/nodes/init-block.test.d.ts.map +1 -0
- package/script/src/ast/nodes/init-block.test.js +30 -0
- package/script/src/ast/nodes/interface.test.d.ts +2 -0
- package/script/src/ast/nodes/interface.test.d.ts.map +1 -0
- package/script/src/ast/nodes/interface.test.js +123 -0
- package/script/src/ast/nodes/object.test.d.ts +2 -0
- package/script/src/ast/nodes/object.test.d.ts.map +1 -0
- package/script/src/ast/nodes/object.test.js +80 -0
- package/script/src/ast/nodes/parameter.test.d.ts +2 -0
- package/script/src/ast/nodes/parameter.test.d.ts.map +1 -0
- package/script/src/ast/nodes/parameter.test.js +154 -0
- package/script/src/ast/nodes/property.test.d.ts +2 -0
- package/script/src/ast/nodes/property.test.d.ts.map +1 -0
- package/script/src/ast/nodes/property.test.js +208 -0
- package/script/src/ast/nodes/reference.test.d.ts +2 -0
- package/script/src/ast/nodes/reference.test.d.ts.map +1 -0
- package/script/src/ast/nodes/reference.test.js +38 -0
- package/script/src/ast/nodes/string.test.d.ts +2 -0
- package/script/src/ast/nodes/string.test.d.ts.map +1 -0
- package/script/src/ast/nodes/string.test.js +50 -0
- package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +26 -26
- package/script/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
- package/script/src/generators/services/spring-controllers/spring-controller-generator.js +11 -7
- package/script/src/import-collection.test.d.ts +2 -0
- package/script/src/import-collection.test.d.ts.map +1 -0
- package/script/src/import-collection.test.js +101 -0
- package/script/tests/openapi-models.test.d.ts +2 -0
- package/script/tests/openapi-models.test.d.ts.map +1 -0
- package/script/tests/openapi-models.test.js +48 -0
- package/src/_dnt.test_polyfills.ts +70 -0
- package/src/_dnt.test_shims.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/equal.ts +152 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/equals.ts +52 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/rejects.ts +123 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_assert_equals.ts +38 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_assert_not_equals.ts +35 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_assertions.ts +18 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_asymmetric_matchers.ts +193 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_build_message.ts +51 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_custom_equality_tester.ts +19 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_equal.ts +230 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_extend.ts +16 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_inspect_args.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_matchers.ts +832 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_mock_util.ts +22 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_types.ts +917 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/_utils.ts +283 -0
- package/src/deps/jsr.io/@std/expect/1.0.7/expect.ts +601 -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.4/_mock_utils.ts +43 -0
- package/src/deps/jsr.io/@std/testing/1.0.4/_test_suite.ts +410 -0
- package/src/deps/jsr.io/@std/testing/1.0.4/bdd.ts +1211 -0
- package/src/deps/jsr.io/@std/testing/1.0.4/mock.ts +1807 -0
- package/src/mod.ts +8 -0
- package/src/src/assets.ts +9 -0
- package/src/src/ast/_index.ts +66 -0
- package/src/src/ast/common.ts +1 -0
- package/src/src/ast/index.ts +1 -0
- package/src/src/ast/node.ts +10 -0
- package/src/src/ast/nodes/annotation.test.ts +69 -0
- package/src/src/ast/nodes/annotation.ts +79 -0
- package/src/src/ast/nodes/argument.test.ts +41 -0
- package/src/src/ast/nodes/argument.ts +62 -0
- package/src/src/ast/nodes/call.test.ts +44 -0
- package/src/src/ast/nodes/call.ts +66 -0
- package/src/src/ast/nodes/class.test.ts +274 -0
- package/src/src/ast/nodes/class.ts +178 -0
- package/src/src/ast/nodes/collection-literal.ts +49 -0
- package/src/src/ast/nodes/constructor.test.ts +178 -0
- package/src/src/ast/nodes/constructor.ts +126 -0
- package/src/src/ast/nodes/doc-tag.test.ts +84 -0
- package/src/src/ast/nodes/doc-tag.ts +138 -0
- package/src/src/ast/nodes/doc.test.ts +42 -0
- package/src/src/ast/nodes/doc.ts +111 -0
- package/src/src/ast/nodes/enum-value.test.ts +146 -0
- package/src/src/ast/nodes/enum-value.ts +100 -0
- package/src/src/ast/nodes/enum.test.ts +167 -0
- package/src/src/ast/nodes/enum.ts +163 -0
- package/src/src/ast/nodes/function.test.ts +194 -0
- package/src/src/ast/nodes/function.ts +176 -0
- package/src/src/ast/nodes/generic-parameter.test.ts +60 -0
- package/src/src/ast/nodes/generic-parameter.ts +54 -0
- package/src/src/ast/nodes/init-block.test.ts +36 -0
- package/src/src/ast/nodes/init-block.ts +38 -0
- package/src/src/ast/nodes/interface.test.ts +151 -0
- package/src/src/ast/nodes/interface.ts +133 -0
- package/src/src/ast/nodes/lambda-type.ts +68 -0
- package/src/src/ast/nodes/lambda.ts +68 -0
- package/src/src/ast/nodes/object.test.ts +101 -0
- package/src/src/ast/nodes/object.ts +102 -0
- package/src/src/ast/nodes/parameter.test.ts +191 -0
- package/src/src/ast/nodes/parameter.ts +118 -0
- package/src/src/ast/nodes/property.test.ts +253 -0
- package/src/src/ast/nodes/property.ts +225 -0
- package/src/src/ast/nodes/reference.test.ts +47 -0
- package/src/src/ast/nodes/reference.ts +178 -0
- package/src/src/ast/nodes/string.test.ts +61 -0
- package/src/src/ast/nodes/string.ts +114 -0
- package/src/src/ast/nodes/types.ts +23 -0
- package/src/src/ast/references/index.ts +8 -0
- package/src/src/ast/references/jackson.ts +16 -0
- package/src/src/ast/references/jakarta.ts +10 -0
- package/src/src/ast/references/java.ts +19 -0
- package/src/src/ast/references/kotlin.ts +40 -0
- package/src/src/ast/references/okhttp3.ts +5 -0
- package/src/src/ast/references/reactor.ts +5 -0
- package/src/src/ast/references/spring.ts +58 -0
- package/src/src/ast/references/swagger.ts +19 -0
- package/src/src/ast/utils/get-kotlin-builder-options.ts +19 -0
- package/src/src/ast/utils/to-kt-node.ts +31 -0
- package/src/src/ast/utils/write-kt-annotations.ts +15 -0
- package/src/src/ast/utils/write-kt-arguments.ts +45 -0
- package/src/src/ast/utils/write-kt-enum-values.ts +27 -0
- package/src/src/ast/utils/write-kt-generic-parameters.ts +12 -0
- package/src/src/ast/utils/write-kt-members.ts +25 -0
- package/src/src/ast/utils/write-kt-node.ts +37 -0
- package/src/src/ast/utils/write-kt-parameters.ts +25 -0
- package/src/src/common-results.ts +4 -0
- package/src/src/config.ts +39 -0
- package/src/src/file-builder.ts +108 -0
- package/src/src/generators/file-generator.ts +29 -0
- package/src/src/generators/index.ts +4 -0
- package/src/src/generators/models/args.ts +128 -0
- package/src/src/generators/models/index.ts +4 -0
- package/src/src/generators/models/model-generator.ts +602 -0
- package/src/src/generators/models/models-generator.ts +65 -0
- package/src/src/generators/models/models.ts +95 -0
- package/src/src/generators/services/okhttp3-clients/args.ts +78 -0
- package/src/src/generators/services/okhttp3-clients/index.ts +4 -0
- package/src/src/generators/services/okhttp3-clients/models.ts +60 -0
- package/src/src/generators/services/okhttp3-clients/okhttp3-client-generator.ts +557 -0
- package/src/src/generators/services/okhttp3-clients/okhttp3-clients-generator.ts +128 -0
- package/src/src/generators/services/okhttp3-clients/refs.ts +55 -0
- package/src/src/generators/services/spring-controllers/args.ts +71 -0
- package/src/src/generators/services/spring-controllers/index.ts +4 -0
- package/src/src/generators/services/spring-controllers/models.ts +58 -0
- package/src/src/generators/services/spring-controllers/spring-controller-generator.ts +609 -0
- package/src/src/generators/services/spring-controllers/spring-controllers-generator.ts +70 -0
- package/src/src/import-collection.test.ts +116 -0
- package/src/src/import-collection.ts +98 -0
- package/src/src/types.ts +3 -0
- package/src/src/utils.ts +39 -0
- package/src/tests/openapi-models.test.ts +63 -0
- package/test_runner.js +227 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. MIT license.
|
|
3
|
+
|
|
4
|
+
import type { EqualOptions, EqualOptionUtil } from "./_types.js";
|
|
5
|
+
import type { Tester } from "./_types.js";
|
|
6
|
+
import { equal } from "./_equal.js";
|
|
7
|
+
|
|
8
|
+
export function buildEqualOptions(options: EqualOptionUtil): EqualOptions {
|
|
9
|
+
const { customMessage, customTesters = [], strictCheck } = options ?? {};
|
|
10
|
+
const ret: EqualOptions = {
|
|
11
|
+
customTesters,
|
|
12
|
+
};
|
|
13
|
+
if (customMessage !== undefined) {
|
|
14
|
+
ret.msg = customMessage;
|
|
15
|
+
}
|
|
16
|
+
if (strictCheck !== undefined) {
|
|
17
|
+
ret.strictCheck = strictCheck;
|
|
18
|
+
}
|
|
19
|
+
return ret;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function isPromiseLike(value: unknown): value is PromiseLike<unknown> {
|
|
23
|
+
if (value == null) {
|
|
24
|
+
return false;
|
|
25
|
+
} else {
|
|
26
|
+
return typeof ((value as Record<string, unknown>).then) === "function";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// deno-lint-ignore no-explicit-any
|
|
31
|
+
export function hasIterator(object: any) {
|
|
32
|
+
return !!(object != null && object[Symbol.iterator]);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function isA<T>(typeName: string, value: unknown): value is T {
|
|
36
|
+
return Object.prototype.toString.apply(value) === `[object ${typeName}]`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isObject(a: unknown) {
|
|
40
|
+
return a !== null && typeof a === "object";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isObjectWithKeys(a: unknown) {
|
|
44
|
+
return (
|
|
45
|
+
isObject(a) &&
|
|
46
|
+
!(a instanceof Error) &&
|
|
47
|
+
!Array.isArray(a) &&
|
|
48
|
+
!(a instanceof Date) &&
|
|
49
|
+
!(a instanceof Set) &&
|
|
50
|
+
!(a instanceof Map)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function getObjectKeys(object: object): Array<string | symbol> {
|
|
55
|
+
return [
|
|
56
|
+
...Object.keys(object),
|
|
57
|
+
...Object.getOwnPropertySymbols(object).filter(
|
|
58
|
+
(s) => Object.getOwnPropertyDescriptor(object, s)?.enumerable,
|
|
59
|
+
),
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function hasPropertyInObject(object: object, key: string | symbol): boolean {
|
|
64
|
+
const shouldTerminate = !object || typeof object !== "object" ||
|
|
65
|
+
object === Object.prototype;
|
|
66
|
+
|
|
67
|
+
if (shouldTerminate) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
Object.prototype.hasOwnProperty.call(object, key) ||
|
|
73
|
+
hasPropertyInObject(Object.getPrototypeOf(object), key)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// deno-lint-ignore no-explicit-any
|
|
78
|
+
function entries(obj: any) {
|
|
79
|
+
if (!isObject(obj)) return [];
|
|
80
|
+
|
|
81
|
+
return Object.getOwnPropertySymbols(obj)
|
|
82
|
+
.filter((key) => key !== Symbol.iterator)
|
|
83
|
+
.map((key) => [key, obj[key as keyof typeof obj]])
|
|
84
|
+
.concat(Object.entries(obj));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Ported from https://github.com/jestjs/jest/blob/442c7f692e3a92f14a2fb56c1737b26fc663a0ef/packages/expect-utils/src/utils.ts#L173
|
|
88
|
+
export function iterableEquality(
|
|
89
|
+
// deno-lint-ignore no-explicit-any
|
|
90
|
+
a: any,
|
|
91
|
+
// deno-lint-ignore no-explicit-any
|
|
92
|
+
b: any,
|
|
93
|
+
customTesters: Tester[] = [],
|
|
94
|
+
aStack: unknown[] = [],
|
|
95
|
+
bStack: unknown[] = [],
|
|
96
|
+
): boolean | undefined {
|
|
97
|
+
if (
|
|
98
|
+
typeof a !== "object" ||
|
|
99
|
+
typeof b !== "object" ||
|
|
100
|
+
Array.isArray(a) ||
|
|
101
|
+
Array.isArray(b) ||
|
|
102
|
+
!hasIterator(a) ||
|
|
103
|
+
!hasIterator(b)
|
|
104
|
+
) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
if (a.constructor !== b.constructor) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
let length = aStack.length;
|
|
111
|
+
while (length--) {
|
|
112
|
+
// Linear search. Performance is inversely proportional to the number of
|
|
113
|
+
// unique nested structures.
|
|
114
|
+
// circular references at same depth are equal
|
|
115
|
+
// circular reference is not equal to non-circular one
|
|
116
|
+
if (aStack[length] === a) {
|
|
117
|
+
return bStack[length] === b;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
aStack.push(a);
|
|
121
|
+
bStack.push(b);
|
|
122
|
+
|
|
123
|
+
// deno-lint-ignore no-explicit-any
|
|
124
|
+
const iterableEqualityWithStack = (a: any, b: any) =>
|
|
125
|
+
iterableEquality(
|
|
126
|
+
a,
|
|
127
|
+
b,
|
|
128
|
+
[...filteredCustomTesters],
|
|
129
|
+
[...aStack],
|
|
130
|
+
[...bStack],
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
// Replace any instance of iterableEquality with the new
|
|
134
|
+
// iterableEqualityWithStack so we can do circular detection
|
|
135
|
+
const filteredCustomTesters: Tester[] = [
|
|
136
|
+
...customTesters.filter((t) => t !== iterableEquality),
|
|
137
|
+
iterableEqualityWithStack,
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
if (a.size !== undefined) {
|
|
141
|
+
if (a.size !== b.size) {
|
|
142
|
+
return false;
|
|
143
|
+
} else if (isA<Set<unknown>>("Set", a)) {
|
|
144
|
+
let allFound = true;
|
|
145
|
+
for (const aValue of a) {
|
|
146
|
+
if (!b.has(aValue)) {
|
|
147
|
+
let has = false;
|
|
148
|
+
for (const bValue of b) {
|
|
149
|
+
const isEqual = equal(aValue, bValue, {
|
|
150
|
+
customTesters: filteredCustomTesters,
|
|
151
|
+
});
|
|
152
|
+
if (isEqual === true) {
|
|
153
|
+
has = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (has === false) {
|
|
158
|
+
allFound = false;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Remove the first value from the stack of traversed values.
|
|
164
|
+
aStack.pop();
|
|
165
|
+
bStack.pop();
|
|
166
|
+
return allFound;
|
|
167
|
+
} else if (isA<Map<unknown, unknown>>("Map", a)) {
|
|
168
|
+
let allFound = true;
|
|
169
|
+
for (const aEntry of a) {
|
|
170
|
+
if (
|
|
171
|
+
!b.has(aEntry[0]) ||
|
|
172
|
+
!equal(aEntry[1], b.get(aEntry[0]), {
|
|
173
|
+
customTesters: filteredCustomTesters,
|
|
174
|
+
})
|
|
175
|
+
) {
|
|
176
|
+
let has = false;
|
|
177
|
+
for (const bEntry of b) {
|
|
178
|
+
const matchedKey = equal(
|
|
179
|
+
aEntry[0],
|
|
180
|
+
bEntry[0],
|
|
181
|
+
{ customTesters: filteredCustomTesters },
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
let matchedValue = false;
|
|
185
|
+
if (matchedKey === true) {
|
|
186
|
+
matchedValue = equal(
|
|
187
|
+
aEntry[1],
|
|
188
|
+
bEntry[1],
|
|
189
|
+
{ customTesters: filteredCustomTesters },
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
if (matchedValue === true) {
|
|
193
|
+
has = true;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (has === false) {
|
|
198
|
+
allFound = false;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// Remove the first value from the stack of traversed values.
|
|
204
|
+
aStack.pop();
|
|
205
|
+
bStack.pop();
|
|
206
|
+
return allFound;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const bIterator = b[Symbol.iterator]();
|
|
211
|
+
|
|
212
|
+
for (const aValue of a) {
|
|
213
|
+
const nextB = bIterator.next();
|
|
214
|
+
if (
|
|
215
|
+
nextB.done ||
|
|
216
|
+
!equal(aValue, nextB.value, { customTesters: filteredCustomTesters })
|
|
217
|
+
) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (!bIterator.next().done) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const aEntries = entries(a);
|
|
226
|
+
const bEntries = entries(b);
|
|
227
|
+
if (!equal(aEntries, bEntries)) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Remove the first value from the stack of traversed values.
|
|
232
|
+
aStack.pop();
|
|
233
|
+
bStack.pop();
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Ported from https://github.com/jestjs/jest/blob/442c7f692e3a92f14a2fb56c1737b26fc663a0ef/packages/expect-utils/src/utils.ts#L341
|
|
238
|
+
export function subsetEquality(
|
|
239
|
+
object: unknown,
|
|
240
|
+
subset: unknown,
|
|
241
|
+
customTesters: Tester[] = [],
|
|
242
|
+
): boolean | undefined {
|
|
243
|
+
const filteredCustomTesters = customTesters.filter((t) =>
|
|
244
|
+
t !== subsetEquality
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
const subsetEqualityWithContext =
|
|
248
|
+
(seenReferences: WeakMap<object, boolean> = new WeakMap()) =>
|
|
249
|
+
// deno-lint-ignore no-explicit-any
|
|
250
|
+
(object: any, subset: any): boolean | undefined => {
|
|
251
|
+
if (!isObjectWithKeys(subset)) {
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (seenReferences.has(subset)) return undefined;
|
|
256
|
+
seenReferences.set(subset, true);
|
|
257
|
+
|
|
258
|
+
const matchResult = getObjectKeys(subset).every((key) => {
|
|
259
|
+
if (isObjectWithKeys(subset[key])) {
|
|
260
|
+
if (seenReferences.has(subset[key])) {
|
|
261
|
+
return equal(object[key], subset[key], {
|
|
262
|
+
customTesters: filteredCustomTesters,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const result = object != null &&
|
|
267
|
+
hasPropertyInObject(object, key) &&
|
|
268
|
+
equal(object[key], subset[key], {
|
|
269
|
+
customTesters: [
|
|
270
|
+
...filteredCustomTesters,
|
|
271
|
+
subsetEqualityWithContext(seenReferences),
|
|
272
|
+
],
|
|
273
|
+
});
|
|
274
|
+
seenReferences.delete(subset[key]);
|
|
275
|
+
return result;
|
|
276
|
+
});
|
|
277
|
+
seenReferences.delete(subset);
|
|
278
|
+
|
|
279
|
+
return matchResult;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
return subsetEqualityWithContext()(object, subset);
|
|
283
|
+
}
|