@duplojs/utils 1.1.16 → 1.2.17
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/index.cjs +28 -28
- package/dist/array/index.mjs +14 -14
- package/dist/array/reduce.cjs +0 -2
- package/dist/array/reduce.mjs +0 -2
- package/dist/array/reduceRight.cjs +0 -2
- package/dist/array/reduceRight.mjs +0 -2
- package/dist/array/types/extractTuple.d.ts +1 -1
- package/dist/common/asyncInnerPipe.d.ts +16 -11
- package/dist/common/asyncPipe.d.ts +16 -11
- package/dist/common/builder.cjs +5 -11
- package/dist/common/builder.d.ts +7 -7
- package/dist/common/builder.mjs +4 -10
- package/dist/common/createKindIdentifier.cjs +1 -3
- package/dist/common/createKindIdentifier.mjs +1 -3
- package/dist/common/equal.d.ts +4 -4
- package/dist/common/errorKindNamespace.cjs +9 -0
- package/dist/common/errorKindNamespace.d.ts +1 -0
- package/dist/common/errorKindNamespace.mjs +7 -0
- package/dist/common/forwardLog.cjs +8 -0
- package/dist/common/forwardLog.d.ts +1 -0
- package/dist/common/forwardLog.mjs +6 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/innerPipe.d.ts +16 -11
- package/dist/common/instanceOf.cjs +0 -2
- package/dist/common/instanceOf.mjs +0 -2
- package/dist/common/kind.d.ts +1 -0
- package/dist/common/override.cjs +36 -0
- package/dist/common/override.d.ts +18 -0
- package/dist/common/override.mjs +34 -0
- package/dist/common/pipe.d.ts +16 -11
- package/dist/common/stringToBytes.cjs +4 -9
- package/dist/common/stringToBytes.d.ts +4 -4
- package/dist/common/stringToBytes.mjs +4 -9
- package/dist/common/stringToMillisecond.cjs +4 -9
- package/dist/common/stringToMillisecond.d.ts +4 -4
- package/dist/common/stringToMillisecond.mjs +4 -9
- package/dist/common/types/objectEntry.d.ts +1 -1
- package/dist/dataParser/base.cjs +7 -6
- package/dist/dataParser/base.d.ts +3 -0
- package/dist/dataParser/base.mjs +7 -6
- package/dist/dataParser/baseExtended.cjs +12 -14
- package/dist/dataParser/baseExtended.d.ts +3 -0
- package/dist/dataParser/baseExtended.mjs +12 -14
- package/dist/dataParser/extended/array.cjs +4 -5
- package/dist/dataParser/extended/array.d.ts +3 -0
- package/dist/dataParser/extended/array.mjs +4 -5
- package/dist/dataParser/extended/bigint.cjs +4 -5
- package/dist/dataParser/extended/bigint.d.ts +3 -0
- package/dist/dataParser/extended/bigint.mjs +4 -5
- package/dist/dataParser/extended/boolean.cjs +4 -5
- package/dist/dataParser/extended/boolean.d.ts +3 -0
- package/dist/dataParser/extended/boolean.mjs +4 -5
- package/dist/dataParser/extended/coerce/bigint.cjs +0 -4
- package/dist/dataParser/extended/coerce/bigint.mjs +0 -4
- package/dist/dataParser/extended/coerce/boolean.cjs +0 -4
- package/dist/dataParser/extended/coerce/boolean.mjs +0 -4
- package/dist/dataParser/extended/coerce/date.cjs +12 -0
- package/dist/dataParser/extended/coerce/date.d.ts +7 -0
- package/dist/dataParser/extended/coerce/date.mjs +10 -0
- package/dist/dataParser/extended/coerce/empty.cjs +0 -4
- package/dist/dataParser/extended/coerce/empty.mjs +0 -4
- package/dist/dataParser/extended/coerce/index.cjs +2 -0
- package/dist/dataParser/extended/coerce/index.d.ts +1 -0
- package/dist/dataParser/extended/coerce/index.mjs +1 -0
- package/dist/dataParser/extended/coerce/nil.cjs +0 -4
- package/dist/dataParser/extended/coerce/nil.mjs +0 -4
- package/dist/dataParser/extended/coerce/number.cjs +0 -4
- package/dist/dataParser/extended/coerce/number.mjs +0 -4
- package/dist/dataParser/extended/coerce/string.cjs +0 -4
- package/dist/dataParser/extended/coerce/string.mjs +0 -4
- package/dist/dataParser/extended/date.cjs +13 -0
- package/dist/dataParser/extended/date.d.ts +23 -0
- package/dist/dataParser/extended/date.mjs +11 -0
- package/dist/dataParser/extended/empty.cjs +4 -5
- package/dist/dataParser/extended/empty.d.ts +3 -0
- package/dist/dataParser/extended/empty.mjs +4 -5
- package/dist/dataParser/extended/index.cjs +15 -0
- package/dist/dataParser/extended/index.d.ts +3 -0
- package/dist/dataParser/extended/index.mjs +2 -0
- package/dist/dataParser/extended/lazy.cjs +4 -5
- package/dist/dataParser/extended/lazy.d.ts +3 -0
- package/dist/dataParser/extended/lazy.mjs +4 -5
- package/dist/dataParser/extended/literal.cjs +4 -5
- package/dist/dataParser/extended/literal.d.ts +3 -0
- package/dist/dataParser/extended/literal.mjs +4 -5
- package/dist/dataParser/extended/nil.cjs +4 -5
- package/dist/dataParser/extended/nil.d.ts +3 -0
- package/dist/dataParser/extended/nil.mjs +4 -5
- package/dist/dataParser/extended/nullable.cjs +4 -5
- package/dist/dataParser/extended/nullable.d.ts +3 -0
- package/dist/dataParser/extended/nullable.mjs +4 -5
- package/dist/dataParser/extended/number.cjs +4 -5
- package/dist/dataParser/extended/number.d.ts +3 -0
- package/dist/dataParser/extended/number.mjs +4 -5
- package/dist/dataParser/extended/object.cjs +19 -6
- package/dist/dataParser/extended/object.d.ts +5 -0
- package/dist/dataParser/extended/object.mjs +19 -6
- package/dist/dataParser/extended/optional.cjs +4 -5
- package/dist/dataParser/extended/optional.d.ts +3 -0
- package/dist/dataParser/extended/optional.mjs +4 -5
- package/dist/dataParser/extended/pipe.cjs +4 -5
- package/dist/dataParser/extended/pipe.d.ts +3 -0
- package/dist/dataParser/extended/pipe.mjs +4 -5
- package/dist/dataParser/extended/record.cjs +4 -5
- package/dist/dataParser/extended/record.d.ts +3 -0
- package/dist/dataParser/extended/record.mjs +4 -5
- package/dist/dataParser/extended/recover.cjs +4 -5
- package/dist/dataParser/extended/recover.d.ts +3 -0
- package/dist/dataParser/extended/recover.mjs +4 -5
- package/dist/dataParser/extended/string.cjs +4 -5
- package/dist/dataParser/extended/string.d.ts +3 -0
- package/dist/dataParser/extended/string.mjs +4 -5
- package/dist/dataParser/extended/templateLiteral.cjs +4 -5
- package/dist/dataParser/extended/templateLiteral.d.ts +3 -0
- package/dist/dataParser/extended/templateLiteral.mjs +4 -5
- package/dist/dataParser/extended/transform.cjs +4 -5
- package/dist/dataParser/extended/transform.d.ts +3 -0
- package/dist/dataParser/extended/transform.mjs +4 -5
- package/dist/dataParser/extended/tuple.cjs +6 -7
- package/dist/dataParser/extended/tuple.d.ts +3 -0
- package/dist/dataParser/extended/tuple.mjs +6 -7
- package/dist/dataParser/extended/union.cjs +4 -5
- package/dist/dataParser/extended/union.d.ts +3 -0
- package/dist/dataParser/extended/union.mjs +4 -5
- package/dist/dataParser/extended/unknown.cjs +4 -5
- package/dist/dataParser/extended/unknown.d.ts +3 -0
- package/dist/dataParser/extended/unknown.mjs +4 -5
- package/dist/dataParser/identifier.cjs +0 -2
- package/dist/dataParser/identifier.d.ts +52 -10
- package/dist/dataParser/identifier.mjs +0 -2
- package/dist/dataParser/index.cjs +72 -65
- package/dist/dataParser/index.mjs +21 -18
- package/dist/dataParser/kind.cjs +0 -2
- package/dist/dataParser/kind.mjs +0 -2
- package/dist/dataParser/parsers/array/index.cjs +4 -1
- package/dist/dataParser/parsers/array/index.d.ts +3 -0
- package/dist/dataParser/parsers/array/index.mjs +4 -1
- package/dist/dataParser/parsers/bigint/index.cjs +4 -1
- package/dist/dataParser/parsers/bigint/index.d.ts +3 -0
- package/dist/dataParser/parsers/bigint/index.mjs +4 -1
- package/dist/dataParser/parsers/boolean.cjs +4 -1
- package/dist/dataParser/parsers/boolean.d.ts +3 -0
- package/dist/dataParser/parsers/boolean.mjs +4 -1
- package/dist/dataParser/parsers/coerce/bigint.cjs +0 -4
- package/dist/dataParser/parsers/coerce/bigint.mjs +0 -4
- package/dist/dataParser/parsers/coerce/boolean.cjs +0 -4
- package/dist/dataParser/parsers/coerce/boolean.mjs +0 -4
- package/dist/dataParser/parsers/coerce/date.cjs +12 -0
- package/dist/dataParser/parsers/coerce/date.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/date.mjs +10 -0
- package/dist/dataParser/parsers/coerce/empty.cjs +0 -4
- package/dist/dataParser/parsers/coerce/empty.mjs +0 -4
- package/dist/dataParser/parsers/coerce/index.cjs +2 -0
- package/dist/dataParser/parsers/coerce/index.d.ts +1 -0
- package/dist/dataParser/parsers/coerce/index.mjs +1 -0
- package/dist/dataParser/parsers/coerce/nil.cjs +0 -4
- package/dist/dataParser/parsers/coerce/nil.mjs +0 -4
- package/dist/dataParser/parsers/coerce/number.cjs +0 -4
- package/dist/dataParser/parsers/coerce/number.mjs +0 -4
- package/dist/dataParser/parsers/coerce/string.cjs +0 -4
- package/dist/dataParser/parsers/coerce/string.mjs +0 -4
- package/dist/dataParser/parsers/date.cjs +50 -0
- package/dist/dataParser/parsers/date.d.ts +28 -0
- package/dist/dataParser/parsers/date.mjs +47 -0
- package/dist/dataParser/parsers/empty.cjs +4 -1
- package/dist/dataParser/parsers/empty.d.ts +3 -0
- package/dist/dataParser/parsers/empty.mjs +4 -1
- package/dist/dataParser/parsers/index.d.ts +1 -0
- package/dist/dataParser/parsers/lazy.cjs +5 -4
- package/dist/dataParser/parsers/lazy.d.ts +3 -0
- package/dist/dataParser/parsers/lazy.mjs +5 -4
- package/dist/dataParser/parsers/literal.cjs +5 -4
- package/dist/dataParser/parsers/literal.d.ts +3 -0
- package/dist/dataParser/parsers/literal.mjs +5 -4
- package/dist/dataParser/parsers/nil.cjs +4 -1
- package/dist/dataParser/parsers/nil.d.ts +3 -0
- package/dist/dataParser/parsers/nil.mjs +4 -1
- package/dist/dataParser/parsers/nullable.cjs +4 -1
- package/dist/dataParser/parsers/nullable.d.ts +3 -0
- package/dist/dataParser/parsers/nullable.mjs +4 -1
- package/dist/dataParser/parsers/number/index.cjs +4 -1
- package/dist/dataParser/parsers/number/index.d.ts +3 -0
- package/dist/dataParser/parsers/number/index.mjs +4 -1
- package/dist/dataParser/parsers/{object.cjs → object/index.cjs} +13 -12
- package/dist/dataParser/parsers/{object.d.ts → object/index.d.ts} +16 -12
- package/dist/dataParser/parsers/{object.mjs → object/index.mjs} +13 -12
- package/dist/dataParser/parsers/object/omit.cjs +15 -0
- package/dist/dataParser/parsers/object/omit.d.ts +6 -0
- package/dist/dataParser/parsers/object/omit.mjs +13 -0
- package/dist/dataParser/parsers/object/pick.cjs +15 -0
- package/dist/dataParser/parsers/object/pick.d.ts +6 -0
- package/dist/dataParser/parsers/object/pick.mjs +13 -0
- package/dist/dataParser/parsers/optional.cjs +4 -1
- package/dist/dataParser/parsers/optional.d.ts +3 -0
- package/dist/dataParser/parsers/optional.mjs +4 -1
- package/dist/dataParser/parsers/pipe.cjs +4 -1
- package/dist/dataParser/parsers/pipe.d.ts +3 -0
- package/dist/dataParser/parsers/pipe.mjs +4 -1
- package/dist/dataParser/parsers/record/findRecordRequiredKey.cjs +17 -20
- package/dist/dataParser/parsers/record/findRecordRequiredKey.mjs +17 -20
- package/dist/dataParser/parsers/record/index.cjs +4 -1
- package/dist/dataParser/parsers/record/index.d.ts +3 -0
- package/dist/dataParser/parsers/record/index.mjs +4 -1
- package/dist/dataParser/parsers/recover.cjs +4 -1
- package/dist/dataParser/parsers/recover.d.ts +3 -0
- package/dist/dataParser/parsers/recover.mjs +4 -1
- package/dist/dataParser/parsers/string/index.cjs +4 -1
- package/dist/dataParser/parsers/string/index.d.ts +3 -0
- package/dist/dataParser/parsers/string/index.mjs +4 -1
- package/dist/dataParser/parsers/templateLiteral/createTemplateLiteralPattern.cjs +14 -17
- package/dist/dataParser/parsers/templateLiteral/createTemplateLiteralPattern.mjs +14 -17
- package/dist/dataParser/parsers/templateLiteral/index.cjs +5 -4
- package/dist/dataParser/parsers/templateLiteral/index.d.ts +3 -0
- package/dist/dataParser/parsers/templateLiteral/index.mjs +5 -4
- package/dist/dataParser/parsers/transform.cjs +4 -1
- package/dist/dataParser/parsers/transform.d.ts +3 -0
- package/dist/dataParser/parsers/transform.mjs +4 -1
- package/dist/dataParser/parsers/tuple.cjs +4 -1
- package/dist/dataParser/parsers/tuple.d.ts +3 -0
- package/dist/dataParser/parsers/tuple.mjs +4 -1
- package/dist/dataParser/parsers/union.cjs +4 -1
- package/dist/dataParser/parsers/union.d.ts +3 -0
- package/dist/dataParser/parsers/union.mjs +4 -1
- package/dist/dataParser/parsers/unknown.cjs +4 -1
- package/dist/dataParser/parsers/unknown.d.ts +3 -0
- package/dist/dataParser/parsers/unknown.mjs +4 -1
- package/dist/dataParser/types/dataParsers.d.ts +2 -2
- package/dist/date/closestTo.cjs +32 -0
- package/dist/date/closestTo.d.ts +7 -0
- package/dist/date/closestTo.mjs +30 -0
- package/dist/date/constants.cjs +29 -0
- package/dist/date/constants.d.ts +13 -0
- package/dist/date/constants.mjs +15 -0
- package/dist/date/create.cjs +50 -0
- package/dist/date/create.d.ts +16 -0
- package/dist/date/create.mjs +48 -0
- package/dist/date/createOrThrow.cjs +25 -0
- package/dist/date/createOrThrow.d.ts +10 -0
- package/dist/date/createOrThrow.mjs +22 -0
- package/dist/date/each.cjs +47 -0
- package/dist/date/each.d.ts +5 -0
- package/dist/date/each.mjs +45 -0
- package/dist/date/getters/getDayOfMonth.cjs +17 -0
- package/dist/date/getters/getDayOfMonth.d.ts +2 -0
- package/dist/date/getters/getDayOfMonth.mjs +15 -0
- package/dist/date/getters/getDayOfWeek.cjs +27 -0
- package/dist/date/getters/getDayOfWeek.d.ts +2 -0
- package/dist/date/getters/getDayOfWeek.mjs +25 -0
- package/dist/date/getters/getDayOfYear.cjs +34 -0
- package/dist/date/getters/getDayOfYear.d.ts +2 -0
- package/dist/date/getters/getDayOfYear.mjs +32 -0
- package/dist/date/getters/getFirstDayOfMonth.cjs +14 -0
- package/dist/date/getters/getFirstDayOfMonth.d.ts +2 -0
- package/dist/date/getters/getFirstDayOfMonth.mjs +12 -0
- package/dist/date/getters/getFirstDayOfWeek.cjs +16 -0
- package/dist/date/getters/getFirstDayOfWeek.d.ts +2 -0
- package/dist/date/getters/getFirstDayOfWeek.mjs +14 -0
- package/dist/date/getters/getHour.cjs +18 -0
- package/dist/date/getters/getHour.d.ts +2 -0
- package/dist/date/getters/getHour.mjs +16 -0
- package/dist/date/getters/getLastDayOfMonth.cjs +14 -0
- package/dist/date/getters/getLastDayOfMonth.d.ts +2 -0
- package/dist/date/getters/getLastDayOfMonth.mjs +12 -0
- package/dist/date/getters/getLastDayOfWeek.cjs +16 -0
- package/dist/date/getters/getLastDayOfWeek.d.ts +2 -0
- package/dist/date/getters/getLastDayOfWeek.mjs +14 -0
- package/dist/date/getters/getMilliseconds.cjs +10 -0
- package/dist/date/getters/getMilliseconds.d.ts +2 -0
- package/dist/date/getters/getMilliseconds.mjs +8 -0
- package/dist/date/getters/getMinute.cjs +17 -0
- package/dist/date/getters/getMinute.d.ts +2 -0
- package/dist/date/getters/getMinute.mjs +15 -0
- package/dist/date/getters/getMonth.cjs +17 -0
- package/dist/date/getters/getMonth.d.ts +2 -0
- package/dist/date/getters/getMonth.mjs +15 -0
- package/dist/date/getters/getSecond.cjs +17 -0
- package/dist/date/getters/getSecond.d.ts +2 -0
- package/dist/date/getters/getSecond.mjs +15 -0
- package/dist/date/getters/getWeekOfYear.cjs +37 -0
- package/dist/date/getters/getWeekOfYear.d.ts +2 -0
- package/dist/date/getters/getWeekOfYear.mjs +35 -0
- package/dist/date/getters/getYear.cjs +17 -0
- package/dist/date/getters/getYear.d.ts +2 -0
- package/dist/date/getters/getYear.mjs +15 -0
- package/dist/date/getters/index.d.ts +15 -0
- package/dist/date/index.cjs +121 -0
- package/dist/date/index.d.ts +18 -0
- package/dist/date/index.mjs +51 -0
- package/dist/date/isSafeTimestamp.cjs +15 -0
- package/dist/date/isSafeTimestamp.d.ts +1 -0
- package/dist/date/isSafeTimestamp.mjs +13 -0
- package/dist/date/now.cjs +8 -0
- package/dist/date/now.d.ts +1 -0
- package/dist/date/now.mjs +6 -0
- package/dist/date/operators/addDays.cjs +20 -0
- package/dist/date/operators/addDays.d.ts +4 -0
- package/dist/date/operators/addDays.mjs +18 -0
- package/dist/date/operators/addHours.cjs +20 -0
- package/dist/date/operators/addHours.d.ts +4 -0
- package/dist/date/operators/addHours.mjs +18 -0
- package/dist/date/operators/addMilliseconds.cjs +19 -0
- package/dist/date/operators/addMilliseconds.d.ts +4 -0
- package/dist/date/operators/addMilliseconds.mjs +17 -0
- package/dist/date/operators/addMinutes.cjs +20 -0
- package/dist/date/operators/addMinutes.d.ts +4 -0
- package/dist/date/operators/addMinutes.mjs +18 -0
- package/dist/date/operators/addMonths.cjs +19 -0
- package/dist/date/operators/addMonths.d.ts +4 -0
- package/dist/date/operators/addMonths.mjs +17 -0
- package/dist/date/operators/addSeconds.cjs +20 -0
- package/dist/date/operators/addSeconds.d.ts +4 -0
- package/dist/date/operators/addSeconds.mjs +18 -0
- package/dist/date/operators/addWeeks.cjs +20 -0
- package/dist/date/operators/addWeeks.d.ts +4 -0
- package/dist/date/operators/addWeeks.mjs +18 -0
- package/dist/date/operators/addYears.cjs +19 -0
- package/dist/date/operators/addYears.d.ts +4 -0
- package/dist/date/operators/addYears.mjs +17 -0
- package/dist/date/operators/between.cjs +17 -0
- package/dist/date/operators/between.d.ts +3 -0
- package/dist/date/operators/between.mjs +15 -0
- package/dist/date/operators/betweenThan.cjs +17 -0
- package/dist/date/operators/betweenThan.d.ts +3 -0
- package/dist/date/operators/betweenThan.mjs +15 -0
- package/dist/date/operators/greater.cjs +16 -0
- package/dist/date/operators/greater.d.ts +3 -0
- package/dist/date/operators/greater.mjs +14 -0
- package/dist/date/operators/greaterThan.cjs +16 -0
- package/dist/date/operators/greaterThan.d.ts +3 -0
- package/dist/date/operators/greaterThan.mjs +14 -0
- package/dist/date/operators/index.d.ts +22 -0
- package/dist/date/operators/less.cjs +16 -0
- package/dist/date/operators/less.d.ts +3 -0
- package/dist/date/operators/less.mjs +14 -0
- package/dist/date/operators/lessThan.cjs +16 -0
- package/dist/date/operators/lessThan.d.ts +3 -0
- package/dist/date/operators/lessThan.mjs +14 -0
- package/dist/date/operators/subtractDays.cjs +20 -0
- package/dist/date/operators/subtractDays.d.ts +4 -0
- package/dist/date/operators/subtractDays.mjs +18 -0
- package/dist/date/operators/subtractHours.cjs +20 -0
- package/dist/date/operators/subtractHours.d.ts +4 -0
- package/dist/date/operators/subtractHours.mjs +18 -0
- package/dist/date/operators/subtractMilliseconds.cjs +19 -0
- package/dist/date/operators/subtractMilliseconds.d.ts +4 -0
- package/dist/date/operators/subtractMilliseconds.mjs +17 -0
- package/dist/date/operators/subtractMinutes.cjs +20 -0
- package/dist/date/operators/subtractMinutes.d.ts +4 -0
- package/dist/date/operators/subtractMinutes.mjs +18 -0
- package/dist/date/operators/subtractMonths.cjs +19 -0
- package/dist/date/operators/subtractMonths.d.ts +4 -0
- package/dist/date/operators/subtractMonths.mjs +17 -0
- package/dist/date/operators/subtractSeconds.cjs +20 -0
- package/dist/date/operators/subtractSeconds.d.ts +4 -0
- package/dist/date/operators/subtractSeconds.mjs +18 -0
- package/dist/date/operators/subtractWeeks.cjs +20 -0
- package/dist/date/operators/subtractWeeks.d.ts +4 -0
- package/dist/date/operators/subtractWeeks.mjs +18 -0
- package/dist/date/operators/subtractYears.cjs +19 -0
- package/dist/date/operators/subtractYears.d.ts +4 -0
- package/dist/date/operators/subtractYears.mjs +17 -0
- package/dist/date/round.cjs +23 -0
- package/dist/date/round.d.ts +3 -0
- package/dist/date/round.mjs +21 -0
- package/dist/date/toISOString.cjs +10 -0
- package/dist/date/toISOString.d.ts +2 -0
- package/dist/date/toISOString.mjs +8 -0
- package/dist/date/toNative.cjs +10 -0
- package/dist/date/toNative.d.ts +2 -0
- package/dist/date/toNative.mjs +8 -0
- package/dist/date/toTimestamp.cjs +31 -0
- package/dist/date/toTimestamp.d.ts +10 -0
- package/dist/date/toTimestamp.mjs +28 -0
- package/dist/date/today.cjs +8 -0
- package/dist/date/today.d.ts +1 -0
- package/dist/date/today.mjs +6 -0
- package/dist/date/tomorrow.cjs +10 -0
- package/dist/date/tomorrow.d.ts +1 -0
- package/dist/date/tomorrow.mjs +8 -0
- package/dist/date/types/index.d.ts +6 -0
- package/dist/date/types/isLeapYear.d.ts +8 -0
- package/dist/date/types/month.d.ts +9 -0
- package/dist/date/types/theDate.d.ts +1 -0
- package/dist/date/types/time.d.ts +5 -0
- package/dist/date/types/timezone.cjs +606 -0
- package/dist/date/types/timezone.d.ts +604 -0
- package/dist/date/types/timezone.mjs +604 -0
- package/dist/date/types/unit.d.ts +1 -0
- package/dist/date/yesterday.cjs +10 -0
- package/dist/date/yesterday.d.ts +1 -0
- package/dist/date/yesterday.mjs +8 -0
- package/dist/either/bool/falsy.cjs +2 -4
- package/dist/either/bool/falsy.mjs +2 -4
- package/dist/either/bool/truthy.cjs +4 -6
- package/dist/either/bool/truthy.mjs +4 -6
- package/dist/either/future/create.cjs +0 -2
- package/dist/either/future/create.mjs +0 -2
- package/dist/either/future/error.cjs +2 -4
- package/dist/either/future/error.mjs +2 -4
- package/dist/either/future/success.cjs +0 -2
- package/dist/either/future/success.mjs +0 -2
- package/dist/either/index.cjs +7 -7
- package/dist/either/index.mjs +3 -3
- package/dist/either/kind.cjs +0 -2
- package/dist/either/kind.mjs +0 -2
- package/dist/either/left/when.cjs +1 -3
- package/dist/either/left/when.mjs +1 -3
- package/dist/either/nullable/empty.cjs +3 -5
- package/dist/either/nullable/empty.mjs +3 -5
- package/dist/either/nullable/filled.cjs +4 -6
- package/dist/either/nullable/filled.mjs +4 -6
- package/dist/either/nullish/empty.cjs +3 -5
- package/dist/either/nullish/empty.mjs +3 -5
- package/dist/either/nullish/filled.cjs +3 -5
- package/dist/either/nullish/filled.mjs +3 -5
- package/dist/either/optional/empty.cjs +0 -2
- package/dist/either/optional/empty.mjs +0 -2
- package/dist/either/optional/filled.cjs +4 -6
- package/dist/either/optional/filled.mjs +4 -6
- package/dist/either/right/asyncPipe.cjs +2 -4
- package/dist/either/right/asyncPipe.d.ts +5 -0
- package/dist/either/right/asyncPipe.mjs +2 -4
- package/dist/either/right/pipe.cjs +1 -3
- package/dist/either/right/pipe.d.ts +5 -0
- package/dist/either/right/pipe.mjs +1 -3
- package/dist/either/right/when.cjs +1 -3
- package/dist/either/right/when.mjs +1 -3
- package/dist/either/whenHasInformation.cjs +1 -3
- package/dist/either/whenHasInformation.mjs +1 -3
- package/dist/generator/asyncReduce.cjs +0 -2
- package/dist/generator/asyncReduce.mjs +0 -2
- package/dist/generator/reduce.cjs +0 -2
- package/dist/generator/reduce.mjs +0 -2
- package/dist/index.cjs +39 -30
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +36 -30
- package/dist/number/between.cjs +12 -0
- package/dist/number/between.d.ts +2 -0
- package/dist/number/between.mjs +10 -0
- package/dist/number/betweenThan.cjs +12 -0
- package/dist/number/betweenThan.d.ts +2 -0
- package/dist/number/betweenThan.mjs +10 -0
- package/dist/number/index.cjs +4 -0
- package/dist/number/index.d.ts +3 -0
- package/dist/number/index.mjs +2 -0
- package/dist/number/types/index.d.ts +1 -0
- package/dist/number/types/positiveNumber.d.ts +1 -0
- package/dist/object/deepDiscriminate.cjs +1 -3
- package/dist/object/deepDiscriminate.mjs +1 -3
- package/dist/object/discriminate.cjs +0 -2
- package/dist/object/discriminate.mjs +0 -2
- package/dist/object/entries.cjs +1 -3
- package/dist/object/entries.mjs +1 -3
- package/dist/object/entry.d.ts +2 -2
- package/dist/object/fromEntries.d.ts +5 -3
- package/dist/object/keys.cjs +1 -3
- package/dist/object/keys.mjs +1 -3
- package/dist/object/values.cjs +1 -3
- package/dist/object/values.mjs +1 -3
- package/dist/pattern/exhaustive.cjs +0 -2
- package/dist/pattern/exhaustive.mjs +0 -2
- package/dist/pattern/index.cjs +7 -4
- package/dist/pattern/index.mjs +3 -2
- package/dist/pattern/match/builder.cjs +56 -0
- package/dist/pattern/match/builder.d.ts +30 -0
- package/dist/pattern/match/builder.mjs +53 -0
- package/dist/pattern/match/index.cjs +28 -0
- package/dist/pattern/{match.d.ts → match/index.d.ts} +7 -4
- package/dist/pattern/match/index.mjs +25 -0
- package/dist/pattern/otherwise.cjs +1 -3
- package/dist/pattern/otherwise.mjs +1 -3
- package/dist/pattern/result.cjs +0 -2
- package/dist/pattern/result.mjs +0 -2
- package/dist/pattern/types/complexUnMatchedValue/array.d.ts +1 -1
- package/dist/string/index.cjs +12 -12
- package/dist/string/index.mjs +6 -6
- package/dist/string/replace.cjs +15 -0
- package/dist/string/replace.d.ts +10 -2
- package/dist/string/replace.mjs +15 -0
- package/package.json +7 -1
- package/dist/pattern/match.cjs +0 -18
- package/dist/pattern/match.mjs +0 -16
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isResult, result } from '../result.mjs';
|
|
2
|
+
import { isMatch } from '../isMatch.mjs';
|
|
3
|
+
import { matchBuilder } from './builder.mjs';
|
|
4
|
+
export { InvalidExhaustivePatternError } from './builder.mjs';
|
|
5
|
+
|
|
6
|
+
function match(...args) {
|
|
7
|
+
if (args.length === 1) {
|
|
8
|
+
const [input] = args;
|
|
9
|
+
return matchBuilder.use({
|
|
10
|
+
input,
|
|
11
|
+
matchers: [],
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
if (args.length === 2) {
|
|
15
|
+
const [pattern, theFunction] = args;
|
|
16
|
+
return (input) => match(input, pattern, theFunction);
|
|
17
|
+
}
|
|
18
|
+
const [input, pattern, theFunction] = args;
|
|
19
|
+
if (!isResult(input) && isMatch(input, pattern)) {
|
|
20
|
+
return result(theFunction(input));
|
|
21
|
+
}
|
|
22
|
+
return input;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { match, matchBuilder };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var unwrap = require('../common/unwrap.cjs');
|
|
4
|
-
require('../common/globalStore.cjs');
|
|
5
|
-
require('../common/builder.cjs');
|
|
6
3
|
var result = require('./result.cjs');
|
|
4
|
+
var unwrap = require('../common/unwrap.cjs');
|
|
7
5
|
|
|
8
6
|
function otherwise(...args) {
|
|
9
7
|
if (args.length === 1) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { unwrap } from '../common/unwrap.mjs';
|
|
2
|
-
import '../common/globalStore.mjs';
|
|
3
|
-
import '../common/builder.mjs';
|
|
4
1
|
import { isResult } from './result.mjs';
|
|
2
|
+
import { unwrap } from '../common/unwrap.mjs';
|
|
5
3
|
|
|
6
4
|
function otherwise(...args) {
|
|
7
5
|
if (args.length === 1) {
|
package/dist/pattern/result.cjs
CHANGED
package/dist/pattern/result.mjs
CHANGED
|
@@ -19,7 +19,7 @@ type ComplexUnMatchedTupleTuple<GenericInput extends unknown, GenericPatternValu
|
|
|
19
19
|
] extends [
|
|
20
20
|
readonly [infer InferredInputFirst, ...infer InferredInputRest],
|
|
21
21
|
readonly [infer InferredPatternValueFirst, ...infer InferredPatternValueRest]
|
|
22
|
-
] ? Extract<ComplexUnMatchedValue<InferredInputFirst, InferredPatternValueFirst>, any> extends infer InferredResultFirst ? InferredPatternValueRest extends readonly [] ? IsEqual<InferredResultFirst, never> extends true ? never : [InferredResultFirst, ...InferredInputRest] : ComplexUnMatchedValue<InferredInputRest, InferredPatternValueRest> extends infer InferredResultRest ? [
|
|
22
|
+
] ? Extract<ComplexUnMatchedValue<InferredInputFirst, InferredPatternValueFirst>, any> extends infer InferredResultFirst ? InferredPatternValueRest extends readonly [] ? IsEqual<InferredResultFirst, never> extends true ? never : [InferredResultFirst, ...InferredInputRest] : ComplexUnMatchedValue<InferredInputRest, InferredPatternValueRest> extends infer InferredResultRest ? IsEqual<InferredResultRest, never> extends true ? never : [
|
|
23
23
|
IsEqual<InferredResultFirst, never> extends true ? InferredInputFirst : InferredResultFirst,
|
|
24
24
|
...Adaptor<IsEqual<InferredResultRest, never> extends true ? InferredPatternValueRest : InferredResultRest, readonly any[]>
|
|
25
25
|
] : never : never : never : never);
|
package/dist/string/index.cjs
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var isKeyof = require('./isKeyof.cjs');
|
|
4
|
-
var _default = require('./at/default.cjs');
|
|
5
|
-
var first = require('./at/first.cjs');
|
|
6
|
-
var last = require('./at/last.cjs');
|
|
7
4
|
var split = require('./split.cjs');
|
|
8
5
|
var charAt = require('./charAt.cjs');
|
|
9
6
|
var toUpperCase = require('./toUpperCase.cjs');
|
|
10
7
|
var toLowerCase = require('./toLowerCase.cjs');
|
|
11
|
-
var _default$1 = require('./trim/default.cjs');
|
|
12
|
-
var end = require('./trim/end.cjs');
|
|
13
|
-
var start = require('./trim/start.cjs');
|
|
14
8
|
var capitalize = require('./capitalize.cjs');
|
|
15
9
|
var uncapitalize = require('./uncapitalize.cjs');
|
|
16
10
|
var substring = require('./substring.cjs');
|
|
@@ -33,20 +27,20 @@ var normalize = require('./normalize.cjs');
|
|
|
33
27
|
var test = require('./test.cjs');
|
|
34
28
|
var isIn = require('./isIn.cjs');
|
|
35
29
|
var length = require('./length.cjs');
|
|
30
|
+
var _default = require('./at/default.cjs');
|
|
31
|
+
var first = require('./at/first.cjs');
|
|
32
|
+
var last = require('./at/last.cjs');
|
|
33
|
+
var _default$1 = require('./trim/default.cjs');
|
|
34
|
+
var end = require('./trim/end.cjs');
|
|
35
|
+
var start = require('./trim/start.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
exports.isKeyof = isKeyof.isKeyof;
|
|
40
|
-
exports.at = _default.at;
|
|
41
|
-
exports.first = first.first;
|
|
42
|
-
exports.last = last.last;
|
|
43
40
|
exports.split = split.split;
|
|
44
41
|
exports.charAt = charAt.charAt;
|
|
45
42
|
exports.toUpperCase = toUpperCase.toUpperCase;
|
|
46
43
|
exports.toLowerCase = toLowerCase.toLowerCase;
|
|
47
|
-
exports.trim = _default$1.trim;
|
|
48
|
-
exports.trimEnd = end.trimEnd;
|
|
49
|
-
exports.trimStart = start.trimStart;
|
|
50
44
|
exports.capitalize = capitalize.capitalize;
|
|
51
45
|
exports.uncapitalize = uncapitalize.uncapitalize;
|
|
52
46
|
exports.substring = substring.substring;
|
|
@@ -69,3 +63,9 @@ exports.normalize = normalize.normalize;
|
|
|
69
63
|
exports.test = test.test;
|
|
70
64
|
exports.isIn = isIn.isIn;
|
|
71
65
|
exports.length = length.length;
|
|
66
|
+
exports.at = _default.at;
|
|
67
|
+
exports.first = first.first;
|
|
68
|
+
exports.last = last.last;
|
|
69
|
+
exports.trim = _default$1.trim;
|
|
70
|
+
exports.trimEnd = end.trimEnd;
|
|
71
|
+
exports.trimStart = start.trimStart;
|
package/dist/string/index.mjs
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
export { isKeyof } from './isKeyof.mjs';
|
|
2
|
-
export { at } from './at/default.mjs';
|
|
3
|
-
export { first } from './at/first.mjs';
|
|
4
|
-
export { last } from './at/last.mjs';
|
|
5
2
|
export { split } from './split.mjs';
|
|
6
3
|
export { charAt } from './charAt.mjs';
|
|
7
4
|
export { toUpperCase } from './toUpperCase.mjs';
|
|
8
5
|
export { toLowerCase } from './toLowerCase.mjs';
|
|
9
|
-
export { trim } from './trim/default.mjs';
|
|
10
|
-
export { trimEnd } from './trim/end.mjs';
|
|
11
|
-
export { trimStart } from './trim/start.mjs';
|
|
12
6
|
export { capitalize } from './capitalize.mjs';
|
|
13
7
|
export { uncapitalize } from './uncapitalize.mjs';
|
|
14
8
|
export { substring } from './substring.mjs';
|
|
@@ -31,3 +25,9 @@ export { normalize } from './normalize.mjs';
|
|
|
31
25
|
export { test } from './test.mjs';
|
|
32
26
|
export { isIn } from './isIn.mjs';
|
|
33
27
|
export { length } from './length.mjs';
|
|
28
|
+
export { at } from './at/default.mjs';
|
|
29
|
+
export { first } from './at/first.mjs';
|
|
30
|
+
export { last } from './at/last.mjs';
|
|
31
|
+
export { trim } from './trim/default.mjs';
|
|
32
|
+
export { trimEnd } from './trim/end.mjs';
|
|
33
|
+
export { trimStart } from './trim/start.mjs';
|
package/dist/string/replace.cjs
CHANGED
|
@@ -6,6 +6,21 @@ function replace(...args) {
|
|
|
6
6
|
return (input) => replace(input, pattern, replacement);
|
|
7
7
|
}
|
|
8
8
|
const [input, pattern, replacement] = args;
|
|
9
|
+
if (typeof replacement === "function") {
|
|
10
|
+
return input.replace(pattern, (matchedValue, ...argsRest) => {
|
|
11
|
+
const namedGroups = typeof argsRest[argsRest.length - 1] === "object"
|
|
12
|
+
? argsRest.pop()
|
|
13
|
+
: undefined;
|
|
14
|
+
const [offset, self] = argsRest.splice(-2, 2);
|
|
15
|
+
return replacement({
|
|
16
|
+
matchedValue,
|
|
17
|
+
namedGroups,
|
|
18
|
+
offset,
|
|
19
|
+
self,
|
|
20
|
+
groups: argsRest,
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
9
24
|
return input.replace(pattern, replacement);
|
|
10
25
|
}
|
|
11
26
|
|
package/dist/string/replace.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export interface StringReplacerParams {
|
|
2
|
+
matchedValue: string;
|
|
3
|
+
groups: string[];
|
|
4
|
+
namedGroups?: Record<string, string>;
|
|
5
|
+
offset: number;
|
|
6
|
+
self: string;
|
|
7
|
+
}
|
|
8
|
+
export type StringReplacer = (params: StringReplacerParams) => string;
|
|
9
|
+
export declare function replace<GenericInput extends string>(pattern: string | RegExp, replacement: string | StringReplacer): (input: GenericInput) => string;
|
|
10
|
+
export declare function replace<GenericInput extends string>(input: GenericInput, pattern: string | RegExp, replacement: string | StringReplacer): string;
|
package/dist/string/replace.mjs
CHANGED
|
@@ -4,6 +4,21 @@ function replace(...args) {
|
|
|
4
4
|
return (input) => replace(input, pattern, replacement);
|
|
5
5
|
}
|
|
6
6
|
const [input, pattern, replacement] = args;
|
|
7
|
+
if (typeof replacement === "function") {
|
|
8
|
+
return input.replace(pattern, (matchedValue, ...argsRest) => {
|
|
9
|
+
const namedGroups = typeof argsRest[argsRest.length - 1] === "object"
|
|
10
|
+
? argsRest.pop()
|
|
11
|
+
: undefined;
|
|
12
|
+
const [offset, self] = argsRest.splice(-2, 2);
|
|
13
|
+
return replacement({
|
|
14
|
+
matchedValue,
|
|
15
|
+
namedGroups,
|
|
16
|
+
offset,
|
|
17
|
+
self,
|
|
18
|
+
groups: argsRest,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
7
22
|
return input.replace(pattern, replacement);
|
|
8
23
|
}
|
|
9
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duplojs/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.17",
|
|
4
4
|
"author": "mathcovax",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"test:lint:fix": "eslint --fix",
|
|
20
20
|
"prepare": "husky"
|
|
21
21
|
},
|
|
22
|
+
"sideEffects": false,
|
|
22
23
|
"types": "./dist/index.d.ts",
|
|
23
24
|
"exports": {
|
|
24
25
|
".": {
|
|
@@ -80,6 +81,11 @@
|
|
|
80
81
|
"import": "./dist/string/index.mjs",
|
|
81
82
|
"require": "./dist/string/index.cjs",
|
|
82
83
|
"types": "./dist/string/index.d.ts"
|
|
84
|
+
},
|
|
85
|
+
"./date": {
|
|
86
|
+
"import": "./dist/date/index.mjs",
|
|
87
|
+
"require": "./dist/date/index.cjs",
|
|
88
|
+
"types": "./dist/date/index.d.ts"
|
|
83
89
|
}
|
|
84
90
|
},
|
|
85
91
|
"files": [
|
package/dist/pattern/match.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var result = require('./result.cjs');
|
|
4
|
-
var isMatch = require('./isMatch.cjs');
|
|
5
|
-
|
|
6
|
-
function match(...args) {
|
|
7
|
-
if (args.length === 2) {
|
|
8
|
-
const [pattern, theFunction] = args;
|
|
9
|
-
return (input) => match(input, pattern, theFunction);
|
|
10
|
-
}
|
|
11
|
-
const [input, pattern, theFunction] = args;
|
|
12
|
-
if (!result.isResult(input) && isMatch.isMatch(input, pattern)) {
|
|
13
|
-
return result.result(theFunction(input));
|
|
14
|
-
}
|
|
15
|
-
return input;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
exports.match = match;
|
package/dist/pattern/match.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { isResult, result } from './result.mjs';
|
|
2
|
-
import { isMatch } from './isMatch.mjs';
|
|
3
|
-
|
|
4
|
-
function match(...args) {
|
|
5
|
-
if (args.length === 2) {
|
|
6
|
-
const [pattern, theFunction] = args;
|
|
7
|
-
return (input) => match(input, pattern, theFunction);
|
|
8
|
-
}
|
|
9
|
-
const [input, pattern, theFunction] = args;
|
|
10
|
-
if (!isResult(input) && isMatch(input, pattern)) {
|
|
11
|
-
return result(theFunction(input));
|
|
12
|
-
}
|
|
13
|
-
return input;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { match };
|