@skmtc/core 0.0.223 → 0.0.225
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/{script → esm}/_dnt.polyfills.js +1 -2
- package/{script → esm}/_dnt.shims.js +4 -8
- package/{script → esm}/context/CoreContext.js +24 -28
- package/{script → esm}/context/GenerateContext.js +13 -17
- package/{script → esm}/context/LogStore.js +1 -5
- package/{script → esm}/context/ParseContext.js +1 -5
- package/{script → esm}/context/RenderContext.js +17 -47
- package/{script → esm}/context/Trail.js +1 -5
- package/esm/context/types.js +1 -0
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/_validate_binary_like.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/ascii85.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base32.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base58.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base64.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base64url.js +3 -30
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/hex.js +4 -8
- package/esm/deps/jsr.io/@std/encoding/1.0.1/mod.js +22 -0
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/varint.js +8 -14
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/assert_path.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/basename.js +5 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/common.js +1 -4
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/constants.js +46 -0
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/dirname.js +8 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/format.js +2 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/from_file_url.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/glob_to_reg_exp.js +1 -4
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/normalize.js +8 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/normalize_string.js +6 -9
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/relative.js +9 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/strip_trailing_separators.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/to_file_url.js +1 -4
- package/esm/deps/jsr.io/@std/path/1.0.0/_os.js +14 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/basename.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/common.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/constants.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/dirname.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/extname.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/format.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/from_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/glob_to_regexp.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/is_absolute.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/is_glob.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/join.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/join_globs.js +7 -10
- package/esm/deps/jsr.io/@std/path/1.0.0/mod.js +54 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/normalize.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/normalize_glob.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/parse.js +5 -8
- package/esm/deps/jsr.io/@std/path/1.0.0/posix/_util.js +8 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/basename.js +8 -11
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/constants.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/dirname.js +8 -11
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/extname.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/format.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/from_file_url.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/glob_to_regexp.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/is_absolute.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/join.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/join_globs.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/normalize.js +8 -11
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/normalize_glob.js +6 -9
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/parse.js +10 -13
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/relative.js +14 -17
- package/esm/deps/jsr.io/@std/path/1.0.0/posix/resolve.js +59 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/to_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/to_namespaced_path.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/relative.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/resolve.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/to_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/to_namespaced_path.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/types.js +1 -2
- package/esm/deps/jsr.io/@std/path/1.0.0/windows/_util.js +15 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/basename.js +11 -14
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/constants.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/dirname.js +17 -20
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/extname.js +9 -12
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/format.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/from_file_url.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/glob_to_regexp.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/is_absolute.js +9 -12
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/join.js +10 -13
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/join_globs.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/normalize.js +17 -20
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/normalize_glob.js +6 -9
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/parse.js +16 -19
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/relative.js +16 -19
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/resolve.js +17 -43
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/to_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/to_namespaced_path.js +11 -14
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_dumper/dumper.js +10 -36
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_dumper/dumper_state.js +2 -6
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_error.js +1 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_loader/loader.js +9 -36
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_loader/loader_state.js +2 -6
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_mark.js +3 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_state.js +3 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/binary.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/bool.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/float.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/function.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/int.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/map.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/merge.js +2 -5
- package/esm/deps/jsr.io/@std/yaml/0.215.0/_type/mod.js +20 -0
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/nil.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/omap.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/pairs.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/regexp.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/seq.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/set.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/str.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/timestamp.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/undefined.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_utils.js +15 -32
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/mod.js +4 -20
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/parse.js +5 -9
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/core.js +4 -7
- package/esm/deps/jsr.io/@std/yaml/0.215.0/schema/default.js +15 -0
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/extended.js +6 -9
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/failsafe.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/json.js +6 -9
- package/esm/deps/jsr.io/@std/yaml/0.215.0/schema/mod.js +10 -0
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema.js +3 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/stringify.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/type.js +1 -5
- package/{script → esm}/dsl/ContentSettings.js +1 -5
- package/{script → esm}/dsl/Definition.js +4 -8
- package/{script → esm}/dsl/GeneratedValueList.js +3 -7
- package/{script → esm}/dsl/Identifier.js +8 -12
- package/{script → esm}/dsl/Import.js +2 -7
- package/esm/dsl/ModelCreator.js +1 -0
- package/{script → esm}/dsl/ModelDriver.js +14 -18
- package/esm/dsl/OperationCreator.js +1 -0
- package/{script → esm}/dsl/OperationDriver.js +11 -15
- package/esm/dsl/Stringable.js +1 -0
- package/{script → esm}/dsl/ValueBase.js +1 -5
- package/{script → esm}/dsl/base.js +5 -13
- package/esm/dsl/constants.js +1 -0
- package/{script → esm}/dsl/withConfig.js +9 -15
- package/esm/generate/generate.js +47 -0
- package/esm/generate/generateModels.js +29 -0
- package/esm/generate/generateOperations.js +35 -0
- package/{script → esm}/helpers/logStatus.js +2 -7
- package/esm/helpers/naming.js +25 -0
- package/esm/helpers/refFns.js +24 -0
- package/esm/helpers/strings.js +6 -0
- package/{script → esm}/helpers/verifyType.js +1 -4
- package/esm/mod.js +61 -0
- package/{script → esm}/oas/array/Array.js +2 -6
- package/esm/oas/array/array-types.js +17 -0
- package/esm/oas/array/toArray.js +20 -0
- package/{script → esm}/oas/boolean/Boolean.js +2 -6
- package/esm/oas/boolean/boolean-types.js +8 -0
- package/esm/oas/boolean/toBoolean.js +10 -0
- package/{script → esm}/oas/components/Components.js +2 -6
- package/esm/oas/components/toComponentsV3.js +44 -0
- package/esm/oas/contact/contact-types.js +7 -0
- package/{script → esm}/oas/discriminator/Discriminator.js +2 -6
- package/esm/oas/discriminator/discriminator-types.js +6 -0
- package/esm/oas/discriminator/toDiscriminatorV3.js +11 -0
- package/{script → esm}/oas/document/Document.js +2 -6
- package/esm/oas/document/toDocumentV3.js +24 -0
- package/{script → esm}/oas/example/Example.js +2 -6
- package/esm/oas/example/example-types.js +9 -0
- package/esm/oas/example/toExamplesV3.js +45 -0
- package/{script → esm}/oas/header/Header.js +2 -6
- package/esm/oas/header/toHeadersV3.js +42 -0
- package/{script → esm}/oas/info/Info.js +2 -6
- package/{script → esm}/oas/info/toInfoV3.js +3 -7
- package/{script → esm}/oas/integer/Integer.js +2 -6
- package/esm/oas/integer/integer-types.js +18 -0
- package/esm/oas/integer/toInteger.js +13 -0
- package/{script → esm}/oas/intersection/Intersection.js +2 -6
- package/esm/oas/intersection/intersection-types.js +12 -0
- package/esm/oas/intersection/toIntersection.js +22 -0
- package/esm/oas/license/license-types.js +7 -0
- package/esm/oas/markdown/markdown-types.js +2 -0
- package/{script → esm}/oas/mediaType/MediaType.js +2 -6
- package/esm/oas/mediaType/mediaType-types.js +12 -0
- package/esm/oas/mediaType/toMediaTypeItemV3.js +37 -0
- package/esm/oas/null/null-types.js +8 -0
- package/{script → esm}/oas/number/Number.js +2 -6
- package/esm/oas/number/number-types.js +14 -0
- package/esm/oas/number/toNumber.js +10 -0
- package/{script → esm}/oas/object/Object.js +4 -8
- package/esm/oas/object/object-types.js +27 -0
- package/esm/oas/object/toAdditionalPropertiesV3.js +14 -0
- package/esm/oas/object/toObject.js +23 -0
- package/{script → esm}/oas/operation/Operation.js +2 -6
- package/{script → esm}/oas/operation/toOperationsV3.js +13 -18
- package/{script → esm}/oas/parameter/Parameter.js +2 -6
- package/esm/oas/parameter/parameter-types.js +38 -0
- package/{script → esm}/oas/parameter/toParameterV3.js +22 -28
- package/{script → esm}/oas/pathItem/PathItem.js +2 -6
- package/esm/oas/pathItem/toPathItemV3.js +15 -0
- package/{script → esm}/oas/ref/Ref.js +6 -10
- package/esm/oas/ref/ref-types.js +54 -0
- package/esm/oas/ref/toRefV31.js +11 -0
- package/{script → esm}/oas/requestBody/RequestBody.js +2 -6
- package/esm/oas/requestBody/toRequestBodiesV3.js +46 -0
- package/{script → esm}/oas/response/Response.js +2 -6
- package/esm/oas/response/toResponseV3.js +35 -0
- package/esm/oas/schema/Schema.js +1 -0
- package/esm/oas/schema/schema-types.js +23 -0
- package/esm/oas/schema/toSchemasV3.js +60 -0
- package/{script → esm}/oas/string/String.js +2 -6
- package/esm/oas/string/string-types.js +29 -0
- package/esm/oas/string/toString.js +11 -0
- package/{script → esm}/oas/tag/Tag.js +2 -6
- package/esm/oas/tag/toTagsV3.js +14 -0
- package/{script → esm}/oas/union/Union.js +2 -6
- package/esm/oas/union/toUnion.js +22 -0
- package/esm/oas/union/union-types.js +12 -0
- package/{script → esm}/oas/unknown/Unknown.js +2 -6
- package/esm/oas/unknown/toUnknown.js +9 -0
- package/esm/oas/unknown/unknown-types.js +8 -0
- package/{script → esm}/oas/void/Void.js +4 -8
- package/{script → esm}/oas-elements/OasBase.js +1 -5
- package/esm/package.json +3 -0
- package/esm/parse/parse.js +16 -0
- package/{script → esm}/schemas/client.js +2 -4
- package/{script → esm}/server/createServer.js +24 -51
- package/esm/types/Brand.js +1 -0
- package/{script → esm}/types/CustomValue.js +3 -8
- package/esm/types/GeneratedValue.js +1 -0
- package/{script → esm}/types/GenerationType.js +1 -2
- package/esm/types/GeneratorKeys.js +13 -0
- package/esm/types/Method.js +32 -0
- package/esm/types/Modifiers.js +1 -0
- package/esm/types/RefName.js +1 -0
- package/esm/types/Settings.js +42 -0
- package/esm/types/TypeSystem.js +1 -0
- package/esm/types/prettierConfig.js +46 -0
- package/{script → esm}/typescript/EntityType.js +3 -7
- package/{script → esm}/typescript/FunctionParameter.js +10 -17
- package/{script → esm}/typescript/ReactRouterPathParams.js +2 -6
- package/esm/typescript/identifiers.js +7 -0
- package/esm/typescript/keyValues.js +11 -0
- package/{script → esm}/typescript/toDestructuredObject.js +1 -5
- package/{script → esm}/typescript/toOperationArg.js +7 -14
- package/esm/typescript/toOperationResponse.js +17 -0
- package/esm/typescript/toParamsObject.js +12 -0
- package/esm/typescript/toPathTemplate.js +3 -0
- package/esm/typescript/withDescription.js +3 -0
- package/package.json +14 -8
- package/types/types/Method.d.ts +1 -0
- package/types/types/Method.d.ts.map +1 -1
- package/script/context/types.js +0 -2
- package/script/deps/jsr.io/@std/encoding/1.0.1/mod.js +0 -38
- package/script/deps/jsr.io/@std/path/1.0.0/_common/constants.js +0 -49
- package/script/deps/jsr.io/@std/path/1.0.0/_common/dirname.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.0/_common/normalize.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.0/_common/relative.js +0 -12
- package/script/deps/jsr.io/@std/path/1.0.0/_os.js +0 -40
- package/script/deps/jsr.io/@std/path/1.0.0/mod.js +0 -70
- package/script/deps/jsr.io/@std/path/1.0.0/posix/_util.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.0/posix/resolve.js +0 -85
- package/script/deps/jsr.io/@std/path/1.0.0/windows/_util.js +0 -20
- package/script/deps/jsr.io/@std/yaml/0.215.0/_type/mod.js +0 -39
- package/script/deps/jsr.io/@std/yaml/0.215.0/schema/default.js +0 -18
- package/script/deps/jsr.io/@std/yaml/0.215.0/schema/mod.js +0 -18
- package/script/dsl/ModelCreator.js +0 -2
- package/script/dsl/OperationCreator.js +0 -2
- package/script/dsl/Stringable.js +0 -2
- package/script/dsl/constants.js +0 -4
- package/script/generate/generate.js +0 -75
- package/script/generate/generateModels.js +0 -56
- package/script/generate/generateOperations.js +0 -62
- package/script/helpers/naming.js +0 -33
- package/script/helpers/refFns.js +0 -30
- package/script/helpers/strings.js +0 -11
- package/script/mod.js +0 -77
- package/script/oas/array/array-types.js +0 -20
- package/script/oas/array/toArray.js +0 -24
- package/script/oas/boolean/boolean-types.js +0 -11
- package/script/oas/boolean/toBoolean.js +0 -14
- package/script/oas/components/toComponentsV3.js +0 -48
- package/script/oas/contact/contact-types.js +0 -10
- package/script/oas/discriminator/discriminator-types.js +0 -9
- package/script/oas/discriminator/toDiscriminatorV3.js +0 -15
- package/script/oas/document/toDocumentV3.js +0 -28
- package/script/oas/example/example-types.js +0 -12
- package/script/oas/example/toExamplesV3.js +0 -51
- package/script/oas/header/toHeadersV3.js +0 -46
- package/script/oas/integer/integer-types.js +0 -21
- package/script/oas/integer/toInteger.js +0 -17
- package/script/oas/intersection/intersection-types.js +0 -15
- package/script/oas/intersection/toIntersection.js +0 -26
- package/script/oas/license/license-types.js +0 -10
- package/script/oas/markdown/markdown-types.js +0 -5
- package/script/oas/mediaType/mediaType-types.js +0 -15
- package/script/oas/mediaType/toMediaTypeItemV3.js +0 -43
- package/script/oas/null/null-types.js +0 -11
- package/script/oas/number/number-types.js +0 -17
- package/script/oas/number/toNumber.js +0 -14
- package/script/oas/object/object-types.js +0 -30
- package/script/oas/object/toAdditionalPropertiesV3.js +0 -18
- package/script/oas/object/toObject.js +0 -27
- package/script/oas/parameter/parameter-types.js +0 -41
- package/script/oas/pathItem/toPathItemV3.js +0 -19
- package/script/oas/ref/ref-types.js +0 -57
- package/script/oas/ref/toRefV31.js +0 -15
- package/script/oas/requestBody/toRequestBodiesV3.js +0 -51
- package/script/oas/response/toResponseV3.js +0 -41
- package/script/oas/schema/Schema.js +0 -2
- package/script/oas/schema/schema-types.js +0 -26
- package/script/oas/schema/toSchemasV3.js +0 -67
- package/script/oas/string/string-types.js +0 -32
- package/script/oas/string/toString.js +0 -15
- package/script/oas/tag/toTagsV3.js +0 -18
- package/script/oas/union/toUnion.js +0 -26
- package/script/oas/union/union-types.js +0 -15
- package/script/oas/unknown/toUnknown.js +0 -13
- package/script/oas/unknown/unknown-types.js +0 -11
- package/script/package.json +0 -3
- package/script/parse/parse.js +0 -20
- package/script/types/Brand.js +0 -2
- package/script/types/GeneratedValue.js +0 -2
- package/script/types/GeneratorKeys.js +0 -19
- package/script/types/Method.js +0 -34
- package/script/types/Modifiers.js +0 -2
- package/script/types/RefName.js +0 -2
- package/script/types/Settings.js +0 -45
- package/script/types/TypeSystem.js +0 -2
- package/script/types/prettierConfig.js +0 -49
- package/script/typescript/identifiers.js +0 -12
- package/script/typescript/keyValues.js +0 -15
- package/script/typescript/toOperationResponse.js +0 -21
- package/script/typescript/toParamsObject.js +0 -16
- package/script/typescript/toPathTemplate.js +0 -7
- package/script/typescript/withDescription.js +0 -7
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
-
}) : function(o, v) {
|
|
18
|
-
o["default"] = v;
|
|
19
|
-
});
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
-
if (mod && mod.__esModule) return mod;
|
|
22
|
-
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
-
__setModuleDefault(result, mod);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.encodeBase64Url = encodeBase64Url;
|
|
29
|
-
exports.decodeBase64Url = decodeBase64Url;
|
|
30
3
|
/**
|
|
31
4
|
* Utilities for
|
|
32
5
|
* {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5 | base64url}
|
|
@@ -34,7 +7,7 @@ exports.decodeBase64Url = decodeBase64Url;
|
|
|
34
7
|
*
|
|
35
8
|
* @module
|
|
36
9
|
*/
|
|
37
|
-
|
|
10
|
+
import * as base64 from "./base64.js";
|
|
38
11
|
/**
|
|
39
12
|
* Some variants allow or require omitting the padding '=' signs:
|
|
40
13
|
* https://en.wikipedia.org/wiki/Base64#The_URL_applications
|
|
@@ -81,7 +54,7 @@ function convertBase64ToBase64url(b64) {
|
|
|
81
54
|
* assertEquals(encodeBase64Url("foobar"), "Zm9vYmFy");
|
|
82
55
|
* ```
|
|
83
56
|
*/
|
|
84
|
-
function encodeBase64Url(data) {
|
|
57
|
+
export function encodeBase64Url(data) {
|
|
85
58
|
return convertBase64ToBase64url(base64.encodeBase64(data));
|
|
86
59
|
}
|
|
87
60
|
/**
|
|
@@ -103,6 +76,6 @@ function encodeBase64Url(data) {
|
|
|
103
76
|
* );
|
|
104
77
|
* ```
|
|
105
78
|
*/
|
|
106
|
-
function decodeBase64Url(b64url) {
|
|
79
|
+
export function decodeBase64Url(b64url) {
|
|
107
80
|
return base64.decodeBase64(convertBase64urlToBase64(b64url));
|
|
108
81
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
3
2
|
// https://github.com/golang/go/blob/master/LICENSE
|
|
4
3
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
4
|
// This module is browser compatible.
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.encodeHex = encodeHex;
|
|
8
|
-
exports.decodeHex = decodeHex;
|
|
9
5
|
/**
|
|
10
6
|
* Port of the Go
|
|
11
7
|
* {@link https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go | encoding/hex}
|
|
@@ -28,7 +24,7 @@ exports.decodeHex = decodeHex;
|
|
|
28
24
|
*
|
|
29
25
|
* @module
|
|
30
26
|
*/
|
|
31
|
-
|
|
27
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
32
28
|
const hexTable = new TextEncoder().encode("0123456789abcdef");
|
|
33
29
|
const textEncoder = new TextEncoder();
|
|
34
30
|
const textDecoder = new TextDecoder();
|
|
@@ -66,8 +62,8 @@ function fromHexChar(byte) {
|
|
|
66
62
|
* assertEquals(encodeHex("abc"), "616263");
|
|
67
63
|
* ```
|
|
68
64
|
*/
|
|
69
|
-
function encodeHex(src) {
|
|
70
|
-
const u8 =
|
|
65
|
+
export function encodeHex(src) {
|
|
66
|
+
const u8 = validateBinaryLike(src);
|
|
71
67
|
const dst = new Uint8Array(u8.length * 2);
|
|
72
68
|
for (let i = 0; i < u8.length; i++) {
|
|
73
69
|
const v = u8[i];
|
|
@@ -95,7 +91,7 @@ function encodeHex(src) {
|
|
|
95
91
|
* );
|
|
96
92
|
* ```
|
|
97
93
|
*/
|
|
98
|
-
function decodeHex(src) {
|
|
94
|
+
export function decodeHex(src) {
|
|
99
95
|
const u8 = textEncoder.encode(src);
|
|
100
96
|
const dst = new Uint8Array(u8.length / 2);
|
|
101
97
|
for (let i = 0; i < dst.length; i++) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
/**
|
|
3
|
+
* Utilities for encoding and decoding common formats like hex, base64, and varint.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { encodeBase64, decodeBase64 } from "@std/encoding";
|
|
7
|
+
* import { assertEquals } from "@std/assert";
|
|
8
|
+
*
|
|
9
|
+
* const foobar = new TextEncoder().encode("foobar");
|
|
10
|
+
* assertEquals(encodeBase64(foobar), "Zm9vYmFy");
|
|
11
|
+
* assertEquals(decodeBase64("Zm9vYmFy"), foobar);
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
export * from "./ascii85.js";
|
|
17
|
+
export * from "./base32.js";
|
|
18
|
+
export * from "./base58.js";
|
|
19
|
+
export * from "./base64.js";
|
|
20
|
+
export * from "./base64url.js";
|
|
21
|
+
export * from "./hex.js";
|
|
22
|
+
export * from "./varint.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// Copyright 2020 Keith Cirkel. All rights reserved. MIT license.
|
|
4
3
|
// Copyright 2023 Skye "MierenManz". All rights reserved. MIT license.
|
|
@@ -25,26 +24,21 @@
|
|
|
25
24
|
*
|
|
26
25
|
* @module
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.MaxVarintLen32 = exports.MaxVarintLen64 = exports.MaxUint64 = void 0;
|
|
30
|
-
exports.decodeVarint = decodeVarint;
|
|
31
|
-
exports.decodeVarint32 = decodeVarint32;
|
|
32
|
-
exports.encodeVarint = encodeVarint;
|
|
33
27
|
// This implementation is a port of https://deno.land/x/varint@v2.0.0 by @keithamus
|
|
34
28
|
// This module is browser compatible.
|
|
35
29
|
/**
|
|
36
30
|
* The maximum value of an unsigned 64-bit integer.
|
|
37
31
|
* Equivalent to `2n**64n - 1n`
|
|
38
32
|
*/
|
|
39
|
-
|
|
33
|
+
export const MaxUint64 = 18446744073709551615n;
|
|
40
34
|
/**
|
|
41
35
|
* The maximum length, in bytes, of a Varint encoded 64-bit integer.
|
|
42
36
|
*/
|
|
43
|
-
|
|
37
|
+
export const MaxVarintLen64 = 10;
|
|
44
38
|
/**
|
|
45
39
|
* The maximum length, in bytes, of a Varint encoded 32-bit integer.
|
|
46
40
|
*/
|
|
47
|
-
|
|
41
|
+
export const MaxVarintLen32 = 5;
|
|
48
42
|
const MSB = 0x80;
|
|
49
43
|
const REST = 0x7f;
|
|
50
44
|
const SHIFT = 7;
|
|
@@ -80,7 +74,7 @@ const U64_VIEW = new BigUint64Array(AB);
|
|
|
80
74
|
* assertEquals(decodeVarint(buf), [270n, 2]);
|
|
81
75
|
* ```
|
|
82
76
|
*/
|
|
83
|
-
function decodeVarint(buf, offset = 0) {
|
|
77
|
+
export function decodeVarint(buf, offset = 0) {
|
|
84
78
|
// Clear the last result from the Two's complement view
|
|
85
79
|
U64_VIEW[0] = 0n;
|
|
86
80
|
// Setup the initiat state of the function
|
|
@@ -157,10 +151,10 @@ function decodeVarint(buf, offset = 0) {
|
|
|
157
151
|
* assertEquals(decodeVarint32(buf), [270, 2]);
|
|
158
152
|
* ```
|
|
159
153
|
*/
|
|
160
|
-
function decodeVarint32(buf, offset = 0) {
|
|
154
|
+
export function decodeVarint32(buf, offset = 0) {
|
|
161
155
|
let shift = 0;
|
|
162
156
|
let decoded = 0;
|
|
163
|
-
for (let i = offset; i <= Math.min(buf.length, offset +
|
|
157
|
+
for (let i = offset; i <= Math.min(buf.length, offset + MaxVarintLen32); i += 1, shift += SHIFT) {
|
|
164
158
|
const byte = buf[i];
|
|
165
159
|
decoded += (byte & REST) * Math.pow(2, shift);
|
|
166
160
|
if (!(byte & MSB))
|
|
@@ -195,11 +189,11 @@ function decodeVarint32(buf, offset = 0) {
|
|
|
195
189
|
* assertEquals(encodeVarint(42n, buf), [new Uint8Array([42]), 1]);
|
|
196
190
|
* ```
|
|
197
191
|
*/
|
|
198
|
-
function encodeVarint(num, buf = new Uint8Array(
|
|
192
|
+
export function encodeVarint(num, buf = new Uint8Array(MaxVarintLen64), offset = 0) {
|
|
199
193
|
num = BigInt(num);
|
|
200
194
|
if (num < 0n)
|
|
201
195
|
throw new RangeError("signed input given");
|
|
202
|
-
for (let i = offset; i <= Math.min(buf.length,
|
|
196
|
+
for (let i = offset; i <= Math.min(buf.length, MaxVarintLen64); i += 1) {
|
|
203
197
|
if (num < MSBN) {
|
|
204
198
|
buf[i] = Number(num);
|
|
205
199
|
i += 1;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// Copyright the Browserify authors. MIT License.
|
|
4
|
-
|
|
5
|
-
exports.assertPath = assertPath;
|
|
6
|
-
function assertPath(path) {
|
|
3
|
+
export function assertPath(path) {
|
|
7
4
|
if (typeof path !== "string") {
|
|
8
5
|
throw new TypeError(`Path must be a string. Received ${JSON.stringify(path)}`);
|
|
9
6
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.lastPathSegment = lastPathSegment;
|
|
7
|
-
exports.assertArgs = assertArgs;
|
|
8
|
-
const assert_path_js_1 = require("./assert_path.js");
|
|
9
|
-
function stripSuffix(name, suffix) {
|
|
3
|
+
import { assertPath } from "./assert_path.js";
|
|
4
|
+
export function stripSuffix(name, suffix) {
|
|
10
5
|
if (suffix.length >= name.length) {
|
|
11
6
|
return name;
|
|
12
7
|
}
|
|
@@ -18,7 +13,7 @@ function stripSuffix(name, suffix) {
|
|
|
18
13
|
}
|
|
19
14
|
return name.slice(0, -suffix.length);
|
|
20
15
|
}
|
|
21
|
-
function lastPathSegment(path, isSep, start = 0) {
|
|
16
|
+
export function lastPathSegment(path, isSep, start = 0) {
|
|
22
17
|
let matchedNonSeparator = false;
|
|
23
18
|
let end = path.length;
|
|
24
19
|
for (let i = path.length - 1; i >= start; --i) {
|
|
@@ -35,8 +30,8 @@ function lastPathSegment(path, isSep, start = 0) {
|
|
|
35
30
|
}
|
|
36
31
|
return path.slice(start, end);
|
|
37
32
|
}
|
|
38
|
-
function assertArgs(path, suffix) {
|
|
39
|
-
|
|
33
|
+
export function assertArgs(path, suffix) {
|
|
34
|
+
assertPath(path);
|
|
40
35
|
if (path.length === 0)
|
|
41
36
|
return path;
|
|
42
37
|
if (typeof suffix !== "string") {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
exports.common = common;
|
|
6
|
-
function common(paths, sep) {
|
|
3
|
+
export function common(paths, sep) {
|
|
7
4
|
const [first = "", ...remaining] = paths;
|
|
8
5
|
const parts = first.split(sep);
|
|
9
6
|
let endOfPrefix = parts.length;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
// Ported from https://github.com/browserify/path-browserify/
|
|
4
|
+
// This module is browser compatible.
|
|
5
|
+
// Alphabet chars.
|
|
6
|
+
export const CHAR_UPPERCASE_A = 65; /* A */
|
|
7
|
+
export const CHAR_LOWERCASE_A = 97; /* a */
|
|
8
|
+
export const CHAR_UPPERCASE_Z = 90; /* Z */
|
|
9
|
+
export const CHAR_LOWERCASE_Z = 122; /* z */
|
|
10
|
+
// Non-alphabetic chars.
|
|
11
|
+
export const CHAR_DOT = 46; /* . */
|
|
12
|
+
export const CHAR_FORWARD_SLASH = 47; /* / */
|
|
13
|
+
export const CHAR_BACKWARD_SLASH = 92; /* \ */
|
|
14
|
+
export const CHAR_VERTICAL_LINE = 124; /* | */
|
|
15
|
+
export const CHAR_COLON = 58; /* : */
|
|
16
|
+
export const CHAR_QUESTION_MARK = 63; /* ? */
|
|
17
|
+
export const CHAR_UNDERSCORE = 95; /* _ */
|
|
18
|
+
export const CHAR_LINE_FEED = 10; /* \n */
|
|
19
|
+
export const CHAR_CARRIAGE_RETURN = 13; /* \r */
|
|
20
|
+
export const CHAR_TAB = 9; /* \t */
|
|
21
|
+
export const CHAR_FORM_FEED = 12; /* \f */
|
|
22
|
+
export const CHAR_EXCLAMATION_MARK = 33; /* ! */
|
|
23
|
+
export const CHAR_HASH = 35; /* # */
|
|
24
|
+
export const CHAR_SPACE = 32; /* */
|
|
25
|
+
export const CHAR_NO_BREAK_SPACE = 160; /* \u00A0 */
|
|
26
|
+
export const CHAR_ZERO_WIDTH_NOBREAK_SPACE = 65279; /* \uFEFF */
|
|
27
|
+
export const CHAR_LEFT_SQUARE_BRACKET = 91; /* [ */
|
|
28
|
+
export const CHAR_RIGHT_SQUARE_BRACKET = 93; /* ] */
|
|
29
|
+
export const CHAR_LEFT_ANGLE_BRACKET = 60; /* < */
|
|
30
|
+
export const CHAR_RIGHT_ANGLE_BRACKET = 62; /* > */
|
|
31
|
+
export const CHAR_LEFT_CURLY_BRACKET = 123; /* { */
|
|
32
|
+
export const CHAR_RIGHT_CURLY_BRACKET = 125; /* } */
|
|
33
|
+
export const CHAR_HYPHEN_MINUS = 45; /* - */
|
|
34
|
+
export const CHAR_PLUS = 43; /* + */
|
|
35
|
+
export const CHAR_DOUBLE_QUOTE = 34; /* " */
|
|
36
|
+
export const CHAR_SINGLE_QUOTE = 39; /* ' */
|
|
37
|
+
export const CHAR_PERCENT = 37; /* % */
|
|
38
|
+
export const CHAR_SEMICOLON = 59; /* ; */
|
|
39
|
+
export const CHAR_CIRCUMFLEX_ACCENT = 94; /* ^ */
|
|
40
|
+
export const CHAR_GRAVE_ACCENT = 96; /* ` */
|
|
41
|
+
export const CHAR_AT = 64; /* @ */
|
|
42
|
+
export const CHAR_AMPERSAND = 38; /* & */
|
|
43
|
+
export const CHAR_EQUAL = 61; /* = */
|
|
44
|
+
// Digits
|
|
45
|
+
export const CHAR_0 = 48; /* 0 */
|
|
46
|
+
export const CHAR_9 = 57; /* 9 */
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
exports._format = _format;
|
|
6
|
-
exports.assertArg = assertArg;
|
|
7
|
-
function _format(sep, pathObject) {
|
|
3
|
+
export function _format(sep, pathObject) {
|
|
8
4
|
const dir = pathObject.dir || pathObject.root;
|
|
9
5
|
const base = pathObject.base ||
|
|
10
6
|
(pathObject.name || "") + (pathObject.ext || "");
|
|
@@ -16,7 +12,7 @@ function _format(sep, pathObject) {
|
|
|
16
12
|
return dir + base;
|
|
17
13
|
return dir + sep + base;
|
|
18
14
|
}
|
|
19
|
-
function assertArg(pathObject) {
|
|
15
|
+
export function assertArg(pathObject) {
|
|
20
16
|
if (pathObject === null || typeof pathObject !== "object") {
|
|
21
17
|
throw new TypeError(`The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`);
|
|
22
18
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
exports.assertArg = assertArg;
|
|
6
|
-
function assertArg(url) {
|
|
3
|
+
export function assertArg(url) {
|
|
7
4
|
url = url instanceof URL ? url : new URL(url);
|
|
8
5
|
if (url.protocol !== "file:") {
|
|
9
6
|
throw new TypeError("Must be a file URL.");
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports._globToRegExp = _globToRegExp;
|
|
6
3
|
const REG_EXP_ESCAPE_CHARS = [
|
|
7
4
|
"!",
|
|
8
5
|
"$",
|
|
@@ -20,7 +17,7 @@ const REG_EXP_ESCAPE_CHARS = [
|
|
|
20
17
|
"|",
|
|
21
18
|
];
|
|
22
19
|
const RANGE_ESCAPE_CHARS = ["-", "\\", "]"];
|
|
23
|
-
function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true,
|
|
20
|
+
export function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true,
|
|
24
21
|
// os = osType,
|
|
25
22
|
caseInsensitive = false, } = {}) {
|
|
26
23
|
if (glob === "") {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// Copyright the Browserify authors. MIT License.
|
|
4
3
|
// Ported from https://github.com/browserify/path-browserify/
|
|
5
4
|
// This module is browser compatible.
|
|
6
|
-
|
|
7
|
-
exports.normalizeString = normalizeString;
|
|
8
|
-
const constants_js_1 = require("./constants.js");
|
|
5
|
+
import { CHAR_DOT, CHAR_FORWARD_SLASH } from "./constants.js";
|
|
9
6
|
// Resolves . and .. elements in a path with directory names
|
|
10
|
-
function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
7
|
+
export function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
11
8
|
let res = "";
|
|
12
9
|
let lastSegmentLength = 0;
|
|
13
10
|
let lastSlash = -1;
|
|
@@ -19,7 +16,7 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
19
16
|
else if (isPathSeparator(code))
|
|
20
17
|
break;
|
|
21
18
|
else
|
|
22
|
-
code =
|
|
19
|
+
code = CHAR_FORWARD_SLASH;
|
|
23
20
|
if (isPathSeparator(code)) {
|
|
24
21
|
if (lastSlash === i - 1 || dots === 1) {
|
|
25
22
|
// NOOP
|
|
@@ -27,8 +24,8 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
27
24
|
else if (lastSlash !== i - 1 && dots === 2) {
|
|
28
25
|
if (res.length < 2 ||
|
|
29
26
|
lastSegmentLength !== 2 ||
|
|
30
|
-
res.charCodeAt(res.length - 1) !==
|
|
31
|
-
res.charCodeAt(res.length - 2) !==
|
|
27
|
+
res.charCodeAt(res.length - 1) !== CHAR_DOT ||
|
|
28
|
+
res.charCodeAt(res.length - 2) !== CHAR_DOT) {
|
|
32
29
|
if (res.length > 2) {
|
|
33
30
|
const lastSlashIndex = res.lastIndexOf(separator);
|
|
34
31
|
if (lastSlashIndex === -1) {
|
|
@@ -69,7 +66,7 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
69
66
|
lastSlash = i;
|
|
70
67
|
dots = 0;
|
|
71
68
|
}
|
|
72
|
-
else if (code ===
|
|
69
|
+
else if (code === CHAR_DOT && dots !== -1) {
|
|
73
70
|
++dots;
|
|
74
71
|
}
|
|
75
72
|
else {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertPath } from "./assert_path.js";
|
|
4
|
+
export function assertArgs(from, to) {
|
|
5
|
+
assertPath(from);
|
|
6
|
+
assertPath(to);
|
|
7
|
+
if (from === to)
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// Copyright the Browserify authors. MIT License.
|
|
4
3
|
// Ported from https://github.com/browserify/path-browserify/
|
|
5
4
|
// This module is browser compatible.
|
|
6
|
-
|
|
7
|
-
exports.stripTrailingSeparators = stripTrailingSeparators;
|
|
8
|
-
function stripTrailingSeparators(segment, isSep) {
|
|
5
|
+
export function stripTrailingSeparators(segment, isSep) {
|
|
9
6
|
if (segment.length <= 1) {
|
|
10
7
|
return segment;
|
|
11
8
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.encodeWhitespace = encodeWhitespace;
|
|
6
3
|
const WHITESPACE_ENCODINGS = {
|
|
7
4
|
"\u0009": "%09",
|
|
8
5
|
"\u000A": "%0A",
|
|
@@ -11,7 +8,7 @@ const WHITESPACE_ENCODINGS = {
|
|
|
11
8
|
"\u000D": "%0D",
|
|
12
9
|
"\u0020": "%20",
|
|
13
10
|
};
|
|
14
|
-
function encodeWhitespace(string) {
|
|
11
|
+
export function encodeWhitespace(string) {
|
|
15
12
|
return string.replaceAll(/[\s]/g, (c) => {
|
|
16
13
|
return WHITESPACE_ENCODINGS[c] ?? c;
|
|
17
14
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
// Keep this up-to-date with Deno.build.os
|
|
4
|
+
/**
|
|
5
|
+
* Operating system type, equivalent to the type of
|
|
6
|
+
* {@linkcode https://deno.land/api?s=Deno.build | Deno.build.os}.
|
|
7
|
+
*/
|
|
8
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
9
|
+
function getOsType() {
|
|
10
|
+
// deno-lint-ignore no-explicit-any
|
|
11
|
+
return dntShim.dntGlobalThis.Deno?.build.os ||
|
|
12
|
+
(navigator.userAgent.includes("Win") ? "windows" : "linux");
|
|
13
|
+
}
|
|
14
|
+
export const isWindows = getOsType() === "windows";
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const basename_js_1 = require("./posix/basename.js");
|
|
8
|
-
const basename_js_2 = require("./windows/basename.js");
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { basename as posixBasename } from "./posix/basename.js";
|
|
5
|
+
import { basename as windowsBasename } from "./windows/basename.js";
|
|
9
6
|
/**
|
|
10
7
|
* Return the last portion of a path.
|
|
11
8
|
*
|
|
@@ -29,8 +26,8 @@ const basename_js_2 = require("./windows/basename.js");
|
|
|
29
26
|
*
|
|
30
27
|
* @returns The basename of the path.
|
|
31
28
|
*/
|
|
32
|
-
function basename(path, suffix = "") {
|
|
33
|
-
return
|
|
34
|
-
? (
|
|
35
|
-
: (
|
|
29
|
+
export function basename(path, suffix = "") {
|
|
30
|
+
return isWindows
|
|
31
|
+
? windowsBasename(path, suffix)
|
|
32
|
+
: posixBasename(path, suffix);
|
|
36
33
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const common_js_1 = require("./_common/common.js");
|
|
7
|
-
const constants_js_1 = require("./constants.js");
|
|
3
|
+
import { common as _common } from "./_common/common.js";
|
|
4
|
+
import { SEPARATOR } from "./constants.js";
|
|
8
5
|
/**
|
|
9
6
|
* Determines the common path from a set of paths for the given OS.
|
|
10
7
|
*
|
|
@@ -31,6 +28,6 @@ const constants_js_1 = require("./constants.js");
|
|
|
31
28
|
* }
|
|
32
29
|
* ```
|
|
33
30
|
*/
|
|
34
|
-
function common(paths) {
|
|
35
|
-
return (
|
|
31
|
+
export function common(paths) {
|
|
32
|
+
return _common(paths, SEPARATOR);
|
|
36
33
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SEPARATOR_PATTERN = exports.SEPARATOR = exports.DELIMITER = void 0;
|
|
4
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
5
2
|
// This module is browser compatible.
|
|
6
|
-
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
7
4
|
/**
|
|
8
5
|
* The character used to separate entries in the PATH environment variable.
|
|
9
6
|
* On Windows, this is `;`. On all other platforms, this is `:`.
|
|
10
7
|
*/
|
|
11
|
-
|
|
8
|
+
export const DELIMITER = isWindows ? ";" : ":";
|
|
12
9
|
/**
|
|
13
10
|
* The character used to separate components of a file path.
|
|
14
11
|
* On Windows, this is `\`. On all other platforms, this is `/`.
|
|
15
12
|
*/
|
|
16
|
-
|
|
13
|
+
export const SEPARATOR = isWindows ? "\\" : "/";
|
|
17
14
|
/**
|
|
18
15
|
* A regular expression that matches one or more path separators.
|
|
19
16
|
*/
|
|
20
|
-
|
|
17
|
+
export const SEPARATOR_PATTERN = isWindows ? /[\\/]+/ : /\/+/;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const dirname_js_1 = require("./posix/dirname.js");
|
|
8
|
-
const dirname_js_2 = require("./windows/dirname.js");
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { dirname as posixDirname } from "./posix/dirname.js";
|
|
5
|
+
import { dirname as windowsDirname } from "./windows/dirname.js";
|
|
9
6
|
/**
|
|
10
7
|
* Return the directory path of a path.
|
|
11
8
|
*
|
|
@@ -24,6 +21,6 @@ const dirname_js_2 = require("./windows/dirname.js");
|
|
|
24
21
|
* @param path Path to extract the directory from.
|
|
25
22
|
* @returns The directory path.
|
|
26
23
|
*/
|
|
27
|
-
function dirname(path) {
|
|
28
|
-
return
|
|
24
|
+
export function dirname(path) {
|
|
25
|
+
return isWindows ? windowsDirname(path) : posixDirname(path);
|
|
29
26
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const extname_js_1 = require("./posix/extname.js");
|
|
8
|
-
const extname_js_2 = require("./windows/extname.js");
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { extname as posixExtname } from "./posix/extname.js";
|
|
5
|
+
import { extname as windowsExtname } from "./windows/extname.js";
|
|
9
6
|
/**
|
|
10
7
|
* Return the extension of the path with leading period (".").
|
|
11
8
|
*
|
|
@@ -24,6 +21,6 @@ const extname_js_2 = require("./windows/extname.js");
|
|
|
24
21
|
* @param path Path with extension.
|
|
25
22
|
* @returns The file extension. E.g. returns `.ts` for `file.ts`.
|
|
26
23
|
*/
|
|
27
|
-
function extname(path) {
|
|
28
|
-
return
|
|
24
|
+
export function extname(path) {
|
|
25
|
+
return isWindows ? windowsExtname(path) : posixExtname(path);
|
|
29
26
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const format_js_1 = require("./posix/format.js");
|
|
8
|
-
const format_js_2 = require("./windows/format.js");
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { format as posixFormat } from "./posix/format.js";
|
|
5
|
+
import { format as windowsFormat } from "./windows/format.js";
|
|
9
6
|
/**
|
|
10
7
|
* Generate a path from a {@linkcode ParsedPath} object. It does the
|
|
11
8
|
* opposite of {@linkcode https://jsr.io/@std/path/doc/~/parse | parse()}.
|
|
@@ -25,6 +22,6 @@ const format_js_2 = require("./windows/format.js");
|
|
|
25
22
|
* @param pathObject Object with path components.
|
|
26
23
|
* @returns The formatted path.
|
|
27
24
|
*/
|
|
28
|
-
function format(pathObject) {
|
|
29
|
-
return
|
|
25
|
+
export function format(pathObject) {
|
|
26
|
+
return isWindows ? windowsFormat(pathObject) : posixFormat(pathObject);
|
|
30
27
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const from_file_url_js_1 = require("./posix/from_file_url.js");
|
|
8
|
-
const from_file_url_js_2 = require("./windows/from_file_url.js");
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { fromFileUrl as posixFromFileUrl } from "./posix/from_file_url.js";
|
|
5
|
+
import { fromFileUrl as windowsFromFileUrl } from "./windows/from_file_url.js";
|
|
9
6
|
/**
|
|
10
7
|
* Converts a file URL to a path string.
|
|
11
8
|
*
|
|
@@ -26,6 +23,6 @@ const from_file_url_js_2 = require("./windows/from_file_url.js");
|
|
|
26
23
|
* @param url The file URL to convert to a path.
|
|
27
24
|
* @returns The path string.
|
|
28
25
|
*/
|
|
29
|
-
function fromFileUrl(url) {
|
|
30
|
-
return
|
|
26
|
+
export function fromFileUrl(url) {
|
|
27
|
+
return isWindows ? windowsFromFileUrl(url) : posixFromFileUrl(url);
|
|
31
28
|
}
|