@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,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
-
// This module is browser compatible.
|
|
4
|
-
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
5
|
-
// deno-lint-ignore-file no-explicit-any ban-types
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.fn = fn;
|
|
8
|
-
/**
|
|
9
|
-
* This module contains a function to mock functions for testing and assertions.
|
|
10
|
-
*
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { fn, expect } from "@std/expect";
|
|
13
|
-
*
|
|
14
|
-
* Deno.test("example", () => {
|
|
15
|
-
* const mockFn = fn((a: number, b: number) => a + b);
|
|
16
|
-
* const result = mockFn(1, 2);
|
|
17
|
-
* expect(result).toEqual(3);
|
|
18
|
-
* expect(mockFn).toHaveBeenCalledWith(1, 2);
|
|
19
|
-
* expect(mockFn).toHaveBeenCalledTimes(1);
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @module
|
|
24
|
-
*/
|
|
25
|
-
const _mock_util_js_1 = require("./_mock_util.js");
|
|
26
|
-
/**
|
|
27
|
-
* Creates a mock function that can be used for testing and assertions.
|
|
28
|
-
*
|
|
29
|
-
* @param stubs Functions to be used as stubs for different calls.
|
|
30
|
-
* @returns A mock function that keeps track of calls and returns values based on the provided stubs.
|
|
31
|
-
*
|
|
32
|
-
* @example Usage
|
|
33
|
-
* ```ts no-assert
|
|
34
|
-
* import { fn, expect } from "@std/expect";
|
|
35
|
-
*
|
|
36
|
-
* Deno.test("example", () => {
|
|
37
|
-
* const mockFn = fn(
|
|
38
|
-
* (a: number, b: number) => a + b,
|
|
39
|
-
* (a: number, b: number) => a - b
|
|
40
|
-
* );
|
|
41
|
-
* const result = mockFn(1, 2);
|
|
42
|
-
* expect(result).toEqual(3);
|
|
43
|
-
* expect(mockFn).toHaveBeenCalledWith(1, 2);
|
|
44
|
-
* expect(mockFn).toHaveBeenCalledTimes(1);
|
|
45
|
-
*
|
|
46
|
-
* const result2 = mockFn(3, 2);
|
|
47
|
-
* expect(result2).toEqual(1);
|
|
48
|
-
* expect(mockFn).toHaveBeenCalledWith(3, 2);
|
|
49
|
-
* expect(mockFn).toHaveBeenCalledTimes(2);
|
|
50
|
-
* });
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
function fn(...stubs) {
|
|
54
|
-
const calls = [];
|
|
55
|
-
const f = (...args) => {
|
|
56
|
-
const stub = stubs.length === 1
|
|
57
|
-
// keep reusing the first
|
|
58
|
-
? stubs[0]
|
|
59
|
-
// pick the exact mock for the current call
|
|
60
|
-
: stubs[calls.length];
|
|
61
|
-
try {
|
|
62
|
-
const returned = stub ? stub(...args) : undefined;
|
|
63
|
-
calls.push({
|
|
64
|
-
args,
|
|
65
|
-
returned,
|
|
66
|
-
timestamp: Date.now(),
|
|
67
|
-
returns: true,
|
|
68
|
-
throws: false,
|
|
69
|
-
});
|
|
70
|
-
return returned;
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
calls.push({
|
|
74
|
-
args,
|
|
75
|
-
timestamp: Date.now(),
|
|
76
|
-
returns: false,
|
|
77
|
-
thrown: err,
|
|
78
|
-
throws: true,
|
|
79
|
-
});
|
|
80
|
-
throw err;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
Object.defineProperty(f, _mock_util_js_1.MOCK_SYMBOL, {
|
|
84
|
-
value: { calls },
|
|
85
|
-
writable: false,
|
|
86
|
-
});
|
|
87
|
-
return f;
|
|
88
|
-
}
|
|
@@ -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,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
-
// Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
|
|
4
|
-
// This module is browser compatible.
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
/**
|
|
8
|
-
* This module provides Jest compatible expect assertion functionality.
|
|
9
|
-
*
|
|
10
|
-
* ```ts no-assert
|
|
11
|
-
* import { expect } from "@std/expect";
|
|
12
|
-
*
|
|
13
|
-
* const x = 6 * 7;
|
|
14
|
-
* expect(x).toEqual(42);
|
|
15
|
-
* expect(x).not.toEqual(0);
|
|
16
|
-
*
|
|
17
|
-
* await expect(Promise.resolve(x)).resolves.toEqual(42);
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* Currently this module supports the following functions:
|
|
21
|
-
* - Common matchers:
|
|
22
|
-
* - {@linkcode Expected.toBe | toBe}
|
|
23
|
-
* - {@linkcode Expected.toEqual | toEqual}
|
|
24
|
-
* - {@linkcode Expected.toStrictEqual | toStrictEqual}
|
|
25
|
-
* - {@linkcode Expected.toMatch | toMatch}
|
|
26
|
-
* - {@linkcode Expected.toMatchObject | toMatchObject}
|
|
27
|
-
* - {@linkcode Expected.toBeDefined | toBeDefined}
|
|
28
|
-
* - {@linkcode Expected.toBeUndefined | toBeUndefined}
|
|
29
|
-
* - {@linkcode Expected.toBeNull | toBeNull}
|
|
30
|
-
* - {@linkcode Expected.toBeNaN | toBeNaN}
|
|
31
|
-
* - {@linkcode Expected.toBeTruthy | toBeTruthy}
|
|
32
|
-
* - {@linkcode Expected.toBeFalsy | toBeFalsy}
|
|
33
|
-
* - {@linkcode Expected.toContain | toContain}
|
|
34
|
-
* - {@linkcode Expected.toContainEqual | toContainEqual}
|
|
35
|
-
* - {@linkcode Expected.toHaveLength | toHaveLength}
|
|
36
|
-
* - {@linkcode Expected.toBeGreaterThan | toBeGreaterThan}
|
|
37
|
-
* - {@linkcode Expected.toBeGreaterThanOrEqual | toBeGreaterThanOrEqual}
|
|
38
|
-
* - {@linkcode Expected.toBeLessThan | toBeLessThan}
|
|
39
|
-
* - {@linkcode Expected.toBeLessThanOrEqual | toBeLessThanOrEqual}
|
|
40
|
-
* - {@linkcode Expected.toBeCloseTo | toBeCloseTo}
|
|
41
|
-
* - {@linkcode Expected.toBeInstanceOf | toBeInstanceOf}
|
|
42
|
-
* - {@linkcode Expected.toThrow | toThrow}
|
|
43
|
-
* - {@linkcode Expected.toHaveProperty | toHaveProperty}
|
|
44
|
-
* - Mock related matchers:
|
|
45
|
-
* - {@linkcode Expected.toHaveBeenCalled | toHaveBeenCalled}
|
|
46
|
-
* - {@linkcode Expected.toHaveBeenCalledTimes | toHaveBeenCalledTimes}
|
|
47
|
-
* - {@linkcode Expected.toHaveBeenCalledWith | toHaveBeenCalledWith}
|
|
48
|
-
* - {@linkcode Expected.toHaveBeenLastCalledWith | toHaveBeenLastCalledWith}
|
|
49
|
-
* - {@linkcode Expected.toHaveBeenNthCalledWith | toHaveBeenNthCalledWith}
|
|
50
|
-
* - {@linkcode Expected.toHaveReturned | toHaveReturned}
|
|
51
|
-
* - {@linkcode Expected.toHaveReturnedTimes | toHaveReturnedTimes}
|
|
52
|
-
* - {@linkcode Expected.toHaveReturnedWith | toHaveReturnedWith}
|
|
53
|
-
* - {@linkcode Expected.toHaveLastReturnedWith | toHaveLastReturnedWith}
|
|
54
|
-
* - {@linkcode Expected.toHaveNthReturnedWith | toHaveNthReturnedWith}
|
|
55
|
-
* - Asymmetric matchers:
|
|
56
|
-
* - {@linkcode expect.anything}
|
|
57
|
-
* - {@linkcode expect.any}
|
|
58
|
-
* - {@linkcode expect.arrayContaining}
|
|
59
|
-
* - {@linkcode expect.closeTo}
|
|
60
|
-
* - {@linkcode expect.stringContaining}
|
|
61
|
-
* - {@linkcode expect.stringMatching}
|
|
62
|
-
* - Utilities:
|
|
63
|
-
* - {@linkcode expect.addEqualityTester}
|
|
64
|
-
* - {@linkcode expect.extend}
|
|
65
|
-
* - {@linkcode expect.hasAssertions}
|
|
66
|
-
*
|
|
67
|
-
* Only these functions are still not available:
|
|
68
|
-
* - Matchers:
|
|
69
|
-
* - `toMatchSnapShot`
|
|
70
|
-
* - `toMatchInlineSnapshot`
|
|
71
|
-
* - `toThrowErrorMatchingSnapshot`
|
|
72
|
-
* - `toThrowErrorMatchingInlineSnapshot`
|
|
73
|
-
* - Asymmetric matchers:
|
|
74
|
-
* - `expect.objectContaining`
|
|
75
|
-
* - `expect.not.objectContaining`
|
|
76
|
-
* - Utilities:
|
|
77
|
-
* - `expect.assertions`
|
|
78
|
-
* - `expect.addSnapshotSerializer`
|
|
79
|
-
*
|
|
80
|
-
* The tracking issue to add support for unsupported parts of the API is
|
|
81
|
-
* {@link https://github.com/denoland/std/issues/3964}.
|
|
82
|
-
*
|
|
83
|
-
* This module is largely inspired by
|
|
84
|
-
* {@link https://github.com/allain/expect | x/expect} module by
|
|
85
|
-
* {@link https://github.com/allain | Allain Lalonde}.
|
|
86
|
-
*
|
|
87
|
-
* @module
|
|
88
|
-
*/
|
|
89
|
-
tslib_1.__exportStar(require("./expect.js"), exports);
|
|
90
|
-
tslib_1.__exportStar(require("./fn.js"), exports);
|
|
@@ -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,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
-
var _AssertionState_instances, _AssertionState_state, _AssertionState_resetAssertionState;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.AssertionState = void 0;
|
|
6
|
-
exports.getAssertionState = getAssertionState;
|
|
7
|
-
const tslib_1 = require("tslib");
|
|
8
|
-
/**
|
|
9
|
-
* Check the test suite internal state
|
|
10
|
-
*
|
|
11
|
-
* @example Usage
|
|
12
|
-
* ```ts ignore
|
|
13
|
-
* import { AssertionState } from "@std/internal";
|
|
14
|
-
*
|
|
15
|
-
* const assertionState = new AssertionState();
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
class AssertionState {
|
|
19
|
-
constructor() {
|
|
20
|
-
_AssertionState_instances.add(this);
|
|
21
|
-
_AssertionState_state.set(this, void 0);
|
|
22
|
-
tslib_1.__classPrivateFieldSet(this, _AssertionState_state, {
|
|
23
|
-
assertionCheck: false,
|
|
24
|
-
assertionTriggered: false,
|
|
25
|
-
}, "f");
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* If `expect.hasAssertions` called, then through this method to update #state.assertionCheck value.
|
|
29
|
-
*
|
|
30
|
-
* @param val Set #state.assertionCheck's value
|
|
31
|
-
*
|
|
32
|
-
* @example Usage
|
|
33
|
-
* ```ts ignore
|
|
34
|
-
* import { AssertionState } from "@std/internal";
|
|
35
|
-
*
|
|
36
|
-
* const assertionState = new AssertionState();
|
|
37
|
-
* assertionState.setAssertionCheck(true);
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
setAssertionCheck(val) {
|
|
41
|
-
tslib_1.__classPrivateFieldGet(this, _AssertionState_state, "f").assertionCheck = val;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* If any matchers was called, `#state.assertionTriggered` will be set through this method.
|
|
45
|
-
*
|
|
46
|
-
* @param val Set #state.assertionTriggered's value
|
|
47
|
-
*
|
|
48
|
-
* @example Usage
|
|
49
|
-
* ```ts ignore
|
|
50
|
-
* import { AssertionState } from "@std/internal";
|
|
51
|
-
*
|
|
52
|
-
* const assertionState = new AssertionState();
|
|
53
|
-
* assertionState.setAssertionTriggered(true);
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
setAssertionTriggered(val) {
|
|
57
|
-
tslib_1.__classPrivateFieldGet(this, _AssertionState_state, "f").assertionTriggered = val;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Check Assertion internal state, if `#state.assertionCheck` is set true, but
|
|
61
|
-
* `#state.assertionTriggered` is still false, then should throw an Assertion Error.
|
|
62
|
-
*
|
|
63
|
-
* @returns a boolean value, that the test suite is satisfied with the check. If not,
|
|
64
|
-
* it should throw an AssertionError.
|
|
65
|
-
*
|
|
66
|
-
* @example Usage
|
|
67
|
-
* ```ts ignore
|
|
68
|
-
* import { AssertionState } from "@std/internal";
|
|
69
|
-
*
|
|
70
|
-
* const assertionState = new AssertionState();
|
|
71
|
-
* if (assertionState.checkAssertionErrorStateAndReset()) {
|
|
72
|
-
* // throw AssertionError("");
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
checkAssertionErrorStateAndReset() {
|
|
77
|
-
const result = tslib_1.__classPrivateFieldGet(this, _AssertionState_state, "f").assertionCheck &&
|
|
78
|
-
!tslib_1.__classPrivateFieldGet(this, _AssertionState_state, "f").assertionTriggered;
|
|
79
|
-
tslib_1.__classPrivateFieldGet(this, _AssertionState_instances, "m", _AssertionState_resetAssertionState).call(this);
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.AssertionState = AssertionState;
|
|
84
|
-
_AssertionState_state = new WeakMap(), _AssertionState_instances = new WeakSet(), _AssertionState_resetAssertionState = function _AssertionState_resetAssertionState() {
|
|
85
|
-
tslib_1.__classPrivateFieldSet(this, _AssertionState_state, {
|
|
86
|
-
assertionCheck: false,
|
|
87
|
-
assertionTriggered: false,
|
|
88
|
-
}, "f");
|
|
89
|
-
};
|
|
90
|
-
const assertionState = new AssertionState();
|
|
91
|
-
/**
|
|
92
|
-
* return an instance of AssertionState
|
|
93
|
-
*
|
|
94
|
-
* @returns AssertionState
|
|
95
|
-
*
|
|
96
|
-
* @example Usage
|
|
97
|
-
* ```ts ignore
|
|
98
|
-
* import { getAssertionState } from "@std/internal";
|
|
99
|
-
*
|
|
100
|
-
* const assertionState = getAssertionState();
|
|
101
|
-
* assertionState.setAssertionTriggered(true);
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
function getAssertionState() {
|
|
105
|
-
return assertionState;
|
|
106
|
-
}
|
|
@@ -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,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
-
// This module is browser compatible.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.createColor = createColor;
|
|
6
|
-
exports.createSign = createSign;
|
|
7
|
-
exports.buildMessage = buildMessage;
|
|
8
|
-
const styles_js_1 = require("./styles.js");
|
|
9
|
-
/**
|
|
10
|
-
* Colors the output of assertion diffs.
|
|
11
|
-
*
|
|
12
|
-
* @param diffType Difference type, either added or removed.
|
|
13
|
-
* @param background If true, colors the background instead of the text.
|
|
14
|
-
*
|
|
15
|
-
* @returns A function that colors the input string.
|
|
16
|
-
*
|
|
17
|
-
* @example Usage
|
|
18
|
-
* ```ts
|
|
19
|
-
* import { createColor } from "@std/internal";
|
|
20
|
-
* import { assertEquals } from "@std/assert";
|
|
21
|
-
* import { bold, green, red, white } from "@std/fmt/colors";
|
|
22
|
-
*
|
|
23
|
-
* assertEquals(createColor("added")("foo"), green(bold("foo")));
|
|
24
|
-
* assertEquals(createColor("removed")("foo"), red(bold("foo")));
|
|
25
|
-
* assertEquals(createColor("common")("foo"), white("foo"));
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
function createColor(diffType,
|
|
29
|
-
/**
|
|
30
|
-
* TODO(@littledivy): Remove this when we can detect true color terminals. See
|
|
31
|
-
* https://github.com/denoland/deno_std/issues/2575.
|
|
32
|
-
*/
|
|
33
|
-
background = false) {
|
|
34
|
-
switch (diffType) {
|
|
35
|
-
case "added":
|
|
36
|
-
return (s) => background ? (0, styles_js_1.bgGreen)((0, styles_js_1.white)(s)) : (0, styles_js_1.green)((0, styles_js_1.bold)(s));
|
|
37
|
-
case "removed":
|
|
38
|
-
return (s) => background ? (0, styles_js_1.bgRed)((0, styles_js_1.white)(s)) : (0, styles_js_1.red)((0, styles_js_1.bold)(s));
|
|
39
|
-
default:
|
|
40
|
-
return styles_js_1.white;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Prefixes `+` or `-` in diff output.
|
|
45
|
-
*
|
|
46
|
-
* @param diffType Difference type, either added or removed
|
|
47
|
-
*
|
|
48
|
-
* @returns A string representing the sign.
|
|
49
|
-
*
|
|
50
|
-
* @example Usage
|
|
51
|
-
* ```ts
|
|
52
|
-
* import { createSign } from "@std/internal";
|
|
53
|
-
* import { assertEquals } from "@std/assert";
|
|
54
|
-
*
|
|
55
|
-
* assertEquals(createSign("added"), "+ ");
|
|
56
|
-
* assertEquals(createSign("removed"), "- ");
|
|
57
|
-
* assertEquals(createSign("common"), " ");
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
function createSign(diffType) {
|
|
61
|
-
switch (diffType) {
|
|
62
|
-
case "added":
|
|
63
|
-
return "+ ";
|
|
64
|
-
case "removed":
|
|
65
|
-
return "- ";
|
|
66
|
-
default:
|
|
67
|
-
return " ";
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Builds a message based on the provided diff result.
|
|
72
|
-
*
|
|
73
|
-
* @param diffResult The diff result array.
|
|
74
|
-
* @param options Optional parameters for customizing the message.
|
|
75
|
-
*
|
|
76
|
-
* @returns An array of strings representing the built message.
|
|
77
|
-
*
|
|
78
|
-
* @example Usage
|
|
79
|
-
* ```ts no-assert
|
|
80
|
-
* import { diffStr, buildMessage } from "@std/internal";
|
|
81
|
-
*
|
|
82
|
-
* const diffResult = diffStr("Hello, world!", "Hello, world");
|
|
83
|
-
*
|
|
84
|
-
* console.log(buildMessage(diffResult));
|
|
85
|
-
* // [
|
|
86
|
-
* // "",
|
|
87
|
-
* // "",
|
|
88
|
-
* // " [Diff] Actual / Expected",
|
|
89
|
-
* // "",
|
|
90
|
-
* // "",
|
|
91
|
-
* // "- Hello, world!",
|
|
92
|
-
* // "+ Hello, world",
|
|
93
|
-
* // "",
|
|
94
|
-
* // ]
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
function buildMessage(diffResult, options = {}) {
|
|
98
|
-
const { stringDiff = false } = options;
|
|
99
|
-
const messages = [
|
|
100
|
-
"",
|
|
101
|
-
"",
|
|
102
|
-
` ${(0, styles_js_1.gray)((0, styles_js_1.bold)("[Diff]"))} ${(0, styles_js_1.red)((0, styles_js_1.bold)("Actual"))} / ${(0, styles_js_1.green)((0, styles_js_1.bold)("Expected"))}`,
|
|
103
|
-
"",
|
|
104
|
-
"",
|
|
105
|
-
];
|
|
106
|
-
const diffMessages = diffResult.map((result) => {
|
|
107
|
-
var _a, _b;
|
|
108
|
-
const color = createColor(result.type);
|
|
109
|
-
const line = (_b = (_a = result.details) === null || _a === void 0 ? void 0 : _a.map((detail) => detail.type !== "common"
|
|
110
|
-
? createColor(detail.type, true)(detail.value)
|
|
111
|
-
: detail.value).join("")) !== null && _b !== void 0 ? _b : result.value;
|
|
112
|
-
return color(`${createSign(result.type)}${line}`);
|
|
113
|
-
});
|
|
114
|
-
messages.push(...(stringDiff ? [diffMessages.join("")] : diffMessages), "");
|
|
115
|
-
return messages;
|
|
116
|
-
}
|