@goast/core 0.4.0-beta3 → 0.4.0
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 +18 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/_dnt.test_polyfills.js +17 -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.6/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.js +136 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.js +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.js +159 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +57 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts +20 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +17 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +26 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.js +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +36 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +124 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +6 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.js +191 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +12 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +34 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.js +564 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +838 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.js +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +8 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.js +159 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +51 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.js +425 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.js +85 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +85 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.js +87 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +75 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +101 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +82 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.js +111 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.js +180 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.js +37 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts +16 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.js +2 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +74 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +340 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +731 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.js +576 -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.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 +78 -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 +506 -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 +164 -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 +5 -5
- package/script/_dnt.shims.d.ts +1 -1
- package/script/_dnt.test_polyfills.d.ts +18 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/_dnt.test_polyfills.js +18 -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.6/assertion_error.d.ts +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +17 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +139 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +22 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +48 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/false.js +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.js +57 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +20 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +32 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +35 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +28 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +162 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +24 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts +20 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +32 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.js +13 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +36 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +140 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +6 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.js +33 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.js +194 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +34 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.js +598 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +11 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +838 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.js +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +8 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.js +166 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +51 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.js +429 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.js +88 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +85 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.js +90 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +75 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +106 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +82 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.js +116 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +140 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.js +284 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +99 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.js +186 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/format.js +41 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +159 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.js +220 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts +16 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.4/types.js +3 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +74 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +345 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +731 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.js +587 -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.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 +80 -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 +508 -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 +166 -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 +43 -0
- package/src/_dnt.test_shims.ts +72 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/equal.ts +152 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/equals.ts +52 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +202 -0
- package/src/deps/jsr.io/@std/assert/1.0.6/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_assert_equals.ts +38 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.ts +35 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_assertion.ts +13 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.ts +147 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_build_message.ts +51 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.ts +19 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_equal.ts +229 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_extend.ts +16 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_inspect_args.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_matchers.ts +828 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_mock_util.ts +22 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_types.ts +917 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/_utils.ts +201 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/expect.ts +511 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/fn.ts +91 -0
- package/src/deps/jsr.io/@std/expect/1.0.5/mod.ts +88 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts +111 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/build_message.ts +134 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/diff_str.ts +204 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/format.ts +39 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.4/types.ts +18 -0
- package/src/deps/jsr.io/@std/testing/1.0.3/_test_suite.ts +389 -0
- package/src/deps/jsr.io/@std/testing/1.0.3/bdd.ts +1202 -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 +87 -0
- package/src/src/utils/schema.utils.ts +142 -0
- package/src/src/utils/source-builder.test.ts +658 -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 +189 -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.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.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/asset-manager.d.ts +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/asset-manager.d.ts +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
|
@@ -1,446 +0,0 @@
|
|
|
1
|
-
import { isNullish } from './common.utils.js';
|
|
2
|
-
import { evalCondition } from './condition.js';
|
|
3
|
-
import { defaultStringBuilderOptions, StringBuilder, } from './string-builder/index.js';
|
|
4
|
-
import { removeStr, trimEnd } from './string.utils.js';
|
|
5
|
-
/**
|
|
6
|
-
* Default options for the `SourceBuilder` class.
|
|
7
|
-
*/
|
|
8
|
-
export const defaultSourceBuilderOptions = {
|
|
9
|
-
...defaultStringBuilderOptions,
|
|
10
|
-
indent: { type: 'spaces', count: 2 },
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Represents an in-memory source file.
|
|
14
|
-
*/
|
|
15
|
-
export class SourceBuilder extends StringBuilder {
|
|
16
|
-
/**
|
|
17
|
-
* Gets the options used by this instance.
|
|
18
|
-
*/
|
|
19
|
-
get options() {
|
|
20
|
-
return this.__options;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Initializes a new instance of the SourceBuilder class.
|
|
24
|
-
* @param options The options to use for this instance.
|
|
25
|
-
*/
|
|
26
|
-
constructor(options) {
|
|
27
|
-
super(options);
|
|
28
|
-
Object.defineProperty(this, "__options", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: void 0
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(this, "_indentString", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: void 0
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(this, "_isLineIndented", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
value: false
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(this, "_isLastLineEmpty", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
configurable: true,
|
|
49
|
-
writable: true,
|
|
50
|
-
value: true
|
|
51
|
-
});
|
|
52
|
-
Object.defineProperty(this, "_isCurrentLineEmpty", {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
configurable: true,
|
|
55
|
-
writable: true,
|
|
56
|
-
value: true
|
|
57
|
-
});
|
|
58
|
-
Object.defineProperty(this, "_linePrefixNodes", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
configurable: true,
|
|
61
|
-
writable: true,
|
|
62
|
-
value: []
|
|
63
|
-
});
|
|
64
|
-
this.__options = { ...defaultSourceBuilderOptions, ...options };
|
|
65
|
-
this._indentString = this.__options.indent.type === 'tabs' ? '\t' : ' '.repeat(this.__options.indent.count);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Creates a new instance of the SourceBuilder class from a string.
|
|
69
|
-
* @param str The string to use as the initial content of the builder.
|
|
70
|
-
* @param options The options to use for this instance.
|
|
71
|
-
* @returns A new instance of the SourceBuilder class.
|
|
72
|
-
*/
|
|
73
|
-
static fromString(str, options) {
|
|
74
|
-
const builder = new SourceBuilder(options);
|
|
75
|
-
builder.append(str);
|
|
76
|
-
return builder;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Builds a string using a callback function that receives a `SourceBuilder` instance.
|
|
80
|
-
* @param buildAction The callback function that receives a `SourceBuilder` instance to build the string.
|
|
81
|
-
* @param options The options to use for the `SourceBuilder` instance.
|
|
82
|
-
* @returns The string built by the `SourceBuilder` instance.
|
|
83
|
-
*/
|
|
84
|
-
static build(buildAction, options) {
|
|
85
|
-
const builder = new SourceBuilder(options);
|
|
86
|
-
builder.append(buildAction);
|
|
87
|
-
return builder.toString();
|
|
88
|
-
}
|
|
89
|
-
appendSingle(value) {
|
|
90
|
-
var _a;
|
|
91
|
-
if (isNullish(value))
|
|
92
|
-
return;
|
|
93
|
-
if (Array.isArray(value)) {
|
|
94
|
-
for (const part of value) {
|
|
95
|
-
this.appendSingle(part);
|
|
96
|
-
}
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (typeof value === 'function') {
|
|
100
|
-
value(this);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
104
|
-
value = value.toString();
|
|
105
|
-
}
|
|
106
|
-
if (typeof value === 'object' && value !== null && '__type' in value && value.__type === 'append-value-group') {
|
|
107
|
-
this.forEach(value.values, (builder, part) => builder.append(part), { separator: (_a = value.separator) !== null && _a !== void 0 ? _a : undefined });
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (typeof value !== 'string') {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
let lineStartIndex = 0;
|
|
114
|
-
for (let i = 0; i < value.length; i++) {
|
|
115
|
-
if (value[i] === '\r')
|
|
116
|
-
continue;
|
|
117
|
-
if (value[i] === '\n') {
|
|
118
|
-
let lineLength = i - lineStartIndex;
|
|
119
|
-
for (let j = i; j > 0 && value[j - 1] === '\r'; j--) {
|
|
120
|
-
lineLength--;
|
|
121
|
-
}
|
|
122
|
-
if (lineLength > 0) {
|
|
123
|
-
if (!this._isLineIndented) {
|
|
124
|
-
this.appendIndent();
|
|
125
|
-
}
|
|
126
|
-
this.str += removeStr(value.substring(lineStartIndex, i), '\r');
|
|
127
|
-
}
|
|
128
|
-
this._isLastLineEmpty = this._isCurrentLineEmpty;
|
|
129
|
-
if (this._isCurrentLineEmpty && this._linePrefixNodes.some((x) => x.kind !== 'indent')) {
|
|
130
|
-
this.appendIndent();
|
|
131
|
-
}
|
|
132
|
-
this.str = trimEnd(this.str, false) + '\n';
|
|
133
|
-
this._isLineIndented = false;
|
|
134
|
-
this._isCurrentLineEmpty = true;
|
|
135
|
-
lineStartIndex = i + 1;
|
|
136
|
-
}
|
|
137
|
-
if (value[i] !== '\r' && value[i] !== '\n' && value[i] !== ' ' && value[i] !== '\t') {
|
|
138
|
-
this._isCurrentLineEmpty = false;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (!this._isLineIndented && lineStartIndex < value.length) {
|
|
142
|
-
this.appendIndent();
|
|
143
|
-
this._isLineIndented = true;
|
|
144
|
-
}
|
|
145
|
-
this.str += removeStr(value.substring(lineStartIndex), '\r');
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Appends one or more strings to the end of the current SourceBuilder if the specified condition is true.
|
|
149
|
-
* @param condition The condition to check before appending the specified value.
|
|
150
|
-
* @param value The string(s) to append.
|
|
151
|
-
* @returns The current SourceBuilder.
|
|
152
|
-
*/
|
|
153
|
-
appendIf(condition, ...value) {
|
|
154
|
-
if (evalCondition(condition)) {
|
|
155
|
-
return this.append(...value);
|
|
156
|
-
}
|
|
157
|
-
return this;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Appends one or more strings to the end of the current SourceBuilder, followed by a line terminator.
|
|
161
|
-
* @param value The string(s) to append.
|
|
162
|
-
* @returns The current SourceBuilder.
|
|
163
|
-
*/
|
|
164
|
-
appendLine(...value) {
|
|
165
|
-
return this.append(...value, '\n');
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Appends one or more strings to the end of the current SourceBuilder, followed by a line terminator, if the specified condition is true.
|
|
169
|
-
* @param condition The condition to check before appending the specified value.
|
|
170
|
-
* @param value The string(s) to append.
|
|
171
|
-
* @returns The current SourceBuilder.
|
|
172
|
-
*/
|
|
173
|
-
appendLineIf(condition, ...value) {
|
|
174
|
-
if (evalCondition(condition)) {
|
|
175
|
-
return this.appendLine(...value);
|
|
176
|
-
}
|
|
177
|
-
return this;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Appends the specified values to this source builder with the specified line prefix.
|
|
181
|
-
* @param {string} prefix - The line prefix to use.
|
|
182
|
-
* @param {...(string|null|undefined)} value - The values to append.
|
|
183
|
-
* @returns {SourceBuilder} This source builder instance.
|
|
184
|
-
*/
|
|
185
|
-
appendWithLinePrefix(prefix, ...value) {
|
|
186
|
-
this._linePrefixNodes.push({ chars: prefix, kind: 'prefix' });
|
|
187
|
-
try {
|
|
188
|
-
this.append(...value);
|
|
189
|
-
}
|
|
190
|
-
finally {
|
|
191
|
-
this._linePrefixNodes.pop();
|
|
192
|
-
}
|
|
193
|
-
return this;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Appends the specified values to this source builder as a new line with the specified line prefix.
|
|
197
|
-
* @param {string} prefix - The line prefix to use.
|
|
198
|
-
* @param {...(string|null|undefined)} value - The values to append.
|
|
199
|
-
* @returns {SourceBuilder} This source builder instance.
|
|
200
|
-
*/
|
|
201
|
-
appendLineWithLinePrefix(prefix, ...value) {
|
|
202
|
-
return this.appendWithLinePrefix(prefix, ...value, '\n');
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Prepends one or more strings to the beginning of the current SourceBuilder if the specified condition is true.
|
|
206
|
-
* @param condition The condition to check before prepending the specified value.
|
|
207
|
-
* @param value The string(s) to prepend.
|
|
208
|
-
* @returns The current SourceBuilder.
|
|
209
|
-
*/
|
|
210
|
-
prependIf(condition, ...value) {
|
|
211
|
-
if (evalCondition(condition)) {
|
|
212
|
-
this.prepend(...value);
|
|
213
|
-
}
|
|
214
|
-
return this;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Prepends one or more strings to the beginning of the current SourceBuilder, followed by a line terminator, if the specified condition is true.
|
|
218
|
-
* @param condition The condition to check before appending the specified value.
|
|
219
|
-
* @param value The string(s) to prepend.
|
|
220
|
-
* @returns The current SourceBuilder.
|
|
221
|
-
*/
|
|
222
|
-
prependLineIf(condition, ...value) {
|
|
223
|
-
if (evalCondition(condition)) {
|
|
224
|
-
this.prependLine(...value);
|
|
225
|
-
}
|
|
226
|
-
return this;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Ensures that the current line and the one before is empty or consists only of whitespace characters.
|
|
230
|
-
* @returns A reference to this instance.
|
|
231
|
-
*/
|
|
232
|
-
ensurePreviousLineEmpty() {
|
|
233
|
-
if (!this._isCurrentLineEmpty) {
|
|
234
|
-
this.appendLine();
|
|
235
|
-
}
|
|
236
|
-
if (!this._isLastLineEmpty) {
|
|
237
|
-
this.appendLine();
|
|
238
|
-
}
|
|
239
|
-
return this;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Ensures that the current line is empty or consists only of whitespace characters.
|
|
243
|
-
* @returns A reference to this instance.
|
|
244
|
-
*/
|
|
245
|
-
ensureCurrentLineEmpty() {
|
|
246
|
-
if (!this._isCurrentLineEmpty) {
|
|
247
|
-
this.appendLine();
|
|
248
|
-
}
|
|
249
|
-
return this;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Pretends that the current line and the one before is empty or consists only of whitespace characters.
|
|
253
|
-
* @returns A reference to this instance.
|
|
254
|
-
*/
|
|
255
|
-
pretendPreviousLineEmpty() {
|
|
256
|
-
this._isLastLineEmpty = true;
|
|
257
|
-
this._isCurrentLineEmpty = true;
|
|
258
|
-
return this;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Pretends that the current line is empty or consists only of whitespace characters.
|
|
262
|
-
* @returns A reference to this instance.
|
|
263
|
-
*/
|
|
264
|
-
pretendCurrentLineEmpty() {
|
|
265
|
-
this._isCurrentLineEmpty = true;
|
|
266
|
-
return this;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Inserts specified content if the specified condition is true.
|
|
270
|
-
* @param condition The condition to check before inserting content.
|
|
271
|
-
* @param builderFn The function to add content if the condition is true.
|
|
272
|
-
* @param elseBuilderFn The function to add content if the condition is false.
|
|
273
|
-
* @returns A reference to this instance.
|
|
274
|
-
*/
|
|
275
|
-
if(condition, builderFn, elseBuilderFn) {
|
|
276
|
-
return evalCondition(condition) ? this.append(builderFn) : this.append(elseBuilderFn);
|
|
277
|
-
}
|
|
278
|
-
switch(value, cases, defaultBuilderFn, equals) {
|
|
279
|
-
var _a;
|
|
280
|
-
if ((typeof value === 'string' || typeof value === 'number') && !Array.isArray(cases)) {
|
|
281
|
-
return this.append((_a = cases[value]) !== null && _a !== void 0 ? _a : defaultBuilderFn);
|
|
282
|
-
}
|
|
283
|
-
else if (Array.isArray(cases)) {
|
|
284
|
-
for (const c of cases) {
|
|
285
|
-
if (equals ? equals(value, c.case) : value === c.case) {
|
|
286
|
-
return this.append(c.value);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return this.append(defaultBuilderFn);
|
|
290
|
-
}
|
|
291
|
-
return this;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Adds one indentation level. If the current line already contains characters, only subsequent lines are affected.
|
|
295
|
-
* @param builderFn The function to add indented content or the content itself.
|
|
296
|
-
* @param condition The condition to check before adding indentation.
|
|
297
|
-
* @returns A reference to this instance.
|
|
298
|
-
*/
|
|
299
|
-
indent(value) {
|
|
300
|
-
this._linePrefixNodes.push({ chars: this._indentString, kind: 'indent' });
|
|
301
|
-
try {
|
|
302
|
-
this.append(value);
|
|
303
|
-
}
|
|
304
|
-
finally {
|
|
305
|
-
this._linePrefixNodes.pop();
|
|
306
|
-
}
|
|
307
|
-
return this;
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Adds one indentation level if the specified condition is true. If the current line already contains characters, only subsequent lines are affected.
|
|
311
|
-
* @param builderFn The function to add indented content or the content itself.
|
|
312
|
-
* @param condition The condition to check before adding indentation.
|
|
313
|
-
* @returns A reference to this instance.
|
|
314
|
-
*/
|
|
315
|
-
indentIf(condition, value) {
|
|
316
|
-
return evalCondition(condition) ? this.indent(value) : this.append(value);
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Adds parentheses around the specified content.
|
|
320
|
-
* @param brackets The brackets to use.
|
|
321
|
-
* @param value The function to add content inside parentheses or one string that should be parenthesized.
|
|
322
|
-
* @param options Options for the parentheses.
|
|
323
|
-
* @returns A reference to this instance.
|
|
324
|
-
*/
|
|
325
|
-
parenthesize(brackets, value, options) {
|
|
326
|
-
var _a, _b, _c, _d, _e, _f;
|
|
327
|
-
const multiline = (_a = options === null || options === void 0 ? void 0 : options.multiline) !== null && _a !== void 0 ? _a : false;
|
|
328
|
-
const indent = (_b = options === null || options === void 0 ? void 0 : options.indent) !== null && _b !== void 0 ? _b : true;
|
|
329
|
-
const pretendEmpty = (_c = options === null || options === void 0 ? void 0 : options.pretendEmpty) !== null && _c !== void 0 ? _c : true;
|
|
330
|
-
if (multiline) {
|
|
331
|
-
this.appendLine((_d = brackets[0]) !== null && _d !== void 0 ? _d : '');
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
this.append((_e = brackets[0]) !== null && _e !== void 0 ? _e : '');
|
|
335
|
-
}
|
|
336
|
-
if (pretendEmpty)
|
|
337
|
-
this.pretendPreviousLineEmpty();
|
|
338
|
-
if (indent !== false) {
|
|
339
|
-
this.indent(value);
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
this.append(value);
|
|
343
|
-
}
|
|
344
|
-
if (multiline)
|
|
345
|
-
this.ensureCurrentLineEmpty();
|
|
346
|
-
this.append((_f = brackets[1]) !== null && _f !== void 0 ? _f : '');
|
|
347
|
-
return this;
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Adds parentheses around the specified content if the specified condition is true.
|
|
351
|
-
* @param condition The condition to check before adding parentheses.
|
|
352
|
-
* @param brackets The brackets to use.
|
|
353
|
-
* @param value The function to add content inside parentheses or one string that should be parenthesized.
|
|
354
|
-
* @param options Options for the parentheses.
|
|
355
|
-
* @returns A reference to this instance.
|
|
356
|
-
*/
|
|
357
|
-
parenthesizeIf(condition, brackets, value, options) {
|
|
358
|
-
if (evalCondition(condition)) {
|
|
359
|
-
return this.parenthesize(brackets, value, options);
|
|
360
|
-
}
|
|
361
|
-
else if (options === null || options === void 0 ? void 0 : options.indent) {
|
|
362
|
-
return this.indent(value);
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
return this.append(value);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Adds content for each item in the specified array.
|
|
370
|
-
* @param items The items to add content for.
|
|
371
|
-
* @param builderFn The function to add content for each item.
|
|
372
|
-
* @param options The options for the loop.
|
|
373
|
-
* @returns A reference to this instance.
|
|
374
|
-
*/
|
|
375
|
-
forEach(items, builderFn, options) {
|
|
376
|
-
var _a;
|
|
377
|
-
const condition = (_a = options === null || options === void 0 ? void 0 : options.condition) !== null && _a !== void 0 ? _a : true;
|
|
378
|
-
if ((options === null || options === void 0 ? void 0 : options.condition) === false)
|
|
379
|
-
return this;
|
|
380
|
-
const seperator = options === null || options === void 0 ? void 0 : options.separator;
|
|
381
|
-
let previousIndex = -1;
|
|
382
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
383
|
-
let previousItem = undefined;
|
|
384
|
-
let index = 0;
|
|
385
|
-
for (const item of items) {
|
|
386
|
-
if (evalCondition(condition, item)) {
|
|
387
|
-
if (previousIndex >= 0 && seperator) {
|
|
388
|
-
if (typeof seperator === 'string') {
|
|
389
|
-
this.append(seperator);
|
|
390
|
-
}
|
|
391
|
-
else {
|
|
392
|
-
seperator(this, previousItem, item, previousIndex, index);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
builderFn(this, item, index);
|
|
396
|
-
previousIndex = index;
|
|
397
|
-
previousItem = item;
|
|
398
|
-
}
|
|
399
|
-
index++;
|
|
400
|
-
}
|
|
401
|
-
return this;
|
|
402
|
-
}
|
|
403
|
-
forEachIf(condition, items, builderFn, options) {
|
|
404
|
-
if (evalCondition(condition)) {
|
|
405
|
-
return this.forEach(items, builderFn, options);
|
|
406
|
-
}
|
|
407
|
-
return this;
|
|
408
|
-
}
|
|
409
|
-
appendSeparated(items, separator) {
|
|
410
|
-
return this.forEach(items, (builder, item) => builder.append(item), { separator });
|
|
411
|
-
}
|
|
412
|
-
appendSeparatedIf(condition, items, separator) {
|
|
413
|
-
if (evalCondition(condition)) {
|
|
414
|
-
return this.appendSeparated(items, separator);
|
|
415
|
-
}
|
|
416
|
-
return this;
|
|
417
|
-
}
|
|
418
|
-
appendIndent() {
|
|
419
|
-
this.str += this._linePrefixNodes.map((n) => n.chars).join('');
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
function _builderTemplate(template, ...substitutions) {
|
|
423
|
-
return (b) => {
|
|
424
|
-
var _a, _b;
|
|
425
|
-
let lastLine = undefined;
|
|
426
|
-
for (let i = template.length - 1; i >= 0; i--) {
|
|
427
|
-
if (template[i].includes('\n')) {
|
|
428
|
-
lastLine = template[i];
|
|
429
|
-
break;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
const indent = (_b = (_a = lastLine === null || lastLine === void 0 ? void 0 : lastLine.match(/\n( *).*$/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';
|
|
433
|
-
const regex = new RegExp(`\\n {0,${indent.length}}`, 'g');
|
|
434
|
-
for (let i = 0; i < template.length; i++) {
|
|
435
|
-
b.append(template[i].replace(regex, '\n'));
|
|
436
|
-
if (i < substitutions.length)
|
|
437
|
-
b.append(substitutions[i]);
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
const _builderTemplateExtensions = {
|
|
442
|
-
indent: (template, ...substitutions) => {
|
|
443
|
-
return (b) => b.indent(_builderTemplate(template, ...substitutions));
|
|
444
|
-
},
|
|
445
|
-
};
|
|
446
|
-
export const builderTemplate = Object.assign(_builderTemplate, _builderTemplateExtensions);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/string-builder/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACtE,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/lib/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"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { type StringBuilderOptions } from './options.js';
|
|
2
|
-
import type { Nullable, SingleOrMultiple } from '../type.utils.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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string-builder.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/string-builder/string-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEtF,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEnE,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"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { defaultStringBuilderOptions } from './options.js';
|
|
2
|
-
import { isNullish } from '../common.utils.js';
|
|
3
|
-
export const AdditionalAppendsSymbol = Symbol('AdditionalAppends');
|
|
4
|
-
/**
|
|
5
|
-
* Represents a mutable string of characters.
|
|
6
|
-
*/
|
|
7
|
-
export class StringBuilder {
|
|
8
|
-
[AdditionalAppendsSymbol](_) {
|
|
9
|
-
throw new Error('This method should never be called.');
|
|
10
|
-
}
|
|
11
|
-
get options() {
|
|
12
|
-
return this._options;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Initializes a new instance of the StringBuilder class.
|
|
16
|
-
* @param options The options.
|
|
17
|
-
*/
|
|
18
|
-
constructor(options) {
|
|
19
|
-
Object.defineProperty(this, "_options", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true,
|
|
23
|
-
value: void 0
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(this, "str", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
configurable: true,
|
|
28
|
-
writable: true,
|
|
29
|
-
value: ''
|
|
30
|
-
});
|
|
31
|
-
this._options = { ...defaultStringBuilderOptions, ...options };
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Creates a new StringBuilder instance and appends the specified string to it.
|
|
35
|
-
* @param str The string to append.
|
|
36
|
-
* @param options The options.
|
|
37
|
-
* @returns A new StringBuilder instance.
|
|
38
|
-
*/
|
|
39
|
-
static fromString(str, options) {
|
|
40
|
-
const builder = new StringBuilder(options);
|
|
41
|
-
builder.append(str);
|
|
42
|
-
return builder;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Builds a string using a StringBuilder build action.
|
|
46
|
-
* @param buildAction The build action to perform on the StringBuilder instance.
|
|
47
|
-
* @param options The options for the StringBuilder instance.
|
|
48
|
-
* @returns The built string.
|
|
49
|
-
*/
|
|
50
|
-
static build(buildAction, options) {
|
|
51
|
-
const builder = new StringBuilder(options);
|
|
52
|
-
builder.append(buildAction);
|
|
53
|
-
return builder.toString();
|
|
54
|
-
}
|
|
55
|
-
appendSingle(value) {
|
|
56
|
-
if (isNullish(value))
|
|
57
|
-
return;
|
|
58
|
-
if (Array.isArray(value)) {
|
|
59
|
-
for (const part of value) {
|
|
60
|
-
this.appendSingle(part);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else if (typeof value === 'string') {
|
|
64
|
-
this.str += value;
|
|
65
|
-
}
|
|
66
|
-
else if (typeof value === 'number' || typeof value === 'boolean') {
|
|
67
|
-
this.str += value.toString();
|
|
68
|
-
}
|
|
69
|
-
else if (typeof value === 'function') {
|
|
70
|
-
value(this);
|
|
71
|
-
}
|
|
72
|
-
else if (typeof value === 'object' &&
|
|
73
|
-
value !== null &&
|
|
74
|
-
'__type' in value &&
|
|
75
|
-
value.__type === 'append-value-group') {
|
|
76
|
-
let isFirst = true;
|
|
77
|
-
for (const part of value.values) {
|
|
78
|
-
if (!isFirst && value.separator) {
|
|
79
|
-
this.append(value.separator);
|
|
80
|
-
}
|
|
81
|
-
this.appendSingle(part);
|
|
82
|
-
isFirst = false;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Appends one or more strings to the end of the current StringBuilder.
|
|
88
|
-
* @param value The string(s) to append.
|
|
89
|
-
* @returns The current StringBuilder.
|
|
90
|
-
*/
|
|
91
|
-
append(...value) {
|
|
92
|
-
for (const part of value) {
|
|
93
|
-
this.appendSingle(part);
|
|
94
|
-
}
|
|
95
|
-
return this;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Appends one or more strings to the end of the current StringBuilder, followed by a line terminator.
|
|
99
|
-
* @param value
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
appendLine(...value) {
|
|
103
|
-
return this.append(...value, '\n');
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Prepends one or more strings to the beginning of the current StringBuilder.
|
|
107
|
-
* @param value The string(s) to prepend.
|
|
108
|
-
* @returns The current StringBuilder.
|
|
109
|
-
*/
|
|
110
|
-
prepend(...value) {
|
|
111
|
-
for (const part of value.reverse()) {
|
|
112
|
-
if (isNullish(part))
|
|
113
|
-
continue;
|
|
114
|
-
if (typeof part === 'function') {
|
|
115
|
-
const builder = new StringBuilder(this.options);
|
|
116
|
-
part(builder);
|
|
117
|
-
this.str = builder.str + this.str;
|
|
118
|
-
}
|
|
119
|
-
else if (typeof part === 'string') {
|
|
120
|
-
this.str = part + this.str;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
this.str = part.toString() + this.str;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return this;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Prepends one or more strings to the beginning of the current StringBuilder, followed by a line terminator.
|
|
130
|
-
* @param value The string(s) to prepend.
|
|
131
|
-
* @returns The current StringBuilder.
|
|
132
|
-
*/
|
|
133
|
-
prependLine(...value) {
|
|
134
|
-
return this.prepend(...value, '\n');
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Converts the value of this instance to a string.
|
|
138
|
-
* @returns A string whose value is the same as this instance.
|
|
139
|
-
*/
|
|
140
|
-
toString() {
|
|
141
|
-
return this.str.replace(/\r?\n/g, this._options.newLine);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Removes all characters from the current StringBuilder.
|
|
145
|
-
*/
|
|
146
|
-
clear() {
|
|
147
|
-
this.str = '';
|
|
148
|
-
}
|
|
149
|
-
}
|