@ariestools/sdk 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +45 -0
- package/dist/_pkg/api/neutral/ApiClient.d.ts +10 -0
- package/dist/_pkg/api/neutral/ApiConfig.d.ts +9 -0
- package/dist/_pkg/api/neutral/ApiEndpoint.d.ts +19 -0
- package/dist/_pkg/api/neutral/ApiStage.d.ts +11 -0
- package/dist/_pkg/api/neutral/getApiStage.d.ts +8 -0
- package/dist/_pkg/api/neutral/index.d.ts +6 -0
- package/dist/_pkg/api/neutral/index.mjs +78 -0
- package/dist/_pkg/api/neutral/model.d.ts +3 -0
- package/dist/_pkg/api/neutral/model.mjs +1 -0
- package/dist/_pkg/array/neutral/containsAll.d.ts +8 -0
- package/dist/_pkg/array/neutral/distinct.d.ts +6 -0
- package/dist/_pkg/array/neutral/filterAs.d.ts +8 -0
- package/dist/_pkg/array/neutral/filterAsync.d.ts +9 -0
- package/dist/_pkg/array/neutral/findAs.d.ts +15 -0
- package/dist/_pkg/array/neutral/flatten.d.ts +8 -0
- package/dist/_pkg/array/neutral/index.d.ts +8 -0
- package/dist/_pkg/array/neutral/index.mjs +80 -0
- package/dist/_pkg/array/neutral/uniq.d.ts +14 -0
- package/dist/_pkg/arraybuffer/neutral/equalArrayBuffers.d.ts +8 -0
- package/dist/_pkg/arraybuffer/neutral/index.d.ts +5 -0
- package/dist/_pkg/arraybuffer/neutral/index.mjs +74 -0
- package/dist/_pkg/arraybuffer/neutral/isArrayBuffer.d.ts +7 -0
- package/dist/_pkg/arraybuffer/neutral/toArrayBuffer.d.ts +11 -0
- package/dist/_pkg/arraybuffer/neutral/toUint8Array.d.ts +11 -0
- package/dist/_pkg/assert/neutral/assertDefinedEx.d.ts +41 -0
- package/dist/_pkg/assert/neutral/assertEx.d.ts +41 -0
- package/dist/_pkg/assert/neutral/index.d.ts +4 -0
- package/dist/_pkg/assert/neutral/index.mjs +30 -0
- package/dist/_pkg/assert/neutral/model.d.ts +2 -0
- package/dist/_pkg/assert/neutral/model.mjs +1 -0
- package/dist/_pkg/assert/neutral/types.d.ts +36 -0
- package/dist/_pkg/base/neutral/Base.d.ts +53 -0
- package/dist/_pkg/base/neutral/UniqueBase.d.ts +10 -0
- package/dist/_pkg/base/neutral/globallyUnique.d.ts +21 -0
- package/dist/_pkg/base/neutral/index.d.ts +4 -0
- package/dist/_pkg/base/neutral/index.mjs +164 -0
- package/dist/_pkg/base/neutral/model.d.ts +2 -0
- package/dist/_pkg/base/neutral/model.mjs +1 -0
- package/dist/_pkg/creatable/neutral/AbstractCreatable.d.ts +123 -0
- package/dist/_pkg/creatable/neutral/Creatable.d.ts +49 -0
- package/dist/_pkg/creatable/neutral/Factory.d.ts +28 -0
- package/dist/_pkg/creatable/neutral/index.d.ts +5 -0
- package/dist/_pkg/creatable/neutral/index.mjs +396 -0
- package/dist/_pkg/creatable/neutral/lib/getFunctionName.d.ts +7 -0
- package/dist/_pkg/creatable/neutral/lib/getRootFunction.d.ts +8 -0
- package/dist/_pkg/creatable/neutral/lib/index.d.ts +3 -0
- package/dist/_pkg/creatable/neutral/model/CreatableInstance.d.ts +16 -0
- package/dist/_pkg/creatable/neutral/model/CreatableParams.d.ts +16 -0
- package/dist/_pkg/creatable/neutral/model/CreatableStatusReporter.d.ts +15 -0
- package/dist/_pkg/creatable/neutral/model/Labels.d.ts +24 -0
- package/dist/_pkg/creatable/neutral/model/index.d.ts +5 -0
- package/dist/_pkg/creatable/neutral/model.d.ts +3 -0
- package/dist/_pkg/creatable/neutral/model.mjs +1 -0
- package/dist/_pkg/decimal-precision/neutral/fromFixedPoint.d.ts +8 -0
- package/dist/_pkg/decimal-precision/neutral/index.d.ts +4 -0
- package/dist/_pkg/decimal-precision/neutral/index.mjs +39 -0
- package/dist/_pkg/decimal-precision/neutral/toDecimalPrecision.d.ts +8 -0
- package/dist/_pkg/decimal-precision/neutral/toFixedPoint.d.ts +8 -0
- package/dist/_pkg/delay/neutral/delay.d.ts +7 -0
- package/dist/_pkg/delay/neutral/index.d.ts +2 -0
- package/dist/_pkg/delay/neutral/index.mjs +9 -0
- package/dist/_pkg/ellipsize/neutral/index.d.ts +8 -0
- package/dist/_pkg/ellipsize/neutral/index.mjs +10 -0
- package/dist/_pkg/enum/neutral/Enum.d.ts +88 -0
- package/dist/_pkg/enum/neutral/index.d.ts +2 -0
- package/dist/_pkg/enum/neutral/index.mjs +8 -0
- package/dist/_pkg/enum/neutral/model.d.ts +2 -0
- package/dist/_pkg/enum/neutral/model.mjs +1 -0
- package/dist/_pkg/error/neutral/assert.d.ts +12 -0
- package/dist/_pkg/error/neutral/handleError.d.ts +15 -0
- package/dist/_pkg/error/neutral/index.d.ts +3 -0
- package/dist/_pkg/error/neutral/index.mjs +32 -0
- package/dist/_pkg/error/neutral/model.d.ts +2 -0
- package/dist/_pkg/error/neutral/model.mjs +1 -0
- package/dist/_pkg/events/neutral/BaseEmitter.d.ts +74 -0
- package/dist/_pkg/events/neutral/Events/Events.d.ts +132 -0
- package/dist/_pkg/events/neutral/Events/index.d.ts +2 -0
- package/dist/_pkg/events/neutral/index.d.ts +4 -0
- package/dist/_pkg/events/neutral/index.mjs +415 -0
- package/dist/_pkg/events/neutral/model/Event.d.ts +21 -0
- package/dist/_pkg/events/neutral/model/EventEmitter.d.ts +25 -0
- package/dist/_pkg/events/neutral/model/index.d.ts +3 -0
- package/dist/_pkg/events/neutral/model.d.ts +3 -0
- package/dist/_pkg/events/neutral/model.mjs +1 -0
- package/dist/_pkg/exists/neutral/index.d.ts +10 -0
- package/dist/_pkg/exists/neutral/index.mjs +8 -0
- package/dist/_pkg/fetch/neutral/FetchClient.d.ts +46 -0
- package/dist/_pkg/fetch/neutral/FetchError.d.ts +80 -0
- package/dist/_pkg/fetch/neutral/FetchJsonClient.d.ts +19 -0
- package/dist/_pkg/fetch/neutral/fetchCompress.d.ts +12 -0
- package/dist/_pkg/fetch/neutral/fetchJson.d.ts +7 -0
- package/dist/_pkg/fetch/neutral/index.d.ts +11 -0
- package/dist/_pkg/fetch/neutral/index.mjs +365 -0
- package/dist/_pkg/fetch/neutral/methods.d.ts +12 -0
- package/dist/_pkg/fetch/neutral/model.d.ts +5 -0
- package/dist/_pkg/fetch/neutral/model.mjs +1 -0
- package/dist/_pkg/fetch/neutral/parseJson.d.ts +16 -0
- package/dist/_pkg/fetch/neutral/types.d.ts +12 -0
- package/dist/_pkg/forget/neutral/ForgetConfig.d.ts +21 -0
- package/dist/_pkg/forget/neutral/ForgetNodeConfig.d.ts +13 -0
- package/dist/_pkg/forget/neutral/ForgetPromise.d.ts +49 -0
- package/dist/_pkg/forget/neutral/ForgetPromiseNode.d.ts +15 -0
- package/dist/_pkg/forget/neutral/forget.d.ts +10 -0
- package/dist/_pkg/forget/neutral/forgetNode.d.ts +9 -0
- package/dist/_pkg/forget/neutral/index.d.ts +2 -0
- package/dist/_pkg/forget/neutral/index.mjs +162 -0
- package/dist/_pkg/forget/neutral/model.d.ts +3 -0
- package/dist/_pkg/forget/neutral/model.mjs +1 -0
- package/dist/_pkg/forget/neutral/neutral/index.d.ts +4 -0
- package/dist/_pkg/forget/neutral/node/index.d.ts +4 -0
- package/dist/_pkg/function-name/neutral/functionName.d.ts +7 -0
- package/dist/_pkg/function-name/neutral/index.d.ts +2 -0
- package/dist/_pkg/function-name/neutral/index.mjs +27 -0
- package/dist/_pkg/hex/neutral/HexRegEx.d.ts +19 -0
- package/dist/_pkg/hex/neutral/address/AddressTransformZod.d.ts +10 -0
- package/dist/_pkg/hex/neutral/address/AddressValidationZod.d.ts +10 -0
- package/dist/_pkg/hex/neutral/address/address.d.ts +18 -0
- package/dist/_pkg/hex/neutral/address/as.d.ts +13 -0
- package/dist/_pkg/hex/neutral/address/index.d.ts +7 -0
- package/dist/_pkg/hex/neutral/address/is.d.ts +12 -0
- package/dist/_pkg/hex/neutral/address/to.d.ts +12 -0
- package/dist/_pkg/hex/neutral/ethAddress.d.ts +45 -0
- package/dist/_pkg/hex/neutral/hash/as.d.ts +11 -0
- package/dist/_pkg/hex/neutral/hash/hash.d.ts +28 -0
- package/dist/_pkg/hex/neutral/hash/index.d.ts +5 -0
- package/dist/_pkg/hex/neutral/hash/is.d.ts +9 -0
- package/dist/_pkg/hex/neutral/hash/zod.d.ts +6 -0
- package/dist/_pkg/hex/neutral/hex/as.d.ts +11 -0
- package/dist/_pkg/hex/neutral/hex/from/from.d.ts +8 -0
- package/dist/_pkg/hex/neutral/hex/from/fromArrayBuffer.d.ts +8 -0
- package/dist/_pkg/hex/neutral/hex/from/fromBigInt.d.ts +8 -0
- package/dist/_pkg/hex/neutral/hex/from/fromHexString.d.ts +9 -0
- package/dist/_pkg/hex/neutral/hex/from/fromNumber.d.ts +9 -0
- package/dist/_pkg/hex/neutral/hex/from/index.d.ts +6 -0
- package/dist/_pkg/hex/neutral/hex/hex.d.ts +17 -0
- package/dist/_pkg/hex/neutral/hex/index.d.ts +9 -0
- package/dist/_pkg/hex/neutral/hex/is.d.ts +9 -0
- package/dist/_pkg/hex/neutral/hex/isHexZero.d.ts +7 -0
- package/dist/_pkg/hex/neutral/hex/legacy.d.ts +7 -0
- package/dist/_pkg/hex/neutral/hex/nibble.d.ts +13 -0
- package/dist/_pkg/hex/neutral/hex/to.d.ts +8 -0
- package/dist/_pkg/hex/neutral/hexToBigInt.d.ts +8 -0
- package/dist/_pkg/hex/neutral/index.d.ts +8 -0
- package/dist/_pkg/hex/neutral/index.mjs +381 -0
- package/dist/_pkg/hex/neutral/model.d.ts +3 -0
- package/dist/_pkg/hex/neutral/model.mjs +1 -0
- package/dist/_pkg/hex/neutral/zod.d.ts +6 -0
- package/dist/_pkg/logger/neutral/ConsoleLogger.d.ts +7 -0
- package/dist/_pkg/logger/neutral/IdLogger.d.ts +19 -0
- package/dist/_pkg/logger/neutral/LevelLogger.d.ts +47 -0
- package/dist/_pkg/logger/neutral/NoOpLogFunction.d.ts +3 -0
- package/dist/_pkg/logger/neutral/SilentLogger.d.ts +17 -0
- package/dist/_pkg/logger/neutral/getFunctionName.d.ts +7 -0
- package/dist/_pkg/logger/neutral/index.d.ts +7 -0
- package/dist/_pkg/logger/neutral/index.mjs +126 -0
- package/dist/_pkg/object/neutral/AsObjectFactory.d.ts +8 -0
- package/dist/_pkg/object/neutral/AsTypeFactory.d.ts +11 -0
- package/dist/_pkg/object/neutral/EmptyObject.d.ts +2 -0
- package/dist/_pkg/object/neutral/IsObjectFactory.d.ts +16 -0
- package/dist/_pkg/object/neutral/JsonObject.d.ts +49 -0
- package/dist/_pkg/object/neutral/ObjectWrapper.d.ts +9 -0
- package/dist/_pkg/object/neutral/OmitStartsWith.d.ts +18 -0
- package/dist/_pkg/object/neutral/Optional.d.ts +3 -0
- package/dist/_pkg/object/neutral/Override.d.ts +4 -0
- package/dist/_pkg/object/neutral/PartialRecord.d.ts +3 -0
- package/dist/_pkg/object/neutral/PickStartsWith.d.ts +9 -0
- package/dist/_pkg/object/neutral/Simplify.d.ts +5 -0
- package/dist/_pkg/object/neutral/StringKeyObject.d.ts +3 -0
- package/dist/_pkg/object/neutral/Validator.d.ts +13 -0
- package/dist/_pkg/object/neutral/WithAdditional.d.ts +4 -0
- package/dist/_pkg/object/neutral/asObject.d.ts +4 -0
- package/dist/_pkg/object/neutral/deepMerge.d.ts +49 -0
- package/dist/_pkg/object/neutral/index-deprecated.d.ts +2 -0
- package/dist/_pkg/object/neutral/index-un-deprecated.d.ts +22 -0
- package/dist/_pkg/object/neutral/index-un-deprecated.mjs +320 -0
- package/dist/_pkg/object/neutral/index.d.ts +3 -0
- package/dist/_pkg/object/neutral/index.mjs +435 -0
- package/dist/_pkg/object/neutral/isType.d.ts +4 -0
- package/dist/_pkg/object/neutral/model.d.ts +14 -0
- package/dist/_pkg/object/neutral/model.mjs +1 -0
- package/dist/_pkg/object/neutral/omitBy.d.ts +21 -0
- package/dist/_pkg/object/neutral/pickBy.d.ts +21 -0
- package/dist/_pkg/object/neutral/removeFields.d.ts +9 -0
- package/dist/_pkg/object/neutral/toSafeJson.d.ts +41 -0
- package/dist/_pkg/object-model/neutral/AnyObject.d.ts +8 -0
- package/dist/_pkg/object-model/neutral/AsTypeFactory.d.ts +12 -0
- package/dist/_pkg/object-model/neutral/AsTypeFunction.d.ts +14 -0
- package/dist/_pkg/object-model/neutral/Compare.d.ts +3 -0
- package/dist/_pkg/object-model/neutral/EmptyObject.d.ts +8 -0
- package/dist/_pkg/object-model/neutral/index.d.ts +6 -0
- package/dist/_pkg/object-model/neutral/index.mjs +1 -0
- package/dist/_pkg/object-model/neutral/model.d.ts +6 -0
- package/dist/_pkg/object-model/neutral/model.mjs +1 -0
- package/dist/_pkg/object-model/neutral/types.d.ts +25 -0
- package/dist/_pkg/platform/browser/browser/index.d.ts +9 -0
- package/dist/_pkg/platform/browser/index-browser.d.ts +2 -0
- package/dist/_pkg/platform/browser/index-browser.mjs +18 -0
- package/dist/_pkg/platform/browser/index-node.d.ts +2 -0
- package/dist/_pkg/platform/browser/node/index.d.ts +9 -0
- package/dist/_pkg/platform/node/browser/index.d.ts +9 -0
- package/dist/_pkg/platform/node/index-browser.d.ts +2 -0
- package/dist/_pkg/platform/node/index-node.d.ts +2 -0
- package/dist/_pkg/platform/node/index-node.mjs +18 -0
- package/dist/_pkg/platform/node/node/index.d.ts +9 -0
- package/dist/_pkg/profile/neutral/index.d.ts +2 -0
- package/dist/_pkg/profile/neutral/index.mjs +37 -0
- package/dist/_pkg/profile/neutral/model.d.ts +2 -0
- package/dist/_pkg/profile/neutral/model.mjs +1 -0
- package/dist/_pkg/profile/neutral/profiler.d.ts +17 -0
- package/dist/_pkg/promise/neutral/PromiseEx.d.ts +24 -0
- package/dist/_pkg/promise/neutral/fulfilled.d.ts +7 -0
- package/dist/_pkg/promise/neutral/fulfilledValues.d.ts +20 -0
- package/dist/_pkg/promise/neutral/index.d.ts +7 -0
- package/dist/_pkg/promise/neutral/index.mjs +57 -0
- package/dist/_pkg/promise/neutral/model.d.ts +3 -0
- package/dist/_pkg/promise/neutral/model.mjs +1 -0
- package/dist/_pkg/promise/neutral/rejected.d.ts +7 -0
- package/dist/_pkg/promise/neutral/toPromise.d.ts +8 -0
- package/dist/_pkg/promise/neutral/types.d.ts +23 -0
- package/dist/_pkg/retry/neutral/index.d.ts +2 -0
- package/dist/_pkg/retry/neutral/index.mjs +28 -0
- package/dist/_pkg/retry/neutral/model.d.ts +2 -0
- package/dist/_pkg/retry/neutral/model.mjs +1 -0
- package/dist/_pkg/retry/neutral/retry.d.ts +23 -0
- package/dist/_pkg/set/neutral/index.d.ts +2 -0
- package/dist/_pkg/set/neutral/index.mjs +20 -0
- package/dist/_pkg/set/neutral/lib/difference.d.ts +8 -0
- package/dist/_pkg/set/neutral/lib/index.d.ts +4 -0
- package/dist/_pkg/set/neutral/lib/intersection.d.ts +8 -0
- package/dist/_pkg/set/neutral/lib/union.d.ts +8 -0
- package/dist/_pkg/static-implements/neutral/index.d.ts +2 -0
- package/dist/_pkg/static-implements/neutral/index.mjs +10 -0
- package/dist/_pkg/static-implements/neutral/staticImplements.d.ts +7 -0
- package/dist/_pkg/storage/neutral/KeyValueStore.d.ts +34 -0
- package/dist/_pkg/storage/neutral/index.d.ts +2 -0
- package/dist/_pkg/storage/neutral/index.mjs +1 -0
- package/dist/_pkg/storage/neutral/model.d.ts +2 -0
- package/dist/_pkg/storage/neutral/model.mjs +1 -0
- package/dist/_pkg/telemetry/neutral/index.d.ts +3 -0
- package/dist/_pkg/telemetry/neutral/index.mjs +152 -0
- package/dist/_pkg/telemetry/neutral/model.d.ts +2 -0
- package/dist/_pkg/telemetry/neutral/model.mjs +1 -0
- package/dist/_pkg/telemetry/neutral/span.d.ts +51 -0
- package/dist/_pkg/telemetry/neutral/timeBudget.d.ts +12 -0
- package/dist/_pkg/telemetry-exporter/neutral/XyConsoleSpanExporter.d.ts +40 -0
- package/dist/_pkg/telemetry-exporter/neutral/index.d.ts +2 -0
- package/dist/_pkg/telemetry-exporter/neutral/index.mjs +88 -0
- package/dist/_pkg/timer/neutral/index.d.ts +2 -0
- package/dist/_pkg/timer/neutral/index.mjs +75 -0
- package/dist/_pkg/timer/neutral/setTimeoutEx.d.ts +37 -0
- package/dist/_pkg/typeof/neutral/Brand.d.ts +5 -0
- package/dist/_pkg/typeof/neutral/IdentityFunction.d.ts +3 -0
- package/dist/_pkg/typeof/neutral/ObjectTypeShape.d.ts +5 -0
- package/dist/_pkg/typeof/neutral/TypeOfTypes.d.ts +3 -0
- package/dist/_pkg/typeof/neutral/Typed.d.ts +41 -0
- package/dist/_pkg/typeof/neutral/ifDefined.d.ts +8 -0
- package/dist/_pkg/typeof/neutral/ifTypeOf.d.ts +11 -0
- package/dist/_pkg/typeof/neutral/index.d.ts +12 -0
- package/dist/_pkg/typeof/neutral/index.mjs +255 -0
- package/dist/_pkg/typeof/neutral/is.d.ts +116 -0
- package/dist/_pkg/typeof/neutral/isType.d.ts +9 -0
- package/dist/_pkg/typeof/neutral/model.d.ts +7 -0
- package/dist/_pkg/typeof/neutral/model.mjs +1 -0
- package/dist/_pkg/typeof/neutral/typeOf.d.ts +8 -0
- package/dist/_pkg/typeof/neutral/validateType.d.ts +10 -0
- package/dist/_pkg/url/browser/index-browser.d.ts +12 -0
- package/dist/_pkg/url/browser/index-browser.mjs +12 -0
- package/dist/_pkg/url/browser/index-neutral.d.ts +12 -0
- package/dist/_pkg/url/browser/index-node.d.ts +13 -0
- package/dist/_pkg/url/browser/lib/index.d.ts +2 -0
- package/dist/_pkg/url/browser/lib/isLocalhost.d.ts +7 -0
- package/dist/_pkg/url/neutral/index-browser.d.ts +12 -0
- package/dist/_pkg/url/neutral/index-neutral.d.ts +12 -0
- package/dist/_pkg/url/neutral/index-neutral.mjs +12 -0
- package/dist/_pkg/url/neutral/index-node.d.ts +13 -0
- package/dist/_pkg/url/neutral/lib/index.d.ts +2 -0
- package/dist/_pkg/url/neutral/lib/isLocalhost.d.ts +7 -0
- package/dist/_pkg/url/node/index-browser.d.ts +12 -0
- package/dist/_pkg/url/node/index-neutral.d.ts +12 -0
- package/dist/_pkg/url/node/index-node.d.ts +13 -0
- package/dist/_pkg/url/node/index-node.mjs +15 -0
- package/dist/_pkg/url/node/lib/index.d.ts +2 -0
- package/dist/_pkg/url/node/lib/isLocalhost.d.ts +7 -0
- package/dist/_pkg/zod/neutral/Config.d.ts +8 -0
- package/dist/_pkg/zod/neutral/index.d.ts +8 -0
- package/dist/_pkg/zod/neutral/index.mjs +127 -0
- package/dist/_pkg/zod/neutral/model.d.ts +2 -0
- package/dist/_pkg/zod/neutral/model.mjs +1 -0
- package/dist/_pkg/zod/neutral/zodAllFactory.d.ts +20 -0
- package/dist/_pkg/zod/neutral/zodAsAsyncFactory.d.ts +14 -0
- package/dist/_pkg/zod/neutral/zodAsFactory.d.ts +14 -0
- package/dist/_pkg/zod/neutral/zodIsFactory.d.ts +8 -0
- package/dist/_pkg/zod/neutral/zodToAsyncFactory.d.ts +14 -0
- package/dist/_pkg/zod/neutral/zodToFactory.d.ts +14 -0
- package/dist/browser/index.d.ts +32 -0
- package/dist/browser/index.mjs +32 -0
- package/dist/browser/platform.d.ts +1 -0
- package/dist/browser/platform.mjs +1 -0
- package/dist/browser/url.d.ts +1 -0
- package/dist/browser/url.mjs +1 -0
- package/dist/neutral/api.d.ts +1 -0
- package/dist/neutral/api.mjs +1 -0
- package/dist/neutral/api.model.d.ts +1 -0
- package/dist/neutral/api.model.mjs +1 -0
- package/dist/neutral/array.d.ts +1 -0
- package/dist/neutral/array.mjs +1 -0
- package/dist/neutral/arraybuffer.d.ts +1 -0
- package/dist/neutral/arraybuffer.mjs +1 -0
- package/dist/neutral/assert.d.ts +1 -0
- package/dist/neutral/assert.mjs +1 -0
- package/dist/neutral/assert.model.d.ts +1 -0
- package/dist/neutral/assert.model.mjs +1 -0
- package/dist/neutral/base.d.ts +1 -0
- package/dist/neutral/base.mjs +1 -0
- package/dist/neutral/base.model.d.ts +1 -0
- package/dist/neutral/base.model.mjs +1 -0
- package/dist/neutral/creatable.d.ts +1 -0
- package/dist/neutral/creatable.mjs +1 -0
- package/dist/neutral/creatable.model.d.ts +1 -0
- package/dist/neutral/creatable.model.mjs +1 -0
- package/dist/neutral/decimal-precision.d.ts +1 -0
- package/dist/neutral/decimal-precision.mjs +1 -0
- package/dist/neutral/delay.d.ts +1 -0
- package/dist/neutral/delay.mjs +1 -0
- package/dist/neutral/ellipsize.d.ts +1 -0
- package/dist/neutral/ellipsize.mjs +1 -0
- package/dist/neutral/enum.d.ts +1 -0
- package/dist/neutral/enum.mjs +1 -0
- package/dist/neutral/enum.model.d.ts +1 -0
- package/dist/neutral/enum.model.mjs +1 -0
- package/dist/neutral/error.d.ts +1 -0
- package/dist/neutral/error.mjs +1 -0
- package/dist/neutral/error.model.d.ts +1 -0
- package/dist/neutral/error.model.mjs +1 -0
- package/dist/neutral/events.d.ts +1 -0
- package/dist/neutral/events.mjs +1 -0
- package/dist/neutral/events.model.d.ts +1 -0
- package/dist/neutral/events.model.mjs +1 -0
- package/dist/neutral/exists.d.ts +1 -0
- package/dist/neutral/exists.mjs +1 -0
- package/dist/neutral/fetch.d.ts +1 -0
- package/dist/neutral/fetch.mjs +1 -0
- package/dist/neutral/fetch.model.d.ts +1 -0
- package/dist/neutral/fetch.model.mjs +1 -0
- package/dist/neutral/forget.d.ts +1 -0
- package/dist/neutral/forget.mjs +1 -0
- package/dist/neutral/forget.model.d.ts +1 -0
- package/dist/neutral/forget.model.mjs +1 -0
- package/dist/neutral/function-name.d.ts +1 -0
- package/dist/neutral/function-name.mjs +1 -0
- package/dist/neutral/hex.d.ts +1 -0
- package/dist/neutral/hex.mjs +1 -0
- package/dist/neutral/hex.model.d.ts +1 -0
- package/dist/neutral/hex.model.mjs +1 -0
- package/dist/neutral/logger.d.ts +1 -0
- package/dist/neutral/logger.mjs +1 -0
- package/dist/neutral/model.d.ts +18 -0
- package/dist/neutral/model.mjs +18 -0
- package/dist/neutral/object.d.ts +1 -0
- package/dist/neutral/object.mjs +1 -0
- package/dist/neutral/object.model.d.ts +1 -0
- package/dist/neutral/object.model.mjs +1 -0
- package/dist/neutral/profile.d.ts +1 -0
- package/dist/neutral/profile.mjs +1 -0
- package/dist/neutral/profile.model.d.ts +1 -0
- package/dist/neutral/profile.model.mjs +1 -0
- package/dist/neutral/promise.d.ts +1 -0
- package/dist/neutral/promise.mjs +1 -0
- package/dist/neutral/promise.model.d.ts +1 -0
- package/dist/neutral/promise.model.mjs +1 -0
- package/dist/neutral/retry.d.ts +1 -0
- package/dist/neutral/retry.mjs +1 -0
- package/dist/neutral/retry.model.d.ts +1 -0
- package/dist/neutral/retry.model.mjs +1 -0
- package/dist/neutral/set.d.ts +1 -0
- package/dist/neutral/set.mjs +1 -0
- package/dist/neutral/static-implements.d.ts +1 -0
- package/dist/neutral/static-implements.mjs +1 -0
- package/dist/neutral/storage.d.ts +1 -0
- package/dist/neutral/storage.mjs +1 -0
- package/dist/neutral/storage.model.d.ts +1 -0
- package/dist/neutral/storage.model.mjs +1 -0
- package/dist/neutral/telemetry-exporter.d.ts +1 -0
- package/dist/neutral/telemetry-exporter.mjs +1 -0
- package/dist/neutral/telemetry.d.ts +1 -0
- package/dist/neutral/telemetry.mjs +1 -0
- package/dist/neutral/telemetry.model.d.ts +1 -0
- package/dist/neutral/telemetry.model.mjs +1 -0
- package/dist/neutral/timer.d.ts +1 -0
- package/dist/neutral/timer.mjs +1 -0
- package/dist/neutral/typeof.d.ts +1 -0
- package/dist/neutral/typeof.mjs +1 -0
- package/dist/neutral/typeof.model.d.ts +1 -0
- package/dist/neutral/typeof.model.mjs +1 -0
- package/dist/neutral/url.d.ts +1 -0
- package/dist/neutral/url.mjs +1 -0
- package/dist/neutral/zod.d.ts +1 -0
- package/dist/neutral/zod.mjs +1 -0
- package/dist/neutral/zod.model.d.ts +1 -0
- package/dist/neutral/zod.model.mjs +1 -0
- package/dist/node/index.d.ts +32 -0
- package/dist/node/index.mjs +32 -0
- package/dist/node/platform.d.ts +1 -0
- package/dist/node/platform.mjs +1 -0
- package/dist/node/url.d.ts +1 -0
- package/dist/node/url.mjs +1 -0
- package/package.json +339 -0
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
AsObjectFactory: () => AsObjectFactory,
|
|
23
|
+
AsTypeFactory: () => AsTypeFactory,
|
|
24
|
+
IsObjectFactory: () => IsObjectFactory,
|
|
25
|
+
JsonObjectZod: () => JsonObjectZod,
|
|
26
|
+
ObjectWrapper: () => ObjectWrapper,
|
|
27
|
+
ValidatorBase: () => ValidatorBase,
|
|
28
|
+
asAnyObject: () => asAnyObject,
|
|
29
|
+
asJsonArray: () => asJsonArray,
|
|
30
|
+
asJsonObject: () => asJsonObject,
|
|
31
|
+
asJsonValue: () => asJsonValue,
|
|
32
|
+
createDeepMerge: () => createDeepMerge,
|
|
33
|
+
deepMerge: () => deepMerge,
|
|
34
|
+
isJsonArray: () => isJsonArray,
|
|
35
|
+
isJsonObject: () => isJsonObject,
|
|
36
|
+
isJsonValue: () => isJsonValue,
|
|
37
|
+
isType: () => isType,
|
|
38
|
+
omitBy: () => omitBy,
|
|
39
|
+
omitByPrefix: () => omitByPrefix,
|
|
40
|
+
pickBy: () => pickBy,
|
|
41
|
+
pickByPrefix: () => pickByPrefix,
|
|
42
|
+
removeFields: () => removeFields,
|
|
43
|
+
toJsonArray: () => toJsonArray,
|
|
44
|
+
toJsonObject: () => toJsonObject,
|
|
45
|
+
toJsonValue: () => toJsonValue,
|
|
46
|
+
toSafeJson: () => toSafeJson,
|
|
47
|
+
toSafeJsonArray: () => toSafeJsonArray,
|
|
48
|
+
toSafeJsonObject: () => toSafeJsonObject,
|
|
49
|
+
toSafeJsonString: () => toSafeJsonString,
|
|
50
|
+
toSafeJsonValue: () => toSafeJsonValue
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// src/isType.ts
|
|
54
|
+
var isType = (value, expectedType) => {
|
|
55
|
+
const typeofValue = typeof value;
|
|
56
|
+
switch (expectedType) {
|
|
57
|
+
case "array": {
|
|
58
|
+
return Array.isArray(value);
|
|
59
|
+
}
|
|
60
|
+
case "null": {
|
|
61
|
+
return value === null;
|
|
62
|
+
}
|
|
63
|
+
case "undefined": {
|
|
64
|
+
return value === void 0;
|
|
65
|
+
}
|
|
66
|
+
case "object": {
|
|
67
|
+
if (value === null) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return typeofValue === "object" && !Array.isArray(value);
|
|
71
|
+
}
|
|
72
|
+
default: {
|
|
73
|
+
return typeofValue === expectedType;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// src/index-un-deprecated.ts
|
|
79
|
+
var index_un_deprecated_exports = {};
|
|
80
|
+
__export(index_un_deprecated_exports, {
|
|
81
|
+
AsObjectFactory: () => AsObjectFactory,
|
|
82
|
+
AsTypeFactory: () => AsTypeFactory,
|
|
83
|
+
IsObjectFactory: () => IsObjectFactory,
|
|
84
|
+
JsonObjectZod: () => JsonObjectZod,
|
|
85
|
+
ObjectWrapper: () => ObjectWrapper,
|
|
86
|
+
ValidatorBase: () => ValidatorBase,
|
|
87
|
+
asAnyObject: () => asAnyObject,
|
|
88
|
+
asJsonArray: () => asJsonArray,
|
|
89
|
+
asJsonObject: () => asJsonObject,
|
|
90
|
+
asJsonValue: () => asJsonValue,
|
|
91
|
+
createDeepMerge: () => createDeepMerge,
|
|
92
|
+
deepMerge: () => deepMerge,
|
|
93
|
+
isJsonArray: () => isJsonArray,
|
|
94
|
+
isJsonObject: () => isJsonObject,
|
|
95
|
+
isJsonValue: () => isJsonValue,
|
|
96
|
+
omitBy: () => omitBy,
|
|
97
|
+
omitByPrefix: () => omitByPrefix,
|
|
98
|
+
pickBy: () => pickBy,
|
|
99
|
+
pickByPrefix: () => pickByPrefix,
|
|
100
|
+
removeFields: () => removeFields,
|
|
101
|
+
toJsonArray: () => toJsonArray,
|
|
102
|
+
toJsonObject: () => toJsonObject,
|
|
103
|
+
toJsonValue: () => toJsonValue,
|
|
104
|
+
toSafeJson: () => toSafeJson,
|
|
105
|
+
toSafeJsonArray: () => toSafeJsonArray,
|
|
106
|
+
toSafeJsonObject: () => toSafeJsonObject,
|
|
107
|
+
toSafeJsonString: () => toSafeJsonString,
|
|
108
|
+
toSafeJsonValue: () => toSafeJsonValue
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// src/asObject.ts
|
|
112
|
+
import { isObject } from "../../typeof/neutral/index.mjs";
|
|
113
|
+
|
|
114
|
+
// src/AsTypeFactory.ts
|
|
115
|
+
import { assertDefinedEx } from "../../assert/neutral/index.mjs";
|
|
116
|
+
import { isPromise, isTruthy } from "../../typeof/neutral/index.mjs";
|
|
117
|
+
var AsTypeFactory = {
|
|
118
|
+
create: (typeCheck) => {
|
|
119
|
+
const func = (value, assertOrConfig, config) => {
|
|
120
|
+
const isPredicate = typeof assertOrConfig === "number";
|
|
121
|
+
const resolvedAssert = isPredicate || typeof assertOrConfig === "object" ? void 0 : assertOrConfig;
|
|
122
|
+
const resolvedConfig = isPredicate ? void 0 : typeof assertOrConfig === "object" ? assertOrConfig : config;
|
|
123
|
+
const isRequired = isTruthy(resolvedConfig?.required);
|
|
124
|
+
if (!isRequired && (value === void 0 || value === null)) {
|
|
125
|
+
return void 0;
|
|
126
|
+
}
|
|
127
|
+
if (isPromise(value)) {
|
|
128
|
+
throw new TypeError('un-awaited promises may not be sent to "as" functions');
|
|
129
|
+
}
|
|
130
|
+
const result = typeCheck(value, resolvedConfig) ? value : void 0;
|
|
131
|
+
if (resolvedAssert !== void 0) {
|
|
132
|
+
const message = typeof resolvedAssert === "function" ? resolvedAssert : () => resolvedAssert;
|
|
133
|
+
return assertDefinedEx(result, message);
|
|
134
|
+
}
|
|
135
|
+
return result;
|
|
136
|
+
};
|
|
137
|
+
return func;
|
|
138
|
+
},
|
|
139
|
+
createOptional: (typeCheck) => {
|
|
140
|
+
const func = (value) => {
|
|
141
|
+
if (value === void 0 || value === null) return void 0;
|
|
142
|
+
if (isPromise(value)) {
|
|
143
|
+
throw new TypeError('un-awaited promises may not be sent to "as" functions');
|
|
144
|
+
}
|
|
145
|
+
return typeCheck(value) ? value : void 0;
|
|
146
|
+
};
|
|
147
|
+
return func;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// src/AsObjectFactory.ts
|
|
152
|
+
var AsObjectFactory = {
|
|
153
|
+
create: (typeCheck) => {
|
|
154
|
+
return AsTypeFactory.create(typeCheck);
|
|
155
|
+
},
|
|
156
|
+
createOptional: (typeCheck) => {
|
|
157
|
+
return AsTypeFactory.createOptional(typeCheck);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// src/asObject.ts
|
|
162
|
+
var asAnyObject = (() => AsObjectFactory.create((obj) => isObject(obj)))();
|
|
163
|
+
|
|
164
|
+
// src/deepMerge.ts
|
|
165
|
+
var isUnsafeKey = (key) => typeof key === "string" && ["__proto__", "constructor", "prototype"].includes(key);
|
|
166
|
+
var isPlainObject = (value) => {
|
|
167
|
+
const prototype = Object.getPrototypeOf(value);
|
|
168
|
+
return prototype === Object.prototype || prototype === null;
|
|
169
|
+
};
|
|
170
|
+
function merge(target, source, options) {
|
|
171
|
+
if (!source || typeof source !== "object") return target;
|
|
172
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
173
|
+
if (isUnsafeKey(key)) {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const value = source[key];
|
|
177
|
+
if (Array.isArray(value)) {
|
|
178
|
+
const targetValue = target[key];
|
|
179
|
+
target[key] = options?.arrayStrategy === "concat" && Array.isArray(targetValue) ? [...targetValue, ...value] : value;
|
|
180
|
+
} else if (value !== null && typeof value === "object" && isPlainObject(value)) {
|
|
181
|
+
const targetValue = target[key];
|
|
182
|
+
if (targetValue === void 0 || targetValue === null || typeof targetValue !== "object" || !isPlainObject(targetValue)) {
|
|
183
|
+
target[key] = {};
|
|
184
|
+
}
|
|
185
|
+
merge(target[key], value, options);
|
|
186
|
+
} else {
|
|
187
|
+
target[key] = value;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return target;
|
|
191
|
+
}
|
|
192
|
+
function createDeepMerge(options) {
|
|
193
|
+
return function deepMerge2(...objects) {
|
|
194
|
+
const result = options.mutate === true ? objects[0] ?? {} : {};
|
|
195
|
+
for (const obj of objects) {
|
|
196
|
+
merge(result, obj, options);
|
|
197
|
+
}
|
|
198
|
+
return result;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
var deepMerge = createDeepMerge({ arrayStrategy: "overwrite", mutate: false });
|
|
202
|
+
|
|
203
|
+
// src/IsObjectFactory.ts
|
|
204
|
+
import {
|
|
205
|
+
isObject as isObject2,
|
|
206
|
+
isTruthy as isTruthy2
|
|
207
|
+
} from "../../typeof/neutral/index.mjs";
|
|
208
|
+
import { isType as isType2 } from "../../typeof/neutral/index.mjs";
|
|
209
|
+
var IsObjectFactory = class {
|
|
210
|
+
/**
|
|
211
|
+
* Creates a type-guard function that validates an object matches the given shape and passes additional checks.
|
|
212
|
+
* @param shape - An optional map of property names to expected types.
|
|
213
|
+
* @param additionalChecks - Optional extra type-check functions to run after shape validation.
|
|
214
|
+
* @returns A type-guard function for type T.
|
|
215
|
+
*/
|
|
216
|
+
create(shape, additionalChecks) {
|
|
217
|
+
return (obj, config) => {
|
|
218
|
+
if (!isObject2(obj)) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
const log = typeof config === "object" ? config.log : void 0;
|
|
222
|
+
return (
|
|
223
|
+
// do primary check
|
|
224
|
+
Object.entries(shape ?? {}).filter(([key, type]) => {
|
|
225
|
+
const isResult = isType2(obj[key], type);
|
|
226
|
+
if (!isResult && isTruthy2(log)) {
|
|
227
|
+
const logger = typeof log === "object" ? log : console;
|
|
228
|
+
logger.warn(`isType Failed: ${key}: ${type}`);
|
|
229
|
+
}
|
|
230
|
+
return !isResult;
|
|
231
|
+
}).length === 0 && (additionalChecks?.reduce((prev, check) => prev && check(obj, { log }), true) ?? true)
|
|
232
|
+
);
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// src/JsonObject.ts
|
|
238
|
+
import {
|
|
239
|
+
zodAsFactory,
|
|
240
|
+
zodIsFactory,
|
|
241
|
+
zodToFactory
|
|
242
|
+
} from "../../zod/neutral/index.mjs";
|
|
243
|
+
import * as z from "zod/mini";
|
|
244
|
+
var JsonArrayZod = z.array(z.lazy(() => JsonValueZod));
|
|
245
|
+
var JsonValueZod = z.lazy(() => z.union([
|
|
246
|
+
z.string(),
|
|
247
|
+
z.number(),
|
|
248
|
+
z.boolean(),
|
|
249
|
+
z.null(),
|
|
250
|
+
z.array(JsonValueZod),
|
|
251
|
+
z.record(z.string(), JsonValueZod)
|
|
252
|
+
// object with string keys and JSON values
|
|
253
|
+
]));
|
|
254
|
+
var JsonObjectZod = z.record(z.string(), JsonValueZod);
|
|
255
|
+
var isJsonValue = zodIsFactory(JsonValueZod);
|
|
256
|
+
var asJsonValue = zodAsFactory(JsonValueZod, "asJsonValue");
|
|
257
|
+
var toJsonValue = zodToFactory(JsonValueZod, "toJsonValue");
|
|
258
|
+
var isJsonArray = zodIsFactory(JsonArrayZod);
|
|
259
|
+
var asJsonArray = zodAsFactory(JsonArrayZod, "asJsonArray");
|
|
260
|
+
var toJsonArray = zodToFactory(JsonArrayZod, "toJsonArray");
|
|
261
|
+
var isJsonObject = zodIsFactory(JsonObjectZod);
|
|
262
|
+
var asJsonObject = zodAsFactory(JsonObjectZod, "asJsonObject");
|
|
263
|
+
var toJsonObject = zodToFactory(JsonObjectZod, "toJsonObject");
|
|
264
|
+
|
|
265
|
+
// src/ObjectWrapper.ts
|
|
266
|
+
var ObjectWrapper = class {
|
|
267
|
+
obj;
|
|
268
|
+
constructor(obj) {
|
|
269
|
+
this.obj = obj;
|
|
270
|
+
}
|
|
271
|
+
get stringKeyObj() {
|
|
272
|
+
return this.obj;
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
// src/omitBy.ts
|
|
277
|
+
import { assertEx } from "../../assert/neutral/index.mjs";
|
|
278
|
+
var omitByArray = (obj, predicate, maxDepth) => {
|
|
279
|
+
return obj.map((value) => {
|
|
280
|
+
return value !== null && typeof value === "object" ? omitBy(value, predicate, maxDepth) : value;
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
var omitByObject = (obj, predicate, maxDepth) => {
|
|
284
|
+
const result = {};
|
|
285
|
+
for (const key of Object.keys(obj)) {
|
|
286
|
+
const value = obj[key];
|
|
287
|
+
if (!predicate(value, key)) {
|
|
288
|
+
result[key] = value !== null && typeof value === "object" ? omitBy(value, predicate, maxDepth - 1) : value;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return result;
|
|
292
|
+
};
|
|
293
|
+
var omitBy = (obj, predicate, maxDepth = 1) => {
|
|
294
|
+
if (maxDepth <= 0) {
|
|
295
|
+
return obj;
|
|
296
|
+
}
|
|
297
|
+
return Array.isArray(obj) ? omitByArray(obj, predicate, maxDepth - 1) : omitByObject(obj, predicate, maxDepth - 1);
|
|
298
|
+
};
|
|
299
|
+
var omitByPrefixPredicate = (prefix) => (_, key) => {
|
|
300
|
+
assertEx(typeof key === "string", () => `Invalid key type [${key}, ${typeof key}]`);
|
|
301
|
+
return key.startsWith(prefix);
|
|
302
|
+
};
|
|
303
|
+
var omitByPrefix = (payload, prefix, maxDepth = 100) => {
|
|
304
|
+
return omitBy(payload, omitByPrefixPredicate(prefix), maxDepth);
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
// src/pickBy.ts
|
|
308
|
+
import { assertEx as assertEx2 } from "../../assert/neutral/index.mjs";
|
|
309
|
+
var pickByArray = (obj, predicate, maxDepth) => {
|
|
310
|
+
return obj.map((value) => {
|
|
311
|
+
return value !== null && typeof value === "object" ? pickBy(value, predicate, maxDepth) : value;
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
var pickByObject = (obj, predicate, maxDepth) => {
|
|
315
|
+
const result = {};
|
|
316
|
+
for (const key of Object.keys(obj)) {
|
|
317
|
+
const value = obj[key];
|
|
318
|
+
if (predicate(value, key)) {
|
|
319
|
+
result[key] = value !== null && typeof value === "object" ? pickBy(value, predicate, maxDepth - 1) : value;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return result;
|
|
323
|
+
};
|
|
324
|
+
var pickBy = (obj, predicate, maxDepth = 1) => {
|
|
325
|
+
if (maxDepth <= 0) {
|
|
326
|
+
return obj;
|
|
327
|
+
}
|
|
328
|
+
return Array.isArray(obj) ? pickByArray(obj, predicate, maxDepth - 1) : pickByObject(obj, predicate, maxDepth - 1);
|
|
329
|
+
};
|
|
330
|
+
var pickByPrefixPredicate = (prefix) => (_, key) => {
|
|
331
|
+
assertEx2(typeof key === "string", () => `Invalid key type [${key}, ${typeof key}]`);
|
|
332
|
+
return key.startsWith(prefix);
|
|
333
|
+
};
|
|
334
|
+
var pickByPrefix = (payload, prefix, maxDepth = 100) => {
|
|
335
|
+
return pickBy(payload, pickByPrefixPredicate(prefix), maxDepth);
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// src/removeFields.ts
|
|
339
|
+
var removeFields = (obj, fields) => {
|
|
340
|
+
const clone = { ...obj };
|
|
341
|
+
for (const field of fields) {
|
|
342
|
+
delete clone[field];
|
|
343
|
+
}
|
|
344
|
+
return clone;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
// src/toSafeJson.ts
|
|
348
|
+
var toSafeJsonArray = (value, cycleList, maxDepth = 3) => {
|
|
349
|
+
return value.map((item) => toSafeJsonValue(item, cycleList, maxDepth));
|
|
350
|
+
};
|
|
351
|
+
var toSafeJsonObject = (value, cycleList, maxDepth = 3) => {
|
|
352
|
+
const result = {};
|
|
353
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
354
|
+
result[key] = entry === void 0 ? "[Undefined]" : toSafeJsonValue(entry, cycleList, maxDepth);
|
|
355
|
+
}
|
|
356
|
+
return result;
|
|
357
|
+
};
|
|
358
|
+
var toSafeJsonValue = (value, cycleList, maxDepth = 3) => {
|
|
359
|
+
if (maxDepth <= 0 && typeof value === "object") {
|
|
360
|
+
return "[MaxDepth]";
|
|
361
|
+
}
|
|
362
|
+
if (cycleList?.includes(value) === true) {
|
|
363
|
+
return "[Circular]";
|
|
364
|
+
}
|
|
365
|
+
switch (typeof value) {
|
|
366
|
+
case "string":
|
|
367
|
+
case "boolean":
|
|
368
|
+
case "number": {
|
|
369
|
+
return value;
|
|
370
|
+
}
|
|
371
|
+
case "object": {
|
|
372
|
+
if (value === null) {
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
const newCycleList = cycleList ?? [];
|
|
376
|
+
newCycleList.push(value);
|
|
377
|
+
if (Array.isArray(value)) {
|
|
378
|
+
return toSafeJsonArray(value, newCycleList, maxDepth - 1);
|
|
379
|
+
}
|
|
380
|
+
return toSafeJsonObject(value, newCycleList, maxDepth - 1);
|
|
381
|
+
}
|
|
382
|
+
default: {
|
|
383
|
+
return `[${typeof value}]`;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
var toSafeJsonString = (value, maxDepth = 3) => {
|
|
388
|
+
return JSON.stringify(toSafeJson(value, maxDepth), null, 2);
|
|
389
|
+
};
|
|
390
|
+
var toSafeJson = (value, maxDepth = 3) => {
|
|
391
|
+
return toSafeJsonValue(value, void 0, maxDepth);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
// src/Validator.ts
|
|
395
|
+
var ValidatorBase = class extends ObjectWrapper {
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
// src/index-un-deprecated.ts
|
|
399
|
+
__reExport(index_un_deprecated_exports, object_model_star);
|
|
400
|
+
import * as object_model_star from "../../object-model/neutral/index.mjs";
|
|
401
|
+
|
|
402
|
+
// src/index.ts
|
|
403
|
+
__reExport(index_exports, index_un_deprecated_exports);
|
|
404
|
+
export {
|
|
405
|
+
AsObjectFactory,
|
|
406
|
+
AsTypeFactory,
|
|
407
|
+
IsObjectFactory,
|
|
408
|
+
JsonObjectZod,
|
|
409
|
+
ObjectWrapper,
|
|
410
|
+
ValidatorBase,
|
|
411
|
+
asAnyObject,
|
|
412
|
+
asJsonArray,
|
|
413
|
+
asJsonObject,
|
|
414
|
+
asJsonValue,
|
|
415
|
+
createDeepMerge,
|
|
416
|
+
deepMerge,
|
|
417
|
+
isJsonArray,
|
|
418
|
+
isJsonObject,
|
|
419
|
+
isJsonValue,
|
|
420
|
+
isType,
|
|
421
|
+
omitBy,
|
|
422
|
+
omitByPrefix,
|
|
423
|
+
pickBy,
|
|
424
|
+
pickByPrefix,
|
|
425
|
+
removeFields,
|
|
426
|
+
toJsonArray,
|
|
427
|
+
toJsonObject,
|
|
428
|
+
toJsonValue,
|
|
429
|
+
toSafeJson,
|
|
430
|
+
toSafeJsonArray,
|
|
431
|
+
toSafeJsonObject,
|
|
432
|
+
toSafeJsonString,
|
|
433
|
+
toSafeJsonValue
|
|
434
|
+
};
|
|
435
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { ObjectTypeConfig } from './IsObjectFactory.ts';
|
|
2
|
+
export type { JsonArray, JsonObject, JsonValue, } from './JsonObject.ts';
|
|
3
|
+
export type { OmitByPredicate } from './omitBy.ts';
|
|
4
|
+
export type * from './OmitStartsWith.ts';
|
|
5
|
+
export type * from './Optional.ts';
|
|
6
|
+
export type * from './Override.ts';
|
|
7
|
+
export type * from './PartialRecord.ts';
|
|
8
|
+
export type * from './PickStartsWith.ts';
|
|
9
|
+
export type * from './Simplify.ts';
|
|
10
|
+
export type * from './StringKeyObject.ts';
|
|
11
|
+
export type { Validator } from './Validator.ts';
|
|
12
|
+
export type * from './WithAdditional.ts';
|
|
13
|
+
export type * from '../../object-model/neutral/model.ts';
|
|
14
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=model.mjs.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { EmptyObject } from './EmptyObject.ts';
|
|
2
|
+
import type { DeepOmitStartsWith } from './OmitStartsWith.ts';
|
|
3
|
+
/** A predicate function used to determine which properties to omit from an object. */
|
|
4
|
+
export type OmitByPredicate<T extends EmptyObject = Record<string, unknown>> = (value: T[keyof T], key: keyof T) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new object excluding properties that satisfy the predicate, with optional recursive depth.
|
|
7
|
+
* @param obj - The source object to omit properties from.
|
|
8
|
+
* @param predicate - A function that returns true for properties to exclude.
|
|
9
|
+
* @param maxDepth - Maximum recursion depth for nested objects.
|
|
10
|
+
* @returns A partial copy of the object without matching properties.
|
|
11
|
+
*/
|
|
12
|
+
export declare const omitBy: <T extends EmptyObject>(obj: T, predicate: OmitByPredicate, maxDepth?: number) => Partial<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Omits all properties whose keys start with the given prefix, recursively through nested objects.
|
|
15
|
+
* @param payload - The source object.
|
|
16
|
+
* @param prefix - The string prefix to match keys against.
|
|
17
|
+
* @param maxDepth - Maximum recursion depth.
|
|
18
|
+
* @returns A new object without properties that have matching prefixed keys.
|
|
19
|
+
*/
|
|
20
|
+
export declare const omitByPrefix: <T extends EmptyObject, P extends string>(payload: T, prefix: P, maxDepth?: number) => DeepOmitStartsWith<T, P>;
|
|
21
|
+
//# sourceMappingURL=omitBy.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { EmptyObject } from './EmptyObject.ts';
|
|
2
|
+
import type { DeepPickStartsWith } from './PickStartsWith.ts';
|
|
3
|
+
/** A predicate function used to determine which properties to pick from an object. */
|
|
4
|
+
export type PickByPredicate<T extends EmptyObject = Record<string, unknown>> = (value: T[keyof T], key: keyof T) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new object containing only the properties that satisfy the predicate, with optional recursive depth.
|
|
7
|
+
* @param obj - The source object to pick properties from.
|
|
8
|
+
* @param predicate - A function that returns true for properties to include.
|
|
9
|
+
* @param maxDepth - Maximum recursion depth for nested objects.
|
|
10
|
+
* @returns A partial copy of the object with only matching properties.
|
|
11
|
+
*/
|
|
12
|
+
export declare const pickBy: <T extends EmptyObject>(obj: T, predicate: PickByPredicate, maxDepth?: number) => Partial<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Picks all properties whose keys start with the given prefix, recursively through nested objects.
|
|
15
|
+
* @param payload - The source object.
|
|
16
|
+
* @param prefix - The string prefix to match keys against.
|
|
17
|
+
* @param maxDepth - Maximum recursion depth.
|
|
18
|
+
* @returns A new object containing only properties with matching prefixed keys.
|
|
19
|
+
*/
|
|
20
|
+
export declare const pickByPrefix: <T extends EmptyObject, P extends string>(payload: T, prefix: P, maxDepth?: number) => DeepPickStartsWith<T, P>;
|
|
21
|
+
//# sourceMappingURL=pickBy.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EmptyObject } from './EmptyObject.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a shallow copy of the object with the specified fields removed.
|
|
4
|
+
* @param obj - The source object.
|
|
5
|
+
* @param fields - An array of keys to remove.
|
|
6
|
+
* @returns A new object without the specified fields.
|
|
7
|
+
*/
|
|
8
|
+
export declare const removeFields: <T extends EmptyObject, K extends keyof T>(obj: T, fields: K[]) => Omit<T, K>;
|
|
9
|
+
//# sourceMappingURL=removeFields.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { JsonArray, JsonObject, JsonValue } from './JsonObject.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Converts an array to a JSON-safe array, handling circular references and depth limits.
|
|
4
|
+
* @param value - The array to convert.
|
|
5
|
+
* @param cycleList - Tracks visited objects to detect circular references.
|
|
6
|
+
* @param maxDepth - Maximum recursion depth before truncating.
|
|
7
|
+
* @returns A JSON-safe array representation.
|
|
8
|
+
*/
|
|
9
|
+
export declare const toSafeJsonArray: (value: unknown[], cycleList?: unknown[], maxDepth?: number) => JsonArray;
|
|
10
|
+
/**
|
|
11
|
+
* Converts an object to a JSON-safe object, handling circular references and depth limits.
|
|
12
|
+
* @param value - The object to convert.
|
|
13
|
+
* @param cycleList - Tracks visited objects to detect circular references.
|
|
14
|
+
* @param maxDepth - Maximum recursion depth before truncating.
|
|
15
|
+
* @returns A JSON-safe object representation.
|
|
16
|
+
*/
|
|
17
|
+
export declare const toSafeJsonObject: (value: object, cycleList?: unknown[], maxDepth?: number) => JsonObject;
|
|
18
|
+
/**
|
|
19
|
+
* Converts an unknown value to a JSON-safe value, replacing circular references with '[Circular]' and
|
|
20
|
+
* non-JSON types with descriptive placeholder strings.
|
|
21
|
+
* @param value - The value to convert.
|
|
22
|
+
* @param cycleList - Tracks visited objects to detect circular references.
|
|
23
|
+
* @param maxDepth - Maximum recursion depth before truncating with '[MaxDepth]'.
|
|
24
|
+
* @returns A JSON-safe representation of the value.
|
|
25
|
+
*/
|
|
26
|
+
export declare const toSafeJsonValue: (value: unknown, cycleList?: unknown[], maxDepth?: number) => JsonValue;
|
|
27
|
+
/**
|
|
28
|
+
* Converts a value to a pretty-printed JSON string, safely handling circular references and non-JSON types.
|
|
29
|
+
* @param value - The value to serialize.
|
|
30
|
+
* @param maxDepth - Maximum recursion depth.
|
|
31
|
+
* @returns A formatted JSON string.
|
|
32
|
+
*/
|
|
33
|
+
export declare const toSafeJsonString: (value: unknown, maxDepth?: number) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Converts a value to a JSON-safe representation, handling circular references and non-serializable types.
|
|
36
|
+
* @param value - The value to convert.
|
|
37
|
+
* @param maxDepth - Maximum recursion depth.
|
|
38
|
+
* @returns A JSON-safe value.
|
|
39
|
+
*/
|
|
40
|
+
export declare const toSafeJson: (value: unknown, maxDepth?: number) => JsonValue;
|
|
41
|
+
//# sourceMappingURL=toSafeJson.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TypedKey } from '../../typeof/neutral/index.ts';
|
|
2
|
+
import type { EmptyObject } from './EmptyObject.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Any object, which means that it does not enforce the set of fields that it has. Extending from AnyObject
|
|
5
|
+
* will result in a type that includes the universal set of field names
|
|
6
|
+
*/
|
|
7
|
+
export type AnyObject = EmptyObject & Partial<Record<TypedKey, unknown>>;
|
|
8
|
+
//# sourceMappingURL=AnyObject.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AnyNonPromise } from '../../promise/neutral/index.ts';
|
|
2
|
+
import type { AsTypeFunction } from './AsTypeFunction.ts';
|
|
3
|
+
import type { TypeCheck } from './types.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Factory for creating type-narrowing 'as' functions that cast a value to T or return undefined.
|
|
6
|
+
* Supports optional assertion messages and configuration for required/optional behavior.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AsTypeFactory: {
|
|
9
|
+
create: <T extends AnyNonPromise>(typeCheck: TypeCheck<T>) => AsTypeFunction<T>;
|
|
10
|
+
createOptional: <T extends AnyNonPromise>(typeCheck: TypeCheck<T>) => (value: AnyNonPromise) => T | undefined;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=AsTypeFactory.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AnyNonPromise } from '../../promise/neutral/index.ts';
|
|
2
|
+
import type { StringOrAlertFunction, TypeCheckConfig, TypeCheckOptionalConfig, TypeCheckRequiredConfig } from './types.ts';
|
|
3
|
+
/** A type-narrowing function that attempts to cast a value to T, with optional assertion and configuration overloads. */
|
|
4
|
+
export interface AsTypeFunction<T extends AnyNonPromise = AnyNonPromise> {
|
|
5
|
+
<TType extends T>(value: AnyNonPromise): TType | undefined;
|
|
6
|
+
<TType extends T>(value: AnyNonPromise, config: TypeCheckRequiredConfig): TType;
|
|
7
|
+
<TType extends T>(value: AnyNonPromise, config: TypeCheckConfig | TypeCheckOptionalConfig): TType | undefined;
|
|
8
|
+
<TType extends T>(value: AnyNonPromise, assert: StringOrAlertFunction<TType>): TType | undefined;
|
|
9
|
+
<TType extends T>(value: AnyNonPromise, assert: StringOrAlertFunction<TType>, config: TypeCheckRequiredConfig): TType;
|
|
10
|
+
<TType extends T>(value: AnyNonPromise, assert: StringOrAlertFunction<TType>, config: TypeCheckConfig | TypeCheckOptionalConfig): TType | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** A simplified type-narrowing function that returns T or undefined, without assertion support. */
|
|
13
|
+
export type AsOptionalTypeFunction<T extends AnyNonPromise = AnyNonPromise> = <TType extends T>(value: AnyNonPromise) => TType | undefined;
|
|
14
|
+
//# sourceMappingURL=AsTypeFunction.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An empty object, which means that it does enforce the set of field names, defaulting to an empty set until
|
|
3
|
+
* extended from, which then adds only those additional fields
|
|
4
|
+
*/
|
|
5
|
+
export type EmptyObject<T extends object = object> = Exclude<{
|
|
6
|
+
[K in keyof T]?: never;
|
|
7
|
+
}, unknown[] | ((...args: unknown[]) => unknown) | null>;
|
|
8
|
+
//# sourceMappingURL=EmptyObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=model.mjs.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AssertExMessageFunc } from '../../assert/neutral/index.ts';
|
|
2
|
+
import type { Logger } from '../../logger/neutral/index.ts';
|
|
3
|
+
import type { AnyNonPromise } from '../../promise/neutral/index.ts';
|
|
4
|
+
import type { TypedValue } from '../../typeof/neutral/index.ts';
|
|
5
|
+
/** Configuration options for type check functions, with optional logging. */
|
|
6
|
+
export interface TypeCheckConfig {
|
|
7
|
+
log?: boolean | Logger;
|
|
8
|
+
}
|
|
9
|
+
/** Type check configuration that marks the value as required, causing assertions on failure. */
|
|
10
|
+
export interface TypeCheckRequiredConfig extends TypeCheckConfig {
|
|
11
|
+
required: true;
|
|
12
|
+
}
|
|
13
|
+
/** Type check configuration that marks the value as optional, returning undefined on failure. */
|
|
14
|
+
export interface TypeCheckOptionalConfig extends TypeCheckConfig {
|
|
15
|
+
required: false;
|
|
16
|
+
}
|
|
17
|
+
/** A string message or function that produces an assertion error message for a failed type check. */
|
|
18
|
+
export type StringOrAlertFunction<T extends AnyNonPromise> = string | AssertExMessageFunc<T>;
|
|
19
|
+
/** A type guard function that checks whether a value conforms to type T, with optional configuration. */
|
|
20
|
+
export interface TypeCheck<T extends TypedValue> {
|
|
21
|
+
(obj: AnyNonPromise): obj is T;
|
|
22
|
+
(obj: AnyNonPromise, config: TypeCheckConfig): obj is T;
|
|
23
|
+
(obj: AnyNonPromise, config: TypeCheckConfig | number | undefined): obj is T;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Returns whether the current environment is a browser window (not a web worker). */
|
|
2
|
+
export declare const isBrowser: () => boolean;
|
|
3
|
+
/** Returns whether the current environment is a dedicated web worker. */
|
|
4
|
+
export declare const isWebworker: () => boolean;
|
|
5
|
+
/** Returns whether the current environment is Node.js. Always returns false in the browser entry point. */
|
|
6
|
+
export declare const isNode: () => boolean;
|
|
7
|
+
/** The Web Crypto API's SubtleCrypto interface, sourced from the browser's globalThis.crypto. */
|
|
8
|
+
export declare const subtle: SubtleCrypto;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|