@skmtc/core 0.0.273 → 0.0.275
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/context/CoreContext.d.ts +32 -3
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +131 -26
- package/esm/context/GenerateContext.d.ts +4 -0
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +13 -1
- package/esm/context/RenderContext.d.ts +4 -2
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +17 -1
- package/esm/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts +700 -0
- package/esm/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fmt/1.0.1/colors.js +903 -0
- package/esm/deps/jsr.io/@std/fs/1.0.2/exists.d.ts +198 -0
- package/esm/deps/jsr.io/@std/fs/1.0.2/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.2/exists.js +251 -0
- package/esm/deps/jsr.io/@std/io/0.224.6/types.d.ts +95 -0
- package/esm/deps/jsr.io/@std/io/0.224.6/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.224.6/types.js +3 -0
- package/esm/deps/jsr.io/@std/io/0.224.6/write_all.d.ts +51 -0
- package/esm/deps/jsr.io/@std/io/0.224.6/write_all.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.224.6/write_all.js +61 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_config.d.ts +4 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_config.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_config.js +14 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts +8 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.js +8 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_state.d.ts +8 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/_state.js +7 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts +22 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/base_handler.js +60 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts +18 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/console_handler.js +58 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/critical.d.ts +5 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/critical.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/critical.js +10 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/debug.d.ts +5 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/debug.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/debug.js +10 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/error.d.ts +5 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/error.js +10 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts +51 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/file_handler.js +135 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/formatters.d.ts +6 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/formatters.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/formatters.js +19 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts +4 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/get_logger.js +21 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/info.d.ts +5 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/info.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/info.js +10 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/levels.d.ts +26 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/levels.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/levels.js +43 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/logger.d.ts +62 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/logger.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/logger.js +179 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/mod.d.ts +390 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/mod.js +390 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts +53 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.js +125 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/setup.d.ts +4 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/setup.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/setup.js +41 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/warn.d.ts +5 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/warn.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.6/warn.js +10 -0
- package/esm/dsl/OasBase.d.ts.map +1 -0
- package/esm/{oas-elements → dsl}/OasBase.js +5 -4
- package/esm/generate/generate.d.ts +3 -1
- package/esm/generate/generate.d.ts.map +1 -1
- package/esm/generate/generate.js +5 -2
- package/esm/generate/generateModels.d.ts.map +1 -1
- package/esm/generate/generateModels.js +18 -5
- package/esm/generate/generateOperations.d.ts.map +1 -1
- package/esm/generate/generateOperations.js +20 -6
- package/esm/helpers/isImported.d.ts +2 -0
- package/esm/helpers/isImported.d.ts.map +1 -0
- package/esm/helpers/isImported.js +4 -0
- package/esm/helpers/refFns.d.ts +0 -1
- package/esm/helpers/refFns.d.ts.map +1 -1
- package/esm/helpers/refFns.js +0 -5
- package/esm/mod.d.ts +1 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -2
- package/esm/oas/array/Array.d.ts +1 -1
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +1 -1
- package/esm/oas/boolean/Boolean.d.ts +1 -1
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +1 -1
- package/esm/oas/components/Components.d.ts +1 -1
- package/esm/oas/components/Components.d.ts.map +1 -1
- package/esm/oas/components/Components.js +1 -1
- package/esm/oas/discriminator/Discriminator.d.ts +1 -1
- package/esm/oas/discriminator/Discriminator.d.ts.map +1 -1
- package/esm/oas/discriminator/Discriminator.js +1 -1
- package/esm/oas/document/Document.d.ts +1 -1
- package/esm/oas/document/Document.d.ts.map +1 -1
- package/esm/oas/document/Document.js +1 -1
- package/esm/oas/example/Example.d.ts +1 -1
- package/esm/oas/example/Example.d.ts.map +1 -1
- package/esm/oas/example/Example.js +1 -1
- package/esm/oas/example/toExamplesV3.js +1 -1
- package/esm/oas/header/Header.d.ts +1 -1
- package/esm/oas/header/Header.d.ts.map +1 -1
- package/esm/oas/header/Header.js +1 -1
- package/esm/oas/info/Info.d.ts +1 -1
- package/esm/oas/info/Info.d.ts.map +1 -1
- package/esm/oas/info/Info.js +1 -1
- package/esm/oas/integer/Integer.d.ts +1 -1
- package/esm/oas/integer/Integer.d.ts.map +1 -1
- package/esm/oas/integer/Integer.js +1 -1
- package/esm/oas/intersection/Intersection.d.ts +1 -1
- package/esm/oas/intersection/Intersection.d.ts.map +1 -1
- package/esm/oas/intersection/Intersection.js +1 -1
- package/esm/oas/mediaType/MediaType.d.ts +1 -1
- package/esm/oas/mediaType/MediaType.d.ts.map +1 -1
- package/esm/oas/mediaType/MediaType.js +1 -1
- package/esm/oas/number/Number.d.ts +1 -1
- package/esm/oas/number/Number.d.ts.map +1 -1
- package/esm/oas/number/Number.js +1 -1
- package/esm/oas/object/Object.d.ts +1 -1
- package/esm/oas/object/Object.d.ts.map +1 -1
- package/esm/oas/object/Object.js +1 -1
- package/esm/oas/operation/Operation.d.ts +1 -1
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +1 -1
- package/esm/oas/parameter/Parameter.d.ts +1 -1
- package/esm/oas/parameter/Parameter.d.ts.map +1 -1
- package/esm/oas/parameter/Parameter.js +1 -1
- package/esm/oas/pathItem/PathItem.d.ts +1 -1
- package/esm/oas/pathItem/PathItem.d.ts.map +1 -1
- package/esm/oas/pathItem/PathItem.js +1 -1
- package/esm/oas/ref/Ref.d.ts +1 -1
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +1 -1
- package/esm/oas/requestBody/RequestBody.d.ts +1 -1
- package/esm/oas/requestBody/RequestBody.d.ts.map +1 -1
- package/esm/oas/requestBody/RequestBody.js +1 -1
- package/esm/oas/response/Response.d.ts +1 -1
- package/esm/oas/response/Response.d.ts.map +1 -1
- package/esm/oas/response/Response.js +1 -1
- package/esm/oas/string/String.d.ts +1 -1
- package/esm/oas/string/String.d.ts.map +1 -1
- package/esm/oas/string/String.js +1 -1
- package/esm/oas/tag/Tag.d.ts +1 -1
- package/esm/oas/tag/Tag.d.ts.map +1 -1
- package/esm/oas/tag/Tag.js +1 -1
- package/esm/oas/union/Union.d.ts +1 -1
- package/esm/oas/union/Union.d.ts.map +1 -1
- package/esm/oas/union/Union.js +1 -1
- package/esm/oas/unknown/Unknown.d.ts +1 -1
- package/esm/oas/unknown/Unknown.d.ts.map +1 -1
- package/esm/oas/unknown/Unknown.js +1 -1
- package/esm/oas/void/Void.d.ts +1 -1
- package/esm/oas/void/Void.d.ts.map +1 -1
- package/esm/oas/void/Void.js +1 -1
- package/esm/server/createServer.d.ts.map +1 -1
- package/esm/server/createServer.js +8 -4
- package/esm/types/Manifest.d.ts +61 -1
- package/esm/types/Manifest.d.ts.map +1 -1
- package/esm/types/Manifest.js +13 -0
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +32 -3
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +132 -26
- package/script/context/GenerateContext.d.ts +4 -0
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +12 -0
- package/script/context/RenderContext.d.ts +4 -2
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +17 -1
- package/script/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts +700 -0
- package/script/deps/jsr.io/@std/fmt/1.0.1/colors.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fmt/1.0.1/colors.js +976 -0
- package/script/deps/jsr.io/@std/fs/1.0.2/exists.d.ts +198 -0
- package/script/deps/jsr.io/@std/fs/1.0.2/exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.2/exists.js +278 -0
- package/script/deps/jsr.io/@std/io/0.224.6/types.d.ts +95 -0
- package/script/deps/jsr.io/@std/io/0.224.6/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.224.6/types.js +4 -0
- package/script/deps/jsr.io/@std/io/0.224.6/write_all.d.ts +51 -0
- package/script/deps/jsr.io/@std/io/0.224.6/write_all.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.224.6/write_all.js +65 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_config.d.ts +4 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_config.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_config.js +17 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts +8 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_file_handler_symbols.js +11 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_state.d.ts +8 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/_state.js +10 -0
- package/script/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts +22 -0
- package/script/deps/jsr.io/@std/log/0.224.6/base_handler.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/base_handler.js +64 -0
- package/script/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts +18 -0
- package/script/deps/jsr.io/@std/log/0.224.6/console_handler.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/console_handler.js +62 -0
- package/script/deps/jsr.io/@std/log/0.224.6/critical.d.ts +5 -0
- package/script/deps/jsr.io/@std/log/0.224.6/critical.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/critical.js +13 -0
- package/script/deps/jsr.io/@std/log/0.224.6/debug.d.ts +5 -0
- package/script/deps/jsr.io/@std/log/0.224.6/debug.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/debug.js +13 -0
- package/script/deps/jsr.io/@std/log/0.224.6/error.d.ts +5 -0
- package/script/deps/jsr.io/@std/log/0.224.6/error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/error.js +13 -0
- package/script/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts +51 -0
- package/script/deps/jsr.io/@std/log/0.224.6/file_handler.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/file_handler.js +162 -0
- package/script/deps/jsr.io/@std/log/0.224.6/formatters.d.ts +6 -0
- package/script/deps/jsr.io/@std/log/0.224.6/formatters.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/formatters.js +23 -0
- package/script/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts +4 -0
- package/script/deps/jsr.io/@std/log/0.224.6/get_logger.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/get_logger.js +24 -0
- package/script/deps/jsr.io/@std/log/0.224.6/info.d.ts +5 -0
- package/script/deps/jsr.io/@std/log/0.224.6/info.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/info.js +13 -0
- package/script/deps/jsr.io/@std/log/0.224.6/levels.d.ts +26 -0
- package/script/deps/jsr.io/@std/log/0.224.6/levels.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/levels.js +48 -0
- package/script/deps/jsr.io/@std/log/0.224.6/logger.d.ts +62 -0
- package/script/deps/jsr.io/@std/log/0.224.6/logger.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/logger.js +185 -0
- package/script/deps/jsr.io/@std/log/0.224.6/mod.d.ts +390 -0
- package/script/deps/jsr.io/@std/log/0.224.6/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/mod.js +406 -0
- package/script/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts +53 -0
- package/script/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/rotating_file_handler.js +152 -0
- package/script/deps/jsr.io/@std/log/0.224.6/setup.d.ts +4 -0
- package/script/deps/jsr.io/@std/log/0.224.6/setup.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/setup.js +44 -0
- package/script/deps/jsr.io/@std/log/0.224.6/warn.d.ts +5 -0
- package/script/deps/jsr.io/@std/log/0.224.6/warn.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/log/0.224.6/warn.js +13 -0
- package/script/dsl/OasBase.d.ts.map +1 -0
- package/script/{oas-elements → dsl}/OasBase.js +5 -4
- package/script/generate/generate.d.ts +3 -1
- package/script/generate/generate.d.ts.map +1 -1
- package/script/generate/generate.js +5 -2
- package/script/generate/generateModels.d.ts.map +1 -1
- package/script/generate/generateModels.js +18 -5
- package/script/generate/generateOperations.d.ts.map +1 -1
- package/script/generate/generateOperations.js +20 -6
- package/script/helpers/isImported.d.ts +2 -0
- package/script/helpers/isImported.d.ts.map +1 -0
- package/script/helpers/isImported.js +8 -0
- package/script/helpers/refFns.d.ts +0 -1
- package/script/helpers/refFns.d.ts.map +1 -1
- package/script/helpers/refFns.js +1 -7
- package/script/mod.d.ts +1 -2
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -2
- package/script/oas/array/Array.d.ts +1 -1
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +1 -1
- package/script/oas/boolean/Boolean.d.ts +1 -1
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +1 -1
- package/script/oas/components/Components.d.ts +1 -1
- package/script/oas/components/Components.d.ts.map +1 -1
- package/script/oas/components/Components.js +1 -1
- package/script/oas/discriminator/Discriminator.d.ts +1 -1
- package/script/oas/discriminator/Discriminator.d.ts.map +1 -1
- package/script/oas/discriminator/Discriminator.js +1 -1
- package/script/oas/document/Document.d.ts +1 -1
- package/script/oas/document/Document.d.ts.map +1 -1
- package/script/oas/document/Document.js +1 -1
- package/script/oas/example/Example.d.ts +1 -1
- package/script/oas/example/Example.d.ts.map +1 -1
- package/script/oas/example/Example.js +1 -1
- package/script/oas/example/toExamplesV3.js +1 -1
- package/script/oas/header/Header.d.ts +1 -1
- package/script/oas/header/Header.d.ts.map +1 -1
- package/script/oas/header/Header.js +1 -1
- package/script/oas/info/Info.d.ts +1 -1
- package/script/oas/info/Info.d.ts.map +1 -1
- package/script/oas/info/Info.js +1 -1
- package/script/oas/integer/Integer.d.ts +1 -1
- package/script/oas/integer/Integer.d.ts.map +1 -1
- package/script/oas/integer/Integer.js +1 -1
- package/script/oas/intersection/Intersection.d.ts +1 -1
- package/script/oas/intersection/Intersection.d.ts.map +1 -1
- package/script/oas/intersection/Intersection.js +1 -1
- package/script/oas/mediaType/MediaType.d.ts +1 -1
- package/script/oas/mediaType/MediaType.d.ts.map +1 -1
- package/script/oas/mediaType/MediaType.js +1 -1
- package/script/oas/number/Number.d.ts +1 -1
- package/script/oas/number/Number.d.ts.map +1 -1
- package/script/oas/number/Number.js +1 -1
- package/script/oas/object/Object.d.ts +1 -1
- package/script/oas/object/Object.d.ts.map +1 -1
- package/script/oas/object/Object.js +1 -1
- package/script/oas/operation/Operation.d.ts +1 -1
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +1 -1
- package/script/oas/parameter/Parameter.d.ts +1 -1
- package/script/oas/parameter/Parameter.d.ts.map +1 -1
- package/script/oas/parameter/Parameter.js +1 -1
- package/script/oas/pathItem/PathItem.d.ts +1 -1
- package/script/oas/pathItem/PathItem.d.ts.map +1 -1
- package/script/oas/pathItem/PathItem.js +1 -1
- package/script/oas/ref/Ref.d.ts +1 -1
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +1 -1
- package/script/oas/requestBody/RequestBody.d.ts +1 -1
- package/script/oas/requestBody/RequestBody.d.ts.map +1 -1
- package/script/oas/requestBody/RequestBody.js +1 -1
- package/script/oas/response/Response.d.ts +1 -1
- package/script/oas/response/Response.d.ts.map +1 -1
- package/script/oas/response/Response.js +1 -1
- package/script/oas/string/String.d.ts +1 -1
- package/script/oas/string/String.d.ts.map +1 -1
- package/script/oas/string/String.js +1 -1
- package/script/oas/tag/Tag.d.ts +1 -1
- package/script/oas/tag/Tag.d.ts.map +1 -1
- package/script/oas/tag/Tag.js +1 -1
- package/script/oas/union/Union.d.ts +1 -1
- package/script/oas/union/Union.d.ts.map +1 -1
- package/script/oas/union/Union.js +1 -1
- package/script/oas/unknown/Unknown.d.ts +1 -1
- package/script/oas/unknown/Unknown.d.ts.map +1 -1
- package/script/oas/unknown/Unknown.js +1 -1
- package/script/oas/void/Void.d.ts +1 -1
- package/script/oas/void/Void.d.ts.map +1 -1
- package/script/oas/void/Void.js +1 -1
- package/script/server/createServer.d.ts.map +1 -1
- package/script/server/createServer.js +8 -4
- package/script/types/Manifest.d.ts +61 -1
- package/script/types/Manifest.d.ts.map +1 -1
- package/script/types/Manifest.js +14 -1
- package/esm/context/LogStore.d.ts +0 -25
- package/esm/context/LogStore.d.ts.map +0 -1
- package/esm/context/LogStore.js +0 -53
- package/esm/helpers/logStatus.d.ts +0 -19
- package/esm/helpers/logStatus.d.ts.map +0 -1
- package/esm/helpers/logStatus.js +0 -16
- package/esm/oas-elements/OasBase.d.ts.map +0 -1
- package/script/context/LogStore.d.ts +0 -25
- package/script/context/LogStore.d.ts.map +0 -1
- package/script/context/LogStore.js +0 -57
- package/script/helpers/logStatus.d.ts +0 -19
- package/script/helpers/logStatus.d.ts.map +0 -1
- package/script/helpers/logStatus.js +0 -21
- package/script/oas-elements/OasBase.d.ts.map +0 -1
- /package/esm/{oas-elements → dsl}/OasBase.d.ts +0 -0
- /package/script/{oas-elements → dsl}/OasBase.d.ts +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
export interface ExistsOptions {
|
|
2
|
+
/**
|
|
3
|
+
* When `true`, will check if the path is readable by the user as well.
|
|
4
|
+
*
|
|
5
|
+
* @default {false}
|
|
6
|
+
*/
|
|
7
|
+
isReadable?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* When `true`, will check if the path is a directory as well. Directory
|
|
10
|
+
* symlinks are included.
|
|
11
|
+
*
|
|
12
|
+
* @default {false}
|
|
13
|
+
*/
|
|
14
|
+
isDirectory?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* When `true`, will check if the path is a file as well. File symlinks are
|
|
17
|
+
* included.
|
|
18
|
+
*
|
|
19
|
+
* @default {false}
|
|
20
|
+
*/
|
|
21
|
+
isFile?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Asynchronously test whether or not the given path exists by checking with
|
|
25
|
+
* the file system.
|
|
26
|
+
*
|
|
27
|
+
* Note: Do not use this function if performing a check before another operation
|
|
28
|
+
* on that file. Doing so creates a race condition. Instead, perform the actual
|
|
29
|
+
* file operation directly. This function is not recommended for this use case.
|
|
30
|
+
* See the recommended method below.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use} for
|
|
33
|
+
* more information on the time-of-check to time-of-use bug.
|
|
34
|
+
*
|
|
35
|
+
* Requires `--allow-read` and `--allow-sys` permissions.
|
|
36
|
+
*
|
|
37
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
|
38
|
+
* for more information on Deno's permissions system.
|
|
39
|
+
*
|
|
40
|
+
* @param path The path to the file or directory, as a string or URL.
|
|
41
|
+
* @param options Additional options for the check.
|
|
42
|
+
*
|
|
43
|
+
* @returns A promise that resolves with `true` if the path exists, `false`
|
|
44
|
+
* otherwise.
|
|
45
|
+
*
|
|
46
|
+
* @example Recommended method
|
|
47
|
+
* ```ts no-eval
|
|
48
|
+
* // Notice no use of exists
|
|
49
|
+
* try {
|
|
50
|
+
* await Deno.remove("./foo", { recursive: true });
|
|
51
|
+
* } catch (error) {
|
|
52
|
+
* if (!(error instanceof Deno.errors.NotFound)) {
|
|
53
|
+
* throw error;
|
|
54
|
+
* }
|
|
55
|
+
* // Do nothing...
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* Notice that `exists()` is not used in the above example. Doing so avoids a
|
|
60
|
+
* possible race condition. See the above note for details.
|
|
61
|
+
*
|
|
62
|
+
* @example Basic usage
|
|
63
|
+
* ```ts no-eval
|
|
64
|
+
* import { exists } from "@std/fs/exists";
|
|
65
|
+
*
|
|
66
|
+
* await exists("./exists"); // true
|
|
67
|
+
* await exists("./does_not_exist"); // false
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example Check if a path is readable
|
|
71
|
+
* ```ts no-eval
|
|
72
|
+
* import { exists } from "@std/fs/exists";
|
|
73
|
+
*
|
|
74
|
+
* await exists("./readable", { isReadable: true }); // true
|
|
75
|
+
* await exists("./not_readable", { isReadable: true }); // false
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @example Check if a path is a directory
|
|
79
|
+
* ```ts no-eval
|
|
80
|
+
* import { exists } from "@std/fs/exists";
|
|
81
|
+
*
|
|
82
|
+
* await exists("./directory", { isDirectory: true }); // true
|
|
83
|
+
* await exists("./file", { isDirectory: true }); // false
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @example Check if a path is a file
|
|
87
|
+
* ```ts no-eval
|
|
88
|
+
* import { exists } from "@std/fs/exists";
|
|
89
|
+
*
|
|
90
|
+
* await exists("./file", { isFile: true }); // true
|
|
91
|
+
* await exists("./directory", { isFile: true }); // false
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @example Check if a path is a readable directory
|
|
95
|
+
* ```ts no-eval
|
|
96
|
+
* import { exists } from "@std/fs/exists";
|
|
97
|
+
*
|
|
98
|
+
* await exists("./readable_directory", { isReadable: true, isDirectory: true }); // true
|
|
99
|
+
* await exists("./not_readable_directory", { isReadable: true, isDirectory: true }); // false
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @example Check if a path is a readable file
|
|
103
|
+
* ```ts no-eval
|
|
104
|
+
* import { exists } from "@std/fs/exists";
|
|
105
|
+
*
|
|
106
|
+
* await exists("./readable_file", { isReadable: true, isFile: true }); // true
|
|
107
|
+
* await exists("./not_readable_file", { isReadable: true, isFile: true }); // false
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare function exists(path: string | URL, options?: ExistsOptions): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Synchronously test whether or not the given path exists by checking with
|
|
113
|
+
* the file system.
|
|
114
|
+
*
|
|
115
|
+
* Note: Do not use this function if performing a check before another operation
|
|
116
|
+
* on that file. Doing so creates a race condition. Instead, perform the actual
|
|
117
|
+
* file operation directly. This function is not recommended for this use case.
|
|
118
|
+
* See the recommended method below.
|
|
119
|
+
*
|
|
120
|
+
* @see {@link https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use} for
|
|
121
|
+
* more information on the time-of-check to time-of-use bug.
|
|
122
|
+
*
|
|
123
|
+
* Requires `--allow-read` and `--allow-sys` permissions.
|
|
124
|
+
*
|
|
125
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
|
126
|
+
* for more information on Deno's permissions system.
|
|
127
|
+
*
|
|
128
|
+
* @param path The path to the file or directory, as a string or URL.
|
|
129
|
+
* @param options Additional options for the check.
|
|
130
|
+
*
|
|
131
|
+
* @returns `true` if the path exists, `false` otherwise.
|
|
132
|
+
*
|
|
133
|
+
* @example Recommended method
|
|
134
|
+
* ```ts no-eval
|
|
135
|
+
* // Notice no use of exists
|
|
136
|
+
* try {
|
|
137
|
+
* Deno.removeSync("./foo", { recursive: true });
|
|
138
|
+
* } catch (error) {
|
|
139
|
+
* if (!(error instanceof Deno.errors.NotFound)) {
|
|
140
|
+
* throw error;
|
|
141
|
+
* }
|
|
142
|
+
* // Do nothing...
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* Notice that `existsSync()` is not used in the above example. Doing so avoids
|
|
147
|
+
* a possible race condition. See the above note for details.
|
|
148
|
+
*
|
|
149
|
+
* @example Basic usage
|
|
150
|
+
* ```ts no-eval
|
|
151
|
+
* import { existsSync } from "@std/fs/exists";
|
|
152
|
+
*
|
|
153
|
+
* existsSync("./exists"); // true
|
|
154
|
+
* existsSync("./does_not_exist"); // false
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @example Check if a path is readable
|
|
158
|
+
* ```ts no-eval
|
|
159
|
+
* import { existsSync } from "@std/fs/exists";
|
|
160
|
+
*
|
|
161
|
+
* existsSync("./readable", { isReadable: true }); // true
|
|
162
|
+
* existsSync("./not_readable", { isReadable: true }); // false
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* @example Check if a path is a directory
|
|
166
|
+
* ```ts no-eval
|
|
167
|
+
* import { existsSync } from "@std/fs/exists";
|
|
168
|
+
*
|
|
169
|
+
* existsSync("./directory", { isDirectory: true }); // true
|
|
170
|
+
* existsSync("./file", { isDirectory: true }); // false
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @example Check if a path is a file
|
|
174
|
+
* ```ts no-eval
|
|
175
|
+
* import { existsSync } from "@std/fs/exists";
|
|
176
|
+
*
|
|
177
|
+
* existsSync("./file", { isFile: true }); // true
|
|
178
|
+
* existsSync("./directory", { isFile: true }); // false
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* @example Check if a path is a readable directory
|
|
182
|
+
* ```ts no-eval
|
|
183
|
+
* import { existsSync } from "@std/fs/exists";
|
|
184
|
+
*
|
|
185
|
+
* existsSync("./readable_directory", { isReadable: true, isDirectory: true }); // true
|
|
186
|
+
* existsSync("./not_readable_directory", { isReadable: true, isDirectory: true }); // false
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* @example Check if a path is a readable file
|
|
190
|
+
* ```ts no-eval
|
|
191
|
+
* import { existsSync } from "@std/fs/exists";
|
|
192
|
+
*
|
|
193
|
+
* existsSync("./readable_file", { isReadable: true, isFile: true }); // true
|
|
194
|
+
* existsSync("./not_readable_file", { isReadable: true, isFile: true }); // false
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
export declare function existsSync(path: string | URL, options?: ExistsOptions): boolean;
|
|
198
|
+
//# sourceMappingURL=exists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.2/exists.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,OAAO,CAAC,CAsClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAqCT"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.exists = exists;
|
|
28
|
+
exports.existsSync = existsSync;
|
|
29
|
+
/** Options for {@linkcode exists} and {@linkcode existsSync.} */
|
|
30
|
+
const dntShim = __importStar(require("../../../../../_dnt.shims.js"));
|
|
31
|
+
/**
|
|
32
|
+
* Asynchronously test whether or not the given path exists by checking with
|
|
33
|
+
* the file system.
|
|
34
|
+
*
|
|
35
|
+
* Note: Do not use this function if performing a check before another operation
|
|
36
|
+
* on that file. Doing so creates a race condition. Instead, perform the actual
|
|
37
|
+
* file operation directly. This function is not recommended for this use case.
|
|
38
|
+
* See the recommended method below.
|
|
39
|
+
*
|
|
40
|
+
* @see {@link https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use} for
|
|
41
|
+
* more information on the time-of-check to time-of-use bug.
|
|
42
|
+
*
|
|
43
|
+
* Requires `--allow-read` and `--allow-sys` permissions.
|
|
44
|
+
*
|
|
45
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
|
46
|
+
* for more information on Deno's permissions system.
|
|
47
|
+
*
|
|
48
|
+
* @param path The path to the file or directory, as a string or URL.
|
|
49
|
+
* @param options Additional options for the check.
|
|
50
|
+
*
|
|
51
|
+
* @returns A promise that resolves with `true` if the path exists, `false`
|
|
52
|
+
* otherwise.
|
|
53
|
+
*
|
|
54
|
+
* @example Recommended method
|
|
55
|
+
* ```ts no-eval
|
|
56
|
+
* // Notice no use of exists
|
|
57
|
+
* try {
|
|
58
|
+
* await Deno.remove("./foo", { recursive: true });
|
|
59
|
+
* } catch (error) {
|
|
60
|
+
* if (!(error instanceof Deno.errors.NotFound)) {
|
|
61
|
+
* throw error;
|
|
62
|
+
* }
|
|
63
|
+
* // Do nothing...
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* Notice that `exists()` is not used in the above example. Doing so avoids a
|
|
68
|
+
* possible race condition. See the above note for details.
|
|
69
|
+
*
|
|
70
|
+
* @example Basic usage
|
|
71
|
+
* ```ts no-eval
|
|
72
|
+
* import { exists } from "@std/fs/exists";
|
|
73
|
+
*
|
|
74
|
+
* await exists("./exists"); // true
|
|
75
|
+
* await exists("./does_not_exist"); // false
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @example Check if a path is readable
|
|
79
|
+
* ```ts no-eval
|
|
80
|
+
* import { exists } from "@std/fs/exists";
|
|
81
|
+
*
|
|
82
|
+
* await exists("./readable", { isReadable: true }); // true
|
|
83
|
+
* await exists("./not_readable", { isReadable: true }); // false
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @example Check if a path is a directory
|
|
87
|
+
* ```ts no-eval
|
|
88
|
+
* import { exists } from "@std/fs/exists";
|
|
89
|
+
*
|
|
90
|
+
* await exists("./directory", { isDirectory: true }); // true
|
|
91
|
+
* await exists("./file", { isDirectory: true }); // false
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @example Check if a path is a file
|
|
95
|
+
* ```ts no-eval
|
|
96
|
+
* import { exists } from "@std/fs/exists";
|
|
97
|
+
*
|
|
98
|
+
* await exists("./file", { isFile: true }); // true
|
|
99
|
+
* await exists("./directory", { isFile: true }); // false
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @example Check if a path is a readable directory
|
|
103
|
+
* ```ts no-eval
|
|
104
|
+
* import { exists } from "@std/fs/exists";
|
|
105
|
+
*
|
|
106
|
+
* await exists("./readable_directory", { isReadable: true, isDirectory: true }); // true
|
|
107
|
+
* await exists("./not_readable_directory", { isReadable: true, isDirectory: true }); // false
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @example Check if a path is a readable file
|
|
111
|
+
* ```ts no-eval
|
|
112
|
+
* import { exists } from "@std/fs/exists";
|
|
113
|
+
*
|
|
114
|
+
* await exists("./readable_file", { isReadable: true, isFile: true }); // true
|
|
115
|
+
* await exists("./not_readable_file", { isReadable: true, isFile: true }); // false
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
async function exists(path, options) {
|
|
119
|
+
try {
|
|
120
|
+
const stat = await dntShim.Deno.stat(path);
|
|
121
|
+
if (options &&
|
|
122
|
+
(options.isReadable || options.isDirectory || options.isFile)) {
|
|
123
|
+
if (options.isDirectory && options.isFile) {
|
|
124
|
+
throw new TypeError("ExistsOptions.options.isDirectory and ExistsOptions.options.isFile must not be true together");
|
|
125
|
+
}
|
|
126
|
+
if ((options.isDirectory && !stat.isDirectory) ||
|
|
127
|
+
(options.isFile && !stat.isFile)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
if (options.isReadable) {
|
|
131
|
+
return fileIsReadable(stat);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
if (error instanceof dntShim.Deno.errors.NotFound) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (error instanceof dntShim.Deno.errors.PermissionDenied) {
|
|
141
|
+
if ((await dntShim.Deno.permissions.query({ name: "read", path })).state ===
|
|
142
|
+
"granted") {
|
|
143
|
+
// --allow-read not missing
|
|
144
|
+
return !options?.isReadable; // PermissionDenied was raised by file system, so the item exists, but can't be read
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Synchronously test whether or not the given path exists by checking with
|
|
152
|
+
* the file system.
|
|
153
|
+
*
|
|
154
|
+
* Note: Do not use this function if performing a check before another operation
|
|
155
|
+
* on that file. Doing so creates a race condition. Instead, perform the actual
|
|
156
|
+
* file operation directly. This function is not recommended for this use case.
|
|
157
|
+
* See the recommended method below.
|
|
158
|
+
*
|
|
159
|
+
* @see {@link https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use} for
|
|
160
|
+
* more information on the time-of-check to time-of-use bug.
|
|
161
|
+
*
|
|
162
|
+
* Requires `--allow-read` and `--allow-sys` permissions.
|
|
163
|
+
*
|
|
164
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
|
165
|
+
* for more information on Deno's permissions system.
|
|
166
|
+
*
|
|
167
|
+
* @param path The path to the file or directory, as a string or URL.
|
|
168
|
+
* @param options Additional options for the check.
|
|
169
|
+
*
|
|
170
|
+
* @returns `true` if the path exists, `false` otherwise.
|
|
171
|
+
*
|
|
172
|
+
* @example Recommended method
|
|
173
|
+
* ```ts no-eval
|
|
174
|
+
* // Notice no use of exists
|
|
175
|
+
* try {
|
|
176
|
+
* Deno.removeSync("./foo", { recursive: true });
|
|
177
|
+
* } catch (error) {
|
|
178
|
+
* if (!(error instanceof Deno.errors.NotFound)) {
|
|
179
|
+
* throw error;
|
|
180
|
+
* }
|
|
181
|
+
* // Do nothing...
|
|
182
|
+
* }
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* Notice that `existsSync()` is not used in the above example. Doing so avoids
|
|
186
|
+
* a possible race condition. See the above note for details.
|
|
187
|
+
*
|
|
188
|
+
* @example Basic usage
|
|
189
|
+
* ```ts no-eval
|
|
190
|
+
* import { existsSync } from "@std/fs/exists";
|
|
191
|
+
*
|
|
192
|
+
* existsSync("./exists"); // true
|
|
193
|
+
* existsSync("./does_not_exist"); // false
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @example Check if a path is readable
|
|
197
|
+
* ```ts no-eval
|
|
198
|
+
* import { existsSync } from "@std/fs/exists";
|
|
199
|
+
*
|
|
200
|
+
* existsSync("./readable", { isReadable: true }); // true
|
|
201
|
+
* existsSync("./not_readable", { isReadable: true }); // false
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @example Check if a path is a directory
|
|
205
|
+
* ```ts no-eval
|
|
206
|
+
* import { existsSync } from "@std/fs/exists";
|
|
207
|
+
*
|
|
208
|
+
* existsSync("./directory", { isDirectory: true }); // true
|
|
209
|
+
* existsSync("./file", { isDirectory: true }); // false
|
|
210
|
+
* ```
|
|
211
|
+
*
|
|
212
|
+
* @example Check if a path is a file
|
|
213
|
+
* ```ts no-eval
|
|
214
|
+
* import { existsSync } from "@std/fs/exists";
|
|
215
|
+
*
|
|
216
|
+
* existsSync("./file", { isFile: true }); // true
|
|
217
|
+
* existsSync("./directory", { isFile: true }); // false
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* @example Check if a path is a readable directory
|
|
221
|
+
* ```ts no-eval
|
|
222
|
+
* import { existsSync } from "@std/fs/exists";
|
|
223
|
+
*
|
|
224
|
+
* existsSync("./readable_directory", { isReadable: true, isDirectory: true }); // true
|
|
225
|
+
* existsSync("./not_readable_directory", { isReadable: true, isDirectory: true }); // false
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* @example Check if a path is a readable file
|
|
229
|
+
* ```ts no-eval
|
|
230
|
+
* import { existsSync } from "@std/fs/exists";
|
|
231
|
+
*
|
|
232
|
+
* existsSync("./readable_file", { isReadable: true, isFile: true }); // true
|
|
233
|
+
* existsSync("./not_readable_file", { isReadable: true, isFile: true }); // false
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
function existsSync(path, options) {
|
|
237
|
+
try {
|
|
238
|
+
const stat = dntShim.Deno.statSync(path);
|
|
239
|
+
if (options &&
|
|
240
|
+
(options.isReadable || options.isDirectory || options.isFile)) {
|
|
241
|
+
if (options.isDirectory && options.isFile) {
|
|
242
|
+
throw new TypeError("ExistsOptions.options.isDirectory and ExistsOptions.options.isFile must not be true together");
|
|
243
|
+
}
|
|
244
|
+
if ((options.isDirectory && !stat.isDirectory) ||
|
|
245
|
+
(options.isFile && !stat.isFile)) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
if (options.isReadable) {
|
|
249
|
+
return fileIsReadable(stat);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
if (error instanceof dntShim.Deno.errors.NotFound) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
if (error instanceof dntShim.Deno.errors.PermissionDenied) {
|
|
259
|
+
if (dntShim.Deno.permissions.querySync({ name: "read", path }).state === "granted") {
|
|
260
|
+
// --allow-read not missing
|
|
261
|
+
return !options?.isReadable; // PermissionDenied was raised by file system, so the item exists, but can't be read
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
throw error;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function fileIsReadable(stat) {
|
|
268
|
+
if (stat.mode === null) {
|
|
269
|
+
return true; // Exclusive on Non-POSIX systems
|
|
270
|
+
}
|
|
271
|
+
else if (dntShim.Deno.uid() === stat.uid) {
|
|
272
|
+
return (stat.mode & 0o400) === 0o400; // User is owner and can read?
|
|
273
|
+
}
|
|
274
|
+
else if (dntShim.Deno.gid() === stat.gid) {
|
|
275
|
+
return (stat.mode & 0o040) === 0o040; // User group is owner and can read?
|
|
276
|
+
}
|
|
277
|
+
return (stat.mode & 0o004) === 0o004; // Others can read?
|
|
278
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously.
|
|
3
|
+
*/
|
|
4
|
+
export interface Reader {
|
|
5
|
+
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of
|
|
6
|
+
* bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error
|
|
7
|
+
* encountered. Even if `read()` resolves to `n` < `p.byteLength`, it may
|
|
8
|
+
* use all of `p` as scratch space during the call. If some data is
|
|
9
|
+
* available but not `p.byteLength` bytes, `read()` conventionally resolves
|
|
10
|
+
* to what is available instead of waiting for more.
|
|
11
|
+
*
|
|
12
|
+
* When `read()` encounters end-of-file condition, it resolves to EOF
|
|
13
|
+
* (`null`).
|
|
14
|
+
*
|
|
15
|
+
* When `read()` encounters an error, it rejects with an error.
|
|
16
|
+
*
|
|
17
|
+
* Callers should always process the `n` > `0` bytes returned before
|
|
18
|
+
* considering the EOF (`null`). Doing so correctly handles I/O errors that
|
|
19
|
+
* happen after reading some bytes and also both of the allowed EOF
|
|
20
|
+
* behaviors.
|
|
21
|
+
*
|
|
22
|
+
* Implementations should not retain a reference to `p`.
|
|
23
|
+
*
|
|
24
|
+
* Use
|
|
25
|
+
* {@linkcode @std/io/to-iterator.ts?s=toIterator}
|
|
26
|
+
* to turn a {@linkcode Reader} into an {@linkcode AsyncIterableIterator}.
|
|
27
|
+
*/
|
|
28
|
+
read(p: Uint8Array): Promise<number | null>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously.
|
|
32
|
+
*/
|
|
33
|
+
export interface ReaderSync {
|
|
34
|
+
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number
|
|
35
|
+
* of bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error
|
|
36
|
+
* encountered. Even if `read()` returns `n` < `p.byteLength`, it may use
|
|
37
|
+
* all of `p` as scratch space during the call. If some data is available
|
|
38
|
+
* but not `p.byteLength` bytes, `read()` conventionally returns what is
|
|
39
|
+
* available instead of waiting for more.
|
|
40
|
+
*
|
|
41
|
+
* When `readSync()` encounters end-of-file condition, it returns EOF
|
|
42
|
+
* (`null`).
|
|
43
|
+
*
|
|
44
|
+
* When `readSync()` encounters an error, it throws with an error.
|
|
45
|
+
*
|
|
46
|
+
* Callers should always process the `n` > `0` bytes returned before
|
|
47
|
+
* considering the EOF (`null`). Doing so correctly handles I/O errors that happen
|
|
48
|
+
* after reading some bytes and also both of the allowed EOF behaviors.
|
|
49
|
+
*
|
|
50
|
+
* Implementations should not retain a reference to `p`.
|
|
51
|
+
*
|
|
52
|
+
* Use
|
|
53
|
+
* {@linkcode @std/io/to-iterator.ts?s=toIteratorSync}
|
|
54
|
+
* to turn a {@linkcode ReaderSync} into an {@linkcode IterableIterator}.
|
|
55
|
+
*/
|
|
56
|
+
readSync(p: Uint8Array): number | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.
|
|
60
|
+
*/
|
|
61
|
+
export interface Writer {
|
|
62
|
+
/** Writes `p.byteLength` bytes from `p` to the underlying data stream. It
|
|
63
|
+
* resolves to the number of bytes written from `p` (`0` <= `n` <=
|
|
64
|
+
* `p.byteLength`) or reject with the error encountered that caused the
|
|
65
|
+
* write to stop early. `write()` must reject with a non-null error if
|
|
66
|
+
* would resolve to `n` < `p.byteLength`. `write()` must not modify the
|
|
67
|
+
* slice data, even temporarily.
|
|
68
|
+
*
|
|
69
|
+
* Implementations should not retain a reference to `p`.
|
|
70
|
+
*/
|
|
71
|
+
write(p: Uint8Array): Promise<number>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously.
|
|
75
|
+
*/
|
|
76
|
+
export interface WriterSync {
|
|
77
|
+
/** Writes `p.byteLength` bytes from `p` to the underlying data
|
|
78
|
+
* stream. It returns the number of bytes written from `p` (`0` <= `n`
|
|
79
|
+
* <= `p.byteLength`) and any error encountered that caused the write to
|
|
80
|
+
* stop early. `writeSync()` must throw a non-null error if it returns `n` <
|
|
81
|
+
* `p.byteLength`. `writeSync()` must not modify the slice data, even
|
|
82
|
+
* temporarily.
|
|
83
|
+
*
|
|
84
|
+
* Implementations should not retain a reference to `p`.
|
|
85
|
+
*/
|
|
86
|
+
writeSync(p: Uint8Array): number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* An abstract interface which when implemented provides an interface to close files/resources that were previously opened.
|
|
90
|
+
*/
|
|
91
|
+
export interface Closer {
|
|
92
|
+
/** Closes the resource, "freeing" the backing file/resource. */
|
|
93
|
+
close(): void;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.224.6/types.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;;;OAQG;IACH,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvC;AACD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;OAQG;IACH,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,gEAAgE;IAChE,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Writer, WriterSync } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Write all the content of the array buffer (`arr`) to the writer (`w`).
|
|
4
|
+
*
|
|
5
|
+
* @example Writing to stdout
|
|
6
|
+
* ```ts no-assert
|
|
7
|
+
* import { writeAll } from "@std/io/write-all";
|
|
8
|
+
*
|
|
9
|
+
* const contentBytes = new TextEncoder().encode("Hello World");
|
|
10
|
+
* await writeAll(Deno.stdout, contentBytes);
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @example Writing to file
|
|
14
|
+
* ```ts no-eval no-assert
|
|
15
|
+
* import { writeAll } from "@std/io/write-all";
|
|
16
|
+
*
|
|
17
|
+
* const contentBytes = new TextEncoder().encode("Hello World");
|
|
18
|
+
* using file = await Deno.open('test.file', { write: true });
|
|
19
|
+
* await writeAll(file, contentBytes);
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param writer The writer to write to
|
|
23
|
+
* @param data The data to write
|
|
24
|
+
*/
|
|
25
|
+
export declare function writeAll(writer: Writer, data: Uint8Array): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Synchronously write all the content of the array buffer (`arr`) to the
|
|
28
|
+
* writer (`w`).
|
|
29
|
+
*
|
|
30
|
+
* @example "riting to stdout
|
|
31
|
+
* ```ts no-assert
|
|
32
|
+
* import { writeAllSync } from "@std/io/write-all";
|
|
33
|
+
*
|
|
34
|
+
* const contentBytes = new TextEncoder().encode("Hello World");
|
|
35
|
+
* writeAllSync(Deno.stdout, contentBytes);
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example Writing to file
|
|
39
|
+
* ```ts no-eval no-assert
|
|
40
|
+
* import { writeAllSync } from "@std/io/write-all";
|
|
41
|
+
*
|
|
42
|
+
* const contentBytes = new TextEncoder().encode("Hello World");
|
|
43
|
+
* using file = Deno.openSync("test.file", { write: true });
|
|
44
|
+
* writeAllSync(file, contentBytes);
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @param writer The writer to write to
|
|
48
|
+
* @param data The data to write
|
|
49
|
+
*/
|
|
50
|
+
export declare function writeAllSync(writer: WriterSync, data: Uint8Array): void;
|
|
51
|
+
//# sourceMappingURL=write_all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write_all.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.224.6/write_all.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,iBAK9D;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,QAKhE"}
|