@duplojs/lang 0.0.1-beta.1 → 0.0.1-beta.11
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/dist/array/at/default.d.ts +1 -1
- package/dist/array/chunk.d.ts +3 -2
- package/dist/array/concat.d.ts +1 -1
- package/dist/array/copyWithin.d.ts +1 -1
- package/dist/array/fill/all.d.ts +1 -1
- package/dist/array/fill/default.d.ts +3 -3
- package/dist/array/filter.d.ts +1 -1
- package/dist/array/findAndReplace.d.ts +1 -1
- package/dist/array/findAndSplice/delete.d.ts +1 -1
- package/dist/array/findAndSplice/insert.d.ts +1 -1
- package/dist/array/index.cjs +0 -3
- package/dist/array/index.d.ts +0 -1
- package/dist/array/index.mjs +1 -3
- package/dist/array/insert.d.ts +3 -3
- package/dist/array/length.d.ts +1 -1
- package/dist/array/lengthEqual.d.ts +1 -1
- package/dist/array/map.d.ts +1 -1
- package/dist/array/maxElements.d.ts +1 -1
- package/dist/array/minElements.d.ts +1 -1
- package/dist/array/pop.d.ts +1 -1
- package/dist/array/prepend.d.ts +1 -1
- package/dist/array/push.d.ts +3 -3
- package/dist/array/reverse.d.ts +1 -1
- package/dist/array/shift.d.ts +1 -1
- package/dist/array/sort.d.ts +1 -1
- package/dist/array/splice/delete.d.ts +1 -1
- package/dist/array/splice/insert.d.ts +1 -1
- package/dist/array/unshift.d.ts +3 -3
- package/dist/chrono/createDate.cjs +9 -9
- package/dist/chrono/createDate.d.ts +3 -3
- package/dist/chrono/createDate.mjs +9 -9
- package/dist/chrono/createTime.cjs +24 -13
- package/dist/chrono/createTime.mjs +24 -13
- package/dist/chrono/theDate.cjs +15 -16
- package/dist/chrono/theDate.d.ts +15 -15
- package/dist/chrono/theDate.mjs +15 -16
- package/dist/chrono/theTime.cjs +0 -1
- package/dist/chrono/theTime.mjs +0 -1
- package/dist/chrono/types/spoolingTime.d.ts +2 -1
- package/dist/common/constraint/cast/index.d.ts +3 -3
- package/dist/common/constraint/cast/number.d.ts +15 -0
- package/dist/common/constraint/cast/string.d.ts +21 -0
- package/dist/common/constraint/index.d.ts +2 -0
- package/dist/common/constraint/infer/array.d.ts +7 -0
- package/dist/{array/infer.cjs → common/constraint/infer/index.cjs} +1 -1
- package/dist/common/constraint/infer/index.d.ts +26 -0
- package/dist/{string/infer.mjs → common/constraint/infer/index.mjs} +1 -1
- package/dist/common/constraint/infer/number.d.ts +11 -0
- package/dist/common/constraint/infer/string.d.ts +13 -0
- package/dist/common/constraint/remove.cjs +6 -0
- package/dist/common/constraint/remove.d.ts +2 -0
- package/dist/common/constraint/remove.mjs +6 -0
- package/dist/common/index.cjs +6 -0
- package/dist/common/index.mjs +5 -1
- package/dist/common/isType.d.ts +3 -2
- package/dist/common/types/forward.d.ts +1 -0
- package/dist/common/types/index.d.ts +3 -0
- package/dist/common/types/isObject.d.ts +8 -0
- package/dist/common/types/json.d.ts +1 -1
- package/dist/common/types/splitPromise.d.ts +1 -0
- package/dist/dataStructure/common/codec/base.cjs +29 -0
- package/dist/dataStructure/common/{codec.d.ts → codec/base.d.ts} +8 -8
- package/dist/dataStructure/common/codec/base.mjs +26 -0
- package/dist/dataStructure/common/codec/defaults/index.d.ts +2 -0
- package/dist/dataStructure/common/codec/defaults/json.cjs +26 -0
- package/dist/dataStructure/common/codec/defaults/json.d.ts +6 -0
- package/dist/dataStructure/common/codec/defaults/json.mjs +26 -0
- package/dist/dataStructure/common/codec/defaults/string.cjs +44 -0
- package/dist/dataStructure/common/codec/defaults/string.d.ts +11 -0
- package/dist/dataStructure/common/codec/defaults/string.mjs +44 -0
- package/dist/dataStructure/common/codec/index.d.ts +2 -0
- package/dist/dataStructure/common/error/base.cjs +73 -0
- package/dist/dataStructure/common/error/base.d.ts +50 -0
- package/dist/dataStructure/common/error/base.mjs +69 -0
- package/dist/dataStructure/common/error/defaultInterpreter.cjs +87 -0
- package/dist/dataStructure/common/error/defaultInterpreter.d.ts +60 -0
- package/dist/dataStructure/common/error/defaultInterpreter.mjs +86 -0
- package/dist/dataStructure/common/error/index.d.ts +3 -0
- package/dist/dataStructure/common/error/interpreter.cjs +44 -0
- package/dist/dataStructure/common/error/interpreter.d.ts +32 -0
- package/dist/dataStructure/common/error/interpreter.mjs +44 -0
- package/dist/dataStructure/constraint/base.cjs +34 -5
- package/dist/dataStructure/constraint/base.d.ts +13 -4
- package/dist/dataStructure/constraint/base.mjs +34 -6
- package/dist/dataStructure/constraint/defaults/absolutePath.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/absolutePath.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/absolutePath.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/allowedCharacters.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/allowedCharacters.d.ts +1 -3
- package/dist/dataStructure/constraint/defaults/allowedCharacters.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/arrayLengthEqual.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/arrayLengthEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/arrayLengthEqual.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThan.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThan.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThan.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThanOrEqual.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThanOrEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/betweenThanOrEqual.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/email.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/email.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/email.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/even.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/even.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/even.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThan.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThan.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThan.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThanOrEqual.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThanOrEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/greaterThanOrEqual.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/index.d.ts +6 -0
- package/dist/dataStructure/constraint/defaults/integer.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/integer.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/integer.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/lessThan.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/lessThan.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/lessThan.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/lessThanOrEqual.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/lessThanOrEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/lessThanOrEqual.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/maxCharacters.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/maxCharacters.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/maxCharacters.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/maxElements.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/maxElements.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/maxElements.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/minCharacters.cjs +4 -4
- package/dist/dataStructure/constraint/defaults/minCharacters.d.ts +2 -2
- package/dist/dataStructure/constraint/defaults/minCharacters.mjs +4 -4
- package/dist/dataStructure/constraint/defaults/minElements.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/minElements.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/minElements.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/multipleOf.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/multipleOf.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/multipleOf.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/negative.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/negative.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/negative.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/notEmpty.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/notEmpty.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/notEmpty.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/notZero.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/notZero.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/notZero.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/numberInString.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/numberInString.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/numberInString.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/odd.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/odd.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/odd.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/path.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/path.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/path.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/positive.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/positive.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/positive.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/refine.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/refine.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/refine.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/regex.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/regex.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/regex.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/safe.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/safe.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/safe.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/segmentPath.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/segmentPath.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/segmentPath.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/strictNegative.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/strictNegative.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/strictNegative.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/strictPositive.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/strictPositive.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/strictPositive.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/stringLengthEqual.cjs +1 -1
- package/dist/dataStructure/constraint/defaults/stringLengthEqual.d.ts +1 -1
- package/dist/dataStructure/constraint/defaults/stringLengthEqual.mjs +1 -1
- package/dist/dataStructure/constraint/defaults/trimmed.cjs +13 -0
- package/dist/dataStructure/constraint/defaults/trimmed.d.ts +10 -0
- package/dist/dataStructure/constraint/defaults/trimmed.mjs +12 -0
- package/dist/dataStructure/constraint/defaults/url.cjs +2 -2
- package/dist/dataStructure/constraint/defaults/url.d.ts +2 -3
- package/dist/dataStructure/constraint/defaults/url.mjs +2 -2
- package/dist/dataStructure/constraint/defaults/uuid.cjs +2 -4
- package/dist/dataStructure/constraint/defaults/uuid.d.ts +1 -3
- package/dist/dataStructure/constraint/defaults/uuid.mjs +4 -5
- package/dist/dataStructure/constraint/identifier.d.ts +3 -4
- package/dist/dataStructure/constraint/types/constraints.d.ts +22 -15
- package/dist/dataStructure/fundamentalType/base.cjs +3 -3
- package/dist/dataStructure/fundamentalType/base.d.ts +4 -5
- package/dist/dataStructure/fundamentalType/base.mjs +3 -3
- package/dist/dataStructure/fundamentalType/defaults/bigint.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/bigint.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/bigint.mjs +5 -2
- package/dist/dataStructure/fundamentalType/defaults/boolean.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/boolean.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/boolean.mjs +5 -2
- package/dist/dataStructure/fundamentalType/defaults/date.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/date.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/date.mjs +5 -2
- package/dist/dataStructure/fundamentalType/defaults/null.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/null.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/null.mjs +5 -2
- package/dist/dataStructure/fundamentalType/defaults/number.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/number.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/number.mjs +5 -2
- package/dist/dataStructure/fundamentalType/defaults/string.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/string.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/string.mjs +5 -2
- package/dist/dataStructure/fundamentalType/defaults/time.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/time.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/time.mjs +5 -2
- package/dist/dataStructure/fundamentalType/defaults/undefined.cjs +4 -2
- package/dist/dataStructure/fundamentalType/defaults/undefined.d.ts +4 -4
- package/dist/dataStructure/fundamentalType/defaults/undefined.mjs +5 -2
- package/dist/dataStructure/fundamentalType/identifier.d.ts +3 -4
- package/dist/dataStructure/helpers/absolutePath.cjs +7 -0
- package/dist/dataStructure/helpers/absolutePath.d.ts +2 -0
- package/dist/dataStructure/helpers/absolutePath.mjs +7 -0
- package/dist/dataStructure/helpers/array.d.ts +1 -1
- package/dist/dataStructure/helpers/bigint.d.ts +1 -1
- package/dist/dataStructure/helpers/boolean.d.ts +1 -1
- package/dist/dataStructure/helpers/date.d.ts +1 -1
- package/dist/dataStructure/helpers/extend.d.ts +1 -1
- package/dist/dataStructure/helpers/index.d.ts +10 -1
- package/dist/dataStructure/helpers/isNullable.cjs +12 -0
- package/dist/dataStructure/helpers/isNullable.d.ts +2 -0
- package/dist/dataStructure/helpers/isNullable.mjs +12 -0
- package/dist/dataStructure/helpers/isOptional.cjs +12 -0
- package/dist/dataStructure/helpers/isOptional.d.ts +2 -0
- package/dist/dataStructure/helpers/isOptional.mjs +12 -0
- package/dist/dataStructure/helpers/lazy.d.ts +1 -1
- package/dist/dataStructure/helpers/null.d.ts +1 -1
- package/dist/dataStructure/helpers/nullable.cjs +5 -2
- package/dist/dataStructure/helpers/nullable.mjs +5 -2
- package/dist/dataStructure/helpers/number.d.ts +1 -1
- package/dist/dataStructure/helpers/numberInString.cjs +7 -0
- package/dist/dataStructure/helpers/numberInString.d.ts +2 -0
- package/dist/dataStructure/helpers/numberInString.mjs +7 -0
- package/dist/dataStructure/helpers/object.d.ts +1 -1
- package/dist/dataStructure/helpers/optional.cjs +5 -2
- package/dist/dataStructure/helpers/optional.mjs +5 -2
- package/dist/dataStructure/helpers/partial.cjs +5 -2
- package/dist/dataStructure/helpers/partial.mjs +5 -2
- package/dist/dataStructure/helpers/path.cjs +7 -0
- package/dist/dataStructure/helpers/path.d.ts +2 -0
- package/dist/dataStructure/helpers/path.mjs +7 -0
- package/dist/dataStructure/helpers/record.d.ts +1 -1
- package/dist/dataStructure/helpers/regex.cjs +7 -0
- package/dist/dataStructure/helpers/regex.d.ts +2 -0
- package/dist/dataStructure/helpers/regex.mjs +7 -0
- package/dist/dataStructure/helpers/required.cjs +6 -3
- package/dist/dataStructure/helpers/required.d.ts +2 -1
- package/dist/dataStructure/helpers/required.mjs +6 -3
- package/dist/dataStructure/helpers/segmentPath.cjs +7 -0
- package/dist/dataStructure/helpers/segmentPath.d.ts +2 -0
- package/dist/dataStructure/helpers/segmentPath.mjs +7 -0
- package/dist/dataStructure/helpers/string.d.ts +1 -1
- package/dist/dataStructure/helpers/time.d.ts +1 -1
- package/dist/dataStructure/helpers/trimmed.cjs +7 -0
- package/dist/dataStructure/helpers/trimmed.d.ts +2 -0
- package/dist/dataStructure/helpers/trimmed.mjs +7 -0
- package/dist/dataStructure/helpers/undefined.d.ts +1 -1
- package/dist/dataStructure/helpers/union.d.ts +1 -1
- package/dist/dataStructure/helpers/unwrapLazy.cjs +9 -0
- package/dist/dataStructure/helpers/unwrapLazy.d.ts +2 -0
- package/dist/dataStructure/helpers/unwrapLazy.mjs +9 -0
- package/dist/dataStructure/helpers/url.cjs +2 -2
- package/dist/dataStructure/helpers/url.d.ts +1 -2
- package/dist/dataStructure/helpers/url.mjs +2 -2
- package/dist/dataStructure/index.cjs +158 -60
- package/dist/dataStructure/index.mjs +80 -21
- package/dist/dataStructure/structure/base.cjs +22 -12
- package/dist/dataStructure/structure/base.d.ts +8 -5
- package/dist/dataStructure/structure/base.mjs +16 -6
- package/dist/dataStructure/structure/defaults/array.d.ts +2 -2
- package/dist/dataStructure/structure/defaults/index.d.ts +1 -0
- package/dist/dataStructure/structure/defaults/lazy.cjs +10 -3
- package/dist/dataStructure/structure/defaults/lazy.d.ts +2 -2
- package/dist/dataStructure/structure/defaults/lazy.mjs +10 -3
- package/dist/dataStructure/structure/defaults/nonEncodableString.cjs +17 -0
- package/dist/dataStructure/structure/defaults/nonEncodableString.d.ts +10 -0
- package/dist/dataStructure/structure/defaults/nonEncodableString.mjs +16 -0
- package/dist/dataStructure/structure/defaults/object.d.ts +2 -2
- package/dist/dataStructure/structure/defaults/record.cjs +7 -7
- package/dist/dataStructure/structure/defaults/record.d.ts +3 -3
- package/dist/dataStructure/structure/defaults/record.mjs +7 -7
- package/dist/dataStructure/structure/defaults/type.cjs +1 -1
- package/dist/dataStructure/structure/defaults/type.d.ts +2 -2
- package/dist/dataStructure/structure/defaults/type.mjs +2 -2
- package/dist/dataStructure/structure/defaults/union.cjs +23 -17
- package/dist/dataStructure/structure/defaults/union.d.ts +3 -3
- package/dist/dataStructure/structure/defaults/union.mjs +21 -15
- package/dist/dataStructure/structure/identifier.d.ts +3 -4
- package/dist/dataStructure/structure/types/constraintsValue.d.ts +1 -1
- package/dist/dataStructure/structure/types/structures.d.ts +2 -1
- package/dist/dataStructure/structure/types/value.d.ts +1 -1
- package/dist/dataStructure/type/base.cjs +17 -4
- package/dist/dataStructure/type/base.d.ts +7 -3
- package/dist/dataStructure/type/base.mjs +17 -4
- package/dist/dataStructure/type/defaults/bigint.d.ts +1 -1
- package/dist/dataStructure/type/defaults/bigintLiteral.cjs +1 -1
- package/dist/dataStructure/type/defaults/bigintLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/bigintLiteral.mjs +1 -1
- package/dist/dataStructure/type/defaults/boolean.d.ts +1 -1
- package/dist/dataStructure/type/defaults/booleanLiteral.cjs +1 -1
- package/dist/dataStructure/type/defaults/booleanLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/booleanLiteral.mjs +1 -1
- package/dist/dataStructure/type/defaults/date.d.ts +1 -1
- package/dist/dataStructure/type/defaults/null.d.ts +1 -1
- package/dist/dataStructure/type/defaults/number.d.ts +1 -1
- package/dist/dataStructure/type/defaults/numberLiteral.cjs +1 -1
- package/dist/dataStructure/type/defaults/numberLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/numberLiteral.mjs +1 -1
- package/dist/dataStructure/type/defaults/string.d.ts +1 -1
- package/dist/dataStructure/type/defaults/stringLiteral.cjs +1 -1
- package/dist/dataStructure/type/defaults/stringLiteral.d.ts +1 -1
- package/dist/dataStructure/type/defaults/stringLiteral.mjs +1 -1
- package/dist/dataStructure/type/defaults/time.d.ts +1 -1
- package/dist/dataStructure/type/defaults/undefined.d.ts +1 -1
- package/dist/dataStructure/type/identifier.d.ts +3 -4
- package/dist/either/index.cjs +30 -8
- package/dist/either/index.d.ts +4 -0
- package/dist/either/index.mjs +23 -9
- package/dist/either/left/index.d.ts +3 -2
- package/dist/either/left/none.cjs +15 -0
- package/dist/either/left/none.d.ts +7 -0
- package/dist/either/left/none.mjs +14 -0
- package/dist/either/matchInformationOtherwise.d.ts +1 -1
- package/dist/either/rewriteInformation.cjs +22 -0
- package/dist/either/rewriteInformation.d.ts +14 -0
- package/dist/either/rewriteInformation.mjs +22 -0
- package/dist/either/right/asyncGroup.cjs +2 -2
- package/dist/either/right/asyncGroup.mjs +2 -2
- package/dist/either/right/group.cjs +1 -1
- package/dist/either/right/group.mjs +1 -1
- package/dist/either/right/index.d.ts +6 -5
- package/dist/either/right/some.cjs +15 -0
- package/dist/either/right/some.d.ts +7 -0
- package/dist/either/right/some.mjs +14 -0
- package/dist/either/toMaybe.cjs +12 -0
- package/dist/either/toMaybe.d.ts +5 -0
- package/dist/either/toMaybe.mjs +12 -0
- package/dist/either/types/mayBe.d.ts +3 -0
- package/dist/either/unwrapOr.cjs +14 -0
- package/dist/either/unwrapOr.d.ts +8 -0
- package/dist/either/unwrapOr.mjs +14 -0
- package/dist/either/unwrapOtherwise.cjs +14 -0
- package/dist/either/unwrapOtherwise.d.ts +8 -0
- package/dist/either/unwrapOtherwise.mjs +14 -0
- package/dist/generator/asyncChunk.d.ts +3 -2
- package/dist/generator/chunk.d.ts +3 -2
- package/dist/generator/reduce.cjs +2 -1
- package/dist/generator/reduce.mjs +1 -1
- package/dist/generator/types/flat.d.ts +2 -2
- package/dist/index.cjs +43 -39
- package/dist/index.mjs +4 -2
- package/dist/invocation/flow/base.d.ts +8 -3
- package/dist/invocation/flow/controller/base.d.ts +1 -0
- package/dist/invocation/flow/controller/defaults/aborter.cjs +38 -0
- package/dist/invocation/flow/controller/defaults/aborter.d.ts +17 -0
- package/dist/invocation/flow/controller/defaults/aborter.mjs +36 -0
- package/dist/invocation/flow/controller/defaults/debounce.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/filter.cjs +5 -3
- package/dist/invocation/flow/controller/defaults/filter.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/filter.mjs +5 -3
- package/dist/invocation/flow/controller/defaults/index.d.ts +1 -0
- package/dist/invocation/flow/controller/defaults/retry.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/throttling.d.ts +1 -1
- package/dist/invocation/flow/controller/defaults/timeout.d.ts +1 -1
- package/dist/invocation/index.cjs +15 -8
- package/dist/invocation/index.d.ts +1 -1
- package/dist/invocation/index.mjs +10 -6
- package/dist/invocation/reader.cjs +26 -0
- package/dist/invocation/reader.d.ts +28 -0
- package/dist/invocation/reader.mjs +25 -0
- package/dist/kind/createIdentifier.d.ts +8 -4
- package/dist/kind/types/getName.d.ts +2 -0
- package/dist/kind/types/getNamespaceName.d.ts +3 -0
- package/dist/kind/types/index.d.ts +2 -0
- package/dist/kind/types/remove.d.ts +2 -2
- package/dist/modeling/entity/base.cjs +38 -11
- package/dist/modeling/entity/base.d.ts +25 -10
- package/dist/modeling/entity/base.mjs +32 -6
- package/dist/modeling/entity/helper.d.ts +1 -1
- package/dist/modeling/entity/index.d.ts +0 -1
- package/dist/modeling/entity/namespace.cjs +2 -2
- package/dist/modeling/entity/namespace.d.ts +1 -1
- package/dist/modeling/entity/namespace.mjs +3 -3
- package/dist/modeling/flag/base.cjs +1 -5
- package/dist/modeling/flag/base.d.ts +6 -7
- package/dist/modeling/flag/base.mjs +1 -5
- package/dist/modeling/index.cjs +45 -28
- package/dist/modeling/index.d.ts +1 -0
- package/dist/modeling/index.mjs +18 -9
- package/dist/modeling/newType/base.cjs +34 -13
- package/dist/modeling/newType/base.d.ts +9 -2
- package/dist/modeling/newType/base.mjs +26 -7
- package/dist/modeling/newType/helper.cjs +2 -2
- package/dist/modeling/newType/helper.d.ts +1 -1
- package/dist/modeling/newType/helper.mjs +2 -2
- package/dist/modeling/taggedObject/base.cjs +113 -0
- package/dist/modeling/taggedObject/base.d.ts +61 -0
- package/dist/modeling/taggedObject/base.mjs +110 -0
- package/dist/modeling/taggedObject/helper.cjs +34 -0
- package/dist/modeling/taggedObject/helper.d.ts +15 -0
- package/dist/modeling/taggedObject/helper.mjs +31 -0
- package/dist/modeling/taggedObject/index.d.ts +2 -0
- package/dist/number/betweenThan.d.ts +2 -2
- package/dist/number/betweenThanOrEqual.d.ts +2 -2
- package/dist/number/greaterThan.d.ts +1 -1
- package/dist/number/greaterThanOrEqual.d.ts +1 -1
- package/dist/number/index.cjs +0 -3
- package/dist/number/index.d.ts +0 -1
- package/dist/number/index.mjs +1 -3
- package/dist/number/lessThan.d.ts +1 -1
- package/dist/number/lessThanOrEqual.d.ts +1 -1
- package/dist/number/sort.d.ts +1 -1
- package/dist/number/types/isGreater.d.ts +5 -5
- package/dist/object/assign.d.ts +3 -3
- package/dist/object/types/assign.d.ts +2 -0
- package/dist/object/types/forbiddenUndefinedProps.d.ts +3 -0
- package/dist/object/types/index.d.ts +4 -2
- package/dist/object/types/override.d.ts +4 -0
- package/dist/object/types/split.d.ts +2 -2
- package/dist/path/computeRelative.cjs +5 -6
- package/dist/path/computeRelative.d.ts +1 -1
- package/dist/path/computeRelative.mjs +5 -6
- package/dist/path/constraints/absolute.d.ts +1 -1
- package/dist/path/constraints/index.d.ts +2 -1
- package/dist/path/constraints/segment.d.ts +3 -0
- package/dist/path/getBaseName.cjs +7 -7
- package/dist/path/getBaseName.d.ts +2 -2
- package/dist/path/getBaseName.mjs +7 -7
- package/dist/path/getExtensionName.cjs +9 -4
- package/dist/path/getExtensionName.d.ts +2 -2
- package/dist/path/getExtensionName.mjs +9 -4
- package/dist/path/getParentFolderPath.cjs +9 -4
- package/dist/path/getParentFolderPath.d.ts +1 -2
- package/dist/path/getParentFolderPath.mjs +9 -4
- package/dist/path/index.cjs +6 -3
- package/dist/path/index.d.ts +3 -2
- package/dist/path/index.mjs +5 -3
- package/dist/path/is.cjs +9 -4
- package/dist/path/is.d.ts +4 -2
- package/dist/path/is.mjs +9 -4
- package/dist/path/isAbsolute.cjs +3 -5
- package/dist/path/isAbsolute.d.ts +4 -2
- package/dist/path/isAbsolute.mjs +3 -5
- package/dist/path/isSegment.cjs +6 -0
- package/dist/path/isSegment.d.ts +4 -0
- package/dist/path/isSegment.mjs +6 -0
- package/dist/path/normalize.cjs +18 -0
- package/dist/path/normalize.d.ts +2 -0
- package/dist/path/normalize.mjs +18 -0
- package/dist/path/resolveFrom.cjs +4 -5
- package/dist/path/resolveFrom.d.ts +10 -2
- package/dist/path/resolveFrom.mjs +4 -5
- package/dist/path/resolveRelative.cjs +17 -20
- package/dist/path/resolveRelative.d.ts +9 -2
- package/dist/path/resolveRelative.mjs +17 -20
- package/dist/path/types/index.d.ts +6 -0
- package/dist/path/types/isLiteralAbsolutePath.d.ts +2 -0
- package/dist/path/types/isLiteralPath.d.ts +20 -0
- package/dist/path/types/isLiteralSegmentPath.d.ts +9 -0
- package/dist/path/types/requireLiteralAbsolutePath.d.ts +3 -0
- package/dist/path/types/requireLiteralPath.d.ts +3 -0
- package/dist/path/types/requireLiteralSegmentPath.d.ts +3 -0
- package/dist/pattern/index.cjs +12 -0
- package/dist/pattern/index.d.ts +4 -0
- package/dist/pattern/index.mjs +9 -1
- package/dist/pattern/matchWithEntity.cjs +12 -0
- package/dist/pattern/matchWithEntity.d.ts +12 -0
- package/dist/pattern/matchWithEntity.mjs +12 -0
- package/dist/pattern/matchWithEntityOtherwise.cjs +13 -0
- package/dist/pattern/matchWithEntityOtherwise.d.ts +14 -0
- package/dist/pattern/matchWithEntityOtherwise.mjs +13 -0
- package/dist/pattern/matchWithNumber.d.ts +4 -4
- package/dist/pattern/matchWithNumberOtherwise.cjs +2 -6
- package/dist/pattern/matchWithNumberOtherwise.d.ts +4 -4
- package/dist/pattern/matchWithNumberOtherwise.mjs +2 -6
- package/dist/pattern/matchWithString.d.ts +4 -4
- package/dist/pattern/matchWithStringOtherwise.cjs +2 -6
- package/dist/pattern/matchWithStringOtherwise.d.ts +5 -5
- package/dist/pattern/matchWithStringOtherwise.mjs +2 -6
- package/dist/pattern/matchWithTaggedObject.cjs +12 -0
- package/dist/pattern/matchWithTaggedObject.d.ts +12 -0
- package/dist/pattern/matchWithTaggedObject.mjs +12 -0
- package/dist/pattern/matchWithTaggedObjectOtherwise.cjs +13 -0
- package/dist/pattern/matchWithTaggedObjectOtherwise.d.ts +14 -0
- package/dist/pattern/matchWithTaggedObjectOtherwise.mjs +13 -0
- package/dist/string/at.d.ts +2 -2
- package/dist/string/constraints/allowedCharacters.d.ts +3 -3
- package/dist/string/constraints/index.d.ts +2 -1
- package/dist/string/constraints/number.d.ts +4 -0
- package/dist/string/first.d.ts +1 -1
- package/dist/string/index.cjs +6 -3
- package/dist/string/index.d.ts +1 -1
- package/dist/string/index.mjs +5 -3
- package/dist/string/isComposedOf.cjs +0 -1
- package/dist/string/isComposedOf.d.ts +5 -8
- package/dist/string/isComposedOf.mjs +0 -1
- package/dist/string/isNumber.cjs +7 -0
- package/dist/string/isNumber.d.ts +5 -0
- package/dist/string/isNumber.mjs +7 -0
- package/dist/string/isUrl.cjs +2 -11
- package/dist/string/isUrl.d.ts +1 -5
- package/dist/string/isUrl.mjs +2 -11
- package/dist/string/last.d.ts +1 -1
- package/dist/string/lengthEqual.d.ts +1 -1
- package/dist/string/maxCharacters.d.ts +1 -1
- package/dist/string/minCharacters.d.ts +1 -1
- package/dist/string/padEnd.d.ts +1 -1
- package/dist/string/padStart.d.ts +1 -1
- package/dist/string/pop.d.ts +1 -1
- package/dist/string/shift.d.ts +1 -1
- package/dist/string/slice.d.ts +1 -1
- package/dist/string/substring.d.ts +1 -1
- package/dist/string/to.d.ts +9 -2
- package/dist/string/trim/default.d.ts +1 -1
- package/dist/string/trim/end.d.ts +1 -1
- package/dist/string/trim/index.d.ts +1 -0
- package/dist/string/trim/is.cjs +6 -0
- package/dist/string/trim/is.d.ts +2 -0
- package/dist/string/trim/is.mjs +6 -0
- package/dist/string/trim/start.d.ts +1 -1
- package/dist/string/types/IsAllowedString.d.ts +5 -0
- package/dist/string/types/index.d.ts +5 -5
- package/dist/string/types/numberInString.d.ts +1 -0
- package/dist/string/types/split.d.ts +1 -1
- package/dist/tuple/from.cjs +6 -0
- package/dist/tuple/from.d.ts +8 -0
- package/dist/tuple/from.mjs +6 -0
- package/dist/tuple/index.cjs +6 -1
- package/dist/tuple/index.d.ts +1 -0
- package/dist/tuple/index.mjs +6 -2
- package/package.json +2 -2
- package/dist/array/infer.d.ts +0 -14
- package/dist/array/infer.mjs +0 -6
- package/dist/dataStructure/common/codec.cjs +0 -28
- package/dist/dataStructure/common/codec.mjs +0 -25
- package/dist/dataStructure/common/error.cjs +0 -53
- package/dist/dataStructure/common/error.d.ts +0 -30
- package/dist/dataStructure/common/error.mjs +0 -52
- package/dist/invocation/useCase.cjs +0 -26
- package/dist/invocation/useCase.d.ts +0 -28
- package/dist/invocation/useCase.mjs +0 -25
- package/dist/modeling/entity/entityName.cjs +0 -13
- package/dist/modeling/entity/entityName.d.ts +0 -13
- package/dist/modeling/entity/entityName.mjs +0 -13
- package/dist/number/infer.cjs +0 -6
- package/dist/number/infer.d.ts +0 -12
- package/dist/number/infer.mjs +0 -6
- package/dist/object/types/assignObjects.d.ts +0 -2
- package/dist/path/fix.cjs +0 -8
- package/dist/path/fix.d.ts +0 -1
- package/dist/path/fix.mjs +0 -8
- package/dist/string/infer.cjs +0 -6
- package/dist/string/infer.d.ts +0 -12
- package/dist/string/types/number.d.ts +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as DCommon from '../../common';
|
|
2
|
+
import type * as DString from '../../string';
|
|
3
|
+
type CheckSegment<GenericSegment extends readonly string[], GenericDotIsPass extends boolean, GenericIsFirst extends boolean = true> = GenericSegment extends readonly [] ? true : GenericSegment extends readonly [
|
|
4
|
+
infer InferredFirst extends string,
|
|
5
|
+
...infer InferredRest extends readonly string[]
|
|
6
|
+
] ? DCommon.Or<[
|
|
7
|
+
DCommon.IsEqual<".", InferredFirst>,
|
|
8
|
+
DString.Includes<InferredFirst, "/">,
|
|
9
|
+
DString.Includes<InferredFirst, "\0">,
|
|
10
|
+
DCommon.And<[
|
|
11
|
+
DCommon.IsEqual<GenericIsFirst, false>,
|
|
12
|
+
DCommon.IsEqual<"", InferredFirst>
|
|
13
|
+
]>,
|
|
14
|
+
DCommon.And<[
|
|
15
|
+
DCommon.IsEqual<GenericDotIsPass, true>,
|
|
16
|
+
DCommon.IsEqual<"..", InferredFirst>
|
|
17
|
+
]>
|
|
18
|
+
]> extends true ? false : CheckSegment<InferredRest, DCommon.Not<DCommon.IsEqual<InferredFirst, "..">>, false> : false;
|
|
19
|
+
export type IsLiteralPath<GenericValue extends string> = DString.IsLiteral<GenericValue> extends true ? GenericValue extends "" ? false : GenericValue extends "/" ? true : GenericValue extends "." ? true : DString.Split<GenericValue, "/"> extends infer InferredResult extends readonly string[] ? CheckSegment<InferredResult, false> : never : false;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as DCommon from '../../common';
|
|
2
|
+
import type * as DString from '../../string';
|
|
3
|
+
export type IsLiteralSegmentPath<GenericValue extends string> = DString.IsLiteral<GenericValue> extends true ? DCommon.Not<DCommon.Or<[
|
|
4
|
+
DCommon.IsEqual<GenericValue, ".">,
|
|
5
|
+
DCommon.IsEqual<GenericValue, "..">,
|
|
6
|
+
DCommon.IsEqual<GenericValue, "">,
|
|
7
|
+
DString.Includes<GenericValue, "/">,
|
|
8
|
+
DString.Includes<GenericValue, "\0">
|
|
9
|
+
]>> : false;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IsLiteralAbsolutePath } from './isLiteralAbsolutePath';
|
|
2
|
+
import type * as DCommon from '../../common';
|
|
3
|
+
export type RequireLiteralAbsolutePath<GenericValue extends string> = IsLiteralAbsolutePath<GenericValue> extends true ? unknown : DCommon.ComputedTypeError<"Value is not a absolute path.">;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IsLiteralSegmentPath } from './isLiteralSegmentPath';
|
|
2
|
+
import type * as DCommon from '../../common';
|
|
3
|
+
export type RequireLiteralSegmentPath<GenericValue extends string> = IsLiteralSegmentPath<GenericValue> extends true ? unknown : DCommon.ComputedTypeError<"Value is not a segment path.">;
|
package/dist/pattern/index.cjs
CHANGED
|
@@ -12,6 +12,10 @@ const require_matchWithString = require("./matchWithString.cjs");
|
|
|
12
12
|
const require_matchWithNumber = require("./matchWithNumber.cjs");
|
|
13
13
|
const require_matchWithStringOtherwise = require("./matchWithStringOtherwise.cjs");
|
|
14
14
|
const require_matchWithNumberOtherwise = require("./matchWithNumberOtherwise.cjs");
|
|
15
|
+
const require_matchWithTaggedObject = require("./matchWithTaggedObject.cjs");
|
|
16
|
+
const require_matchWithTaggedObjectOtherwise = require("./matchWithTaggedObjectOtherwise.cjs");
|
|
17
|
+
const require_matchWithEntity = require("./matchWithEntity.cjs");
|
|
18
|
+
const require_matchWithEntityOtherwise = require("./matchWithEntityOtherwise.cjs");
|
|
15
19
|
//#region scripts/pattern/index.ts
|
|
16
20
|
var pattern_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
17
21
|
InvalidExhaustivePatternError: () => require_builder.InvalidExhaustivePatternError,
|
|
@@ -20,10 +24,14 @@ var pattern_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
20
24
|
isResult: () => require_result.isResult,
|
|
21
25
|
match: () => require_index.match,
|
|
22
26
|
matchBuilder: () => require_builder.matchBuilder,
|
|
27
|
+
matchWithEntity: () => require_matchWithEntity.matchWithEntity,
|
|
28
|
+
matchWithEntityOtherwise: () => require_matchWithEntityOtherwise.matchWithEntityOtherwise,
|
|
23
29
|
matchWithNumber: () => require_matchWithNumber.matchWithNumber,
|
|
24
30
|
matchWithNumberOtherwise: () => require_matchWithNumberOtherwise.matchWithNumberOtherwise,
|
|
25
31
|
matchWithString: () => require_matchWithString.matchWithString,
|
|
26
32
|
matchWithStringOtherwise: () => require_matchWithStringOtherwise.matchWithStringOtherwise,
|
|
33
|
+
matchWithTaggedObject: () => require_matchWithTaggedObject.matchWithTaggedObject,
|
|
34
|
+
matchWithTaggedObjectOtherwise: () => require_matchWithTaggedObjectOtherwise.matchWithTaggedObjectOtherwise,
|
|
27
35
|
otherwise: () => require_otherwise.otherwise,
|
|
28
36
|
result: () => require_result.result,
|
|
29
37
|
union: () => require_union.union,
|
|
@@ -37,10 +45,14 @@ exports.isMatch = require_isMatch.isMatch;
|
|
|
37
45
|
exports.isResult = require_result.isResult;
|
|
38
46
|
exports.match = require_index.match;
|
|
39
47
|
exports.matchBuilder = require_builder.matchBuilder;
|
|
48
|
+
exports.matchWithEntity = require_matchWithEntity.matchWithEntity;
|
|
49
|
+
exports.matchWithEntityOtherwise = require_matchWithEntityOtherwise.matchWithEntityOtherwise;
|
|
40
50
|
exports.matchWithNumber = require_matchWithNumber.matchWithNumber;
|
|
41
51
|
exports.matchWithNumberOtherwise = require_matchWithNumberOtherwise.matchWithNumberOtherwise;
|
|
42
52
|
exports.matchWithString = require_matchWithString.matchWithString;
|
|
43
53
|
exports.matchWithStringOtherwise = require_matchWithStringOtherwise.matchWithStringOtherwise;
|
|
54
|
+
exports.matchWithTaggedObject = require_matchWithTaggedObject.matchWithTaggedObject;
|
|
55
|
+
exports.matchWithTaggedObjectOtherwise = require_matchWithTaggedObjectOtherwise.matchWithTaggedObjectOtherwise;
|
|
44
56
|
exports.otherwise = require_otherwise.otherwise;
|
|
45
57
|
Object.defineProperty(exports, "pattern_exports", {
|
|
46
58
|
enumerable: true,
|
package/dist/pattern/index.d.ts
CHANGED
|
@@ -11,3 +11,7 @@ export * from './matchWithString';
|
|
|
11
11
|
export * from './matchWithNumber';
|
|
12
12
|
export * from './matchWithStringOtherwise';
|
|
13
13
|
export * from './matchWithNumberOtherwise';
|
|
14
|
+
export * from './matchWithTaggedObject';
|
|
15
|
+
export * from './matchWithTaggedObjectOtherwise';
|
|
16
|
+
export * from './matchWithEntity';
|
|
17
|
+
export * from './matchWithEntityOtherwise';
|
package/dist/pattern/index.mjs
CHANGED
|
@@ -12,6 +12,10 @@ import { matchWithString } from "./matchWithString.mjs";
|
|
|
12
12
|
import { matchWithNumber } from "./matchWithNumber.mjs";
|
|
13
13
|
import { matchWithStringOtherwise } from "./matchWithStringOtherwise.mjs";
|
|
14
14
|
import { matchWithNumberOtherwise } from "./matchWithNumberOtherwise.mjs";
|
|
15
|
+
import { matchWithTaggedObject } from "./matchWithTaggedObject.mjs";
|
|
16
|
+
import { matchWithTaggedObjectOtherwise } from "./matchWithTaggedObjectOtherwise.mjs";
|
|
17
|
+
import { matchWithEntity } from "./matchWithEntity.mjs";
|
|
18
|
+
import { matchWithEntityOtherwise } from "./matchWithEntityOtherwise.mjs";
|
|
15
19
|
//#region scripts/pattern/index.ts
|
|
16
20
|
var pattern_exports = /* @__PURE__ */ __exportAll({
|
|
17
21
|
InvalidExhaustivePatternError: () => InvalidExhaustivePatternError,
|
|
@@ -20,10 +24,14 @@ var pattern_exports = /* @__PURE__ */ __exportAll({
|
|
|
20
24
|
isResult: () => isResult,
|
|
21
25
|
match: () => match,
|
|
22
26
|
matchBuilder: () => matchBuilder,
|
|
27
|
+
matchWithEntity: () => matchWithEntity,
|
|
28
|
+
matchWithEntityOtherwise: () => matchWithEntityOtherwise,
|
|
23
29
|
matchWithNumber: () => matchWithNumber,
|
|
24
30
|
matchWithNumberOtherwise: () => matchWithNumberOtherwise,
|
|
25
31
|
matchWithString: () => matchWithString,
|
|
26
32
|
matchWithStringOtherwise: () => matchWithStringOtherwise,
|
|
33
|
+
matchWithTaggedObject: () => matchWithTaggedObject,
|
|
34
|
+
matchWithTaggedObjectOtherwise: () => matchWithTaggedObjectOtherwise,
|
|
27
35
|
otherwise: () => otherwise,
|
|
28
36
|
result: () => result,
|
|
29
37
|
union: () => union,
|
|
@@ -31,4 +39,4 @@ var pattern_exports = /* @__PURE__ */ __exportAll({
|
|
|
31
39
|
whenNot: () => whenNot
|
|
32
40
|
});
|
|
33
41
|
//#endregion
|
|
34
|
-
export { InvalidExhaustivePatternError, exhaustive, isMatch, isResult, match, matchBuilder, matchWithNumber, matchWithNumberOtherwise, matchWithString, matchWithStringOtherwise, otherwise, pattern_exports, result, union, when, whenNot };
|
|
42
|
+
export { InvalidExhaustivePatternError, exhaustive, isMatch, isResult, match, matchBuilder, matchWithEntity, matchWithEntityOtherwise, matchWithNumber, matchWithNumberOtherwise, matchWithString, matchWithStringOtherwise, matchWithTaggedObject, matchWithTaggedObjectOtherwise, otherwise, pattern_exports, result, union, when, whenNot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_base = require("../modeling/entity/base.cjs");
|
|
2
|
+
//#region scripts/pattern/matchWithEntity.ts
|
|
3
|
+
function matchWithEntity(...args) {
|
|
4
|
+
if (args.length === 1) {
|
|
5
|
+
const [matcher] = args;
|
|
6
|
+
return (input) => matcher[require_base.entityKind.getValue(input)](input);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher] = args;
|
|
9
|
+
return matcher[require_base.entityKind.getValue(input)](input);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.matchWithEntity = matchWithEntity;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as DCommon from '../common';
|
|
2
|
+
import * as DModeling from '../modeling';
|
|
3
|
+
import type * as DObject from '../object';
|
|
4
|
+
import type * as DString from '../string';
|
|
5
|
+
type ComputeMatcher<GenericEntity extends DModeling.Entity> = {
|
|
6
|
+
[Entity in GenericEntity as DModeling.GetEntityName<Entity>]: (value: Entity) => unknown;
|
|
7
|
+
};
|
|
8
|
+
type ForbiddenMoreKey<GenericEntity extends DModeling.Entity, GenericMatcher extends ComputeMatcher<GenericEntity>> = DObject.ForbiddenKey<GenericMatcher, Extract<Exclude<keyof GenericMatcher, DModeling.GetEntityName<GenericEntity>>, string>>;
|
|
9
|
+
type RequireSimpleName<GenericEntity extends DModeling.Entity> = DString.RequireSimpleLiteral<DModeling.GetEntityName<GenericEntity>>;
|
|
10
|
+
export declare function matchWithEntity<GenericEntity extends DModeling.Entity, GenericMatcher extends ComputeMatcher<GenericEntity>>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericEntity>, GenericMatcher> & ForbiddenMoreKey<NoInfer<GenericEntity>, GenericMatcher>)): (input: GenericEntity & RequireSimpleName<GenericEntity>) => ReturnType<Extract<NoInfer<GenericMatcher>[keyof GenericMatcher], DCommon.AnyFunction>>;
|
|
11
|
+
export declare function matchWithEntity<GenericEntity extends DModeling.Entity, GenericMatcher extends ComputeMatcher<GenericEntity>>(input: GenericEntity & RequireSimpleName<GenericEntity>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericEntity>, GenericMatcher> & ForbiddenMoreKey<GenericEntity, GenericMatcher>)): ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { entityKind } from "../modeling/entity/base.mjs";
|
|
2
|
+
//#region scripts/pattern/matchWithEntity.ts
|
|
3
|
+
function matchWithEntity(...args) {
|
|
4
|
+
if (args.length === 1) {
|
|
5
|
+
const [matcher] = args;
|
|
6
|
+
return (input) => matcher[entityKind.getValue(input)](input);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher] = args;
|
|
9
|
+
return matcher[entityKind.getValue(input)](input);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { matchWithEntity };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_base = require("../modeling/entity/base.cjs");
|
|
2
|
+
//#region scripts/pattern/matchWithEntityOtherwise.ts
|
|
3
|
+
function matchWithEntityOtherwise(...args) {
|
|
4
|
+
if (args.length === 2) {
|
|
5
|
+
const [matcher, otherwise] = args;
|
|
6
|
+
return (input) => matchWithEntityOtherwise(input, matcher, otherwise);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher, otherwise] = args;
|
|
9
|
+
const entityName = require_base.entityKind.getValue(input);
|
|
10
|
+
return matcher[entityName] === void 0 ? otherwise(input) : matcher[entityName](input);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.matchWithEntityOtherwise = matchWithEntityOtherwise;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as DCommon from '../common';
|
|
2
|
+
import * as DModeling from '../modeling';
|
|
3
|
+
import type * as DObject from '../object';
|
|
4
|
+
import type * as DString from '../string';
|
|
5
|
+
type ComputeMatcher<GenericEntity extends DModeling.Entity> = {
|
|
6
|
+
[Entity in GenericEntity as DModeling.GetEntityName<Entity>]?: (value: Entity) => unknown;
|
|
7
|
+
};
|
|
8
|
+
type ForbiddenMoreKey<GenericEntity extends DModeling.Entity, GenericMatcher extends ComputeMatcher<GenericEntity>> = DObject.ForbiddenKey<GenericMatcher, Extract<Exclude<keyof GenericMatcher, DModeling.GetEntityName<GenericEntity>>, string>>;
|
|
9
|
+
type HandledKeys<GenericMatcher extends object> = Extract<DObject.GetPropsWithValueExtends<GenericMatcher, DCommon.AnyFunction>, string>;
|
|
10
|
+
type UnhandledEntity<GenericEntity extends DModeling.Entity, GenericMatcher extends object> = Exclude<GenericEntity, DModeling.ExtractByEntityName<GenericEntity, HandledKeys<GenericMatcher>>>;
|
|
11
|
+
type RequireSimpleName<GenericEntity extends DModeling.Entity> = DString.RequireSimpleLiteral<DModeling.GetEntityName<GenericEntity>>;
|
|
12
|
+
export declare function matchWithEntityOtherwise<GenericEntity extends DModeling.Entity, GenericMatcher extends ComputeMatcher<GenericEntity>, GenericOutput>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericEntity>, GenericMatcher> & ForbiddenMoreKey<NoInfer<GenericEntity>, GenericMatcher>), otherwise: (value: UnhandledEntity<GenericEntity, GenericMatcher>) => GenericOutput): (input: GenericEntity & RequireSimpleName<GenericEntity>) => (ReturnType<Extract<NoInfer<GenericMatcher>[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
13
|
+
export declare function matchWithEntityOtherwise<GenericEntity extends DModeling.Entity, GenericMatcher extends ComputeMatcher<GenericEntity>, GenericOutput>(input: GenericEntity & RequireSimpleName<GenericEntity>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericEntity>, GenericMatcher> & ForbiddenMoreKey<GenericEntity, GenericMatcher>), otherwise: (value: UnhandledEntity<GenericEntity, GenericMatcher>) => GenericOutput): (ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { entityKind } from "../modeling/entity/base.mjs";
|
|
2
|
+
//#region scripts/pattern/matchWithEntityOtherwise.ts
|
|
3
|
+
function matchWithEntityOtherwise(...args) {
|
|
4
|
+
if (args.length === 2) {
|
|
5
|
+
const [matcher, otherwise] = args;
|
|
6
|
+
return (input) => matchWithEntityOtherwise(input, matcher, otherwise);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher, otherwise] = args;
|
|
9
|
+
const entityName = entityKind.getValue(input);
|
|
10
|
+
return matcher[entityName] === void 0 ? otherwise(input) : matcher[entityName](input);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { matchWithEntityOtherwise };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as DCommon from '../common';
|
|
2
2
|
import type * as DNumber from '../number/types';
|
|
3
|
-
type ComputeMatcher<GenericInput extends number> = {
|
|
3
|
+
type ComputeMatcher<GenericInput extends number> = DCommon.SimplifyType<{
|
|
4
4
|
[Prop in GenericInput]: (value: Prop) => unknown;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
|
6
6
|
type ForbiddenMoreKey<GenericInput extends number, GenericMatcher extends ComputeMatcher<GenericInput>> = Exclude<keyof GenericMatcher, GenericInput> extends infer InferredKey ? DCommon.IsEqual<InferredKey, never> extends true ? unknown : DCommon.ComputedTypeError<`Key "${Extract<InferredKey, number>}" is forbidden.`> : never;
|
|
7
|
-
export declare function matchWithNumber<GenericInput extends number, GenericMatcher extends ComputeMatcher<
|
|
8
|
-
export declare function matchWithNumber<GenericInput extends number, GenericMatcher extends ComputeMatcher<
|
|
7
|
+
export declare function matchWithNumber<GenericInput extends number, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, number>, GenericMatcher extends ComputeMatcher<GenericClearInput>>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>)): (input: GenericInput & DNumber.RequireSimpleLiteral<GenericClearInput>) => ReturnType<GenericMatcher[keyof GenericMatcher]>;
|
|
8
|
+
export declare function matchWithNumber<GenericInput extends number, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, number>, GenericMatcher extends ComputeMatcher<GenericClearInput>>(input: GenericInput & DNumber.RequireSimpleLiteral<GenericClearInput>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>)): ReturnType<GenericMatcher[keyof GenericMatcher]>;
|
|
9
9
|
export {};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
//#region scripts/pattern/matchWithNumberOtherwise.ts
|
|
2
|
-
function execute(input, matcher, otherwise) {
|
|
3
|
-
const callback = matcher[input];
|
|
4
|
-
return callback === void 0 ? otherwise(input) : callback(input);
|
|
5
|
-
}
|
|
6
2
|
function matchWithNumberOtherwise(...args) {
|
|
7
3
|
if (args.length === 2) {
|
|
8
4
|
const [matcher, otherwise] = args;
|
|
9
|
-
return (input) =>
|
|
5
|
+
return (input) => matchWithNumberOtherwise(input, matcher, otherwise);
|
|
10
6
|
}
|
|
11
7
|
const [input, matcher, otherwise] = args;
|
|
12
|
-
return
|
|
8
|
+
return matcher[input] === void 0 ? otherwise(input) : matcher[input](input);
|
|
13
9
|
}
|
|
14
10
|
//#endregion
|
|
15
11
|
exports.matchWithNumberOtherwise = matchWithNumberOtherwise;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as DCommon from '../common';
|
|
2
2
|
import type * as DNumber from '../number/types';
|
|
3
3
|
import type * as DObject from '../object';
|
|
4
|
-
type ComputeMatcher<GenericInput extends number> = {
|
|
4
|
+
type ComputeMatcher<GenericInput extends number> = DCommon.SimplifyType<{
|
|
5
5
|
[Prop in GenericInput]?: (value: Prop) => unknown;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
7
7
|
type ForbiddenMoreKey<GenericInput extends number, GenericMatcher extends ComputeMatcher<GenericInput>> = Exclude<keyof GenericMatcher, GenericInput> extends infer InferredKey ? DCommon.IsEqual<InferredKey, never> extends true ? unknown : DCommon.ComputedTypeError<`Key "${Extract<InferredKey, number>}" is forbidden.`> : never;
|
|
8
8
|
type HandledKeys<GenericMatcher extends object> = Extract<DObject.GetPropsWithValueExtends<GenericMatcher, DCommon.AnyFunction>, number>;
|
|
9
|
-
export declare function matchWithNumberOtherwise<GenericInput extends number, GenericMatcher extends ComputeMatcher<
|
|
10
|
-
export declare function matchWithNumberOtherwise<GenericInput extends number, GenericMatcher extends ComputeMatcher<
|
|
9
|
+
export declare function matchWithNumberOtherwise<GenericInput extends number, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, number>, GenericMatcher extends ComputeMatcher<GenericClearInput>, GenericOutput extends unknown>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>), otherwise: (value: Exclude<GenericInput, HandledKeys<GenericMatcher>>) => GenericOutput): (input: GenericInput & DNumber.RequireSimpleLiteral<GenericClearInput>) => (ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
10
|
+
export declare function matchWithNumberOtherwise<GenericInput extends number, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, number>, GenericMatcher extends ComputeMatcher<GenericClearInput>, GenericOutput extends unknown>(input: GenericInput & DNumber.RequireSimpleLiteral<GenericClearInput>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>), otherwise: (value: Exclude<GenericInput, HandledKeys<GenericMatcher>>) => GenericOutput): (ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
11
11
|
export {};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
//#region scripts/pattern/matchWithNumberOtherwise.ts
|
|
2
|
-
function execute(input, matcher, otherwise) {
|
|
3
|
-
const callback = matcher[input];
|
|
4
|
-
return callback === void 0 ? otherwise(input) : callback(input);
|
|
5
|
-
}
|
|
6
2
|
function matchWithNumberOtherwise(...args) {
|
|
7
3
|
if (args.length === 2) {
|
|
8
4
|
const [matcher, otherwise] = args;
|
|
9
|
-
return (input) =>
|
|
5
|
+
return (input) => matchWithNumberOtherwise(input, matcher, otherwise);
|
|
10
6
|
}
|
|
11
7
|
const [input, matcher, otherwise] = args;
|
|
12
|
-
return
|
|
8
|
+
return matcher[input] === void 0 ? otherwise(input) : matcher[input](input);
|
|
13
9
|
}
|
|
14
10
|
//#endregion
|
|
15
11
|
export { matchWithNumberOtherwise };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as DCommon from '../common';
|
|
2
2
|
import type * as DObject from '../object';
|
|
3
3
|
import type * as DString from '../string/types';
|
|
4
|
-
type ComputeMatcher<GenericInput extends string> = {
|
|
4
|
+
type ComputeMatcher<GenericInput extends string> = DCommon.SimplifyType<{
|
|
5
5
|
[Prop in GenericInput]: (value: Prop) => unknown;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
7
7
|
type ForbiddenMoreKey<GenericInput extends string, GenericMatcher extends ComputeMatcher<GenericInput>> = DObject.ForbiddenKey<GenericMatcher, Extract<Exclude<keyof GenericMatcher, GenericInput>, string>>;
|
|
8
|
-
export declare function matchWithString<GenericInput extends string, GenericMatcher extends ComputeMatcher<
|
|
9
|
-
export declare function matchWithString<GenericInput extends string, GenericMatcher extends ComputeMatcher<
|
|
8
|
+
export declare function matchWithString<GenericInput extends string, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, string>, GenericMatcher extends ComputeMatcher<GenericClearInput>>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>)): (input: GenericInput & DString.RequireSimpleLiteral<GenericClearInput>) => ReturnType<GenericMatcher[keyof GenericMatcher]>;
|
|
9
|
+
export declare function matchWithString<GenericInput extends string, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, string>, GenericMatcher extends ComputeMatcher<GenericClearInput>>(input: GenericInput & DString.RequireSimpleLiteral<GenericClearInput>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>)): ReturnType<GenericMatcher[keyof GenericMatcher]>;
|
|
10
10
|
export {};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
//#region scripts/pattern/matchWithStringOtherwise.ts
|
|
2
|
-
function execute(input, matcher, otherwise) {
|
|
3
|
-
const callback = matcher[input];
|
|
4
|
-
return callback === void 0 ? otherwise(input) : callback(input);
|
|
5
|
-
}
|
|
6
2
|
function matchWithStringOtherwise(...args) {
|
|
7
3
|
if (args.length === 2) {
|
|
8
4
|
const [matcher, otherwise] = args;
|
|
9
|
-
return (input) =>
|
|
5
|
+
return (input) => matchWithStringOtherwise(input, matcher, otherwise);
|
|
10
6
|
}
|
|
11
7
|
const [input, matcher, otherwise] = args;
|
|
12
|
-
return
|
|
8
|
+
return matcher[input] === void 0 ? otherwise(input) : matcher[input](input);
|
|
13
9
|
}
|
|
14
10
|
//#endregion
|
|
15
11
|
exports.matchWithStringOtherwise = matchWithStringOtherwise;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as DCommon from '../common';
|
|
2
2
|
import type * as DObject from '../object';
|
|
3
|
-
import type * as DString from '../string
|
|
4
|
-
type ComputeMatcher<GenericInput extends string> = {
|
|
3
|
+
import type * as DString from '../string';
|
|
4
|
+
type ComputeMatcher<GenericInput extends string> = DCommon.SimplifyType<{
|
|
5
5
|
[Prop in GenericInput]?: (value: Prop) => unknown;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
7
7
|
type ForbiddenMoreKey<GenericInput extends string, GenericMatcher extends ComputeMatcher<GenericInput>> = DObject.ForbiddenKey<GenericMatcher, Extract<Exclude<keyof GenericMatcher, GenericInput>, string>>;
|
|
8
8
|
type HandledKeys<GenericMatcher extends object> = Extract<DObject.GetPropsWithValueExtends<GenericMatcher, DCommon.AnyFunction>, string>;
|
|
9
|
-
export declare function matchWithStringOtherwise<GenericInput extends string, GenericMatcher extends ComputeMatcher<
|
|
10
|
-
export declare function matchWithStringOtherwise<GenericInput extends string, GenericMatcher extends ComputeMatcher<
|
|
9
|
+
export declare function matchWithStringOtherwise<GenericInput extends string, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, string>, GenericMatcher extends ComputeMatcher<GenericClearInput>, GenericOutput extends unknown>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>), otherwise: (value: Exclude<GenericInput, HandledKeys<GenericMatcher>>) => GenericOutput): (input: GenericInput & DString.RequireSimpleLiteral<GenericClearInput>) => (ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
10
|
+
export declare function matchWithStringOtherwise<GenericInput extends string, GenericClearInput extends Extract<DCommon.RemoveConstraint<GenericInput>, string>, GenericMatcher extends ComputeMatcher<GenericClearInput>, GenericOutput extends unknown>(input: GenericInput & DString.RequireSimpleLiteral<GenericClearInput>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericClearInput>, GenericMatcher> & ForbiddenMoreKey<GenericClearInput, GenericMatcher>), otherwise: (value: Exclude<GenericInput, HandledKeys<GenericMatcher>>) => GenericOutput): (ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
11
11
|
export {};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
//#region scripts/pattern/matchWithStringOtherwise.ts
|
|
2
|
-
function execute(input, matcher, otherwise) {
|
|
3
|
-
const callback = matcher[input];
|
|
4
|
-
return callback === void 0 ? otherwise(input) : callback(input);
|
|
5
|
-
}
|
|
6
2
|
function matchWithStringOtherwise(...args) {
|
|
7
3
|
if (args.length === 2) {
|
|
8
4
|
const [matcher, otherwise] = args;
|
|
9
|
-
return (input) =>
|
|
5
|
+
return (input) => matchWithStringOtherwise(input, matcher, otherwise);
|
|
10
6
|
}
|
|
11
7
|
const [input, matcher, otherwise] = args;
|
|
12
|
-
return
|
|
8
|
+
return matcher[input] === void 0 ? otherwise(input) : matcher[input](input);
|
|
13
9
|
}
|
|
14
10
|
//#endregion
|
|
15
11
|
export { matchWithStringOtherwise };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_helper = require("../modeling/taggedObject/helper.cjs");
|
|
2
|
+
//#region scripts/pattern/matchWithTaggedObject.ts
|
|
3
|
+
function matchWithTaggedObject(...args) {
|
|
4
|
+
if (args.length === 1) {
|
|
5
|
+
const [matcher] = args;
|
|
6
|
+
return (input) => matcher[require_helper.getTagValue(input)](input);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher] = args;
|
|
9
|
+
return matcher[require_helper.getTagValue(input)](input);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.matchWithTaggedObject = matchWithTaggedObject;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as DCommon from '../common';
|
|
2
|
+
import * as DModeling from '../modeling';
|
|
3
|
+
import type * as DObject from '../object';
|
|
4
|
+
import type * as DString from '../string';
|
|
5
|
+
type ComputeMatcher<GenericTaggedObject extends DModeling.ObjectTag> = {
|
|
6
|
+
[TaggedObject in GenericTaggedObject as DModeling.GetTagValue<TaggedObject>]: (value: TaggedObject) => unknown;
|
|
7
|
+
};
|
|
8
|
+
type ForbiddenMoreKey<GenericTaggedObject extends DModeling.ObjectTag, GenericMatcher extends ComputeMatcher<GenericTaggedObject>> = DObject.ForbiddenKey<GenericMatcher, Extract<Exclude<keyof GenericMatcher, DModeling.GetTagValue<GenericTaggedObject>>, string>>;
|
|
9
|
+
type RequireSimpleTag<GenericTaggedObject extends DModeling.ObjectTag> = DString.RequireSimpleLiteral<DModeling.GetTagValue<GenericTaggedObject>>;
|
|
10
|
+
export declare function matchWithTaggedObject<GenericTaggedObject extends DModeling.ObjectTag, GenericMatcher extends ComputeMatcher<GenericTaggedObject>>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericTaggedObject>, GenericMatcher> & ForbiddenMoreKey<NoInfer<GenericTaggedObject>, GenericMatcher>)): (input: GenericTaggedObject & RequireSimpleTag<GenericTaggedObject>) => ReturnType<Extract<NoInfer<GenericMatcher>[keyof GenericMatcher], DCommon.AnyFunction>>;
|
|
11
|
+
export declare function matchWithTaggedObject<GenericTaggedObject extends DModeling.ObjectTag, GenericMatcher extends ComputeMatcher<GenericTaggedObject>>(input: GenericTaggedObject & RequireSimpleTag<GenericTaggedObject>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericTaggedObject>, GenericMatcher> & ForbiddenMoreKey<GenericTaggedObject, GenericMatcher>)): ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getTagValue } from "../modeling/taggedObject/helper.mjs";
|
|
2
|
+
//#region scripts/pattern/matchWithTaggedObject.ts
|
|
3
|
+
function matchWithTaggedObject(...args) {
|
|
4
|
+
if (args.length === 1) {
|
|
5
|
+
const [matcher] = args;
|
|
6
|
+
return (input) => matcher[getTagValue(input)](input);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher] = args;
|
|
9
|
+
return matcher[getTagValue(input)](input);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { matchWithTaggedObject };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_helper = require("../modeling/taggedObject/helper.cjs");
|
|
2
|
+
//#region scripts/pattern/matchWithTaggedObjectOtherwise.ts
|
|
3
|
+
function matchWithTaggedObjectOtherwise(...args) {
|
|
4
|
+
if (args.length === 2) {
|
|
5
|
+
const [matcher, otherwise] = args;
|
|
6
|
+
return (input) => matchWithTaggedObjectOtherwise(input, matcher, otherwise);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher, otherwise] = args;
|
|
9
|
+
const tagValue = require_helper.getTagValue(input);
|
|
10
|
+
return matcher[tagValue] === void 0 ? otherwise(input) : matcher[tagValue](input);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.matchWithTaggedObjectOtherwise = matchWithTaggedObjectOtherwise;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as DCommon from '../common';
|
|
2
|
+
import * as DModeling from '../modeling';
|
|
3
|
+
import type * as DObject from '../object';
|
|
4
|
+
import type * as DString from '../string';
|
|
5
|
+
type ComputeMatcher<GenericTaggedObject extends DModeling.ObjectTag> = {
|
|
6
|
+
[TaggedObject in GenericTaggedObject as DModeling.GetTagValue<TaggedObject>]?: (value: TaggedObject) => unknown;
|
|
7
|
+
};
|
|
8
|
+
type ForbiddenMoreKey<GenericTaggedObject extends DModeling.ObjectTag, GenericMatcher extends ComputeMatcher<GenericTaggedObject>> = DObject.ForbiddenKey<GenericMatcher, Extract<Exclude<keyof GenericMatcher, DModeling.GetTagValue<GenericTaggedObject>>, string>>;
|
|
9
|
+
type HandledKeys<GenericMatcher extends object> = Extract<DObject.GetPropsWithValueExtends<GenericMatcher, DCommon.AnyFunction>, string>;
|
|
10
|
+
type UnhandledTaggedObject<GenericTaggedObject extends DModeling.ObjectTag, GenericMatcher extends object> = Exclude<GenericTaggedObject, DModeling.ObjectTag<HandledKeys<GenericMatcher>>>;
|
|
11
|
+
type RequireLiteralTag<GenericTaggedObject extends DModeling.ObjectTag> = DString.RequireSimpleLiteral<DModeling.GetTagValue<GenericTaggedObject>>;
|
|
12
|
+
export declare function matchWithTaggedObjectOtherwise<GenericTaggedObject extends DModeling.ObjectTag, GenericMatcher extends ComputeMatcher<GenericTaggedObject>, GenericOutput>(matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericTaggedObject>, GenericMatcher> & ForbiddenMoreKey<NoInfer<GenericTaggedObject>, GenericMatcher>), otherwise: (value: UnhandledTaggedObject<GenericTaggedObject, GenericMatcher>) => GenericOutput): (input: GenericTaggedObject & RequireLiteralTag<GenericTaggedObject>) => (ReturnType<Extract<NoInfer<GenericMatcher>[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
13
|
+
export declare function matchWithTaggedObjectOtherwise<GenericTaggedObject extends DModeling.ObjectTag, GenericMatcher extends ComputeMatcher<GenericTaggedObject>, GenericOutput>(input: GenericTaggedObject & RequireLiteralTag<GenericTaggedObject>, matcher: (DCommon.FixDeepFunctionInfer<ComputeMatcher<GenericTaggedObject>, GenericMatcher> & ForbiddenMoreKey<GenericTaggedObject, GenericMatcher>), otherwise: (value: UnhandledTaggedObject<GenericTaggedObject, GenericMatcher>) => GenericOutput): (ReturnType<Extract<GenericMatcher[keyof GenericMatcher], DCommon.AnyFunction>> | GenericOutput);
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getTagValue } from "../modeling/taggedObject/helper.mjs";
|
|
2
|
+
//#region scripts/pattern/matchWithTaggedObjectOtherwise.ts
|
|
3
|
+
function matchWithTaggedObjectOtherwise(...args) {
|
|
4
|
+
if (args.length === 2) {
|
|
5
|
+
const [matcher, otherwise] = args;
|
|
6
|
+
return (input) => matchWithTaggedObjectOtherwise(input, matcher, otherwise);
|
|
7
|
+
}
|
|
8
|
+
const [input, matcher, otherwise] = args;
|
|
9
|
+
const tagValue = getTagValue(input);
|
|
10
|
+
return matcher[tagValue] === void 0 ? otherwise(input) : matcher[tagValue](input);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { matchWithTaggedObjectOtherwise };
|
package/dist/string/at.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { At } from './types';
|
|
2
|
-
export declare function at<GenericString extends string, GenericIndex extends number>(index: GenericIndex): (string: GenericString) => At<GenericString, GenericIndex
|
|
3
|
-
export declare function at<GenericString extends string, GenericIndex extends number>(string: GenericString, index: GenericIndex): At<GenericString, GenericIndex
|
|
2
|
+
export declare function at<GenericString extends string, GenericIndex extends number>(index: GenericIndex): (string: GenericString) => GenericString extends string ? At<GenericString, GenericIndex> : never;
|
|
3
|
+
export declare function at<GenericString extends string, GenericIndex extends number>(string: GenericString, index: GenericIndex): GenericString extends string ? At<GenericString, GenericIndex> : never;
|
|
@@ -2,8 +2,8 @@ import type * as DCommon from '../../common';
|
|
|
2
2
|
import type * as DObject from '../../object';
|
|
3
3
|
export interface CharactersRangeStore {
|
|
4
4
|
}
|
|
5
|
-
export type CharactersRange = Extract<DObject.
|
|
5
|
+
export type CharactersRange = Extract<DObject.GetPropsWithValueExtends<CharactersRangeStore, string>, string>;
|
|
6
6
|
export type AllowedCharactersConstraintName = "string-allowed-characters";
|
|
7
|
-
export interface AllowedCharacters<GenericCharactersRange extends CharactersRange = never> extends DCommon.Constraint<AllowedCharactersConstraintName, Record<GenericCharactersRange,
|
|
7
|
+
export interface AllowedCharacters<GenericCharactersRange extends CharactersRange = never> extends DCommon.Constraint<AllowedCharactersConstraintName, () => Partial<Record<GenericCharactersRange, GenericCharactersRange>>> {
|
|
8
8
|
}
|
|
9
|
-
export type ExtractAllowedCharacters<GenericConstraint extends unknown, GenericDefault extends unknown = never> = GenericConstraint extends AllowedCharacters ? (keyof GenericConstraint[DCommon.ConstraintSymbol][AllowedCharactersConstraintName]) extends infer InferredResult extends CharactersRange ? DCommon.UnionToIntersection<InferredResult extends any ? AllowedCharacters<InferredResult> : never> : GenericDefault : GenericDefault;
|
|
9
|
+
export type ExtractAllowedCharacters<GenericConstraint extends unknown, GenericDefault extends unknown = never> = GenericConstraint extends AllowedCharacters ? (keyof ReturnType<GenericConstraint[DCommon.ConstraintSymbol][AllowedCharactersConstraintName]>) extends infer InferredResult extends CharactersRange ? DCommon.UnionToIntersection<InferredResult extends any ? DCommon.IsNever<InferredResult> extends true ? AllowedCharacters : AllowedCharacters<InferredResult> : never> : GenericDefault : GenericDefault;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type * from './types';
|
|
2
1
|
export type * from './allowedCharacters';
|
|
3
2
|
export type * from './email';
|
|
4
3
|
export type * from './format';
|
|
@@ -6,6 +5,8 @@ export type * from './lengthEqual';
|
|
|
6
5
|
export type * from './maxCharacters';
|
|
7
6
|
export type * from './minCharacters';
|
|
8
7
|
export type * from './notEmpty';
|
|
8
|
+
export type * from './number';
|
|
9
9
|
export type * from './trimmed';
|
|
10
|
+
export type * from './types';
|
|
10
11
|
export type * from './url';
|
|
11
12
|
export type * from './uuid';
|
package/dist/string/first.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { First } from './types';
|
|
2
|
-
export declare function first<GenericString extends string>(string: GenericString): First<GenericString
|
|
2
|
+
export declare function first<GenericString extends string>(string: GenericString): GenericString extends unknown ? First<GenericString> : never;
|
package/dist/string/index.cjs
CHANGED
|
@@ -9,12 +9,12 @@ const require_extractAll = require("./extractAll.cjs");
|
|
|
9
9
|
const require_first = require("./first.cjs");
|
|
10
10
|
const require_includes = require("./includes.cjs");
|
|
11
11
|
const require_indexOf = require("./indexOf.cjs");
|
|
12
|
-
const require_infer = require("./infer.cjs");
|
|
13
12
|
const require_isComposedOf = require("./isComposedOf.cjs");
|
|
14
13
|
const require_isEmail = require("./isEmail.cjs");
|
|
15
14
|
const require_isIn = require("./isIn.cjs");
|
|
16
15
|
const require_isKeyof = require("./isKeyof.cjs");
|
|
17
16
|
const require_isNotEmpty = require("./isNotEmpty.cjs");
|
|
17
|
+
const require_isNumber = require("./isNumber.cjs");
|
|
18
18
|
const require_isUrl = require("./isUrl.cjs");
|
|
19
19
|
const require_isUuid = require("./isUuid.cjs");
|
|
20
20
|
const require_join = require("./join.cjs");
|
|
@@ -48,6 +48,7 @@ const require_toUpperCase = require("./toUpperCase.cjs");
|
|
|
48
48
|
const require_default = require("./trim/default.cjs");
|
|
49
49
|
const require_end = require("./trim/end.cjs");
|
|
50
50
|
const require_start = require("./trim/start.cjs");
|
|
51
|
+
const require_is = require("./trim/is.cjs");
|
|
51
52
|
const require_uncapitalize = require("./uncapitalize.cjs");
|
|
52
53
|
//#region scripts/string/index.ts
|
|
53
54
|
var string_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
@@ -62,12 +63,13 @@ var string_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
62
63
|
first: () => require_first.first,
|
|
63
64
|
includes: () => require_includes.includes,
|
|
64
65
|
indexOf: () => require_indexOf.indexOf,
|
|
65
|
-
infer: () => require_infer.infer,
|
|
66
66
|
isComposedOf: () => require_isComposedOf.isComposedOf,
|
|
67
67
|
isEmail: () => require_isEmail.isEmail,
|
|
68
68
|
isIn: () => require_isIn.isIn,
|
|
69
69
|
isKeyof: () => require_isKeyof.isKeyof,
|
|
70
70
|
isNotEmpty: () => require_isNotEmpty.isNotEmpty,
|
|
71
|
+
isNumber: () => require_isNumber.isNumber,
|
|
72
|
+
isTrimmed: () => require_is.isTrimmed,
|
|
71
73
|
isUrl: () => require_isUrl.isUrl,
|
|
72
74
|
isUuid: () => require_isUuid.isUuid,
|
|
73
75
|
join: () => require_join.join,
|
|
@@ -116,12 +118,13 @@ exports.extractAll = require_extractAll.extractAll;
|
|
|
116
118
|
exports.first = require_first.first;
|
|
117
119
|
exports.includes = require_includes.includes;
|
|
118
120
|
exports.indexOf = require_indexOf.indexOf;
|
|
119
|
-
exports.infer = require_infer.infer;
|
|
120
121
|
exports.isComposedOf = require_isComposedOf.isComposedOf;
|
|
121
122
|
exports.isEmail = require_isEmail.isEmail;
|
|
122
123
|
exports.isIn = require_isIn.isIn;
|
|
123
124
|
exports.isKeyof = require_isKeyof.isKeyof;
|
|
124
125
|
exports.isNotEmpty = require_isNotEmpty.isNotEmpty;
|
|
126
|
+
exports.isNumber = require_isNumber.isNumber;
|
|
127
|
+
exports.isTrimmed = require_is.isTrimmed;
|
|
125
128
|
exports.isUrl = require_isUrl.isUrl;
|
|
126
129
|
exports.isUuid = require_isUuid.isUuid;
|
|
127
130
|
exports.join = require_join.join;
|
package/dist/string/index.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ export * from './extractAll';
|
|
|
9
9
|
export * from './first';
|
|
10
10
|
export * from './includes';
|
|
11
11
|
export * from './indexOf';
|
|
12
|
-
export * from './infer';
|
|
13
12
|
export * from './isComposedOf';
|
|
14
13
|
export * from './isEmail';
|
|
15
14
|
export * from './isIn';
|
|
16
15
|
export * from './isKeyof';
|
|
17
16
|
export * from './isNotEmpty';
|
|
17
|
+
export * from './isNumber';
|
|
18
18
|
export * from './isUrl';
|
|
19
19
|
export * from './isUuid';
|
|
20
20
|
export * from './join';
|