@goast/core 0.4.0-beta4 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +4 -0
- package/esm/_dnt.shims.d.ts +1 -1
- package/esm/_dnt.test_polyfills.d.ts +29 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/_dnt.test_polyfills.js +31 -0
- package/esm/_dnt.test_shims.d.ts +14 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/_dnt.test_shims.js +69 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.js +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +57 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +20 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +14 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +43 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +17 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +26 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.js +13 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +46 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +161 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +6 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.js +191 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +12 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +34 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.js +714 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +843 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.js +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.js +218 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +60 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.js +523 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.js +85 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +86 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.js +88 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +199 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +111 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +180 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +37 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +2 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +79 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +380 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +738 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.js +654 -0
- package/esm/mod.d.ts +30 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +29 -0
- package/esm/src/ast/node.d.ts +17 -0
- package/esm/src/ast/node.d.ts.map +1 -0
- package/esm/src/codegen/config.d.ts +16 -0
- package/esm/src/codegen/config.d.ts.map +1 -0
- package/esm/src/codegen/endpoints-generator.d.ts +18 -0
- package/esm/src/codegen/endpoints-generator.d.ts.map +1 -0
- package/esm/src/codegen/generator.d.ts +39 -0
- package/esm/src/codegen/generator.d.ts.map +1 -0
- package/esm/src/codegen/generator.js +117 -0
- package/esm/src/codegen/internal-utils.d.ts.map +1 -0
- package/esm/src/codegen/internal-utils.js +6 -0
- package/esm/src/codegen/schemas-generator.d.ts +19 -0
- package/esm/src/codegen/schemas-generator.d.ts.map +1 -0
- package/esm/src/codegen/schemas-generator.js +45 -0
- package/esm/src/codegen/services-generator.d.ts +18 -0
- package/esm/src/codegen/services-generator.d.ts.map +1 -0
- package/esm/src/codegen/types.d.ts +19 -0
- package/esm/src/codegen/types.d.ts.map +1 -0
- package/esm/src/collect/collector.d.ts +5 -0
- package/esm/src/collect/collector.d.ts.map +1 -0
- package/esm/src/collect/helpers.d.ts +5 -0
- package/esm/src/collect/helpers.d.ts.map +1 -0
- package/esm/src/collect/helpers.test.d.ts +2 -0
- package/esm/src/collect/helpers.test.d.ts.map +1 -0
- package/esm/src/collect/helpers.test.js +77 -0
- package/esm/src/collect/types.d.ts +14 -0
- package/esm/src/collect/types.d.ts.map +1 -0
- package/esm/src/internal-utils.d.ts.map +1 -0
- package/esm/src/parse/deref-proxy.d.ts.map +1 -0
- package/esm/src/parse/deref-proxy.js +62 -0
- package/esm/src/parse/openapi-types.d.ts.map +1 -0
- package/esm/src/parse/parser.d.ts +19 -0
- package/esm/src/parse/parser.d.ts.map +1 -0
- package/esm/src/parse/parser.js +195 -0
- package/esm/src/parse/types.d.ts.map +1 -0
- package/esm/src/transform/api-types.d.ts +196 -0
- package/esm/src/transform/api-types.d.ts.map +1 -0
- package/esm/src/transform/helpers.d.ts +52 -0
- package/esm/src/transform/helpers.d.ts.map +1 -0
- package/esm/src/transform/helpers.js +160 -0
- package/esm/src/transform/helpers.test.d.ts +2 -0
- package/esm/src/transform/helpers.test.d.ts.map +1 -0
- package/esm/src/transform/helpers.test.js +265 -0
- package/esm/src/transform/transform-document.d.ts +5 -0
- package/esm/src/transform/transform-document.d.ts.map +1 -0
- package/esm/src/transform/transform-endpoint.d.ts +5 -0
- package/esm/src/transform/transform-endpoint.d.ts.map +1 -0
- package/esm/src/transform/transform-endpoint.js +269 -0
- package/esm/src/transform/transform-schema.d.ts +6 -0
- package/esm/src/transform/transform-schema.d.ts.map +1 -0
- package/esm/src/transform/transform-schema.js +182 -0
- package/esm/src/transform/transformer.d.ts +5 -0
- package/esm/src/transform/transformer.d.ts.map +1 -0
- package/esm/src/transform/types.d.ts.map +1 -0
- package/esm/src/utils/action-provider.d.ts.map +1 -0
- package/esm/src/utils/action-provider.js +29 -0
- package/esm/src/utils/action-provider.test.d.ts +2 -0
- package/esm/src/utils/action-provider.test.d.ts.map +1 -0
- package/esm/src/utils/action-provider.test.js +28 -0
- package/esm/src/utils/array.utils.d.ts.map +1 -0
- package/esm/src/utils/asset-manager.d.ts +9 -0
- package/esm/src/utils/asset-manager.d.ts.map +1 -0
- package/esm/src/utils/asset-manager.js +50 -0
- package/esm/src/utils/class.utils.d.ts.map +1 -0
- package/esm/src/utils/class.utils.js +28 -0
- package/esm/src/utils/common.utils.d.ts.map +1 -0
- package/esm/src/utils/common.utils.test.d.ts +2 -0
- package/esm/src/utils/common.utils.test.d.ts.map +1 -0
- package/esm/src/utils/common.utils.test.js +18 -0
- package/esm/src/utils/condition.d.ts.map +1 -0
- package/esm/src/utils/condition.test.d.ts +2 -0
- package/esm/src/utils/condition.test.d.ts.map +1 -0
- package/esm/src/utils/condition.test.js +31 -0
- package/esm/src/utils/endpoint.utils.d.ts +3 -0
- package/esm/src/utils/endpoint.utils.d.ts.map +1 -0
- package/esm/src/utils/endpoint.utils.test.d.ts +2 -0
- package/esm/src/utils/endpoint.utils.test.d.ts.map +1 -0
- package/esm/src/utils/endpoint.utils.test.js +31 -0
- package/esm/src/utils/error.utils.d.ts.map +1 -0
- package/esm/src/utils/factory.d.ts +21 -0
- package/esm/src/utils/factory.d.ts.map +1 -0
- package/esm/src/utils/factory.test.d.ts +2 -0
- package/esm/src/utils/factory.test.d.ts.map +1 -0
- package/esm/src/utils/factory.test.js +34 -0
- package/esm/src/utils/file-system.utils.d.ts.map +1 -0
- package/esm/src/utils/generator.utils.d.ts.map +1 -0
- package/esm/src/utils/generator.utils.test.d.ts +2 -0
- package/esm/src/utils/generator.utils.test.d.ts.map +1 -0
- package/esm/src/utils/generator.utils.test.js +13 -0
- package/esm/src/utils/object.utils.d.ts.map +1 -0
- package/esm/src/utils/object.utils.js +36 -0
- package/esm/src/utils/object.utils.test.d.ts +2 -0
- package/esm/src/utils/object.utils.test.d.ts.map +1 -0
- package/esm/src/utils/object.utils.test.js +29 -0
- package/esm/src/utils/schema.utils.d.ts +11 -0
- package/esm/src/utils/schema.utils.d.ts.map +1 -0
- package/esm/src/utils/schema.utils.test.d.ts +2 -0
- package/esm/src/utils/schema.utils.test.d.ts.map +1 -0
- package/esm/src/utils/schema.utils.test.js +70 -0
- package/esm/src/utils/source-builder.d.ts +234 -0
- package/esm/src/utils/source-builder.d.ts.map +1 -0
- package/esm/src/utils/source-builder.js +447 -0
- package/esm/src/utils/source-builder.test.d.ts +2 -0
- package/esm/src/utils/source-builder.test.d.ts.map +1 -0
- package/esm/src/utils/source-builder.test.js +505 -0
- package/esm/src/utils/string-builder/options.d.ts.map +1 -0
- package/esm/src/utils/string-builder/string-builder.d.ts +73 -0
- package/esm/src/utils/string-builder/string-builder.d.ts.map +1 -0
- package/esm/src/utils/string-builder/string-builder.js +149 -0
- package/esm/src/utils/string-builder/string-builder.test.d.ts +2 -0
- package/esm/src/utils/string-builder/string-builder.test.d.ts.map +1 -0
- package/esm/src/utils/string-builder/string-builder.test.js +163 -0
- package/esm/src/utils/string-builder/utils.d.ts.map +1 -0
- package/esm/src/utils/string.utils.d.ts.map +1 -0
- package/esm/src/utils/string.utils.test.d.ts +2 -0
- package/esm/src/utils/string.utils.test.d.ts.map +1 -0
- package/esm/src/utils/string.utils.test.js +528 -0
- package/esm/src/utils/string.utils.types.d.ts.map +1 -0
- package/esm/src/utils/type.utils.d.ts.map +1 -0
- package/esm/tests/openapi.test.d.ts +2 -0
- package/esm/tests/openapi.test.d.ts.map +1 -0
- package/esm/tests/openapi.test.js +33 -0
- package/esm/tests/schema-factory.d.ts +42 -0
- package/esm/tests/schema-factory.d.ts.map +1 -0
- package/esm/tests/schema-factory.js +138 -0
- package/package.json +6 -6
- package/script/_dnt.shims.d.ts +1 -1
- package/script/_dnt.test_polyfills.d.ts +29 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/_dnt.test_polyfills.js +32 -0
- package/script/_dnt.test_shims.d.ts +14 -0
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/_dnt.test_shims.js +79 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.js +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +20 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +32 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +35 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +24 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +20 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +32 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +46 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.js +18 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +46 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +183 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +6 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.js +33 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.js +194 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +34 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.js +748 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +11 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +843 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.js +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.js +226 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.js +527 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.js +88 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +86 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.js +91 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +204 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.js +116 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.js +284 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.js +186 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.js +41 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.js +220 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +3 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +79 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +385 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +738 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.js +665 -0
- package/script/mod.d.ts +30 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +34 -0
- package/script/src/ast/node.d.ts +17 -0
- package/script/src/ast/node.d.ts.map +1 -0
- package/script/src/codegen/config.d.ts +16 -0
- package/script/src/codegen/config.d.ts.map +1 -0
- package/script/src/codegen/endpoints-generator.d.ts +18 -0
- package/script/src/codegen/endpoints-generator.d.ts.map +1 -0
- package/script/src/codegen/generator.d.ts +39 -0
- package/script/src/codegen/generator.d.ts.map +1 -0
- package/script/src/codegen/generator.js +123 -0
- package/script/src/codegen/internal-utils.d.ts.map +1 -0
- package/script/src/codegen/internal-utils.js +9 -0
- package/script/src/codegen/schemas-generator.d.ts +19 -0
- package/script/src/codegen/schemas-generator.d.ts.map +1 -0
- package/script/src/codegen/schemas-generator.js +49 -0
- package/script/src/codegen/services-generator.d.ts +18 -0
- package/script/src/codegen/services-generator.d.ts.map +1 -0
- package/script/src/codegen/types.d.ts +19 -0
- package/script/src/codegen/types.d.ts.map +1 -0
- package/script/src/collect/collector.d.ts +5 -0
- package/script/src/collect/collector.d.ts.map +1 -0
- package/script/src/collect/helpers.d.ts +5 -0
- package/script/src/collect/helpers.d.ts.map +1 -0
- package/script/src/collect/helpers.test.d.ts +2 -0
- package/script/src/collect/helpers.test.d.ts.map +1 -0
- package/script/src/collect/helpers.test.js +79 -0
- package/script/src/collect/types.d.ts +14 -0
- package/script/src/collect/types.d.ts.map +1 -0
- package/script/src/internal-utils.d.ts.map +1 -0
- package/script/src/parse/deref-proxy.d.ts.map +1 -0
- package/script/src/parse/deref-proxy.js +65 -0
- package/script/src/parse/openapi-types.d.ts.map +1 -0
- package/script/src/parse/parser.d.ts +19 -0
- package/script/src/parse/parser.d.ts.map +1 -0
- package/script/src/parse/parser.js +200 -0
- package/script/src/parse/types.d.ts.map +1 -0
- package/script/src/transform/api-types.d.ts +196 -0
- package/script/src/transform/api-types.d.ts.map +1 -0
- package/script/src/transform/helpers.d.ts +52 -0
- package/script/src/transform/helpers.d.ts.map +1 -0
- package/script/src/transform/helpers.js +173 -0
- package/script/src/transform/helpers.test.d.ts +2 -0
- package/script/src/transform/helpers.test.d.ts.map +1 -0
- package/script/src/transform/helpers.test.js +267 -0
- package/script/src/transform/transform-document.d.ts +5 -0
- package/script/src/transform/transform-document.d.ts.map +1 -0
- package/script/src/transform/transform-endpoint.d.ts +5 -0
- package/script/src/transform/transform-endpoint.d.ts.map +1 -0
- package/script/src/transform/transform-endpoint.js +272 -0
- package/script/src/transform/transform-schema.d.ts +6 -0
- package/script/src/transform/transform-schema.d.ts.map +1 -0
- package/script/src/transform/transform-schema.js +185 -0
- package/script/src/transform/transformer.d.ts +5 -0
- package/script/src/transform/transformer.d.ts.map +1 -0
- package/script/src/transform/types.d.ts.map +1 -0
- package/script/src/utils/action-provider.d.ts.map +1 -0
- package/script/src/utils/action-provider.js +33 -0
- package/script/src/utils/action-provider.test.d.ts +2 -0
- package/script/src/utils/action-provider.test.d.ts.map +1 -0
- package/script/src/utils/action-provider.test.js +30 -0
- package/script/src/utils/array.utils.d.ts.map +1 -0
- package/script/src/utils/asset-manager.d.ts +9 -0
- package/script/src/utils/asset-manager.d.ts.map +1 -0
- package/script/src/utils/asset-manager.js +55 -0
- package/script/src/utils/class.utils.d.ts.map +1 -0
- package/script/src/utils/class.utils.js +33 -0
- package/script/src/utils/common.utils.d.ts.map +1 -0
- package/script/src/utils/common.utils.test.d.ts +2 -0
- package/script/src/utils/common.utils.test.d.ts.map +1 -0
- package/script/src/utils/common.utils.test.js +20 -0
- package/script/src/utils/condition.d.ts.map +1 -0
- package/script/src/utils/condition.test.d.ts +2 -0
- package/script/src/utils/condition.test.d.ts.map +1 -0
- package/script/src/utils/condition.test.js +33 -0
- package/script/src/utils/endpoint.utils.d.ts +3 -0
- package/script/src/utils/endpoint.utils.d.ts.map +1 -0
- package/script/src/utils/endpoint.utils.test.d.ts +2 -0
- package/script/src/utils/endpoint.utils.test.d.ts.map +1 -0
- package/script/src/utils/endpoint.utils.test.js +33 -0
- package/script/src/utils/error.utils.d.ts.map +1 -0
- package/script/src/utils/factory.d.ts +21 -0
- package/script/src/utils/factory.d.ts.map +1 -0
- package/script/src/utils/factory.test.d.ts +2 -0
- package/script/src/utils/factory.test.d.ts.map +1 -0
- package/script/src/utils/factory.test.js +36 -0
- package/script/src/utils/file-system.utils.d.ts.map +1 -0
- package/script/src/utils/generator.utils.d.ts.map +1 -0
- package/script/src/utils/generator.utils.test.d.ts +2 -0
- package/script/src/utils/generator.utils.test.d.ts.map +1 -0
- package/script/src/utils/generator.utils.test.js +15 -0
- package/script/src/utils/object.utils.d.ts.map +1 -0
- package/script/src/utils/object.utils.js +40 -0
- package/script/src/utils/object.utils.test.d.ts +2 -0
- package/script/src/utils/object.utils.test.d.ts.map +1 -0
- package/script/src/utils/object.utils.test.js +31 -0
- package/script/src/utils/schema.utils.d.ts +11 -0
- package/script/src/utils/schema.utils.d.ts.map +1 -0
- package/script/src/utils/schema.utils.test.d.ts +2 -0
- package/script/src/utils/schema.utils.test.d.ts.map +1 -0
- package/script/src/utils/schema.utils.test.js +72 -0
- package/script/src/utils/source-builder.d.ts +234 -0
- package/script/src/utils/source-builder.d.ts.map +1 -0
- package/script/src/utils/source-builder.js +451 -0
- package/script/src/utils/source-builder.test.d.ts +2 -0
- package/script/src/utils/source-builder.test.d.ts.map +1 -0
- package/script/src/utils/source-builder.test.js +507 -0
- package/script/src/utils/string-builder/options.d.ts.map +1 -0
- package/script/src/utils/string-builder/string-builder.d.ts +73 -0
- package/script/src/utils/string-builder/string-builder.d.ts.map +1 -0
- package/script/src/utils/string-builder/string-builder.js +153 -0
- package/script/src/utils/string-builder/string-builder.test.d.ts +2 -0
- package/script/src/utils/string-builder/string-builder.test.d.ts.map +1 -0
- package/script/src/utils/string-builder/string-builder.test.js +165 -0
- package/script/src/utils/string-builder/utils.d.ts.map +1 -0
- package/script/src/utils/string.utils.d.ts.map +1 -0
- package/script/src/utils/string.utils.test.d.ts +2 -0
- package/script/src/utils/string.utils.test.d.ts.map +1 -0
- package/script/src/utils/string.utils.test.js +530 -0
- package/script/src/utils/string.utils.types.d.ts.map +1 -0
- package/script/src/utils/type.utils.d.ts.map +1 -0
- package/script/tests/openapi.test.d.ts +2 -0
- package/script/tests/openapi.test.d.ts.map +1 -0
- package/script/tests/openapi.test.js +35 -0
- package/script/tests/schema-factory.d.ts +42 -0
- package/script/tests/schema-factory.d.ts.map +1 -0
- package/script/tests/schema-factory.js +162 -0
- package/src/_dnt.shims.ts +69 -0
- package/src/_dnt.test_polyfills.ts +70 -0
- package/src/_dnt.test_shims.ts +72 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_equals.ts +38 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.ts +54 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.ts +35 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assertions.ts +18 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.ts +198 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_build_message.ts +51 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.ts +19 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_equal.ts +230 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_extend.ts +16 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_inspect_args.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_matchers.ts +1028 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_mock_util.ts +22 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_serializer.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_types.ts +923 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_utils.ts +283 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/expect.ts +620 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/fn.ts +91 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/mod.ts +89 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +214 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +134 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +204 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +39 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +18 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/_test_suite.ts +448 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/bdd.ts +1288 -0
- package/src/mod.ts +33 -0
- package/src/src/ast/node.ts +46 -0
- package/src/src/codegen/config.ts +28 -0
- package/src/src/codegen/endpoints-generator.ts +72 -0
- package/src/src/codegen/generator.ts +181 -0
- package/src/src/codegen/internal-utils.ts +6 -0
- package/src/src/codegen/schemas-generator.ts +87 -0
- package/src/src/codegen/services-generator.ts +77 -0
- package/src/src/codegen/types.ts +37 -0
- package/src/src/collect/collector.ts +142 -0
- package/src/src/collect/helpers.test.ts +91 -0
- package/src/src/collect/helpers.ts +36 -0
- package/src/src/collect/types.ts +21 -0
- package/src/src/internal-utils.ts +5 -0
- package/src/src/parse/deref-proxy.ts +64 -0
- package/src/src/parse/openapi-types.ts +949 -0
- package/src/src/parse/parser.ts +220 -0
- package/src/src/parse/types.ts +27 -0
- package/src/src/transform/api-types.ts +243 -0
- package/src/src/transform/helpers.test.ts +316 -0
- package/src/src/transform/helpers.ts +211 -0
- package/src/src/transform/transform-document.ts +35 -0
- package/src/src/transform/transform-endpoint.ts +331 -0
- package/src/src/transform/transform-schema.ts +217 -0
- package/src/src/transform/transformer.ts +52 -0
- package/src/src/transform/types.ts +52 -0
- package/src/src/utils/action-provider.test.ts +32 -0
- package/src/src/utils/action-provider.ts +58 -0
- package/src/src/utils/array.utils.ts +7 -0
- package/src/src/utils/asset-manager.ts +51 -0
- package/src/src/utils/class.utils.ts +40 -0
- package/src/src/utils/common.utils.test.ts +22 -0
- package/src/src/utils/common.utils.ts +86 -0
- package/src/src/utils/condition.test.ts +36 -0
- package/src/src/utils/condition.ts +7 -0
- package/src/src/utils/endpoint.utils.test.ts +36 -0
- package/src/src/utils/endpoint.utils.ts +10 -0
- package/src/src/utils/error.utils.ts +3 -0
- package/src/src/utils/factory.test.ts +31 -0
- package/src/src/utils/factory.ts +42 -0
- package/src/src/utils/file-system.utils.ts +48 -0
- package/src/src/utils/generator.utils.test.ts +16 -0
- package/src/src/utils/generator.utils.ts +6 -0
- package/src/src/utils/object.utils.test.ts +33 -0
- package/src/src/utils/object.utils.ts +32 -0
- package/src/src/utils/schema.utils.test.ts +88 -0
- package/src/src/utils/schema.utils.ts +142 -0
- package/src/src/utils/source-builder.test.ts +657 -0
- package/src/src/utils/source-builder.ts +589 -0
- package/src/src/utils/string-builder/options.ts +19 -0
- package/src/src/utils/string-builder/string-builder.test.ts +188 -0
- package/src/src/utils/string-builder/string-builder.ts +165 -0
- package/src/src/utils/string-builder/utils.ts +69 -0
- package/src/src/utils/string.utils.test.ts +691 -0
- package/src/src/utils/string.utils.ts +369 -0
- package/src/src/utils/string.utils.types.ts +179 -0
- package/src/src/utils/type.utils.ts +93 -0
- package/src/tests/openapi.test.ts +50 -0
- package/src/tests/schema-factory.ts +185 -0
- package/test_runner.js +221 -0
- package/esm/index.d.ts +0 -6
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -5
- package/esm/lib/ast/index.d.ts +0 -2
- package/esm/lib/ast/index.d.ts.map +0 -1
- package/esm/lib/ast/index.js +0 -1
- package/esm/lib/ast/node.d.ts +0 -15
- package/esm/lib/ast/node.d.ts.map +0 -1
- package/esm/lib/codegen/config.d.ts +0 -16
- package/esm/lib/codegen/config.d.ts.map +0 -1
- package/esm/lib/codegen/endpoints-generator.d.ts +0 -18
- package/esm/lib/codegen/endpoints-generator.d.ts.map +0 -1
- package/esm/lib/codegen/generator.d.ts +0 -39
- package/esm/lib/codegen/generator.d.ts.map +0 -1
- package/esm/lib/codegen/generator.js +0 -115
- package/esm/lib/codegen/index.d.ts +0 -7
- package/esm/lib/codegen/index.d.ts.map +0 -1
- package/esm/lib/codegen/index.js +0 -6
- package/esm/lib/codegen/internal-utils.d.ts.map +0 -1
- package/esm/lib/codegen/internal-utils.js +0 -5
- package/esm/lib/codegen/schemas-generator.d.ts +0 -19
- package/esm/lib/codegen/schemas-generator.d.ts.map +0 -1
- package/esm/lib/codegen/schemas-generator.js +0 -45
- package/esm/lib/codegen/services-generator.d.ts +0 -18
- package/esm/lib/codegen/services-generator.d.ts.map +0 -1
- package/esm/lib/codegen/types.d.ts +0 -19
- package/esm/lib/codegen/types.d.ts.map +0 -1
- package/esm/lib/collect/collector.d.ts +0 -4
- package/esm/lib/collect/collector.d.ts.map +0 -1
- package/esm/lib/collect/helpers.d.ts +0 -5
- package/esm/lib/collect/helpers.d.ts.map +0 -1
- package/esm/lib/collect/index.d.ts +0 -4
- package/esm/lib/collect/index.d.ts.map +0 -1
- package/esm/lib/collect/index.js +0 -3
- package/esm/lib/collect/types.d.ts +0 -13
- package/esm/lib/collect/types.d.ts.map +0 -1
- package/esm/lib/internal-utils.d.ts.map +0 -1
- package/esm/lib/parse/deref-proxy.d.ts.map +0 -1
- package/esm/lib/parse/deref-proxy.js +0 -62
- package/esm/lib/parse/index.d.ts +0 -4
- package/esm/lib/parse/index.d.ts.map +0 -1
- package/esm/lib/parse/index.js +0 -3
- package/esm/lib/parse/openapi-types.d.ts.map +0 -1
- package/esm/lib/parse/parser.d.ts +0 -19
- package/esm/lib/parse/parser.d.ts.map +0 -1
- package/esm/lib/parse/parser.js +0 -190
- package/esm/lib/parse/types.d.ts.map +0 -1
- package/esm/lib/transform/api-types.d.ts +0 -195
- package/esm/lib/transform/api-types.d.ts.map +0 -1
- package/esm/lib/transform/helpers.d.ts +0 -51
- package/esm/lib/transform/helpers.d.ts.map +0 -1
- package/esm/lib/transform/helpers.js +0 -158
- package/esm/lib/transform/index.d.ts +0 -3
- package/esm/lib/transform/index.d.ts.map +0 -1
- package/esm/lib/transform/index.js +0 -2
- package/esm/lib/transform/transform-document.d.ts +0 -4
- package/esm/lib/transform/transform-document.d.ts.map +0 -1
- package/esm/lib/transform/transform-endpoint.d.ts +0 -5
- package/esm/lib/transform/transform-endpoint.d.ts.map +0 -1
- package/esm/lib/transform/transform-endpoint.js +0 -275
- package/esm/lib/transform/transform-schema.d.ts +0 -5
- package/esm/lib/transform/transform-schema.d.ts.map +0 -1
- package/esm/lib/transform/transform-schema.js +0 -182
- package/esm/lib/transform/transformer.d.ts +0 -5
- package/esm/lib/transform/transformer.d.ts.map +0 -1
- package/esm/lib/transform/types.d.ts.map +0 -1
- package/esm/lib/utils/action-provider.d.ts.map +0 -1
- package/esm/lib/utils/action-provider.js +0 -35
- package/esm/lib/utils/array.utils.d.ts.map +0 -1
- package/esm/lib/utils/asset-manager.d.ts +0 -8
- package/esm/lib/utils/asset-manager.d.ts.map +0 -1
- package/esm/lib/utils/asset-manager.js +0 -49
- package/esm/lib/utils/class.utils.d.ts.map +0 -1
- package/esm/lib/utils/class.utils.js +0 -27
- package/esm/lib/utils/common.utils.d.ts.map +0 -1
- package/esm/lib/utils/condition.d.ts.map +0 -1
- package/esm/lib/utils/endpoint.utils.d.ts +0 -3
- package/esm/lib/utils/endpoint.utils.d.ts.map +0 -1
- package/esm/lib/utils/error.utils.d.ts.map +0 -1
- package/esm/lib/utils/factory.d.ts +0 -21
- package/esm/lib/utils/factory.d.ts.map +0 -1
- package/esm/lib/utils/file-system.utils.d.ts.map +0 -1
- package/esm/lib/utils/generator.utils.d.ts.map +0 -1
- package/esm/lib/utils/index.d.ts +0 -16
- package/esm/lib/utils/index.d.ts.map +0 -1
- package/esm/lib/utils/index.js +0 -15
- package/esm/lib/utils/object.utils.d.ts.map +0 -1
- package/esm/lib/utils/object.utils.js +0 -35
- package/esm/lib/utils/schema.utils.d.ts +0 -11
- package/esm/lib/utils/schema.utils.d.ts.map +0 -1
- package/esm/lib/utils/source-builder.d.ts +0 -233
- package/esm/lib/utils/source-builder.d.ts.map +0 -1
- package/esm/lib/utils/source-builder.js +0 -446
- package/esm/lib/utils/string-builder/index.d.ts +0 -4
- package/esm/lib/utils/string-builder/index.d.ts.map +0 -1
- package/esm/lib/utils/string-builder/index.js +0 -3
- package/esm/lib/utils/string-builder/options.d.ts.map +0 -1
- package/esm/lib/utils/string-builder/string-builder.d.ts +0 -73
- package/esm/lib/utils/string-builder/string-builder.d.ts.map +0 -1
- package/esm/lib/utils/string-builder/string-builder.js +0 -149
- package/esm/lib/utils/string-builder/utils.d.ts.map +0 -1
- package/esm/lib/utils/string.utils.d.ts.map +0 -1
- package/esm/lib/utils/string.utils.types.d.ts.map +0 -1
- package/esm/lib/utils/type.utils.d.ts.map +0 -1
- package/script/index.d.ts +0 -6
- package/script/index.d.ts.map +0 -1
- package/script/index.js +0 -8
- package/script/lib/ast/index.d.ts +0 -2
- package/script/lib/ast/index.d.ts.map +0 -1
- package/script/lib/ast/index.js +0 -4
- package/script/lib/ast/node.d.ts +0 -15
- package/script/lib/ast/node.d.ts.map +0 -1
- package/script/lib/codegen/config.d.ts +0 -16
- package/script/lib/codegen/config.d.ts.map +0 -1
- package/script/lib/codegen/endpoints-generator.d.ts +0 -18
- package/script/lib/codegen/endpoints-generator.d.ts.map +0 -1
- package/script/lib/codegen/generator.d.ts +0 -39
- package/script/lib/codegen/generator.d.ts.map +0 -1
- package/script/lib/codegen/generator.js +0 -121
- package/script/lib/codegen/index.d.ts +0 -7
- package/script/lib/codegen/index.d.ts.map +0 -1
- package/script/lib/codegen/index.js +0 -9
- package/script/lib/codegen/internal-utils.d.ts.map +0 -1
- package/script/lib/codegen/internal-utils.js +0 -8
- package/script/lib/codegen/schemas-generator.d.ts +0 -19
- package/script/lib/codegen/schemas-generator.d.ts.map +0 -1
- package/script/lib/codegen/schemas-generator.js +0 -49
- package/script/lib/codegen/services-generator.d.ts +0 -18
- package/script/lib/codegen/services-generator.d.ts.map +0 -1
- package/script/lib/codegen/types.d.ts +0 -19
- package/script/lib/codegen/types.d.ts.map +0 -1
- package/script/lib/collect/collector.d.ts +0 -4
- package/script/lib/collect/collector.d.ts.map +0 -1
- package/script/lib/collect/helpers.d.ts +0 -5
- package/script/lib/collect/helpers.d.ts.map +0 -1
- package/script/lib/collect/index.d.ts +0 -4
- package/script/lib/collect/index.d.ts.map +0 -1
- package/script/lib/collect/index.js +0 -6
- package/script/lib/collect/types.d.ts +0 -13
- package/script/lib/collect/types.d.ts.map +0 -1
- package/script/lib/internal-utils.d.ts.map +0 -1
- package/script/lib/parse/deref-proxy.d.ts.map +0 -1
- package/script/lib/parse/deref-proxy.js +0 -65
- package/script/lib/parse/index.d.ts +0 -4
- package/script/lib/parse/index.d.ts.map +0 -1
- package/script/lib/parse/index.js +0 -6
- package/script/lib/parse/openapi-types.d.ts.map +0 -1
- package/script/lib/parse/parser.d.ts +0 -19
- package/script/lib/parse/parser.d.ts.map +0 -1
- package/script/lib/parse/parser.js +0 -195
- package/script/lib/parse/types.d.ts.map +0 -1
- package/script/lib/transform/api-types.d.ts +0 -195
- package/script/lib/transform/api-types.d.ts.map +0 -1
- package/script/lib/transform/helpers.d.ts +0 -51
- package/script/lib/transform/helpers.d.ts.map +0 -1
- package/script/lib/transform/helpers.js +0 -171
- package/script/lib/transform/index.d.ts +0 -3
- package/script/lib/transform/index.d.ts.map +0 -1
- package/script/lib/transform/index.js +0 -5
- package/script/lib/transform/transform-document.d.ts +0 -4
- package/script/lib/transform/transform-document.d.ts.map +0 -1
- package/script/lib/transform/transform-endpoint.d.ts +0 -5
- package/script/lib/transform/transform-endpoint.d.ts.map +0 -1
- package/script/lib/transform/transform-endpoint.js +0 -278
- package/script/lib/transform/transform-schema.d.ts +0 -5
- package/script/lib/transform/transform-schema.d.ts.map +0 -1
- package/script/lib/transform/transform-schema.js +0 -185
- package/script/lib/transform/transformer.d.ts +0 -5
- package/script/lib/transform/transformer.d.ts.map +0 -1
- package/script/lib/transform/types.d.ts.map +0 -1
- package/script/lib/utils/action-provider.d.ts.map +0 -1
- package/script/lib/utils/action-provider.js +0 -39
- package/script/lib/utils/array.utils.d.ts.map +0 -1
- package/script/lib/utils/asset-manager.d.ts +0 -8
- package/script/lib/utils/asset-manager.d.ts.map +0 -1
- package/script/lib/utils/asset-manager.js +0 -54
- package/script/lib/utils/class.utils.d.ts.map +0 -1
- package/script/lib/utils/class.utils.js +0 -32
- package/script/lib/utils/common.utils.d.ts.map +0 -1
- package/script/lib/utils/condition.d.ts.map +0 -1
- package/script/lib/utils/endpoint.utils.d.ts +0 -3
- package/script/lib/utils/endpoint.utils.d.ts.map +0 -1
- package/script/lib/utils/error.utils.d.ts.map +0 -1
- package/script/lib/utils/factory.d.ts +0 -21
- package/script/lib/utils/factory.d.ts.map +0 -1
- package/script/lib/utils/file-system.utils.d.ts.map +0 -1
- package/script/lib/utils/generator.utils.d.ts.map +0 -1
- package/script/lib/utils/index.d.ts +0 -16
- package/script/lib/utils/index.d.ts.map +0 -1
- package/script/lib/utils/index.js +0 -18
- package/script/lib/utils/object.utils.d.ts.map +0 -1
- package/script/lib/utils/object.utils.js +0 -39
- package/script/lib/utils/schema.utils.d.ts +0 -11
- package/script/lib/utils/schema.utils.d.ts.map +0 -1
- package/script/lib/utils/source-builder.d.ts +0 -233
- package/script/lib/utils/source-builder.d.ts.map +0 -1
- package/script/lib/utils/source-builder.js +0 -450
- package/script/lib/utils/string-builder/index.d.ts +0 -4
- package/script/lib/utils/string-builder/index.d.ts.map +0 -1
- package/script/lib/utils/string-builder/index.js +0 -8
- package/script/lib/utils/string-builder/options.d.ts.map +0 -1
- package/script/lib/utils/string-builder/string-builder.d.ts +0 -73
- package/script/lib/utils/string-builder/string-builder.d.ts.map +0 -1
- package/script/lib/utils/string-builder/string-builder.js +0 -153
- package/script/lib/utils/string-builder/utils.d.ts.map +0 -1
- package/script/lib/utils/string.utils.d.ts.map +0 -1
- package/script/lib/utils/string.utils.types.d.ts.map +0 -1
- package/script/lib/utils/type.utils.d.ts.map +0 -1
- /package/esm/{lib → src}/ast/node.js +0 -0
- /package/esm/{lib → src}/codegen/config.js +0 -0
- /package/esm/{lib → src}/codegen/endpoints-generator.js +0 -0
- /package/esm/{lib → src}/codegen/internal-utils.d.ts +0 -0
- /package/esm/{lib → src}/codegen/services-generator.js +0 -0
- /package/esm/{lib → src}/codegen/types.js +0 -0
- /package/esm/{lib → src}/collect/collector.js +0 -0
- /package/esm/{lib → src}/collect/helpers.js +0 -0
- /package/esm/{lib → src}/collect/types.js +0 -0
- /package/esm/{lib → src}/internal-utils.d.ts +0 -0
- /package/esm/{lib → src}/internal-utils.js +0 -0
- /package/esm/{lib → src}/parse/deref-proxy.d.ts +0 -0
- /package/esm/{lib → src}/parse/openapi-types.d.ts +0 -0
- /package/esm/{lib → src}/parse/openapi-types.js +0 -0
- /package/esm/{lib → src}/parse/types.d.ts +0 -0
- /package/esm/{lib → src}/parse/types.js +0 -0
- /package/esm/{lib → src}/transform/api-types.js +0 -0
- /package/esm/{lib → src}/transform/transform-document.js +0 -0
- /package/esm/{lib → src}/transform/transformer.js +0 -0
- /package/esm/{lib → src}/transform/types.d.ts +0 -0
- /package/esm/{lib → src}/transform/types.js +0 -0
- /package/esm/{lib → src}/utils/action-provider.d.ts +0 -0
- /package/esm/{lib → src}/utils/array.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/array.utils.js +0 -0
- /package/esm/{lib → src}/utils/class.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/common.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/common.utils.js +0 -0
- /package/esm/{lib → src}/utils/condition.d.ts +0 -0
- /package/esm/{lib → src}/utils/condition.js +0 -0
- /package/esm/{lib → src}/utils/endpoint.utils.js +0 -0
- /package/esm/{lib → src}/utils/error.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/error.utils.js +0 -0
- /package/esm/{lib → src}/utils/factory.js +0 -0
- /package/esm/{lib → src}/utils/file-system.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/file-system.utils.js +0 -0
- /package/esm/{lib → src}/utils/generator.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/generator.utils.js +0 -0
- /package/esm/{lib → src}/utils/object.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/schema.utils.js +0 -0
- /package/esm/{lib → src}/utils/string-builder/options.d.ts +0 -0
- /package/esm/{lib → src}/utils/string-builder/options.js +0 -0
- /package/esm/{lib → src}/utils/string-builder/utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/string-builder/utils.js +0 -0
- /package/esm/{lib → src}/utils/string.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/string.utils.js +0 -0
- /package/esm/{lib → src}/utils/string.utils.types.d.ts +0 -0
- /package/esm/{lib → src}/utils/string.utils.types.js +0 -0
- /package/esm/{lib → src}/utils/type.utils.d.ts +0 -0
- /package/esm/{lib → src}/utils/type.utils.js +0 -0
- /package/script/{lib → src}/ast/node.js +0 -0
- /package/script/{lib → src}/codegen/config.js +0 -0
- /package/script/{lib → src}/codegen/endpoints-generator.js +0 -0
- /package/script/{lib → src}/codegen/internal-utils.d.ts +0 -0
- /package/script/{lib → src}/codegen/services-generator.js +0 -0
- /package/script/{lib → src}/codegen/types.js +0 -0
- /package/script/{lib → src}/collect/collector.js +0 -0
- /package/script/{lib → src}/collect/helpers.js +0 -0
- /package/script/{lib → src}/collect/types.js +0 -0
- /package/script/{lib → src}/internal-utils.d.ts +0 -0
- /package/script/{lib → src}/internal-utils.js +0 -0
- /package/script/{lib → src}/parse/deref-proxy.d.ts +0 -0
- /package/script/{lib → src}/parse/openapi-types.d.ts +0 -0
- /package/script/{lib → src}/parse/openapi-types.js +0 -0
- /package/script/{lib → src}/parse/types.d.ts +0 -0
- /package/script/{lib → src}/parse/types.js +0 -0
- /package/script/{lib → src}/transform/api-types.js +0 -0
- /package/script/{lib → src}/transform/transform-document.js +0 -0
- /package/script/{lib → src}/transform/transformer.js +0 -0
- /package/script/{lib → src}/transform/types.d.ts +0 -0
- /package/script/{lib → src}/transform/types.js +0 -0
- /package/script/{lib → src}/utils/action-provider.d.ts +0 -0
- /package/script/{lib → src}/utils/array.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/array.utils.js +0 -0
- /package/script/{lib → src}/utils/class.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/common.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/common.utils.js +0 -0
- /package/script/{lib → src}/utils/condition.d.ts +0 -0
- /package/script/{lib → src}/utils/condition.js +0 -0
- /package/script/{lib → src}/utils/endpoint.utils.js +0 -0
- /package/script/{lib → src}/utils/error.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/error.utils.js +0 -0
- /package/script/{lib → src}/utils/factory.js +0 -0
- /package/script/{lib → src}/utils/file-system.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/file-system.utils.js +0 -0
- /package/script/{lib → src}/utils/generator.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/generator.utils.js +0 -0
- /package/script/{lib → src}/utils/object.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/schema.utils.js +0 -0
- /package/script/{lib → src}/utils/string-builder/options.d.ts +0 -0
- /package/script/{lib → src}/utils/string-builder/options.js +0 -0
- /package/script/{lib → src}/utils/string-builder/utils.d.ts +0 -0
- /package/script/{lib → src}/utils/string-builder/utils.js +0 -0
- /package/script/{lib → src}/utils/string.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/string.utils.js +0 -0
- /package/script/{lib → src}/utils/string.utils.types.d.ts +0 -0
- /package/script/{lib → src}/utils/string.utils.types.js +0 -0
- /package/script/{lib → src}/utils/type.utils.d.ts +0 -0
- /package/script/{lib → src}/utils/type.utils.js +0 -0
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
import "../../_dnt.test_polyfills.js";
|
|
2
|
+
import { EOL } from 'node:os';
|
|
3
|
+
import { expect } from '../../deps/jsr.io/@std/expect/1.0.12/mod.js';
|
|
4
|
+
import { beforeEach, describe, it } from '../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
5
|
+
import { builderTemplate, SourceBuilder } from './source-builder.js';
|
|
6
|
+
import { appendValueGroup } from './string-builder/utils.js';
|
|
7
|
+
describe('SourceBuilder', () => {
|
|
8
|
+
let sb;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
sb = new SourceBuilder();
|
|
11
|
+
});
|
|
12
|
+
describe('constructor', () => {
|
|
13
|
+
it('should initialize with default options', () => {
|
|
14
|
+
const options = sb.options;
|
|
15
|
+
expect(options.indent).toEqual({ type: 'spaces', count: 2 });
|
|
16
|
+
expect(options.newLine).toBe(EOL);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('fromString', () => {
|
|
20
|
+
it('should create a new instance of SourceBuilder with the given string', () => {
|
|
21
|
+
const str = 'test string';
|
|
22
|
+
const sb = SourceBuilder.fromString(str);
|
|
23
|
+
expect(sb.toString()).toEqual(str);
|
|
24
|
+
});
|
|
25
|
+
it('should create a new instance of SourceBuilder with the given string and options', () => {
|
|
26
|
+
const str = 'test string';
|
|
27
|
+
const options = {
|
|
28
|
+
indent: { type: 'tabs' },
|
|
29
|
+
newLine: '\n-',
|
|
30
|
+
};
|
|
31
|
+
const sb = SourceBuilder.fromString(str, options);
|
|
32
|
+
expect(sb.toString()).toEqual(str);
|
|
33
|
+
expect(sb.options).toEqual(expect.objectContaining(options));
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('build', () => {
|
|
37
|
+
it('should build a string using a callback function that receives a `SourceBuilder` instance', () => {
|
|
38
|
+
const buildAction = (builder) => {
|
|
39
|
+
builder.append('hello');
|
|
40
|
+
builder.append('world');
|
|
41
|
+
};
|
|
42
|
+
const result = SourceBuilder.build(buildAction);
|
|
43
|
+
expect(result).toEqual('helloworld');
|
|
44
|
+
});
|
|
45
|
+
it('should build a string using a callback function that receives a `SourceBuilder` instance and options', () => {
|
|
46
|
+
const buildAction = (builder) => {
|
|
47
|
+
builder.appendLine('hello');
|
|
48
|
+
builder.indent((b) => b.append('world'));
|
|
49
|
+
};
|
|
50
|
+
const options = {
|
|
51
|
+
indent: { type: 'spaces', count: 4 },
|
|
52
|
+
newLine: '\r\n\t',
|
|
53
|
+
};
|
|
54
|
+
const result = SourceBuilder.build(buildAction, options);
|
|
55
|
+
expect(result).toEqual(`hello${options.newLine} world`);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('append', () => {
|
|
59
|
+
it('should handle consecutive line breaks', () => {
|
|
60
|
+
sb.append('line1', EOL, EOL, EOL, 'line2');
|
|
61
|
+
expect(sb.toString()).toBe(`line1${EOL}${EOL}${EOL}line2`);
|
|
62
|
+
});
|
|
63
|
+
it('should handle mixed line breaks', () => {
|
|
64
|
+
sb.append('line1\r\n', '\n', 'line2\r', '\r', 'line3\n', 'line4');
|
|
65
|
+
expect(sb.toString()).toBe(`line1${EOL}${EOL}line2line3${EOL}line4`);
|
|
66
|
+
});
|
|
67
|
+
it('should handle strings with special chars', () => {
|
|
68
|
+
sb.append('line1 {', EOL, 'line2}');
|
|
69
|
+
expect(sb.toString()).toBe(`line1 {${EOL}line2}`);
|
|
70
|
+
});
|
|
71
|
+
it('should handle long strings without line breaks', () => {
|
|
72
|
+
sb.append('This is a long string without any line breaks.');
|
|
73
|
+
expect(sb.toString()).toBe('This is a long string without any line breaks.');
|
|
74
|
+
});
|
|
75
|
+
it('should handle multiple calls', () => {
|
|
76
|
+
sb.append('line1', EOL);
|
|
77
|
+
sb.append('line2', EOL);
|
|
78
|
+
sb.append('line3', EOL);
|
|
79
|
+
expect(sb.toString()).toBe(`line1${EOL}line2${EOL}line3${EOL}`);
|
|
80
|
+
});
|
|
81
|
+
it('should handle empty input', () => {
|
|
82
|
+
sb.append('', '', '', EOL, '', '');
|
|
83
|
+
expect(sb.toString()).toBe(EOL);
|
|
84
|
+
});
|
|
85
|
+
it('should apply the provided builder function to the source builder', () => {
|
|
86
|
+
const builder = new SourceBuilder().append((b) => b.append('foo'));
|
|
87
|
+
expect(builder.toString()).toBe('foo');
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
describe('appendIf', () => {
|
|
91
|
+
it('should append the string when condition is true', () => {
|
|
92
|
+
sb.appendIf(true, 'line1', EOL);
|
|
93
|
+
expect(sb.toString()).toBe(`line1${EOL}`);
|
|
94
|
+
});
|
|
95
|
+
it('should not append the string when condition is false', () => {
|
|
96
|
+
sb.appendIf(false, 'line1', EOL);
|
|
97
|
+
expect(sb.toString()).toBe('');
|
|
98
|
+
});
|
|
99
|
+
it('should append the string when condition is a function returning true', () => {
|
|
100
|
+
sb.appendIf(() => true, 'line1', EOL);
|
|
101
|
+
expect(sb.toString()).toBe(`line1${EOL}`);
|
|
102
|
+
});
|
|
103
|
+
it('should not append the string when condition is a function returning false', () => {
|
|
104
|
+
sb.appendIf(() => false, 'line1', EOL);
|
|
105
|
+
expect(sb.toString()).toBe('');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
describe('appendLineIf', () => {
|
|
109
|
+
it('should append the string when condition is true', () => {
|
|
110
|
+
sb.appendLineIf(true, 'line1');
|
|
111
|
+
expect(sb.toString()).toBe(`line1${EOL}`);
|
|
112
|
+
});
|
|
113
|
+
it('should not append the string when condition is false', () => {
|
|
114
|
+
sb.appendLineIf(false, 'line1');
|
|
115
|
+
expect(sb.toString()).toBe('');
|
|
116
|
+
});
|
|
117
|
+
it('should append the string when condition is a function returning true', () => {
|
|
118
|
+
sb.appendLineIf(() => true, 'line1');
|
|
119
|
+
expect(sb.toString()).toBe(`line1${EOL}`);
|
|
120
|
+
});
|
|
121
|
+
it('should not append the string when condition is a function returning false', () => {
|
|
122
|
+
sb.appendLineIf(() => false, 'line1');
|
|
123
|
+
expect(sb.toString()).toBe('');
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
describe('prependIf', () => {
|
|
127
|
+
it('should prepend the specified value if the condition is true', () => {
|
|
128
|
+
const builder = new SourceBuilder().append('bar').prependIf(true, 'foo');
|
|
129
|
+
expect(builder.toString()).toBe('foobar');
|
|
130
|
+
});
|
|
131
|
+
it('should not prepend the specified value if the condition is false', () => {
|
|
132
|
+
const builder = new SourceBuilder().append('bar').prependIf(false, 'foo');
|
|
133
|
+
expect(builder.toString()).toBe('bar');
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
describe('prependLineIf', () => {
|
|
137
|
+
it('should prepend the specified value with a line terminator if the condition is true', () => {
|
|
138
|
+
const builder = new SourceBuilder().append('bar').prependLineIf(true, 'foo');
|
|
139
|
+
expect(builder.toString()).toBe(`foo${EOL}bar`);
|
|
140
|
+
});
|
|
141
|
+
it('should not prepend the specified value if the condition is false', () => {
|
|
142
|
+
const builder = new SourceBuilder().append('bar').prependLineIf(false, 'foo');
|
|
143
|
+
expect(builder.toString()).toBe('bar');
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
describe('appendWithLinePrefix', () => {
|
|
147
|
+
it('should append the specified values with the specified line prefix', () => {
|
|
148
|
+
const builder = new SourceBuilder().appendWithLinePrefix('// ', 'foo', 'bar');
|
|
149
|
+
expect(builder.toString()).toBe('// foobar');
|
|
150
|
+
});
|
|
151
|
+
it('should handle null and undefined values', () => {
|
|
152
|
+
const builder = new SourceBuilder().appendWithLinePrefix('// ', 'foo', null, undefined, 'bar');
|
|
153
|
+
expect(builder.toString()).toBe('// foobar');
|
|
154
|
+
});
|
|
155
|
+
it('should apply the provided builder function with the specified line prefix', () => {
|
|
156
|
+
const builder = new SourceBuilder().appendWithLinePrefix('// ', (b) => {
|
|
157
|
+
b.appendLine('foo');
|
|
158
|
+
b.appendLine('bar');
|
|
159
|
+
});
|
|
160
|
+
expect(builder.toString()).toBe(`// foo${EOL}// bar${EOL}`);
|
|
161
|
+
});
|
|
162
|
+
it('should apply the provided builder function with the specified line prefix and indentation', () => {
|
|
163
|
+
const builder = new SourceBuilder().indent((b) => b.appendWithLinePrefix('// ', (b) => {
|
|
164
|
+
b.appendLine('foo');
|
|
165
|
+
b.appendLine('bar');
|
|
166
|
+
}));
|
|
167
|
+
expect(builder.toString()).toBe(` // foo${EOL} // bar${EOL}`);
|
|
168
|
+
});
|
|
169
|
+
it('should write indents after the prefix', () => {
|
|
170
|
+
const builder = new SourceBuilder().indent((b) => b.appendWithLinePrefix('// ', (b) => {
|
|
171
|
+
b.indent((b) => b.appendLine('foo'));
|
|
172
|
+
}));
|
|
173
|
+
expect(builder.toString()).toBe(` // foo${EOL}`);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
describe('appendLineWithLinePrefix', () => {
|
|
177
|
+
it('should append the specified values as a new line with the specified line prefix', () => {
|
|
178
|
+
const builder = new SourceBuilder().appendLineWithLinePrefix('// ', 'foo', 'bar');
|
|
179
|
+
expect(builder.toString()).toBe('// foobar' + EOL);
|
|
180
|
+
});
|
|
181
|
+
it('should handle null and undefined values', () => {
|
|
182
|
+
const builder = new SourceBuilder().appendLineWithLinePrefix('// ', 'foo', null, undefined, 'bar');
|
|
183
|
+
expect(builder.toString()).toBe('// foobar' + EOL);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
describe('ensurePreviousLineEmpty', () => {
|
|
187
|
+
it('should insert one empty line when current line is empty', () => {
|
|
188
|
+
sb.append('line1', EOL, 'line2', EOL);
|
|
189
|
+
sb.ensurePreviousLineEmpty();
|
|
190
|
+
expect(sb.toString()).toBe(`line1${EOL}line2${EOL}${EOL}`);
|
|
191
|
+
});
|
|
192
|
+
it('should insert two empty lines when current line is not empty', () => {
|
|
193
|
+
sb.append('line1', EOL, 'line2');
|
|
194
|
+
sb.ensurePreviousLineEmpty();
|
|
195
|
+
expect(sb.toString()).toBe(`line1${EOL}line2${EOL}${EOL}`);
|
|
196
|
+
});
|
|
197
|
+
it('should not insert an empty line when already empty', () => {
|
|
198
|
+
sb.append('line1', EOL, 'line2', EOL, EOL);
|
|
199
|
+
sb.ensurePreviousLineEmpty();
|
|
200
|
+
expect(sb.toString()).toBe(`line1${EOL}line2${EOL}${EOL}`);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
describe('ensureCurrentLineEmpty', () => {
|
|
204
|
+
it('should insert an empty line', () => {
|
|
205
|
+
sb.append('line1', EOL, 'line2');
|
|
206
|
+
sb.ensureCurrentLineEmpty();
|
|
207
|
+
expect(sb.toString()).toBe(`line1${EOL}line2${EOL}`);
|
|
208
|
+
});
|
|
209
|
+
it('should not insert an empty line when already empty', () => {
|
|
210
|
+
sb.append('line1', EOL, 'line2', EOL);
|
|
211
|
+
sb.ensureCurrentLineEmpty();
|
|
212
|
+
expect(sb.toString()).toBe(`line1${EOL}line2${EOL}`);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
describe('pretendPreviousLineEmpty', () => {
|
|
216
|
+
it('should pretend the previous line is empty', () => {
|
|
217
|
+
sb.appendLine('line1').append('a').pretendPreviousLineEmpty().ensurePreviousLineEmpty().append('b');
|
|
218
|
+
expect(sb.toString()).toBe(`line1${EOL}ab`);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
describe('pretendCurrentLineEmpty', () => {
|
|
222
|
+
it('should pretend the previous line is empty', () => {
|
|
223
|
+
sb.append('a').pretendCurrentLineEmpty().ensureCurrentLineEmpty().append('b');
|
|
224
|
+
expect(sb.toString()).toBe(`ab`);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
describe('if', () => {
|
|
228
|
+
it('should append the content when condition is true', () => {
|
|
229
|
+
sb.if(true, (x) => x.append('stuff'));
|
|
230
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
231
|
+
});
|
|
232
|
+
it('should not append the content when condition is false', () => {
|
|
233
|
+
sb.if(false, (x) => x.append('stuff'));
|
|
234
|
+
expect(sb.toString()).toBe(``);
|
|
235
|
+
});
|
|
236
|
+
it('should append the content when condition function returns true', () => {
|
|
237
|
+
sb.if(() => true, (x) => x.append('stuff'));
|
|
238
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
239
|
+
});
|
|
240
|
+
it('should not append the content when condition function returns false', () => {
|
|
241
|
+
sb.if(() => false, (x) => x.append('stuff'));
|
|
242
|
+
expect(sb.toString()).toBe(``);
|
|
243
|
+
});
|
|
244
|
+
it('should append the correct content when condition is true', () => {
|
|
245
|
+
sb.if(true, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
246
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
247
|
+
});
|
|
248
|
+
it('should append the correct content when condition is false', () => {
|
|
249
|
+
sb.if(false, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
250
|
+
expect(sb.toString()).toBe(`other stuff`);
|
|
251
|
+
});
|
|
252
|
+
it('should append the correct content when condition function returns true', () => {
|
|
253
|
+
sb.if(() => true, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
254
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
255
|
+
});
|
|
256
|
+
it('should append the correct content when condition function returns false', () => {
|
|
257
|
+
sb.if(() => false, (x) => x.append('stuff'), (x) => x.append('other stuff'));
|
|
258
|
+
expect(sb.toString()).toBe(`other stuff`);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
describe('indent', () => {
|
|
262
|
+
it('should correctly indent the content (fn)', () => {
|
|
263
|
+
sb.append('line1', EOL);
|
|
264
|
+
sb.indent((innerSb) => {
|
|
265
|
+
innerSb.append('line2', EOL);
|
|
266
|
+
});
|
|
267
|
+
sb.append('line3', EOL);
|
|
268
|
+
expect(sb.toString()).toBe(`line1${EOL} line2${EOL}line3${EOL}`);
|
|
269
|
+
});
|
|
270
|
+
it('should correctly indent the content (string)', () => {
|
|
271
|
+
sb.append('line1', EOL);
|
|
272
|
+
sb.indent('line2\n');
|
|
273
|
+
sb.append('line3', EOL);
|
|
274
|
+
expect(sb.toString()).toBe(`line1${EOL} line2${EOL}line3${EOL}`);
|
|
275
|
+
});
|
|
276
|
+
it('should correctly handle nested indentation', () => {
|
|
277
|
+
sb.indent((innerSb1) => {
|
|
278
|
+
innerSb1.append('line1', EOL);
|
|
279
|
+
innerSb1.indent((innerSb2) => {
|
|
280
|
+
innerSb2.append('line2', EOL);
|
|
281
|
+
});
|
|
282
|
+
innerSb1.append('line3', EOL);
|
|
283
|
+
});
|
|
284
|
+
expect(sb.toString()).toBe(` line1${EOL} line2${EOL} line3${EOL}`);
|
|
285
|
+
});
|
|
286
|
+
it('should correctly handle multiline strings (fn)', () => {
|
|
287
|
+
sb.indent((innerSb) => {
|
|
288
|
+
innerSb.append(`line1${EOL}line2`, EOL);
|
|
289
|
+
});
|
|
290
|
+
expect(sb.toString()).toBe(` line1${EOL} line2${EOL}`);
|
|
291
|
+
});
|
|
292
|
+
it('should correctly handle multiline strings (string)', () => {
|
|
293
|
+
sb.indent('line1\nline2\n');
|
|
294
|
+
expect(sb.toString()).toBe(` line1${EOL} line2${EOL}`);
|
|
295
|
+
});
|
|
296
|
+
it('should nest indentations', () => {
|
|
297
|
+
sb.appendLine('(')
|
|
298
|
+
.indent((b1) => {
|
|
299
|
+
b1.appendLine('(')
|
|
300
|
+
.indent((b2) => {
|
|
301
|
+
b2.appendLine('line1');
|
|
302
|
+
})
|
|
303
|
+
.appendLine(')');
|
|
304
|
+
})
|
|
305
|
+
.appendLine(')');
|
|
306
|
+
expect(sb.toString()).toBe(`(${EOL} (${EOL} line1${EOL} )${EOL})${EOL}`);
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
describe('indentIf', () => {
|
|
310
|
+
it('should indent when condition is true', () => {
|
|
311
|
+
sb.indentIf(true, (x) => x.append('stuff'));
|
|
312
|
+
expect(sb.toString()).toBe(` stuff`);
|
|
313
|
+
});
|
|
314
|
+
it('should not indent when condition is false', () => {
|
|
315
|
+
sb.indentIf(false, (x) => x.append('stuff'));
|
|
316
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
317
|
+
});
|
|
318
|
+
it('should indent when condition function returns true', () => {
|
|
319
|
+
sb.indentIf(() => true, (x) => x.append('stuff'));
|
|
320
|
+
expect(sb.toString()).toBe(` stuff`);
|
|
321
|
+
});
|
|
322
|
+
it('should not indent when condition function returns false', () => {
|
|
323
|
+
sb.indentIf(() => false, (x) => x.append('stuff'));
|
|
324
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
describe('parenthesize', () => {
|
|
328
|
+
it('should parenthesize the content with the given brackets string', () => {
|
|
329
|
+
sb.parenthesize('{}', (x) => x.append('stuff'));
|
|
330
|
+
expect(sb.toString()).toBe(`{stuff}`);
|
|
331
|
+
});
|
|
332
|
+
it('should parenthesize the content with the given brackets array', () => {
|
|
333
|
+
sb.parenthesize(['{', '}'], (x) => x.append('stuff'));
|
|
334
|
+
expect(sb.toString()).toBe(`{stuff}`);
|
|
335
|
+
});
|
|
336
|
+
it('should parenthesize and indent the content (fn)', () => {
|
|
337
|
+
sb.parenthesize('()', (x) => x.append(`${EOL}stuff${EOL}`));
|
|
338
|
+
expect(sb.toString()).toBe(`(${EOL} stuff${EOL})`);
|
|
339
|
+
});
|
|
340
|
+
it('should parenthesize and indent the content (string)', () => {
|
|
341
|
+
sb.parenthesize('()', `${EOL}stuff${EOL}`);
|
|
342
|
+
expect(sb.toString()).toBe(`(${EOL} stuff${EOL})`);
|
|
343
|
+
});
|
|
344
|
+
it('should parenthesize but not indent the content when indent is false', () => {
|
|
345
|
+
sb.parenthesize('()', (x) => x.append(`${EOL}stuff${EOL}`), { indent: false });
|
|
346
|
+
expect(sb.toString()).toBe(`(${EOL}stuff${EOL})`);
|
|
347
|
+
});
|
|
348
|
+
it('should parenthesize the content with the given brackets string (multiline)', () => {
|
|
349
|
+
sb.parenthesize('{}', (x) => x.append('stuff'), { multiline: true });
|
|
350
|
+
expect(sb.toString()).toBe(`{${EOL} stuff${EOL}}`);
|
|
351
|
+
});
|
|
352
|
+
it('should parenthesize the content with the given brackets array (multiline)', () => {
|
|
353
|
+
sb.parenthesize(['{', '}'], (x) => x.append('stuff'), { multiline: true });
|
|
354
|
+
expect(sb.toString()).toBe(`{${EOL} stuff${EOL}}`);
|
|
355
|
+
});
|
|
356
|
+
it('should parenthesize and indent the content (fn) (multiline)', () => {
|
|
357
|
+
sb.parenthesize('()', (x) => x.append(`${EOL}stuff${EOL}`), { multiline: true });
|
|
358
|
+
expect(sb.toString()).toBe(`(${EOL}${EOL} stuff${EOL})`);
|
|
359
|
+
});
|
|
360
|
+
it('should parenthesize and indent the content (string) (multiline)', () => {
|
|
361
|
+
sb.parenthesize('()', `${EOL}stuff${EOL}`, { multiline: true });
|
|
362
|
+
expect(sb.toString()).toBe(`(${EOL}${EOL} stuff${EOL})`);
|
|
363
|
+
});
|
|
364
|
+
it('should parenthesize but not indent the content when indent is false (multiline)', () => {
|
|
365
|
+
sb.parenthesize('()', (x) => x.append(`${EOL}stuff${EOL}`), { multiline: true, indent: false });
|
|
366
|
+
expect(sb.toString()).toBe(`(${EOL}${EOL}stuff${EOL})`);
|
|
367
|
+
});
|
|
368
|
+
it('should ignore first ensurePreviousLineEmpty', () => {
|
|
369
|
+
sb.parenthesize('()', (x) => x.ensurePreviousLineEmpty().append('stuff'), { multiline: true });
|
|
370
|
+
expect(sb.toString()).toBe(`(${EOL} stuff${EOL})`);
|
|
371
|
+
});
|
|
372
|
+
it('should not ignore first ensurePreviousLineEmpty if disabled', () => {
|
|
373
|
+
sb.parenthesize('()', (x) => x.ensurePreviousLineEmpty().append('stuff'), {
|
|
374
|
+
multiline: true,
|
|
375
|
+
pretendEmpty: false,
|
|
376
|
+
});
|
|
377
|
+
expect(sb.toString()).toBe(`(${EOL}${EOL} stuff${EOL})`);
|
|
378
|
+
});
|
|
379
|
+
});
|
|
380
|
+
describe('parenthesizeIf', () => {
|
|
381
|
+
it('should parenthesize when condition is true (fn)', () => {
|
|
382
|
+
sb.parenthesizeIf(true, '()', (x) => x.append('stuff'));
|
|
383
|
+
expect(sb.toString()).toBe(`(stuff)`);
|
|
384
|
+
});
|
|
385
|
+
it('should parenthesize when condition is true (string)', () => {
|
|
386
|
+
sb.parenthesizeIf(true, '()', 'stuff');
|
|
387
|
+
expect(sb.toString()).toBe(`(stuff)`);
|
|
388
|
+
});
|
|
389
|
+
it('should not parenthesize when condition is false', () => {
|
|
390
|
+
sb.parenthesizeIf(false, '()', (x) => x.append('stuff'));
|
|
391
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
392
|
+
});
|
|
393
|
+
it('should parenthesize when condition function returns true', () => {
|
|
394
|
+
sb.parenthesizeIf(() => true, '()', (x) => x.append('stuff'));
|
|
395
|
+
expect(sb.toString()).toBe(`(stuff)`);
|
|
396
|
+
});
|
|
397
|
+
it('should not parenthesize when condition function returns false', () => {
|
|
398
|
+
sb.parenthesizeIf(() => false, '()', (x) => x.append('stuff'));
|
|
399
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
400
|
+
});
|
|
401
|
+
it('should parenthesize when condition is true (fn) (multiline)', () => {
|
|
402
|
+
sb.parenthesizeIf(true, '()', (x) => x.append('stuff'), { multiline: true });
|
|
403
|
+
expect(sb.toString()).toBe(`(${EOL} stuff${EOL})`);
|
|
404
|
+
});
|
|
405
|
+
it('should parenthesize when condition is true (string) (multiline)', () => {
|
|
406
|
+
sb.parenthesizeIf(true, '()', 'stuff', { multiline: true });
|
|
407
|
+
expect(sb.toString()).toBe(`(${EOL} stuff${EOL})`);
|
|
408
|
+
});
|
|
409
|
+
it('should not parenthesize when condition is false (multiline)', () => {
|
|
410
|
+
sb.parenthesizeIf(false, '()', (x) => x.append('stuff'), { multiline: true });
|
|
411
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
412
|
+
});
|
|
413
|
+
it('should parenthesize when condition function returns true (multiline)', () => {
|
|
414
|
+
sb.parenthesizeIf(() => true, '()', (x) => x.append('stuff'), { multiline: true });
|
|
415
|
+
expect(sb.toString()).toBe(`(${EOL} stuff${EOL})`);
|
|
416
|
+
});
|
|
417
|
+
it('should not parenthesize when condition function returns false (multiline)', () => {
|
|
418
|
+
sb.parenthesizeIf(() => false, '()', (x) => x.append('stuff'), { multiline: true });
|
|
419
|
+
expect(sb.toString()).toBe(`stuff`);
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
describe('forEach', () => {
|
|
423
|
+
it('should add the content for each item', () => {
|
|
424
|
+
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`(${item})`));
|
|
425
|
+
expect(sb.toString()).toBe(`(a)(b)(c)`);
|
|
426
|
+
});
|
|
427
|
+
it('should add the content for items that match the condition', () => {
|
|
428
|
+
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`(${item})`), { condition: (item) => item === 'b' });
|
|
429
|
+
expect(sb.toString()).toBe(`(b)`);
|
|
430
|
+
});
|
|
431
|
+
it('should add the content for each item with the given string separator', () => {
|
|
432
|
+
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), { separator: ', ' });
|
|
433
|
+
expect(sb.toString()).toBe(`item: a, item: b, item: c`);
|
|
434
|
+
});
|
|
435
|
+
it('should add the content for each item with the given separator builder', () => {
|
|
436
|
+
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), {
|
|
437
|
+
separator: (x, p, n, pi, ni) => x.append(`(${p}:${pi}), (${n}:${ni})`),
|
|
438
|
+
});
|
|
439
|
+
expect(sb.toString()).toBe(`item: a(a:0), (b:1)item: b(b:1), (c:2)item: c`);
|
|
440
|
+
});
|
|
441
|
+
it('should add the content for items that match the condition with the given string separator', () => {
|
|
442
|
+
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), {
|
|
443
|
+
condition: (item) => item === 'a' || item === 'c',
|
|
444
|
+
separator: ', ',
|
|
445
|
+
});
|
|
446
|
+
expect(sb.toString()).toBe(`item: a, item: c`);
|
|
447
|
+
});
|
|
448
|
+
it('should add the content for items that match the condition with the given separator builder', () => {
|
|
449
|
+
sb.forEach(['a', 'b', 'c'], (x, item) => x.append(`item: ${item}`), {
|
|
450
|
+
condition: (item) => item === 'a' || item === 'c',
|
|
451
|
+
separator: (x, p, n, pi, ni) => x.append(`(${p}:${pi}), (${n}:${ni})`),
|
|
452
|
+
});
|
|
453
|
+
expect(sb.toString()).toBe(`item: a(a:0), (c:2)item: c`);
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
describe('forEachIf', () => {
|
|
457
|
+
it('should add the content for each item when condition is true', () => {
|
|
458
|
+
sb.forEachIf(true, ['a', 'b', 'c'], (x, item) => x.append(`(${item})`));
|
|
459
|
+
expect(sb.toString()).toBe(`(a)(b)(c)`);
|
|
460
|
+
});
|
|
461
|
+
it('should not add the content for each item when condition is false', () => {
|
|
462
|
+
sb.forEachIf(false, ['a', 'b', 'c'], (x, item) => x.append(`(${item})`));
|
|
463
|
+
expect(sb.toString()).toBe(``);
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
describe('appendSeparated', () => {
|
|
467
|
+
it('should add the content for each item with the given string separator', () => {
|
|
468
|
+
sb.appendSeparated(['a', 'b', 'c'], ', ');
|
|
469
|
+
expect(sb.toString()).toBe(`a, b, c`);
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
describe('appendSeparatedIf', () => {
|
|
473
|
+
it('should add the content for each item with the given string separator when condition is true', () => {
|
|
474
|
+
sb.appendSeparatedIf(true, ['a', 'b', 'c'], ', ');
|
|
475
|
+
expect(sb.toString()).toBe(`a, b, c`);
|
|
476
|
+
});
|
|
477
|
+
it('should not add the content for each item with the given string separator when condition is false', () => {
|
|
478
|
+
sb.appendSeparatedIf(false, ['a', 'b', 'c'], ', ');
|
|
479
|
+
expect(sb.toString()).toBe(``);
|
|
480
|
+
});
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
describe('builderTemplate', () => {
|
|
484
|
+
it('should resolve append values in a template string', () => {
|
|
485
|
+
const sb = new SourceBuilder();
|
|
486
|
+
sb.append(builderTemplate `abc${'def'}ghi${123}jkl${(b) => b.append('mno')}pqr${appendValueGroup(['stu', 'vxw'])}yz`);
|
|
487
|
+
expect(sb.toString()).toEqual('abcdefghi123jklmnopqrstuvxwyz');
|
|
488
|
+
});
|
|
489
|
+
it('should remove indentation based on last line', () => {
|
|
490
|
+
const sb = new SourceBuilder();
|
|
491
|
+
sb.append(builderTemplate `${'abc'}
|
|
492
|
+
${123}
|
|
493
|
+
ghi`);
|
|
494
|
+
expect(sb.toString()).toEqual(`abc${EOL}123${EOL}ghi`);
|
|
495
|
+
});
|
|
496
|
+
describe('indent', () => {
|
|
497
|
+
it('should indent the content', () => {
|
|
498
|
+
const sb = new SourceBuilder();
|
|
499
|
+
sb.append(builderTemplate.indent `${'abc'}
|
|
500
|
+
${123}
|
|
501
|
+
ghi`);
|
|
502
|
+
expect(sb.toString()).toEqual(` abc${EOL} 123${EOL} ghi`);
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/string-builder/options.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,oBAEzC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Nullable, SingleOrMultiple } from '../type.utils.js';
|
|
2
|
+
import { type StringBuilderOptions } from './options.js';
|
|
3
|
+
export type BuilderFn<TBuilder extends StringBuilder> = (builder: TBuilder) => void;
|
|
4
|
+
export type Primitive = string | number | boolean;
|
|
5
|
+
export type AppendParam<TBuilder extends StringBuilder, TAdditionalAppends> = SingleOrMultiple<Primitive | null | undefined | BuilderFn<TBuilder> | TAdditionalAppends | {
|
|
6
|
+
__type: 'append-value-group';
|
|
7
|
+
values: AppendParam<TBuilder, TAdditionalAppends>[];
|
|
8
|
+
separator: string | null;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const AdditionalAppendsSymbol: unique symbol;
|
|
11
|
+
/**
|
|
12
|
+
* Represents a mutable string of characters.
|
|
13
|
+
*/
|
|
14
|
+
export declare class StringBuilder<TAdditionalAppends = never> {
|
|
15
|
+
private readonly _options;
|
|
16
|
+
protected str: string;
|
|
17
|
+
[AdditionalAppendsSymbol](_: TAdditionalAppends): void;
|
|
18
|
+
get options(): StringBuilderOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Initializes a new instance of the StringBuilder class.
|
|
21
|
+
* @param options The options.
|
|
22
|
+
*/
|
|
23
|
+
constructor(options?: Partial<StringBuilderOptions>);
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new StringBuilder instance and appends the specified string to it.
|
|
26
|
+
* @param str The string to append.
|
|
27
|
+
* @param options The options.
|
|
28
|
+
* @returns A new StringBuilder instance.
|
|
29
|
+
*/
|
|
30
|
+
static fromString(str: string, options?: Partial<StringBuilderOptions>): StringBuilder;
|
|
31
|
+
/**
|
|
32
|
+
* Builds a string using a StringBuilder build action.
|
|
33
|
+
* @param buildAction The build action to perform on the StringBuilder instance.
|
|
34
|
+
* @param options The options for the StringBuilder instance.
|
|
35
|
+
* @returns The built string.
|
|
36
|
+
*/
|
|
37
|
+
static build(buildAction: AppendParam<StringBuilder, never>, options?: Partial<StringBuilderOptions>): string;
|
|
38
|
+
protected appendSingle(value: AppendParam<this, TAdditionalAppends>): void;
|
|
39
|
+
/**
|
|
40
|
+
* Appends one or more strings to the end of the current StringBuilder.
|
|
41
|
+
* @param value The string(s) to append.
|
|
42
|
+
* @returns The current StringBuilder.
|
|
43
|
+
*/
|
|
44
|
+
append(...value: AppendParam<this, TAdditionalAppends>[]): this;
|
|
45
|
+
/**
|
|
46
|
+
* Appends one or more strings to the end of the current StringBuilder, followed by a line terminator.
|
|
47
|
+
* @param value
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
appendLine(...value: Nullable<AppendParam<this, TAdditionalAppends>>[]): this;
|
|
51
|
+
/**
|
|
52
|
+
* Prepends one or more strings to the beginning of the current StringBuilder.
|
|
53
|
+
* @param value The string(s) to prepend.
|
|
54
|
+
* @returns The current StringBuilder.
|
|
55
|
+
*/
|
|
56
|
+
prepend(...value: AppendParam<StringBuilder, never>[]): this;
|
|
57
|
+
/**
|
|
58
|
+
* Prepends one or more strings to the beginning of the current StringBuilder, followed by a line terminator.
|
|
59
|
+
* @param value The string(s) to prepend.
|
|
60
|
+
* @returns The current StringBuilder.
|
|
61
|
+
*/
|
|
62
|
+
prependLine(...value: AppendParam<StringBuilder, never>[]): this;
|
|
63
|
+
/**
|
|
64
|
+
* Converts the value of this instance to a string.
|
|
65
|
+
* @returns A string whose value is the same as this instance.
|
|
66
|
+
*/
|
|
67
|
+
toString(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Removes all characters from the current StringBuilder.
|
|
70
|
+
*/
|
|
71
|
+
clear(): void;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=string-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/string-builder/string-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAA+B,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEtF,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,aAAa,IAAI,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC;AACpF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,aAAa,EAAE,kBAAkB,IAAI,gBAAgB,CAC1F,SAAS,GACT,IAAI,GACJ,SAAS,GACT,SAAS,CAAC,QAAQ,CAAC,GAEnB,kBAAkB,GAClB;IACA,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,EAAE,CAAC;IACpD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CACF,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAA8B,CAAC;AAEnE;;GAEG;AACH,qBAAa,aAAa,CAAC,kBAAkB,GAAG,KAAK;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAChD,SAAS,CAAC,GAAG,EAAE,MAAM,CAAM;IAE3B,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,kBAAkB,GAAG,IAAI;IAItD,IAAW,OAAO,IAAI,oBAAoB,CAEzC;IAED;;;OAGG;gBACS,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAInD;;;;;OAKG;WACW,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,aAAa;IAM7F;;;;;OAKG;WACW,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,MAAM;IAMpH,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,EAAE,kBAAkB,CAAC;IA6BnE;;;;OAIG;IACI,MAAM,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC,IAAI,EAAE,kBAAkB,CAAC,EAAE,GAAG,IAAI;IAOtE;;;;OAIG;IACI,UAAU,CAAC,GAAG,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,GAAG,IAAI;IAIpF;;;;OAIG;IACI,OAAO,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI;IAgBnE;;;;OAIG;IACI,WAAW,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI;IAIvE;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAIzB;;OAEG;IACI,KAAK,IAAI,IAAI;CAGrB"}
|