@goast/core 0.4.1 → 0.4.2
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/esm/src/transform/helpers.d.ts.map +1 -1
- package/esm/src/transform/helpers.js +5 -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 +1 -4
- package/script/src/transform/helpers.d.ts.map +1 -1
- package/script/src/transform/helpers.js +5 -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/src/src/transform/helpers.ts +6 -1
- package/src/src/utils/source-builder.ts +9 -1
- package/esm/_dnt.test_polyfills.d.ts +0 -29
- package/esm/_dnt.test_polyfills.d.ts.map +0 -1
- package/esm/_dnt.test_polyfills.js +0 -31
- package/esm/_dnt.test_shims.d.ts +0 -14
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/_dnt.test_shims.js +0 -69
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -57
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +0 -20
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +0 -14
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +0 -43
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +0 -17
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +0 -26
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.js +0 -13
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +0 -46
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +0 -161
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +0 -6
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.js +0 -191
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +0 -12
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +0 -34
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.js +0 -714
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +0 -843
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.js +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.js +0 -218
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +0 -60
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.js +0 -523
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.js +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +0 -86
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.js +0 -88
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +0 -160
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +0 -199
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -111
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -277
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -180
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +0 -37
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -207
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -2
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +0 -79
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +0 -380
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +0 -738
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.js +0 -654
- package/esm/src/collect/helpers.test.d.ts +0 -2
- package/esm/src/collect/helpers.test.d.ts.map +0 -1
- package/esm/src/collect/helpers.test.js +0 -77
- package/esm/src/transform/helpers.test.d.ts +0 -2
- package/esm/src/transform/helpers.test.d.ts.map +0 -1
- package/esm/src/transform/helpers.test.js +0 -265
- package/esm/src/utils/action-provider.test.d.ts +0 -2
- package/esm/src/utils/action-provider.test.d.ts.map +0 -1
- package/esm/src/utils/action-provider.test.js +0 -28
- package/esm/src/utils/common.utils.test.d.ts +0 -2
- package/esm/src/utils/common.utils.test.d.ts.map +0 -1
- package/esm/src/utils/common.utils.test.js +0 -18
- package/esm/src/utils/condition.test.d.ts +0 -2
- package/esm/src/utils/condition.test.d.ts.map +0 -1
- package/esm/src/utils/condition.test.js +0 -31
- package/esm/src/utils/endpoint.utils.test.d.ts +0 -2
- package/esm/src/utils/endpoint.utils.test.d.ts.map +0 -1
- package/esm/src/utils/endpoint.utils.test.js +0 -31
- package/esm/src/utils/factory.test.d.ts +0 -2
- package/esm/src/utils/factory.test.d.ts.map +0 -1
- package/esm/src/utils/factory.test.js +0 -34
- package/esm/src/utils/generator.utils.test.d.ts +0 -2
- package/esm/src/utils/generator.utils.test.d.ts.map +0 -1
- package/esm/src/utils/generator.utils.test.js +0 -13
- package/esm/src/utils/object.utils.test.d.ts +0 -2
- package/esm/src/utils/object.utils.test.d.ts.map +0 -1
- package/esm/src/utils/object.utils.test.js +0 -29
- package/esm/src/utils/schema.utils.test.d.ts +0 -2
- package/esm/src/utils/schema.utils.test.d.ts.map +0 -1
- package/esm/src/utils/schema.utils.test.js +0 -70
- package/esm/src/utils/source-builder.test.d.ts +0 -2
- package/esm/src/utils/source-builder.test.d.ts.map +0 -1
- package/esm/src/utils/source-builder.test.js +0 -505
- package/esm/src/utils/string-builder/string-builder.test.d.ts +0 -2
- package/esm/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
- package/esm/src/utils/string-builder/string-builder.test.js +0 -163
- package/esm/src/utils/string.utils.test.d.ts +0 -2
- package/esm/src/utils/string.utils.test.d.ts.map +0 -1
- package/esm/src/utils/string.utils.test.js +0 -528
- package/esm/tests/openapi.test.d.ts +0 -2
- package/esm/tests/openapi.test.d.ts.map +0 -1
- package/esm/tests/openapi.test.js +0 -33
- package/esm/tests/schema-factory.d.ts +0 -42
- package/esm/tests/schema-factory.d.ts.map +0 -1
- package/esm/tests/schema-factory.js +0 -138
- package/script/_dnt.test_polyfills.d.ts +0 -29
- package/script/_dnt.test_polyfills.d.ts.map +0 -1
- package/script/_dnt.test_polyfills.js +0 -32
- package/script/_dnt.test_shims.d.ts +0 -14
- package/script/_dnt.test_shims.d.ts.map +0 -1
- package/script/_dnt.test_shims.js +0 -79
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +0 -26
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/false.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +0 -20
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +0 -32
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +0 -46
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.js +0 -18
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +0 -46
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +0 -183
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +0 -6
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.js +0 -33
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.js +0 -194
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +0 -34
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.js +0 -748
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +0 -11
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +0 -843
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.js +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.js +0 -226
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.js +0 -527
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.js +0 -88
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +0 -86
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.js +0 -91
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +0 -160
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +0 -204
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -116
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -284
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -186
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/format.js +0 -41
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -220
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +0 -79
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +0 -385
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +0 -738
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.js +0 -665
- package/script/src/collect/helpers.test.d.ts +0 -2
- package/script/src/collect/helpers.test.d.ts.map +0 -1
- package/script/src/collect/helpers.test.js +0 -79
- package/script/src/transform/helpers.test.d.ts +0 -2
- package/script/src/transform/helpers.test.d.ts.map +0 -1
- package/script/src/transform/helpers.test.js +0 -267
- package/script/src/utils/action-provider.test.d.ts +0 -2
- package/script/src/utils/action-provider.test.d.ts.map +0 -1
- package/script/src/utils/action-provider.test.js +0 -30
- package/script/src/utils/common.utils.test.d.ts +0 -2
- package/script/src/utils/common.utils.test.d.ts.map +0 -1
- package/script/src/utils/common.utils.test.js +0 -20
- package/script/src/utils/condition.test.d.ts +0 -2
- package/script/src/utils/condition.test.d.ts.map +0 -1
- package/script/src/utils/condition.test.js +0 -33
- package/script/src/utils/endpoint.utils.test.d.ts +0 -2
- package/script/src/utils/endpoint.utils.test.d.ts.map +0 -1
- package/script/src/utils/endpoint.utils.test.js +0 -33
- package/script/src/utils/factory.test.d.ts +0 -2
- package/script/src/utils/factory.test.d.ts.map +0 -1
- package/script/src/utils/factory.test.js +0 -36
- package/script/src/utils/generator.utils.test.d.ts +0 -2
- package/script/src/utils/generator.utils.test.d.ts.map +0 -1
- package/script/src/utils/generator.utils.test.js +0 -15
- package/script/src/utils/object.utils.test.d.ts +0 -2
- package/script/src/utils/object.utils.test.d.ts.map +0 -1
- package/script/src/utils/object.utils.test.js +0 -31
- package/script/src/utils/schema.utils.test.d.ts +0 -2
- package/script/src/utils/schema.utils.test.d.ts.map +0 -1
- package/script/src/utils/schema.utils.test.js +0 -72
- package/script/src/utils/source-builder.test.d.ts +0 -2
- package/script/src/utils/source-builder.test.d.ts.map +0 -1
- package/script/src/utils/source-builder.test.js +0 -507
- package/script/src/utils/string-builder/string-builder.test.d.ts +0 -2
- package/script/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
- package/script/src/utils/string-builder/string-builder.test.js +0 -165
- package/script/src/utils/string.utils.test.d.ts +0 -2
- package/script/src/utils/string.utils.test.d.ts.map +0 -1
- package/script/src/utils/string.utils.test.js +0 -530
- package/script/tests/openapi.test.d.ts +0 -2
- package/script/tests/openapi.test.d.ts.map +0 -1
- package/script/tests/openapi.test.js +0 -35
- package/script/tests/schema-factory.d.ts +0 -42
- package/script/tests/schema-factory.d.ts.map +0 -1
- package/script/tests/schema-factory.js +0 -162
- package/src/_dnt.test_polyfills.ts +0 -70
- package/src/_dnt.test_shims.ts +0 -72
- package/src/deps/jsr.io/@std/assert/1.0.11/assertion_error.ts +0 -31
- package/src/deps/jsr.io/@std/assert/1.0.11/false.ts +0 -26
- package/src/deps/jsr.io/@std/assert/1.0.11/instance_of.ts +0 -64
- package/src/deps/jsr.io/@std/assert/1.0.11/match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.11/not_instance_of.ts +0 -33
- package/src/deps/jsr.io/@std/assert/1.0.11/not_match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.ts +0 -42
- package/src/deps/jsr.io/@std/assert/1.0.11/strict_equals.ts +0 -67
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_equals.ts +0 -38
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.ts +0 -54
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.ts +0 -35
- package/src/deps/jsr.io/@std/expect/1.0.12/_assertions.ts +0 -18
- package/src/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.ts +0 -198
- package/src/deps/jsr.io/@std/expect/1.0.12/_build_message.ts +0 -51
- package/src/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.ts +0 -19
- package/src/deps/jsr.io/@std/expect/1.0.12/_equal.ts +0 -230
- package/src/deps/jsr.io/@std/expect/1.0.12/_extend.ts +0 -16
- package/src/deps/jsr.io/@std/expect/1.0.12/_inspect_args.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.12/_matchers.ts +0 -1028
- package/src/deps/jsr.io/@std/expect/1.0.12/_mock_util.ts +0 -22
- package/src/deps/jsr.io/@std/expect/1.0.12/_serializer.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.12/_types.ts +0 -923
- package/src/deps/jsr.io/@std/expect/1.0.12/_utils.ts +0 -283
- package/src/deps/jsr.io/@std/expect/1.0.12/expect.ts +0 -620
- package/src/deps/jsr.io/@std/expect/1.0.12/fn.ts +0 -91
- package/src/deps/jsr.io/@std/expect/1.0.12/mod.ts +0 -89
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +0 -214
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +0 -134
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +0 -317
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +0 -204
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +0 -39
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +0 -233
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +0 -18
- package/src/deps/jsr.io/@std/testing/1.0.9/_test_suite.ts +0 -448
- package/src/deps/jsr.io/@std/testing/1.0.9/bdd.ts +0 -1288
- package/src/src/collect/helpers.test.ts +0 -91
- package/src/src/transform/helpers.test.ts +0 -316
- package/src/src/utils/action-provider.test.ts +0 -32
- package/src/src/utils/common.utils.test.ts +0 -22
- package/src/src/utils/condition.test.ts +0 -36
- package/src/src/utils/endpoint.utils.test.ts +0 -36
- package/src/src/utils/factory.test.ts +0 -31
- package/src/src/utils/generator.utils.test.ts +0 -16
- package/src/src/utils/object.utils.test.ts +0 -33
- package/src/src/utils/schema.utils.test.ts +0 -88
- package/src/src/utils/source-builder.test.ts +0 -657
- package/src/src/utils/string-builder/string-builder.test.ts +0 -188
- package/src/src/utils/string.utils.test.ts +0 -691
- package/src/tests/openapi.test.ts +0 -50
- package/src/tests/schema-factory.ts +0 -185
- package/test_runner.js +0 -221
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("../../_dnt.test_polyfills.js");
|
|
4
|
-
const mod_js_1 = require("../../deps/jsr.io/@std/expect/1.0.12/mod.js");
|
|
5
|
-
const bdd_js_1 = require("../../deps/jsr.io/@std/testing/1.0.9/bdd.js");
|
|
6
|
-
const schema_factory_js_1 = require("../../tests/schema-factory.js");
|
|
7
|
-
const schema_utils_js_1 = require("./schema.utils.js");
|
|
8
|
-
(0, bdd_js_1.describe)('resolveAnyOfAndAllOf', () => {
|
|
9
|
-
(0, bdd_js_1.it)('should return undefined if the schema is not valid for merge and ignoreNonObjectParts is false', () => {
|
|
10
|
-
const schema = (0, schema_factory_js_1.createCombinedSchema)({
|
|
11
|
-
anyOf: [(0, schema_factory_js_1.createStringSchema)()],
|
|
12
|
-
});
|
|
13
|
-
const result = (0, schema_utils_js_1.resolveAnyOfAndAllOf)(schema, false);
|
|
14
|
-
(0, mod_js_1.expect)(result).toBeUndefined();
|
|
15
|
-
});
|
|
16
|
-
(0, bdd_js_1.it)('should resolve schema from allOf and anyOf', () => {
|
|
17
|
-
const prop0 = (0, schema_factory_js_1.createUnknownProperty)('prop0');
|
|
18
|
-
const prop1 = (0, schema_factory_js_1.createUnknownProperty)('prop1');
|
|
19
|
-
const prop2 = (0, schema_factory_js_1.createUnknownProperty)('prop2');
|
|
20
|
-
const schema = (0, schema_factory_js_1.createObjectSchema)({
|
|
21
|
-
name: 'root',
|
|
22
|
-
properties: [prop0],
|
|
23
|
-
required: ['prop0'],
|
|
24
|
-
allOf: [(0, schema_factory_js_1.createObjectSchema)({ properties: [prop1], required: ['prop1'] })],
|
|
25
|
-
anyOf: [(0, schema_factory_js_1.createObjectSchema)({ properties: [prop2], required: ['prop2'] })],
|
|
26
|
-
});
|
|
27
|
-
const expectedResult = mod_js_1.expect.objectContaining((0, schema_factory_js_1.createObjectSchema)({
|
|
28
|
-
name: 'root',
|
|
29
|
-
properties: [prop0, prop1, prop2],
|
|
30
|
-
required: ['prop0', 'prop1'],
|
|
31
|
-
}));
|
|
32
|
-
const result = (0, schema_utils_js_1.resolveAnyOfAndAllOf)(schema, true);
|
|
33
|
-
(0, mod_js_1.expect)(result).toEqual(expectedResult);
|
|
34
|
-
});
|
|
35
|
-
(0, bdd_js_1.it)('should merge properties from allOf and anyOf recursively', () => {
|
|
36
|
-
const prop1 = (0, schema_factory_js_1.createUnknownProperty)('prop1');
|
|
37
|
-
const prop2 = (0, schema_factory_js_1.createUnknownProperty)('prop2');
|
|
38
|
-
const prop3 = (0, schema_factory_js_1.createUnknownProperty)('prop3');
|
|
39
|
-
const schema = (0, schema_factory_js_1.createCombinedSchema)({
|
|
40
|
-
name: 'root',
|
|
41
|
-
allOf: [
|
|
42
|
-
(0, schema_factory_js_1.createObjectSchema)({
|
|
43
|
-
properties: [prop1],
|
|
44
|
-
required: ['prop1'],
|
|
45
|
-
}),
|
|
46
|
-
],
|
|
47
|
-
anyOf: [
|
|
48
|
-
(0, schema_factory_js_1.createCombinedSchema)({
|
|
49
|
-
allOf: [
|
|
50
|
-
(0, schema_factory_js_1.createObjectSchema)({
|
|
51
|
-
properties: [prop2],
|
|
52
|
-
required: ['prop2'],
|
|
53
|
-
}),
|
|
54
|
-
],
|
|
55
|
-
anyOf: [
|
|
56
|
-
(0, schema_factory_js_1.createObjectSchema)({
|
|
57
|
-
properties: [prop3],
|
|
58
|
-
required: ['prop3'],
|
|
59
|
-
}),
|
|
60
|
-
],
|
|
61
|
-
}),
|
|
62
|
-
],
|
|
63
|
-
});
|
|
64
|
-
const expectedResult = mod_js_1.expect.objectContaining((0, schema_factory_js_1.createObjectSchema)({
|
|
65
|
-
name: 'root',
|
|
66
|
-
properties: [prop1, prop2, prop3],
|
|
67
|
-
required: ['prop1'],
|
|
68
|
-
}));
|
|
69
|
-
const result = (0, schema_utils_js_1.resolveAnyOfAndAllOf)(schema, true);
|
|
70
|
-
(0, mod_js_1.expect)(result).toEqual(expectedResult);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"source-builder.test.d.ts","sourceRoot":"","sources":["../../../src/src/utils/source-builder.test.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC"}
|
|
@@ -1,507 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("../../_dnt.test_polyfills.js");
|
|
4
|
-
const node_os_1 = require("node:os");
|
|
5
|
-
const mod_js_1 = require("../../deps/jsr.io/@std/expect/1.0.12/mod.js");
|
|
6
|
-
const bdd_js_1 = require("../../deps/jsr.io/@std/testing/1.0.9/bdd.js");
|
|
7
|
-
const source_builder_js_1 = require("./source-builder.js");
|
|
8
|
-
const utils_js_1 = require("./string-builder/utils.js");
|
|
9
|
-
(0, bdd_js_1.describe)('SourceBuilder', () => {
|
|
10
|
-
let sb;
|
|
11
|
-
(0, bdd_js_1.beforeEach)(() => {
|
|
12
|
-
sb = new source_builder_js_1.SourceBuilder();
|
|
13
|
-
});
|
|
14
|
-
(0, bdd_js_1.describe)('constructor', () => {
|
|
15
|
-
(0, bdd_js_1.it)('should initialize with default options', () => {
|
|
16
|
-
const options = sb.options;
|
|
17
|
-
(0, mod_js_1.expect)(options.indent).toEqual({ type: 'spaces', count: 2 });
|
|
18
|
-
(0, mod_js_1.expect)(options.newLine).toBe(node_os_1.EOL);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
(0, bdd_js_1.describe)('fromString', () => {
|
|
22
|
-
(0, bdd_js_1.it)('should create a new instance of SourceBuilder with the given string', () => {
|
|
23
|
-
const str = 'test string';
|
|
24
|
-
const sb = source_builder_js_1.SourceBuilder.fromString(str);
|
|
25
|
-
(0, mod_js_1.expect)(sb.toString()).toEqual(str);
|
|
26
|
-
});
|
|
27
|
-
(0, bdd_js_1.it)('should create a new instance of SourceBuilder with the given string and options', () => {
|
|
28
|
-
const str = 'test string';
|
|
29
|
-
const options = {
|
|
30
|
-
indent: { type: 'tabs' },
|
|
31
|
-
newLine: '\n-',
|
|
32
|
-
};
|
|
33
|
-
const sb = source_builder_js_1.SourceBuilder.fromString(str, options);
|
|
34
|
-
(0, mod_js_1.expect)(sb.toString()).toEqual(str);
|
|
35
|
-
(0, mod_js_1.expect)(sb.options).toEqual(mod_js_1.expect.objectContaining(options));
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
(0, bdd_js_1.describe)('build', () => {
|
|
39
|
-
(0, bdd_js_1.it)('should build a string using a callback function that receives a `SourceBuilder` instance', () => {
|
|
40
|
-
const buildAction = (builder) => {
|
|
41
|
-
builder.append('hello');
|
|
42
|
-
builder.append('world');
|
|
43
|
-
};
|
|
44
|
-
const result = source_builder_js_1.SourceBuilder.build(buildAction);
|
|
45
|
-
(0, mod_js_1.expect)(result).toEqual('helloworld');
|
|
46
|
-
});
|
|
47
|
-
(0, bdd_js_1.it)('should build a string using a callback function that receives a `SourceBuilder` instance and options', () => {
|
|
48
|
-
const buildAction = (builder) => {
|
|
49
|
-
builder.appendLine('hello');
|
|
50
|
-
builder.indent((b) => b.append('world'));
|
|
51
|
-
};
|
|
52
|
-
const options = {
|
|
53
|
-
indent: { type: 'spaces', count: 4 },
|
|
54
|
-
newLine: '\r\n\t',
|
|
55
|
-
};
|
|
56
|
-
const result = source_builder_js_1.SourceBuilder.build(buildAction, options);
|
|
57
|
-
(0, mod_js_1.expect)(result).toEqual(`hello${options.newLine} world`);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
(0, bdd_js_1.describe)('append', () => {
|
|
61
|
-
(0, bdd_js_1.it)('should handle consecutive line breaks', () => {
|
|
62
|
-
sb.append('line1', node_os_1.EOL, node_os_1.EOL, node_os_1.EOL, 'line2');
|
|
63
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}${node_os_1.EOL}${node_os_1.EOL}line2`);
|
|
64
|
-
});
|
|
65
|
-
(0, bdd_js_1.it)('should handle mixed line breaks', () => {
|
|
66
|
-
sb.append('line1\r\n', '\n', 'line2\r', '\r', 'line3\n', 'line4');
|
|
67
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}${node_os_1.EOL}line2line3${node_os_1.EOL}line4`);
|
|
68
|
-
});
|
|
69
|
-
(0, bdd_js_1.it)('should handle strings with special chars', () => {
|
|
70
|
-
sb.append('line1 {', node_os_1.EOL, 'line2}');
|
|
71
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1 {${node_os_1.EOL}line2}`);
|
|
72
|
-
});
|
|
73
|
-
(0, bdd_js_1.it)('should handle long strings without line breaks', () => {
|
|
74
|
-
sb.append('This is a long string without any line breaks.');
|
|
75
|
-
(0, mod_js_1.expect)(sb.toString()).toBe('This is a long string without any line breaks.');
|
|
76
|
-
});
|
|
77
|
-
(0, bdd_js_1.it)('should handle multiple calls', () => {
|
|
78
|
-
sb.append('line1', node_os_1.EOL);
|
|
79
|
-
sb.append('line2', node_os_1.EOL);
|
|
80
|
-
sb.append('line3', node_os_1.EOL);
|
|
81
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}line2${node_os_1.EOL}line3${node_os_1.EOL}`);
|
|
82
|
-
});
|
|
83
|
-
(0, bdd_js_1.it)('should handle empty input', () => {
|
|
84
|
-
sb.append('', '', '', node_os_1.EOL, '', '');
|
|
85
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(node_os_1.EOL);
|
|
86
|
-
});
|
|
87
|
-
(0, bdd_js_1.it)('should apply the provided builder function to the source builder', () => {
|
|
88
|
-
const builder = new source_builder_js_1.SourceBuilder().append((b) => b.append('foo'));
|
|
89
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('foo');
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
(0, bdd_js_1.describe)('appendIf', () => {
|
|
93
|
-
(0, bdd_js_1.it)('should append the string when condition is true', () => {
|
|
94
|
-
sb.appendIf(true, 'line1', node_os_1.EOL);
|
|
95
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}`);
|
|
96
|
-
});
|
|
97
|
-
(0, bdd_js_1.it)('should not append the string when condition is false', () => {
|
|
98
|
-
sb.appendIf(false, 'line1', node_os_1.EOL);
|
|
99
|
-
(0, mod_js_1.expect)(sb.toString()).toBe('');
|
|
100
|
-
});
|
|
101
|
-
(0, bdd_js_1.it)('should append the string when condition is a function returning true', () => {
|
|
102
|
-
sb.appendIf(() => true, 'line1', node_os_1.EOL);
|
|
103
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}`);
|
|
104
|
-
});
|
|
105
|
-
(0, bdd_js_1.it)('should not append the string when condition is a function returning false', () => {
|
|
106
|
-
sb.appendIf(() => false, 'line1', node_os_1.EOL);
|
|
107
|
-
(0, mod_js_1.expect)(sb.toString()).toBe('');
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
(0, bdd_js_1.describe)('appendLineIf', () => {
|
|
111
|
-
(0, bdd_js_1.it)('should append the string when condition is true', () => {
|
|
112
|
-
sb.appendLineIf(true, 'line1');
|
|
113
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}`);
|
|
114
|
-
});
|
|
115
|
-
(0, bdd_js_1.it)('should not append the string when condition is false', () => {
|
|
116
|
-
sb.appendLineIf(false, 'line1');
|
|
117
|
-
(0, mod_js_1.expect)(sb.toString()).toBe('');
|
|
118
|
-
});
|
|
119
|
-
(0, bdd_js_1.it)('should append the string when condition is a function returning true', () => {
|
|
120
|
-
sb.appendLineIf(() => true, 'line1');
|
|
121
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}`);
|
|
122
|
-
});
|
|
123
|
-
(0, bdd_js_1.it)('should not append the string when condition is a function returning false', () => {
|
|
124
|
-
sb.appendLineIf(() => false, 'line1');
|
|
125
|
-
(0, mod_js_1.expect)(sb.toString()).toBe('');
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
(0, bdd_js_1.describe)('prependIf', () => {
|
|
129
|
-
(0, bdd_js_1.it)('should prepend the specified value if the condition is true', () => {
|
|
130
|
-
const builder = new source_builder_js_1.SourceBuilder().append('bar').prependIf(true, 'foo');
|
|
131
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('foobar');
|
|
132
|
-
});
|
|
133
|
-
(0, bdd_js_1.it)('should not prepend the specified value if the condition is false', () => {
|
|
134
|
-
const builder = new source_builder_js_1.SourceBuilder().append('bar').prependIf(false, 'foo');
|
|
135
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('bar');
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
(0, bdd_js_1.describe)('prependLineIf', () => {
|
|
139
|
-
(0, bdd_js_1.it)('should prepend the specified value with a line terminator if the condition is true', () => {
|
|
140
|
-
const builder = new source_builder_js_1.SourceBuilder().append('bar').prependLineIf(true, 'foo');
|
|
141
|
-
(0, mod_js_1.expect)(builder.toString()).toBe(`foo${node_os_1.EOL}bar`);
|
|
142
|
-
});
|
|
143
|
-
(0, bdd_js_1.it)('should not prepend the specified value if the condition is false', () => {
|
|
144
|
-
const builder = new source_builder_js_1.SourceBuilder().append('bar').prependLineIf(false, 'foo');
|
|
145
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('bar');
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
(0, bdd_js_1.describe)('appendWithLinePrefix', () => {
|
|
149
|
-
(0, bdd_js_1.it)('should append the specified values with the specified line prefix', () => {
|
|
150
|
-
const builder = new source_builder_js_1.SourceBuilder().appendWithLinePrefix('// ', 'foo', 'bar');
|
|
151
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('// foobar');
|
|
152
|
-
});
|
|
153
|
-
(0, bdd_js_1.it)('should handle null and undefined values', () => {
|
|
154
|
-
const builder = new source_builder_js_1.SourceBuilder().appendWithLinePrefix('// ', 'foo', null, undefined, 'bar');
|
|
155
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('// foobar');
|
|
156
|
-
});
|
|
157
|
-
(0, bdd_js_1.it)('should apply the provided builder function with the specified line prefix', () => {
|
|
158
|
-
const builder = new source_builder_js_1.SourceBuilder().appendWithLinePrefix('// ', (b) => {
|
|
159
|
-
b.appendLine('foo');
|
|
160
|
-
b.appendLine('bar');
|
|
161
|
-
});
|
|
162
|
-
(0, mod_js_1.expect)(builder.toString()).toBe(`// foo${node_os_1.EOL}// bar${node_os_1.EOL}`);
|
|
163
|
-
});
|
|
164
|
-
(0, bdd_js_1.it)('should apply the provided builder function with the specified line prefix and indentation', () => {
|
|
165
|
-
const builder = new source_builder_js_1.SourceBuilder().indent((b) => b.appendWithLinePrefix('// ', (b) => {
|
|
166
|
-
b.appendLine('foo');
|
|
167
|
-
b.appendLine('bar');
|
|
168
|
-
}));
|
|
169
|
-
(0, mod_js_1.expect)(builder.toString()).toBe(` // foo${node_os_1.EOL} // bar${node_os_1.EOL}`);
|
|
170
|
-
});
|
|
171
|
-
(0, bdd_js_1.it)('should write indents after the prefix', () => {
|
|
172
|
-
const builder = new source_builder_js_1.SourceBuilder().indent((b) => b.appendWithLinePrefix('// ', (b) => {
|
|
173
|
-
b.indent((b) => b.appendLine('foo'));
|
|
174
|
-
}));
|
|
175
|
-
(0, mod_js_1.expect)(builder.toString()).toBe(` // foo${node_os_1.EOL}`);
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
(0, bdd_js_1.describe)('appendLineWithLinePrefix', () => {
|
|
179
|
-
(0, bdd_js_1.it)('should append the specified values as a new line with the specified line prefix', () => {
|
|
180
|
-
const builder = new source_builder_js_1.SourceBuilder().appendLineWithLinePrefix('// ', 'foo', 'bar');
|
|
181
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('// foobar' + node_os_1.EOL);
|
|
182
|
-
});
|
|
183
|
-
(0, bdd_js_1.it)('should handle null and undefined values', () => {
|
|
184
|
-
const builder = new source_builder_js_1.SourceBuilder().appendLineWithLinePrefix('// ', 'foo', null, undefined, 'bar');
|
|
185
|
-
(0, mod_js_1.expect)(builder.toString()).toBe('// foobar' + node_os_1.EOL);
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
(0, bdd_js_1.describe)('ensurePreviousLineEmpty', () => {
|
|
189
|
-
(0, bdd_js_1.it)('should insert one empty line when current line is empty', () => {
|
|
190
|
-
sb.append('line1', node_os_1.EOL, 'line2', node_os_1.EOL);
|
|
191
|
-
sb.ensurePreviousLineEmpty();
|
|
192
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}line2${node_os_1.EOL}${node_os_1.EOL}`);
|
|
193
|
-
});
|
|
194
|
-
(0, bdd_js_1.it)('should insert two empty lines when current line is not empty', () => {
|
|
195
|
-
sb.append('line1', node_os_1.EOL, 'line2');
|
|
196
|
-
sb.ensurePreviousLineEmpty();
|
|
197
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}line2${node_os_1.EOL}${node_os_1.EOL}`);
|
|
198
|
-
});
|
|
199
|
-
(0, bdd_js_1.it)('should not insert an empty line when already empty', () => {
|
|
200
|
-
sb.append('line1', node_os_1.EOL, 'line2', node_os_1.EOL, node_os_1.EOL);
|
|
201
|
-
sb.ensurePreviousLineEmpty();
|
|
202
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}line2${node_os_1.EOL}${node_os_1.EOL}`);
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
(0, bdd_js_1.describe)('ensureCurrentLineEmpty', () => {
|
|
206
|
-
(0, bdd_js_1.it)('should insert an empty line', () => {
|
|
207
|
-
sb.append('line1', node_os_1.EOL, 'line2');
|
|
208
|
-
sb.ensureCurrentLineEmpty();
|
|
209
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}line2${node_os_1.EOL}`);
|
|
210
|
-
});
|
|
211
|
-
(0, bdd_js_1.it)('should not insert an empty line when already empty', () => {
|
|
212
|
-
sb.append('line1', node_os_1.EOL, 'line2', node_os_1.EOL);
|
|
213
|
-
sb.ensureCurrentLineEmpty();
|
|
214
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}line2${node_os_1.EOL}`);
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
(0, bdd_js_1.describe)('pretendPreviousLineEmpty', () => {
|
|
218
|
-
(0, bdd_js_1.it)('should pretend the previous line is empty', () => {
|
|
219
|
-
sb.appendLine('line1').append('a').pretendPreviousLineEmpty().ensurePreviousLineEmpty().append('b');
|
|
220
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL}ab`);
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
(0, bdd_js_1.describe)('pretendCurrentLineEmpty', () => {
|
|
224
|
-
(0, bdd_js_1.it)('should pretend the previous line is empty', () => {
|
|
225
|
-
sb.append('a').pretendCurrentLineEmpty().ensureCurrentLineEmpty().append('b');
|
|
226
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`ab`);
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
(0, bdd_js_1.describe)('if', () => {
|
|
230
|
-
(0, bdd_js_1.it)('should append the content when condition is true', () => {
|
|
231
|
-
sb.if(true, (x) => x.append('stuff'));
|
|
232
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
233
|
-
});
|
|
234
|
-
(0, bdd_js_1.it)('should not append the content when condition is false', () => {
|
|
235
|
-
sb.if(false, (x) => x.append('stuff'));
|
|
236
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(``);
|
|
237
|
-
});
|
|
238
|
-
(0, bdd_js_1.it)('should append the content when condition function returns true', () => {
|
|
239
|
-
sb.if(() => true, (x) => x.append('stuff'));
|
|
240
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
241
|
-
});
|
|
242
|
-
(0, bdd_js_1.it)('should not append the content when condition function returns false', () => {
|
|
243
|
-
sb.if(() => false, (x) => x.append('stuff'));
|
|
244
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(``);
|
|
245
|
-
});
|
|
246
|
-
(0, bdd_js_1.it)('should append the correct content when condition is true', () => {
|
|
247
|
-
sb.if(true, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
248
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
249
|
-
});
|
|
250
|
-
(0, bdd_js_1.it)('should append the correct content when condition is false', () => {
|
|
251
|
-
sb.if(false, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
252
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`other stuff`);
|
|
253
|
-
});
|
|
254
|
-
(0, bdd_js_1.it)('should append the correct content when condition function returns true', () => {
|
|
255
|
-
sb.if(() => true, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
256
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
257
|
-
});
|
|
258
|
-
(0, bdd_js_1.it)('should append the correct content when condition function returns false', () => {
|
|
259
|
-
sb.if(() => false, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
260
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`other stuff`);
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
(0, bdd_js_1.describe)('indent', () => {
|
|
264
|
-
(0, bdd_js_1.it)('should correctly indent the content (fn)', () => {
|
|
265
|
-
sb.append('line1', node_os_1.EOL);
|
|
266
|
-
sb.indent((innerSb) => {
|
|
267
|
-
innerSb.append('line2', node_os_1.EOL);
|
|
268
|
-
});
|
|
269
|
-
sb.append('line3', node_os_1.EOL);
|
|
270
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL} line2${node_os_1.EOL}line3${node_os_1.EOL}`);
|
|
271
|
-
});
|
|
272
|
-
(0, bdd_js_1.it)('should correctly indent the content (string)', () => {
|
|
273
|
-
sb.append('line1', node_os_1.EOL);
|
|
274
|
-
sb.indent('line2\n');
|
|
275
|
-
sb.append('line3', node_os_1.EOL);
|
|
276
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`line1${node_os_1.EOL} line2${node_os_1.EOL}line3${node_os_1.EOL}`);
|
|
277
|
-
});
|
|
278
|
-
(0, bdd_js_1.it)('should correctly handle nested indentation', () => {
|
|
279
|
-
sb.indent((innerSb1) => {
|
|
280
|
-
innerSb1.append('line1', node_os_1.EOL);
|
|
281
|
-
innerSb1.indent((innerSb2) => {
|
|
282
|
-
innerSb2.append('line2', node_os_1.EOL);
|
|
283
|
-
});
|
|
284
|
-
innerSb1.append('line3', node_os_1.EOL);
|
|
285
|
-
});
|
|
286
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(` line1${node_os_1.EOL} line2${node_os_1.EOL} line3${node_os_1.EOL}`);
|
|
287
|
-
});
|
|
288
|
-
(0, bdd_js_1.it)('should correctly handle multiline strings (fn)', () => {
|
|
289
|
-
sb.indent((innerSb) => {
|
|
290
|
-
innerSb.append(`line1${node_os_1.EOL}line2`, node_os_1.EOL);
|
|
291
|
-
});
|
|
292
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(` line1${node_os_1.EOL} line2${node_os_1.EOL}`);
|
|
293
|
-
});
|
|
294
|
-
(0, bdd_js_1.it)('should correctly handle multiline strings (string)', () => {
|
|
295
|
-
sb.indent('line1\nline2\n');
|
|
296
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(` line1${node_os_1.EOL} line2${node_os_1.EOL}`);
|
|
297
|
-
});
|
|
298
|
-
(0, bdd_js_1.it)('should nest indentations', () => {
|
|
299
|
-
sb.appendLine('(')
|
|
300
|
-
.indent((b1) => {
|
|
301
|
-
b1.appendLine('(')
|
|
302
|
-
.indent((b2) => {
|
|
303
|
-
b2.appendLine('line1');
|
|
304
|
-
})
|
|
305
|
-
.appendLine(')');
|
|
306
|
-
})
|
|
307
|
-
.appendLine(')');
|
|
308
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL} (${node_os_1.EOL} line1${node_os_1.EOL} )${node_os_1.EOL})${node_os_1.EOL}`);
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
(0, bdd_js_1.describe)('indentIf', () => {
|
|
312
|
-
(0, bdd_js_1.it)('should indent when condition is true', () => {
|
|
313
|
-
sb.indentIf(true, (x) => x.append('stuff'));
|
|
314
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(` stuff`);
|
|
315
|
-
});
|
|
316
|
-
(0, bdd_js_1.it)('should not indent when condition is false', () => {
|
|
317
|
-
sb.indentIf(false, (x) => x.append('stuff'));
|
|
318
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
319
|
-
});
|
|
320
|
-
(0, bdd_js_1.it)('should indent when condition function returns true', () => {
|
|
321
|
-
sb.indentIf(() => true, (x) => x.append('stuff'));
|
|
322
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(` stuff`);
|
|
323
|
-
});
|
|
324
|
-
(0, bdd_js_1.it)('should not indent when condition function returns false', () => {
|
|
325
|
-
sb.indentIf(() => false, (x) => x.append('stuff'));
|
|
326
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
(0, bdd_js_1.describe)('parenthesize', () => {
|
|
330
|
-
(0, bdd_js_1.it)('should parenthesize the content with the given brackets string', () => {
|
|
331
|
-
sb.parenthesize('{}', (x) => x.append('stuff'));
|
|
332
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`{stuff}`);
|
|
333
|
-
});
|
|
334
|
-
(0, bdd_js_1.it)('should parenthesize the content with the given brackets array', () => {
|
|
335
|
-
sb.parenthesize(['{', '}'], (x) => x.append('stuff'));
|
|
336
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`{stuff}`);
|
|
337
|
-
});
|
|
338
|
-
(0, bdd_js_1.it)('should parenthesize and indent the content (fn)', () => {
|
|
339
|
-
sb.parenthesize('()', (x) => x.append(`${node_os_1.EOL}stuff${node_os_1.EOL}`));
|
|
340
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
341
|
-
});
|
|
342
|
-
(0, bdd_js_1.it)('should parenthesize and indent the content (string)', () => {
|
|
343
|
-
sb.parenthesize('()', `${node_os_1.EOL}stuff${node_os_1.EOL}`);
|
|
344
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
345
|
-
});
|
|
346
|
-
(0, bdd_js_1.it)('should parenthesize but not indent the content when indent is false', () => {
|
|
347
|
-
sb.parenthesize('()', (x) => x.append(`${node_os_1.EOL}stuff${node_os_1.EOL}`), { indent: false });
|
|
348
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL}stuff${node_os_1.EOL})`);
|
|
349
|
-
});
|
|
350
|
-
(0, bdd_js_1.it)('should parenthesize the content with the given brackets string (multiline)', () => {
|
|
351
|
-
sb.parenthesize('{}', (x) => x.append('stuff'), { multiline: true });
|
|
352
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`{${node_os_1.EOL} stuff${node_os_1.EOL}}`);
|
|
353
|
-
});
|
|
354
|
-
(0, bdd_js_1.it)('should parenthesize the content with the given brackets array (multiline)', () => {
|
|
355
|
-
sb.parenthesize(['{', '}'], (x) => x.append('stuff'), { multiline: true });
|
|
356
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`{${node_os_1.EOL} stuff${node_os_1.EOL}}`);
|
|
357
|
-
});
|
|
358
|
-
(0, bdd_js_1.it)('should parenthesize and indent the content (fn) (multiline)', () => {
|
|
359
|
-
sb.parenthesize('()', (x) => x.append(`${node_os_1.EOL}stuff${node_os_1.EOL}`), { multiline: true });
|
|
360
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL}${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
361
|
-
});
|
|
362
|
-
(0, bdd_js_1.it)('should parenthesize and indent the content (string) (multiline)', () => {
|
|
363
|
-
sb.parenthesize('()', `${node_os_1.EOL}stuff${node_os_1.EOL}`, { multiline: true });
|
|
364
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL}${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
365
|
-
});
|
|
366
|
-
(0, bdd_js_1.it)('should parenthesize but not indent the content when indent is false (multiline)', () => {
|
|
367
|
-
sb.parenthesize('()', (x) => x.append(`${node_os_1.EOL}stuff${node_os_1.EOL}`), { multiline: true, indent: false });
|
|
368
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL}${node_os_1.EOL}stuff${node_os_1.EOL})`);
|
|
369
|
-
});
|
|
370
|
-
(0, bdd_js_1.it)('should ignore first ensurePreviousLineEmpty', () => {
|
|
371
|
-
sb.parenthesize('()', (x) => x.ensurePreviousLineEmpty().append('stuff'), { multiline: true });
|
|
372
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
373
|
-
});
|
|
374
|
-
(0, bdd_js_1.it)('should not ignore first ensurePreviousLineEmpty if disabled', () => {
|
|
375
|
-
sb.parenthesize('()', (x) => x.ensurePreviousLineEmpty().append('stuff'), {
|
|
376
|
-
multiline: true,
|
|
377
|
-
pretendEmpty: false,
|
|
378
|
-
});
|
|
379
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL}${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
(0, bdd_js_1.describe)('parenthesizeIf', () => {
|
|
383
|
-
(0, bdd_js_1.it)('should parenthesize when condition is true (fn)', () => {
|
|
384
|
-
sb.parenthesizeIf(true, '()', (x) => x.append('stuff'));
|
|
385
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(stuff)`);
|
|
386
|
-
});
|
|
387
|
-
(0, bdd_js_1.it)('should parenthesize when condition is true (string)', () => {
|
|
388
|
-
sb.parenthesizeIf(true, '()', 'stuff');
|
|
389
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(stuff)`);
|
|
390
|
-
});
|
|
391
|
-
(0, bdd_js_1.it)('should not parenthesize when condition is false', () => {
|
|
392
|
-
sb.parenthesizeIf(false, '()', (x) => x.append('stuff'));
|
|
393
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
394
|
-
});
|
|
395
|
-
(0, bdd_js_1.it)('should parenthesize when condition function returns true', () => {
|
|
396
|
-
sb.parenthesizeIf(() => true, '()', (x) => x.append('stuff'));
|
|
397
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(stuff)`);
|
|
398
|
-
});
|
|
399
|
-
(0, bdd_js_1.it)('should not parenthesize when condition function returns false', () => {
|
|
400
|
-
sb.parenthesizeIf(() => false, '()', (x) => x.append('stuff'));
|
|
401
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
402
|
-
});
|
|
403
|
-
(0, bdd_js_1.it)('should parenthesize when condition is true (fn) (multiline)', () => {
|
|
404
|
-
sb.parenthesizeIf(true, '()', (x) => x.append('stuff'), { multiline: true });
|
|
405
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
406
|
-
});
|
|
407
|
-
(0, bdd_js_1.it)('should parenthesize when condition is true (string) (multiline)', () => {
|
|
408
|
-
sb.parenthesizeIf(true, '()', 'stuff', { multiline: true });
|
|
409
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
410
|
-
});
|
|
411
|
-
(0, bdd_js_1.it)('should not parenthesize when condition is false (multiline)', () => {
|
|
412
|
-
sb.parenthesizeIf(false, '()', (x) => x.append('stuff'), { multiline: true });
|
|
413
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
414
|
-
});
|
|
415
|
-
(0, bdd_js_1.it)('should parenthesize when condition function returns true (multiline)', () => {
|
|
416
|
-
sb.parenthesizeIf(() => true, '()', (x) => x.append('stuff'), { multiline: true });
|
|
417
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(${node_os_1.EOL} stuff${node_os_1.EOL})`);
|
|
418
|
-
});
|
|
419
|
-
(0, bdd_js_1.it)('should not parenthesize when condition function returns false (multiline)', () => {
|
|
420
|
-
sb.parenthesizeIf(() => false, '()', (x) => x.append('stuff'), { multiline: true });
|
|
421
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`stuff`);
|
|
422
|
-
});
|
|
423
|
-
});
|
|
424
|
-
(0, bdd_js_1.describe)('forEach', () => {
|
|
425
|
-
(0, bdd_js_1.it)('should add the content for each item', () => {
|
|
426
|
-
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`(${item})`));
|
|
427
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(a)(b)(c)`);
|
|
428
|
-
});
|
|
429
|
-
(0, bdd_js_1.it)('should add the content for items that match the condition', () => {
|
|
430
|
-
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`(${item})`), { condition: (item) => item === 'b' });
|
|
431
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(b)`);
|
|
432
|
-
});
|
|
433
|
-
(0, bdd_js_1.it)('should add the content for each item with the given string separator', () => {
|
|
434
|
-
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), { separator: ', ' });
|
|
435
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`item: a, item: b, item: c`);
|
|
436
|
-
});
|
|
437
|
-
(0, bdd_js_1.it)('should add the content for each item with the given separator builder', () => {
|
|
438
|
-
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), {
|
|
439
|
-
separator: (x, p, n, pi, ni) => x.append(`(${p}:${pi}), (${n}:${ni})`),
|
|
440
|
-
});
|
|
441
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`item: a(a:0), (b:1)item: b(b:1), (c:2)item: c`);
|
|
442
|
-
});
|
|
443
|
-
(0, bdd_js_1.it)('should add the content for items that match the condition with the given string separator', () => {
|
|
444
|
-
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), {
|
|
445
|
-
condition: (item) => item === 'a' || item === 'c',
|
|
446
|
-
separator: ', ',
|
|
447
|
-
});
|
|
448
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`item: a, item: c`);
|
|
449
|
-
});
|
|
450
|
-
(0, bdd_js_1.it)('should add the content for items that match the condition with the given separator builder', () => {
|
|
451
|
-
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), {
|
|
452
|
-
condition: (item) => item === 'a' || item === 'c',
|
|
453
|
-
separator: (x, p, n, pi, ni) => x.append(`(${p}:${pi}), (${n}:${ni})`),
|
|
454
|
-
});
|
|
455
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`item: a(a:0), (c:2)item: c`);
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
(0, bdd_js_1.describe)('forEachIf', () => {
|
|
459
|
-
(0, bdd_js_1.it)('should add the content for each item when condition is true', () => {
|
|
460
|
-
sb.forEachIf(true, ['a', 'b', 'c'], (x, item) => x.append(`(${item})`));
|
|
461
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`(a)(b)(c)`);
|
|
462
|
-
});
|
|
463
|
-
(0, bdd_js_1.it)('should not add the content for each item when condition is false', () => {
|
|
464
|
-
sb.forEachIf(false, ['a', 'b', 'c'], (x, item) => x.append(`(${item})`));
|
|
465
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(``);
|
|
466
|
-
});
|
|
467
|
-
});
|
|
468
|
-
(0, bdd_js_1.describe)('appendSeparated', () => {
|
|
469
|
-
(0, bdd_js_1.it)('should add the content for each item with the given string separator', () => {
|
|
470
|
-
sb.appendSeparated(['a', 'b', 'c'], ', ');
|
|
471
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`a, b, c`);
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
(0, bdd_js_1.describe)('appendSeparatedIf', () => {
|
|
475
|
-
(0, bdd_js_1.it)('should add the content for each item with the given string separator when condition is true', () => {
|
|
476
|
-
sb.appendSeparatedIf(true, ['a', 'b', 'c'], ', ');
|
|
477
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(`a, b, c`);
|
|
478
|
-
});
|
|
479
|
-
(0, bdd_js_1.it)('should not add the content for each item with the given string separator when condition is false', () => {
|
|
480
|
-
sb.appendSeparatedIf(false, ['a', 'b', 'c'], ', ');
|
|
481
|
-
(0, mod_js_1.expect)(sb.toString()).toBe(``);
|
|
482
|
-
});
|
|
483
|
-
});
|
|
484
|
-
});
|
|
485
|
-
(0, bdd_js_1.describe)('builderTemplate', () => {
|
|
486
|
-
(0, bdd_js_1.it)('should resolve append values in a template string', () => {
|
|
487
|
-
const sb = new source_builder_js_1.SourceBuilder();
|
|
488
|
-
sb.append((0, source_builder_js_1.builderTemplate) `abc${'def'}ghi${123}jkl${(b) => b.append('mno')}pqr${(0, utils_js_1.appendValueGroup)(['stu', 'vxw'])}yz`);
|
|
489
|
-
(0, mod_js_1.expect)(sb.toString()).toEqual('abcdefghi123jklmnopqrstuvxwyz');
|
|
490
|
-
});
|
|
491
|
-
(0, bdd_js_1.it)('should remove indentation based on last line', () => {
|
|
492
|
-
const sb = new source_builder_js_1.SourceBuilder();
|
|
493
|
-
sb.append((0, source_builder_js_1.builderTemplate) `${'abc'}
|
|
494
|
-
${123}
|
|
495
|
-
ghi`);
|
|
496
|
-
(0, mod_js_1.expect)(sb.toString()).toEqual(`abc${node_os_1.EOL}123${node_os_1.EOL}ghi`);
|
|
497
|
-
});
|
|
498
|
-
(0, bdd_js_1.describe)('indent', () => {
|
|
499
|
-
(0, bdd_js_1.it)('should indent the content', () => {
|
|
500
|
-
const sb = new source_builder_js_1.SourceBuilder();
|
|
501
|
-
sb.append(source_builder_js_1.builderTemplate.indent `${'abc'}
|
|
502
|
-
${123}
|
|
503
|
-
ghi`);
|
|
504
|
-
(0, mod_js_1.expect)(sb.toString()).toEqual(` abc${node_os_1.EOL} 123${node_os_1.EOL} ghi`);
|
|
505
|
-
});
|
|
506
|
-
});
|
|
507
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string-builder.test.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/string-builder/string-builder.test.ts"],"names":[],"mappings":"AAAA,OAAO,iCAAiC,CAAC"}
|