@goast/core 0.4.0 → 0.4.1-springwebclient1
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 +67 -67
- package/esm/src/transform/helpers.d.ts.map +1 -1
- package/esm/src/transform/helpers.js +5 -1
- package/esm/src/utils/asset-manager.d.ts +1 -0
- package/esm/src/utils/asset-manager.d.ts.map +1 -1
- package/esm/src/utils/asset-manager.js +1 -1
- 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/src/transform/helpers.d.ts.map +1 -1
- package/script/src/transform/helpers.js +5 -1
- package/script/src/utils/asset-manager.d.ts +1 -0
- package/script/src/utils/asset-manager.d.ts.map +1 -1
- package/script/src/utils/asset-manager.js +1 -1
- 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 -18
- package/esm/_dnt.test_polyfills.d.ts.map +0 -1
- package/esm/_dnt.test_polyfills.js +0 -17
- 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.6/assertion_error.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -136
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -54
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -159
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -57
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts +0 -20
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +0 -17
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +0 -26
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.js +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +0 -36
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +0 -124
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +0 -6
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.js +0 -191
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +0 -12
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +0 -34
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -564
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +0 -838
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.js +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +0 -8
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.js +0 -159
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +0 -51
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.js +0 -425
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.js +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.js +0 -87
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -101
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -111
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -277
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -180
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.js +0 -37
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -207
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.js +0 -2
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -340
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -576
- 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 -78
- 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 -506
- 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 -164
- 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 -18
- package/script/_dnt.test_polyfills.d.ts.map +0 -1
- package/script/_dnt.test_polyfills.js +0 -18
- 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.6/assertion_error.d.ts +0 -26
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -139
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -48
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/false.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -57
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -162
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts +0 -20
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +0 -32
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.js +0 -13
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +0 -36
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +0 -140
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +0 -6
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.js +0 -33
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.js +0 -194
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +0 -34
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -598
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +0 -11
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +0 -838
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.js +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +0 -8
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.js +0 -166
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +0 -51
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.js +0 -429
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.js +0 -88
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +0 -85
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.js +0 -90
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -106
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -116
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -284
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -186
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/format.js +0 -41
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -220
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/types.js +0 -3
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -345
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -587
- 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 -80
- 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 -508
- 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 -166
- 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 -43
- package/src/_dnt.test_shims.ts +0 -72
- package/src/deps/jsr.io/@std/assert/1.0.6/assertion_error.ts +0 -31
- package/src/deps/jsr.io/@std/assert/1.0.6/equal.ts +0 -152
- package/src/deps/jsr.io/@std/assert/1.0.6/equals.ts +0 -52
- package/src/deps/jsr.io/@std/assert/1.0.6/false.ts +0 -26
- package/src/deps/jsr.io/@std/assert/1.0.6/instance_of.ts +0 -64
- package/src/deps/jsr.io/@std/assert/1.0.6/is_error.ts +0 -65
- package/src/deps/jsr.io/@std/assert/1.0.6/match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.6/not_instance_of.ts +0 -33
- package/src/deps/jsr.io/@std/assert/1.0.6/not_match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.ts +0 -42
- package/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +0 -202
- package/src/deps/jsr.io/@std/assert/1.0.6/strict_equals.ts +0 -67
- package/src/deps/jsr.io/@std/expect/1.0.5/_assert_equals.ts +0 -38
- package/src/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.ts +0 -35
- package/src/deps/jsr.io/@std/expect/1.0.5/_assertion.ts +0 -13
- package/src/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.ts +0 -147
- package/src/deps/jsr.io/@std/expect/1.0.5/_build_message.ts +0 -51
- package/src/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.ts +0 -19
- package/src/deps/jsr.io/@std/expect/1.0.5/_equal.ts +0 -229
- package/src/deps/jsr.io/@std/expect/1.0.5/_extend.ts +0 -16
- package/src/deps/jsr.io/@std/expect/1.0.5/_inspect_args.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.5/_matchers.ts +0 -828
- package/src/deps/jsr.io/@std/expect/1.0.5/_mock_util.ts +0 -22
- package/src/deps/jsr.io/@std/expect/1.0.5/_types.ts +0 -917
- package/src/deps/jsr.io/@std/expect/1.0.5/_utils.ts +0 -201
- package/src/deps/jsr.io/@std/expect/1.0.5/expect.ts +0 -511
- package/src/deps/jsr.io/@std/expect/1.0.5/fn.ts +0 -91
- package/src/deps/jsr.io/@std/expect/1.0.5/mod.ts +0 -88
- package/src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts +0 -111
- package/src/deps/jsr.io/@std/internal/1.0.4/build_message.ts +0 -134
- package/src/deps/jsr.io/@std/internal/1.0.4/diff.ts +0 -317
- package/src/deps/jsr.io/@std/internal/1.0.4/diff_str.ts +0 -204
- package/src/deps/jsr.io/@std/internal/1.0.4/format.ts +0 -39
- package/src/deps/jsr.io/@std/internal/1.0.4/styles.ts +0 -233
- package/src/deps/jsr.io/@std/internal/1.0.4/types.ts +0 -18
- package/src/deps/jsr.io/@std/testing/1.0.3/_test_suite.ts +0 -389
- package/src/deps/jsr.io/@std/testing/1.0.3/bdd.ts +0 -1202
- 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 -87
- package/src/src/utils/schema.utils.ts +0 -142
- package/src/src/utils/source-builder.test.ts +0 -658
- 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 -189
- 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,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a mock function that can be used for testing and assertions.
|
|
3
|
-
*
|
|
4
|
-
* @param stubs Functions to be used as stubs for different calls.
|
|
5
|
-
* @returns A mock function that keeps track of calls and returns values based on the provided stubs.
|
|
6
|
-
*
|
|
7
|
-
* @example Usage
|
|
8
|
-
* ```ts no-assert
|
|
9
|
-
* import { fn, expect } from "@std/expect";
|
|
10
|
-
*
|
|
11
|
-
* Deno.test("example", () => {
|
|
12
|
-
* const mockFn = fn(
|
|
13
|
-
* (a: number, b: number) => a + b,
|
|
14
|
-
* (a: number, b: number) => a - b
|
|
15
|
-
* );
|
|
16
|
-
* const result = mockFn(1, 2);
|
|
17
|
-
* expect(result).toEqual(3);
|
|
18
|
-
* expect(mockFn).toHaveBeenCalledWith(1, 2);
|
|
19
|
-
* expect(mockFn).toHaveBeenCalledTimes(1);
|
|
20
|
-
*
|
|
21
|
-
* const result2 = mockFn(3, 2);
|
|
22
|
-
* expect(result2).toEqual(1);
|
|
23
|
-
* expect(mockFn).toHaveBeenCalledWith(3, 2);
|
|
24
|
-
* expect(mockFn).toHaveBeenCalledTimes(2);
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function fn(...stubs: Function[]): Function;
|
|
29
|
-
//# sourceMappingURL=fn.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fn.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/expect/1.0.5/fn.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAsCjD"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
4
|
-
// deno-lint-ignore-file no-explicit-any ban-types
|
|
5
|
-
/**
|
|
6
|
-
* This module contains a function to mock functions for testing and assertions.
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* import { fn, expect } from "@std/expect";
|
|
10
|
-
*
|
|
11
|
-
* Deno.test("example", () => {
|
|
12
|
-
* const mockFn = fn((a: number, b: number) => a + b);
|
|
13
|
-
* const result = mockFn(1, 2);
|
|
14
|
-
* expect(result).toEqual(3);
|
|
15
|
-
* expect(mockFn).toHaveBeenCalledWith(1, 2);
|
|
16
|
-
* expect(mockFn).toHaveBeenCalledTimes(1);
|
|
17
|
-
* });
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @module
|
|
21
|
-
*/
|
|
22
|
-
import { MOCK_SYMBOL } from "./_mock_util.js";
|
|
23
|
-
/**
|
|
24
|
-
* Creates a mock function that can be used for testing and assertions.
|
|
25
|
-
*
|
|
26
|
-
* @param stubs Functions to be used as stubs for different calls.
|
|
27
|
-
* @returns A mock function that keeps track of calls and returns values based on the provided stubs.
|
|
28
|
-
*
|
|
29
|
-
* @example Usage
|
|
30
|
-
* ```ts no-assert
|
|
31
|
-
* import { fn, expect } from "@std/expect";
|
|
32
|
-
*
|
|
33
|
-
* Deno.test("example", () => {
|
|
34
|
-
* const mockFn = fn(
|
|
35
|
-
* (a: number, b: number) => a + b,
|
|
36
|
-
* (a: number, b: number) => a - b
|
|
37
|
-
* );
|
|
38
|
-
* const result = mockFn(1, 2);
|
|
39
|
-
* expect(result).toEqual(3);
|
|
40
|
-
* expect(mockFn).toHaveBeenCalledWith(1, 2);
|
|
41
|
-
* expect(mockFn).toHaveBeenCalledTimes(1);
|
|
42
|
-
*
|
|
43
|
-
* const result2 = mockFn(3, 2);
|
|
44
|
-
* expect(result2).toEqual(1);
|
|
45
|
-
* expect(mockFn).toHaveBeenCalledWith(3, 2);
|
|
46
|
-
* expect(mockFn).toHaveBeenCalledTimes(2);
|
|
47
|
-
* });
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export function fn(...stubs) {
|
|
51
|
-
const calls = [];
|
|
52
|
-
const f = (...args) => {
|
|
53
|
-
const stub = stubs.length === 1
|
|
54
|
-
// keep reusing the first
|
|
55
|
-
? stubs[0]
|
|
56
|
-
// pick the exact mock for the current call
|
|
57
|
-
: stubs[calls.length];
|
|
58
|
-
try {
|
|
59
|
-
const returned = stub ? stub(...args) : undefined;
|
|
60
|
-
calls.push({
|
|
61
|
-
args,
|
|
62
|
-
returned,
|
|
63
|
-
timestamp: Date.now(),
|
|
64
|
-
returns: true,
|
|
65
|
-
throws: false,
|
|
66
|
-
});
|
|
67
|
-
return returned;
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
calls.push({
|
|
71
|
-
args,
|
|
72
|
-
timestamp: Date.now(),
|
|
73
|
-
returns: false,
|
|
74
|
-
thrown: err,
|
|
75
|
-
throws: true,
|
|
76
|
-
});
|
|
77
|
-
throw err;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
Object.defineProperty(f, MOCK_SYMBOL, {
|
|
81
|
-
value: { calls },
|
|
82
|
-
writable: false,
|
|
83
|
-
});
|
|
84
|
-
return f;
|
|
85
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module provides Jest compatible expect assertion functionality.
|
|
3
|
-
*
|
|
4
|
-
* ```ts no-assert
|
|
5
|
-
* import { expect } from "@std/expect";
|
|
6
|
-
*
|
|
7
|
-
* const x = 6 * 7;
|
|
8
|
-
* expect(x).toEqual(42);
|
|
9
|
-
* expect(x).not.toEqual(0);
|
|
10
|
-
*
|
|
11
|
-
* await expect(Promise.resolve(x)).resolves.toEqual(42);
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Currently this module supports the following functions:
|
|
15
|
-
* - Common matchers:
|
|
16
|
-
* - {@linkcode Expected.toBe | toBe}
|
|
17
|
-
* - {@linkcode Expected.toEqual | toEqual}
|
|
18
|
-
* - {@linkcode Expected.toStrictEqual | toStrictEqual}
|
|
19
|
-
* - {@linkcode Expected.toMatch | toMatch}
|
|
20
|
-
* - {@linkcode Expected.toMatchObject | toMatchObject}
|
|
21
|
-
* - {@linkcode Expected.toBeDefined | toBeDefined}
|
|
22
|
-
* - {@linkcode Expected.toBeUndefined | toBeUndefined}
|
|
23
|
-
* - {@linkcode Expected.toBeNull | toBeNull}
|
|
24
|
-
* - {@linkcode Expected.toBeNaN | toBeNaN}
|
|
25
|
-
* - {@linkcode Expected.toBeTruthy | toBeTruthy}
|
|
26
|
-
* - {@linkcode Expected.toBeFalsy | toBeFalsy}
|
|
27
|
-
* - {@linkcode Expected.toContain | toContain}
|
|
28
|
-
* - {@linkcode Expected.toContainEqual | toContainEqual}
|
|
29
|
-
* - {@linkcode Expected.toHaveLength | toHaveLength}
|
|
30
|
-
* - {@linkcode Expected.toBeGreaterThan | toBeGreaterThan}
|
|
31
|
-
* - {@linkcode Expected.toBeGreaterThanOrEqual | toBeGreaterThanOrEqual}
|
|
32
|
-
* - {@linkcode Expected.toBeLessThan | toBeLessThan}
|
|
33
|
-
* - {@linkcode Expected.toBeLessThanOrEqual | toBeLessThanOrEqual}
|
|
34
|
-
* - {@linkcode Expected.toBeCloseTo | toBeCloseTo}
|
|
35
|
-
* - {@linkcode Expected.toBeInstanceOf | toBeInstanceOf}
|
|
36
|
-
* - {@linkcode Expected.toThrow | toThrow}
|
|
37
|
-
* - {@linkcode Expected.toHaveProperty | toHaveProperty}
|
|
38
|
-
* - Mock related matchers:
|
|
39
|
-
* - {@linkcode Expected.toHaveBeenCalled | toHaveBeenCalled}
|
|
40
|
-
* - {@linkcode Expected.toHaveBeenCalledTimes | toHaveBeenCalledTimes}
|
|
41
|
-
* - {@linkcode Expected.toHaveBeenCalledWith | toHaveBeenCalledWith}
|
|
42
|
-
* - {@linkcode Expected.toHaveBeenLastCalledWith | toHaveBeenLastCalledWith}
|
|
43
|
-
* - {@linkcode Expected.toHaveBeenNthCalledWith | toHaveBeenNthCalledWith}
|
|
44
|
-
* - {@linkcode Expected.toHaveReturned | toHaveReturned}
|
|
45
|
-
* - {@linkcode Expected.toHaveReturnedTimes | toHaveReturnedTimes}
|
|
46
|
-
* - {@linkcode Expected.toHaveReturnedWith | toHaveReturnedWith}
|
|
47
|
-
* - {@linkcode Expected.toHaveLastReturnedWith | toHaveLastReturnedWith}
|
|
48
|
-
* - {@linkcode Expected.toHaveNthReturnedWith | toHaveNthReturnedWith}
|
|
49
|
-
* - Asymmetric matchers:
|
|
50
|
-
* - {@linkcode expect.anything}
|
|
51
|
-
* - {@linkcode expect.any}
|
|
52
|
-
* - {@linkcode expect.arrayContaining}
|
|
53
|
-
* - {@linkcode expect.closeTo}
|
|
54
|
-
* - {@linkcode expect.stringContaining}
|
|
55
|
-
* - {@linkcode expect.stringMatching}
|
|
56
|
-
* - Utilities:
|
|
57
|
-
* - {@linkcode expect.addEqualityTester}
|
|
58
|
-
* - {@linkcode expect.extend}
|
|
59
|
-
* - {@linkcode expect.hasAssertions}
|
|
60
|
-
*
|
|
61
|
-
* Only these functions are still not available:
|
|
62
|
-
* - Matchers:
|
|
63
|
-
* - `toMatchSnapShot`
|
|
64
|
-
* - `toMatchInlineSnapshot`
|
|
65
|
-
* - `toThrowErrorMatchingSnapshot`
|
|
66
|
-
* - `toThrowErrorMatchingInlineSnapshot`
|
|
67
|
-
* - Asymmetric matchers:
|
|
68
|
-
* - `expect.objectContaining`
|
|
69
|
-
* - `expect.not.objectContaining`
|
|
70
|
-
* - Utilities:
|
|
71
|
-
* - `expect.assertions`
|
|
72
|
-
* - `expect.addSnapshotSerializer`
|
|
73
|
-
*
|
|
74
|
-
* The tracking issue to add support for unsupported parts of the API is
|
|
75
|
-
* {@link https://github.com/denoland/std/issues/3964}.
|
|
76
|
-
*
|
|
77
|
-
* This module is largely inspired by
|
|
78
|
-
* {@link https://github.com/allain/expect | x/expect} module by
|
|
79
|
-
* {@link https://github.com/allain | Allain Lalonde}.
|
|
80
|
-
*
|
|
81
|
-
* @module
|
|
82
|
-
*/
|
|
83
|
-
export * from "./expect.js";
|
|
84
|
-
export * from "./fn.js";
|
|
85
|
-
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/expect/1.0.5/mod.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
3
|
-
// This module is browser compatible.
|
|
4
|
-
/**
|
|
5
|
-
* This module provides Jest compatible expect assertion functionality.
|
|
6
|
-
*
|
|
7
|
-
* ```ts no-assert
|
|
8
|
-
* import { expect } from "@std/expect";
|
|
9
|
-
*
|
|
10
|
-
* const x = 6 * 7;
|
|
11
|
-
* expect(x).toEqual(42);
|
|
12
|
-
* expect(x).not.toEqual(0);
|
|
13
|
-
*
|
|
14
|
-
* await expect(Promise.resolve(x)).resolves.toEqual(42);
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* Currently this module supports the following functions:
|
|
18
|
-
* - Common matchers:
|
|
19
|
-
* - {@linkcode Expected.toBe | toBe}
|
|
20
|
-
* - {@linkcode Expected.toEqual | toEqual}
|
|
21
|
-
* - {@linkcode Expected.toStrictEqual | toStrictEqual}
|
|
22
|
-
* - {@linkcode Expected.toMatch | toMatch}
|
|
23
|
-
* - {@linkcode Expected.toMatchObject | toMatchObject}
|
|
24
|
-
* - {@linkcode Expected.toBeDefined | toBeDefined}
|
|
25
|
-
* - {@linkcode Expected.toBeUndefined | toBeUndefined}
|
|
26
|
-
* - {@linkcode Expected.toBeNull | toBeNull}
|
|
27
|
-
* - {@linkcode Expected.toBeNaN | toBeNaN}
|
|
28
|
-
* - {@linkcode Expected.toBeTruthy | toBeTruthy}
|
|
29
|
-
* - {@linkcode Expected.toBeFalsy | toBeFalsy}
|
|
30
|
-
* - {@linkcode Expected.toContain | toContain}
|
|
31
|
-
* - {@linkcode Expected.toContainEqual | toContainEqual}
|
|
32
|
-
* - {@linkcode Expected.toHaveLength | toHaveLength}
|
|
33
|
-
* - {@linkcode Expected.toBeGreaterThan | toBeGreaterThan}
|
|
34
|
-
* - {@linkcode Expected.toBeGreaterThanOrEqual | toBeGreaterThanOrEqual}
|
|
35
|
-
* - {@linkcode Expected.toBeLessThan | toBeLessThan}
|
|
36
|
-
* - {@linkcode Expected.toBeLessThanOrEqual | toBeLessThanOrEqual}
|
|
37
|
-
* - {@linkcode Expected.toBeCloseTo | toBeCloseTo}
|
|
38
|
-
* - {@linkcode Expected.toBeInstanceOf | toBeInstanceOf}
|
|
39
|
-
* - {@linkcode Expected.toThrow | toThrow}
|
|
40
|
-
* - {@linkcode Expected.toHaveProperty | toHaveProperty}
|
|
41
|
-
* - Mock related matchers:
|
|
42
|
-
* - {@linkcode Expected.toHaveBeenCalled | toHaveBeenCalled}
|
|
43
|
-
* - {@linkcode Expected.toHaveBeenCalledTimes | toHaveBeenCalledTimes}
|
|
44
|
-
* - {@linkcode Expected.toHaveBeenCalledWith | toHaveBeenCalledWith}
|
|
45
|
-
* - {@linkcode Expected.toHaveBeenLastCalledWith | toHaveBeenLastCalledWith}
|
|
46
|
-
* - {@linkcode Expected.toHaveBeenNthCalledWith | toHaveBeenNthCalledWith}
|
|
47
|
-
* - {@linkcode Expected.toHaveReturned | toHaveReturned}
|
|
48
|
-
* - {@linkcode Expected.toHaveReturnedTimes | toHaveReturnedTimes}
|
|
49
|
-
* - {@linkcode Expected.toHaveReturnedWith | toHaveReturnedWith}
|
|
50
|
-
* - {@linkcode Expected.toHaveLastReturnedWith | toHaveLastReturnedWith}
|
|
51
|
-
* - {@linkcode Expected.toHaveNthReturnedWith | toHaveNthReturnedWith}
|
|
52
|
-
* - Asymmetric matchers:
|
|
53
|
-
* - {@linkcode expect.anything}
|
|
54
|
-
* - {@linkcode expect.any}
|
|
55
|
-
* - {@linkcode expect.arrayContaining}
|
|
56
|
-
* - {@linkcode expect.closeTo}
|
|
57
|
-
* - {@linkcode expect.stringContaining}
|
|
58
|
-
* - {@linkcode expect.stringMatching}
|
|
59
|
-
* - Utilities:
|
|
60
|
-
* - {@linkcode expect.addEqualityTester}
|
|
61
|
-
* - {@linkcode expect.extend}
|
|
62
|
-
* - {@linkcode expect.hasAssertions}
|
|
63
|
-
*
|
|
64
|
-
* Only these functions are still not available:
|
|
65
|
-
* - Matchers:
|
|
66
|
-
* - `toMatchSnapShot`
|
|
67
|
-
* - `toMatchInlineSnapshot`
|
|
68
|
-
* - `toThrowErrorMatchingSnapshot`
|
|
69
|
-
* - `toThrowErrorMatchingInlineSnapshot`
|
|
70
|
-
* - Asymmetric matchers:
|
|
71
|
-
* - `expect.objectContaining`
|
|
72
|
-
* - `expect.not.objectContaining`
|
|
73
|
-
* - Utilities:
|
|
74
|
-
* - `expect.assertions`
|
|
75
|
-
* - `expect.addSnapshotSerializer`
|
|
76
|
-
*
|
|
77
|
-
* The tracking issue to add support for unsupported parts of the API is
|
|
78
|
-
* {@link https://github.com/denoland/std/issues/3964}.
|
|
79
|
-
*
|
|
80
|
-
* This module is largely inspired by
|
|
81
|
-
* {@link https://github.com/allain/expect | x/expect} module by
|
|
82
|
-
* {@link https://github.com/allain | Allain Lalonde}.
|
|
83
|
-
*
|
|
84
|
-
* @module
|
|
85
|
-
*/
|
|
86
|
-
export * from "./expect.js";
|
|
87
|
-
export * from "./fn.js";
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check the test suite internal state
|
|
3
|
-
*
|
|
4
|
-
* @example Usage
|
|
5
|
-
* ```ts ignore
|
|
6
|
-
* import { AssertionState } from "@std/internal";
|
|
7
|
-
*
|
|
8
|
-
* const assertionState = new AssertionState();
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export declare class AssertionState {
|
|
12
|
-
#private;
|
|
13
|
-
constructor();
|
|
14
|
-
/**
|
|
15
|
-
* If `expect.hasAssertions` called, then through this method to update #state.assertionCheck value.
|
|
16
|
-
*
|
|
17
|
-
* @param val Set #state.assertionCheck's value
|
|
18
|
-
*
|
|
19
|
-
* @example Usage
|
|
20
|
-
* ```ts ignore
|
|
21
|
-
* import { AssertionState } from "@std/internal";
|
|
22
|
-
*
|
|
23
|
-
* const assertionState = new AssertionState();
|
|
24
|
-
* assertionState.setAssertionCheck(true);
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
setAssertionCheck(val: boolean): void;
|
|
28
|
-
/**
|
|
29
|
-
* If any matchers was called, `#state.assertionTriggered` will be set through this method.
|
|
30
|
-
*
|
|
31
|
-
* @param val Set #state.assertionTriggered's value
|
|
32
|
-
*
|
|
33
|
-
* @example Usage
|
|
34
|
-
* ```ts ignore
|
|
35
|
-
* import { AssertionState } from "@std/internal";
|
|
36
|
-
*
|
|
37
|
-
* const assertionState = new AssertionState();
|
|
38
|
-
* assertionState.setAssertionTriggered(true);
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
setAssertionTriggered(val: boolean): void;
|
|
42
|
-
/**
|
|
43
|
-
* Check Assertion internal state, if `#state.assertionCheck` is set true, but
|
|
44
|
-
* `#state.assertionTriggered` is still false, then should throw an Assertion Error.
|
|
45
|
-
*
|
|
46
|
-
* @returns a boolean value, that the test suite is satisfied with the check. If not,
|
|
47
|
-
* it should throw an AssertionError.
|
|
48
|
-
*
|
|
49
|
-
* @example Usage
|
|
50
|
-
* ```ts ignore
|
|
51
|
-
* import { AssertionState } from "@std/internal";
|
|
52
|
-
*
|
|
53
|
-
* const assertionState = new AssertionState();
|
|
54
|
-
* if (assertionState.checkAssertionErrorStateAndReset()) {
|
|
55
|
-
* // throw AssertionError("");
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
checkAssertionErrorStateAndReset(): boolean;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* return an instance of AssertionState
|
|
63
|
-
*
|
|
64
|
-
* @returns AssertionState
|
|
65
|
-
*
|
|
66
|
-
* @example Usage
|
|
67
|
-
* ```ts ignore
|
|
68
|
-
* import { getAssertionState } from "@std/internal";
|
|
69
|
-
*
|
|
70
|
-
* const assertionState = getAssertionState();
|
|
71
|
-
* assertionState.setAssertionTriggered(true);
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
export declare function getAssertionState(): AssertionState;
|
|
75
|
-
//# sourceMappingURL=assertion_state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assertion_state.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,qBAAa,cAAc;;;IAazB;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,GAAG,EAAE,OAAO;IAI9B;;;;;;;;;;;;OAYG;IACH,qBAAqB,CAAC,GAAG,EAAE,OAAO;IAIlC;;;;;;;;;;;;;;;;OAgBG;IACH,gCAAgC,IAAI,OAAO;CAe5C;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
var _AssertionState_instances, _AssertionState_state, _AssertionState_resetAssertionState;
|
|
3
|
-
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
4
|
-
/**
|
|
5
|
-
* Check the test suite internal state
|
|
6
|
-
*
|
|
7
|
-
* @example Usage
|
|
8
|
-
* ```ts ignore
|
|
9
|
-
* import { AssertionState } from "@std/internal";
|
|
10
|
-
*
|
|
11
|
-
* const assertionState = new AssertionState();
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export class AssertionState {
|
|
15
|
-
constructor() {
|
|
16
|
-
_AssertionState_instances.add(this);
|
|
17
|
-
_AssertionState_state.set(this, void 0);
|
|
18
|
-
__classPrivateFieldSet(this, _AssertionState_state, {
|
|
19
|
-
assertionCheck: false,
|
|
20
|
-
assertionTriggered: false,
|
|
21
|
-
}, "f");
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* If `expect.hasAssertions` called, then through this method to update #state.assertionCheck value.
|
|
25
|
-
*
|
|
26
|
-
* @param val Set #state.assertionCheck's value
|
|
27
|
-
*
|
|
28
|
-
* @example Usage
|
|
29
|
-
* ```ts ignore
|
|
30
|
-
* import { AssertionState } from "@std/internal";
|
|
31
|
-
*
|
|
32
|
-
* const assertionState = new AssertionState();
|
|
33
|
-
* assertionState.setAssertionCheck(true);
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
setAssertionCheck(val) {
|
|
37
|
-
__classPrivateFieldGet(this, _AssertionState_state, "f").assertionCheck = val;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* If any matchers was called, `#state.assertionTriggered` will be set through this method.
|
|
41
|
-
*
|
|
42
|
-
* @param val Set #state.assertionTriggered's value
|
|
43
|
-
*
|
|
44
|
-
* @example Usage
|
|
45
|
-
* ```ts ignore
|
|
46
|
-
* import { AssertionState } from "@std/internal";
|
|
47
|
-
*
|
|
48
|
-
* const assertionState = new AssertionState();
|
|
49
|
-
* assertionState.setAssertionTriggered(true);
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
setAssertionTriggered(val) {
|
|
53
|
-
__classPrivateFieldGet(this, _AssertionState_state, "f").assertionTriggered = val;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Check Assertion internal state, if `#state.assertionCheck` is set true, but
|
|
57
|
-
* `#state.assertionTriggered` is still false, then should throw an Assertion Error.
|
|
58
|
-
*
|
|
59
|
-
* @returns a boolean value, that the test suite is satisfied with the check. If not,
|
|
60
|
-
* it should throw an AssertionError.
|
|
61
|
-
*
|
|
62
|
-
* @example Usage
|
|
63
|
-
* ```ts ignore
|
|
64
|
-
* import { AssertionState } from "@std/internal";
|
|
65
|
-
*
|
|
66
|
-
* const assertionState = new AssertionState();
|
|
67
|
-
* if (assertionState.checkAssertionErrorStateAndReset()) {
|
|
68
|
-
* // throw AssertionError("");
|
|
69
|
-
* }
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
checkAssertionErrorStateAndReset() {
|
|
73
|
-
const result = __classPrivateFieldGet(this, _AssertionState_state, "f").assertionCheck &&
|
|
74
|
-
!__classPrivateFieldGet(this, _AssertionState_state, "f").assertionTriggered;
|
|
75
|
-
__classPrivateFieldGet(this, _AssertionState_instances, "m", _AssertionState_resetAssertionState).call(this);
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
_AssertionState_state = new WeakMap(), _AssertionState_instances = new WeakSet(), _AssertionState_resetAssertionState = function _AssertionState_resetAssertionState() {
|
|
80
|
-
__classPrivateFieldSet(this, _AssertionState_state, {
|
|
81
|
-
assertionCheck: false,
|
|
82
|
-
assertionTriggered: false,
|
|
83
|
-
}, "f");
|
|
84
|
-
};
|
|
85
|
-
const assertionState = new AssertionState();
|
|
86
|
-
/**
|
|
87
|
-
* return an instance of AssertionState
|
|
88
|
-
*
|
|
89
|
-
* @returns AssertionState
|
|
90
|
-
*
|
|
91
|
-
* @example Usage
|
|
92
|
-
* ```ts ignore
|
|
93
|
-
* import { getAssertionState } from "@std/internal";
|
|
94
|
-
*
|
|
95
|
-
* const assertionState = getAssertionState();
|
|
96
|
-
* assertionState.setAssertionTriggered(true);
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
export function getAssertionState() {
|
|
100
|
-
return assertionState;
|
|
101
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { DiffResult, DiffType } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Colors the output of assertion diffs.
|
|
4
|
-
*
|
|
5
|
-
* @param diffType Difference type, either added or removed.
|
|
6
|
-
* @param background If true, colors the background instead of the text.
|
|
7
|
-
*
|
|
8
|
-
* @returns A function that colors the input string.
|
|
9
|
-
*
|
|
10
|
-
* @example Usage
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { createColor } from "@std/internal";
|
|
13
|
-
* import { assertEquals } from "@std/assert";
|
|
14
|
-
* import { bold, green, red, white } from "@std/fmt/colors";
|
|
15
|
-
*
|
|
16
|
-
* assertEquals(createColor("added")("foo"), green(bold("foo")));
|
|
17
|
-
* assertEquals(createColor("removed")("foo"), red(bold("foo")));
|
|
18
|
-
* assertEquals(createColor("common")("foo"), white("foo"));
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function createColor(diffType: DiffType,
|
|
22
|
-
/**
|
|
23
|
-
* TODO(@littledivy): Remove this when we can detect true color terminals. See
|
|
24
|
-
* https://github.com/denoland/deno_std/issues/2575.
|
|
25
|
-
*/
|
|
26
|
-
background?: boolean): (s: string) => string;
|
|
27
|
-
/**
|
|
28
|
-
* Prefixes `+` or `-` in diff output.
|
|
29
|
-
*
|
|
30
|
-
* @param diffType Difference type, either added or removed
|
|
31
|
-
*
|
|
32
|
-
* @returns A string representing the sign.
|
|
33
|
-
*
|
|
34
|
-
* @example Usage
|
|
35
|
-
* ```ts
|
|
36
|
-
* import { createSign } from "@std/internal";
|
|
37
|
-
* import { assertEquals } from "@std/assert";
|
|
38
|
-
*
|
|
39
|
-
* assertEquals(createSign("added"), "+ ");
|
|
40
|
-
* assertEquals(createSign("removed"), "- ");
|
|
41
|
-
* assertEquals(createSign("common"), " ");
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function createSign(diffType: DiffType): string;
|
|
45
|
-
/** Options for {@linkcode buildMessage}. */
|
|
46
|
-
export interface BuildMessageOptions {
|
|
47
|
-
/**
|
|
48
|
-
* Whether to output the diff as a single string.
|
|
49
|
-
*
|
|
50
|
-
* @default {false}
|
|
51
|
-
*/
|
|
52
|
-
stringDiff?: boolean;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Builds a message based on the provided diff result.
|
|
56
|
-
*
|
|
57
|
-
* @param diffResult The diff result array.
|
|
58
|
-
* @param options Optional parameters for customizing the message.
|
|
59
|
-
*
|
|
60
|
-
* @returns An array of strings representing the built message.
|
|
61
|
-
*
|
|
62
|
-
* @example Usage
|
|
63
|
-
* ```ts no-assert
|
|
64
|
-
* import { diffStr, buildMessage } from "@std/internal";
|
|
65
|
-
*
|
|
66
|
-
* const diffResult = diffStr("Hello, world!", "Hello, world");
|
|
67
|
-
*
|
|
68
|
-
* console.log(buildMessage(diffResult));
|
|
69
|
-
* // [
|
|
70
|
-
* // "",
|
|
71
|
-
* // "",
|
|
72
|
-
* // " [Diff] Actual / Expected",
|
|
73
|
-
* // "",
|
|
74
|
-
* // "",
|
|
75
|
-
* // "- Hello, world!",
|
|
76
|
-
* // "+ Hello, world",
|
|
77
|
-
* // "",
|
|
78
|
-
* // ]
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
export declare function buildMessage(diffResult: ReadonlyArray<DiffResult<string>>, options?: BuildMessageOptions): string[];
|
|
82
|
-
//# sourceMappingURL=build_message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build_message.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.4/build_message.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,QAAQ;AAClB;;;GAGG;AACH,UAAU,UAAQ,GACjB,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CASvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CASrD;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAC7C,OAAO,GAAE,mBAAwB,GAChC,MAAM,EAAE,CAsBV"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { bgGreen, bgRed, bold, gray, green, red, white } from "./styles.js";
|
|
4
|
-
/**
|
|
5
|
-
* Colors the output of assertion diffs.
|
|
6
|
-
*
|
|
7
|
-
* @param diffType Difference type, either added or removed.
|
|
8
|
-
* @param background If true, colors the background instead of the text.
|
|
9
|
-
*
|
|
10
|
-
* @returns A function that colors the input string.
|
|
11
|
-
*
|
|
12
|
-
* @example Usage
|
|
13
|
-
* ```ts
|
|
14
|
-
* import { createColor } from "@std/internal";
|
|
15
|
-
* import { assertEquals } from "@std/assert";
|
|
16
|
-
* import { bold, green, red, white } from "@std/fmt/colors";
|
|
17
|
-
*
|
|
18
|
-
* assertEquals(createColor("added")("foo"), green(bold("foo")));
|
|
19
|
-
* assertEquals(createColor("removed")("foo"), red(bold("foo")));
|
|
20
|
-
* assertEquals(createColor("common")("foo"), white("foo"));
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export function createColor(diffType,
|
|
24
|
-
/**
|
|
25
|
-
* TODO(@littledivy): Remove this when we can detect true color terminals. See
|
|
26
|
-
* https://github.com/denoland/deno_std/issues/2575.
|
|
27
|
-
*/
|
|
28
|
-
background = false) {
|
|
29
|
-
switch (diffType) {
|
|
30
|
-
case "added":
|
|
31
|
-
return (s) => background ? bgGreen(white(s)) : green(bold(s));
|
|
32
|
-
case "removed":
|
|
33
|
-
return (s) => background ? bgRed(white(s)) : red(bold(s));
|
|
34
|
-
default:
|
|
35
|
-
return white;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Prefixes `+` or `-` in diff output.
|
|
40
|
-
*
|
|
41
|
-
* @param diffType Difference type, either added or removed
|
|
42
|
-
*
|
|
43
|
-
* @returns A string representing the sign.
|
|
44
|
-
*
|
|
45
|
-
* @example Usage
|
|
46
|
-
* ```ts
|
|
47
|
-
* import { createSign } from "@std/internal";
|
|
48
|
-
* import { assertEquals } from "@std/assert";
|
|
49
|
-
*
|
|
50
|
-
* assertEquals(createSign("added"), "+ ");
|
|
51
|
-
* assertEquals(createSign("removed"), "- ");
|
|
52
|
-
* assertEquals(createSign("common"), " ");
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export function createSign(diffType) {
|
|
56
|
-
switch (diffType) {
|
|
57
|
-
case "added":
|
|
58
|
-
return "+ ";
|
|
59
|
-
case "removed":
|
|
60
|
-
return "- ";
|
|
61
|
-
default:
|
|
62
|
-
return " ";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Builds a message based on the provided diff result.
|
|
67
|
-
*
|
|
68
|
-
* @param diffResult The diff result array.
|
|
69
|
-
* @param options Optional parameters for customizing the message.
|
|
70
|
-
*
|
|
71
|
-
* @returns An array of strings representing the built message.
|
|
72
|
-
*
|
|
73
|
-
* @example Usage
|
|
74
|
-
* ```ts no-assert
|
|
75
|
-
* import { diffStr, buildMessage } from "@std/internal";
|
|
76
|
-
*
|
|
77
|
-
* const diffResult = diffStr("Hello, world!", "Hello, world");
|
|
78
|
-
*
|
|
79
|
-
* console.log(buildMessage(diffResult));
|
|
80
|
-
* // [
|
|
81
|
-
* // "",
|
|
82
|
-
* // "",
|
|
83
|
-
* // " [Diff] Actual / Expected",
|
|
84
|
-
* // "",
|
|
85
|
-
* // "",
|
|
86
|
-
* // "- Hello, world!",
|
|
87
|
-
* // "+ Hello, world",
|
|
88
|
-
* // "",
|
|
89
|
-
* // ]
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
export function buildMessage(diffResult, options = {}) {
|
|
93
|
-
const { stringDiff = false } = options;
|
|
94
|
-
const messages = [
|
|
95
|
-
"",
|
|
96
|
-
"",
|
|
97
|
-
` ${gray(bold("[Diff]"))} ${red(bold("Actual"))} / ${green(bold("Expected"))}`,
|
|
98
|
-
"",
|
|
99
|
-
"",
|
|
100
|
-
];
|
|
101
|
-
const diffMessages = diffResult.map((result) => {
|
|
102
|
-
var _a, _b;
|
|
103
|
-
const color = createColor(result.type);
|
|
104
|
-
const line = (_b = (_a = result.details) === null || _a === void 0 ? void 0 : _a.map((detail) => detail.type !== "common"
|
|
105
|
-
? createColor(detail.type, true)(detail.value)
|
|
106
|
-
: detail.value).join("")) !== null && _b !== void 0 ? _b : result.value;
|
|
107
|
-
return color(`${createSign(result.type)}${line}`);
|
|
108
|
-
});
|
|
109
|
-
messages.push(...(stringDiff ? [diffMessages.join("")] : diffMessages), "");
|
|
110
|
-
return messages;
|
|
111
|
-
}
|