type-plus 3.12.2 → 3.15.0
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/README.md +36 -37
- package/cjs/ComposableTypes.d.ts +8 -0
- package/cjs/ComposableTypes.js +3 -0
- package/cjs/ComposableTypes.js.map +1 -0
- package/{lib → cjs}/JSONTypes.d.ts +0 -0
- package/cjs/JSONTypes.js +27 -0
- package/cjs/JSONTypes.js.map +1 -0
- package/{lib → cjs}/PrimitiveTypes.d.ts +0 -0
- package/{lib → cjs}/PrimitiveTypes.js +0 -0
- package/cjs/PrimitiveTypes.js.map +1 -0
- package/{lib → cjs}/UnionKeys.d.ts +0 -0
- package/{lib → cjs}/UnionKeys.js +0 -0
- package/cjs/UnionKeys.js.map +1 -0
- package/{lib → cjs}/array/CommonPropKeys.d.ts +0 -0
- package/{lib → cjs}/array/CommonPropKeys.js +0 -0
- package/cjs/array/CommonPropKeys.js.map +1 -0
- package/{lib → cjs}/array/Concat.d.ts +0 -0
- package/{lib → cjs}/array/Concat.js +0 -0
- package/cjs/array/Concat.js.map +1 -0
- package/{lib → cjs}/array/CreateTuple.d.ts +0 -0
- package/{lib → cjs}/array/CreateTuple.js +0 -0
- package/cjs/array/CreateTuple.js.map +1 -0
- package/{lib → cjs}/array/DropFirst.d.ts +0 -0
- package/{lib → cjs}/array/DropFirst.js +0 -0
- package/cjs/array/DropFirst.js.map +1 -0
- package/{lib → cjs}/array/DropLast.d.ts +0 -0
- package/{lib → cjs}/array/DropLast.js +0 -0
- package/cjs/array/DropLast.js.map +1 -0
- package/{lib → cjs}/array/Filter.d.ts +0 -0
- package/{lib → cjs}/array/Filter.js +0 -0
- package/cjs/array/Filter.js.map +1 -0
- package/{lib → cjs}/array/FindFirst.d.ts +0 -0
- package/{lib → cjs}/array/FindFirst.js +0 -0
- package/cjs/array/FindFirst.js.map +1 -0
- package/{lib → cjs}/array/FindLast.d.ts +0 -0
- package/{lib → cjs}/array/FindLast.js +0 -0
- package/cjs/array/FindLast.js.map +1 -0
- package/{lib → cjs}/array/Head.d.ts +0 -0
- package/{lib → cjs}/array/Head.js +0 -0
- package/cjs/array/Head.js.map +1 -0
- package/{lib → cjs}/array/IntersectOfProps.d.ts +0 -0
- package/{lib → cjs}/array/IntersectOfProps.js +0 -0
- package/cjs/array/IntersectOfProps.js.map +1 -0
- package/{lib → cjs}/array/IsArray.d.ts +0 -0
- package/{lib → cjs}/array/IsArray.js +0 -0
- package/cjs/array/IsArray.js.map +1 -0
- package/{lib → cjs}/array/PadLeft.d.ts +0 -0
- package/{lib → cjs}/array/PadLeft.js +0 -0
- package/cjs/array/PadLeft.js.map +1 -0
- package/{lib → cjs}/array/Reverse.d.ts +0 -0
- package/{lib → cjs}/array/Reverse.js +0 -0
- package/cjs/array/Reverse.js.map +1 -0
- package/{lib → cjs}/array/Some.d.ts +0 -0
- package/{lib → cjs}/array/Some.js +0 -0
- package/cjs/array/Some.js.map +1 -0
- package/{lib → cjs}/array/Tail.d.ts +0 -0
- package/{lib → cjs}/array/Tail.js +0 -0
- package/cjs/array/Tail.js.map +1 -0
- package/{lib → cjs}/array/UnionOfProps.d.ts +0 -0
- package/{lib → cjs}/array/UnionOfProps.js +0 -0
- package/cjs/array/UnionOfProps.js.map +1 -0
- package/{lib → cjs}/array/UnionOfValues.d.ts +0 -0
- package/{lib → cjs}/array/UnionOfValues.js +0 -0
- package/cjs/array/UnionOfValues.js.map +1 -0
- package/{lib → cjs}/array/index.d.ts +0 -0
- package/{lib → cjs}/array/index.js +0 -0
- package/cjs/array/index.js.map +1 -0
- package/{lib → cjs}/array/literalArray.d.ts +0 -0
- package/{lib → cjs}/array/literalArray.js +0 -0
- package/cjs/array/literalArray.js.map +1 -0
- package/{lib → cjs}/array/reduceWhile.d.ts +0 -0
- package/{lib → cjs}/array/reduceWhile.js +0 -0
- package/cjs/array/reduceWhile.js.map +1 -0
- package/cjs/assertion/assertType.d.ts +32 -0
- package/cjs/assertion/assertType.js +107 -0
- package/cjs/assertion/assertType.js.map +1 -0
- package/{lib → cjs}/assertion/index.d.ts +0 -0
- package/{lib → cjs}/assertion/index.js +0 -0
- package/cjs/assertion/index.js.map +1 -0
- package/{lib → cjs}/class/AnyConstructor.d.ts +0 -0
- package/{lib → cjs}/class/AnyConstructor.js +0 -0
- package/cjs/class/AnyConstructor.js.map +1 -0
- package/{lib → cjs}/class/index.d.ts +0 -0
- package/{lib → cjs}/class/index.js +0 -0
- package/cjs/class/index.js.map +1 -0
- package/{lib → cjs}/class/isConstructor.d.ts +0 -0
- package/cjs/class/isConstructor.js +17 -0
- package/cjs/class/isConstructor.js.map +1 -0
- package/{lib → cjs}/function/AnyFunction.d.ts +0 -0
- package/{lib → cjs}/function/AnyFunction.js +0 -0
- package/cjs/function/AnyFunction.js.map +1 -0
- package/{lib → cjs}/function/index.d.ts +0 -0
- package/{lib → cjs}/function/index.js +0 -0
- package/cjs/function/index.js.map +1 -0
- package/{lib → cjs}/functional/ChainFn.d.ts +0 -0
- package/{lib → cjs}/functional/ChainFn.js +0 -0
- package/cjs/functional/ChainFn.js.map +1 -0
- package/{lib → cjs}/functional/index.d.ts +0 -0
- package/{lib → cjs}/functional/index.js +0 -0
- package/cjs/functional/index.js.map +1 -0
- package/cjs/index.d.ts +21 -0
- package/cjs/index.js +50 -0
- package/cjs/index.js.map +1 -0
- package/{lib → cjs}/math/Abs.d.ts +0 -0
- package/{lib → cjs}/math/Abs.js +0 -0
- package/cjs/math/Abs.js.map +1 -0
- package/{lib → cjs}/math/Add.d.ts +0 -0
- package/{lib → cjs}/math/Add.js +0 -0
- package/cjs/math/Add.js.map +1 -0
- package/{lib → cjs}/math/Digit.d.ts +0 -0
- package/{lib → cjs}/math/Digit.js +0 -0
- package/cjs/math/Digit.js.map +1 -0
- package/{lib → cjs}/math/GreaterThan.d.ts +0 -0
- package/{lib → cjs}/math/GreaterThan.js +0 -0
- package/cjs/math/GreaterThan.js.map +1 -0
- package/{lib → cjs}/math/IsPositive.d.ts +0 -0
- package/{lib → cjs}/math/IsPositive.js +0 -0
- package/cjs/math/IsPositive.js.map +1 -0
- package/{lib → cjs}/math/IsWhole.d.ts +0 -0
- package/{lib → cjs}/math/IsWhole.js +0 -0
- package/cjs/math/IsWhole.js.map +1 -0
- package/{lib → cjs}/math/Max.d.ts +0 -0
- package/{lib → cjs}/math/Max.js +0 -0
- package/cjs/math/Max.js.map +1 -0
- package/cjs/math/Subtract.d.ts +14 -0
- package/{lib → cjs}/math/Subtract.js +0 -0
- package/cjs/math/Subtract.js.map +1 -0
- package/{lib → cjs}/math/index.d.ts +0 -0
- package/{lib → cjs}/math/index.js +0 -0
- package/cjs/math/index.js.map +1 -0
- package/cjs/nodejs/index.d.ts +1 -0
- package/cjs/nodejs/index.js +14 -0
- package/cjs/nodejs/index.js.map +1 -0
- package/cjs/nodejs/isNodeError.d.ts +31 -0
- package/cjs/nodejs/isNodeError.js +13 -0
- package/cjs/nodejs/isNodeError.js.map +1 -0
- package/{lib → cjs}/nominal-types/Brand.d.ts +0 -0
- package/{lib → cjs}/nominal-types/Brand.js +0 -0
- package/cjs/nominal-types/Brand.js.map +1 -0
- package/{lib → cjs}/nominal-types/Flavor.d.ts +0 -0
- package/cjs/nominal-types/Flavor.js +17 -0
- package/cjs/nominal-types/Flavor.js.map +1 -0
- package/{lib → cjs}/nominal-types/index.d.ts +0 -0
- package/{lib → cjs}/nominal-types/index.js +0 -0
- package/cjs/nominal-types/index.js.map +1 -0
- package/{lib → cjs}/nominal-types/nominalMatch.d.ts +0 -0
- package/{lib → cjs}/nominal-types/nominalMatch.js +0 -0
- package/cjs/nominal-types/nominalMatch.js.map +1 -0
- package/{lib → cjs}/nominal-types/types.d.ts +0 -0
- package/{lib → cjs}/nominal-types/types.js +0 -0
- package/cjs/nominal-types/types.js.map +1 -0
- package/{lib → cjs}/object/ANotB.d.ts +0 -0
- package/{lib → cjs}/object/ANotB.js +0 -0
- package/cjs/object/ANotB.js.map +1 -0
- package/{lib → cjs}/object/AnyRecord.d.ts +0 -0
- package/{lib → cjs}/object/AnyRecord.js +0 -0
- package/cjs/object/AnyRecord.js.map +1 -0
- package/{lib → cjs}/object/ExcludePropType.d.ts +0 -0
- package/{lib → cjs}/object/ExcludePropType.js +0 -0
- package/cjs/object/ExcludePropType.js.map +1 -0
- package/{lib → cjs}/object/IsDisjoint.d.ts +0 -0
- package/{lib → cjs}/object/IsDisjoint.js +0 -0
- package/cjs/object/IsDisjoint.js.map +1 -0
- package/{lib → cjs}/object/IsRecord.d.ts +0 -0
- package/{lib → cjs}/object/IsRecord.js +0 -0
- package/cjs/object/IsRecord.js.map +1 -0
- package/{lib → cjs}/object/KeyTypes.d.ts +0 -0
- package/{lib → cjs}/object/KeyTypes.js +0 -0
- package/cjs/object/KeyTypes.js.map +1 -0
- package/{lib → cjs}/object/KeyofOptional.d.ts +0 -0
- package/{lib → cjs}/object/KeyofOptional.js +0 -0
- package/cjs/object/KeyofOptional.js.map +1 -0
- package/{lib → cjs}/object/KeysWithDiffType.d.ts +0 -0
- package/{lib → cjs}/object/KeysWithDiffType.js +0 -0
- package/cjs/object/KeysWithDiffType.js.map +1 -0
- package/{lib → cjs}/object/KnownKeys.d.ts +0 -0
- package/{lib → cjs}/object/KnownKeys.js +0 -0
- package/cjs/object/KnownKeys.js.map +1 -0
- package/{lib → cjs}/object/OptionalKeys.d.ts +0 -0
- package/{lib → cjs}/object/OptionalKeys.js +0 -0
- package/cjs/object/OptionalKeys.js.map +1 -0
- package/{lib → cjs}/object/Partial.d.ts +0 -0
- package/{lib → cjs}/object/Partial.js +0 -0
- package/cjs/object/Partial.js.map +1 -0
- package/{lib → cjs}/object/RecursiveIntersect.d.ts +0 -0
- package/{lib → cjs}/object/RecursiveIntersect.js +0 -0
- package/cjs/object/RecursiveIntersect.js.map +1 -0
- package/{lib → cjs}/object/RecursivePartial.d.ts +0 -0
- package/{lib → cjs}/object/RecursivePartial.js +0 -0
- package/cjs/object/RecursivePartial.js.map +1 -0
- package/{lib → cjs}/object/RecursiveRequired.d.ts +0 -0
- package/{lib → cjs}/object/RecursiveRequired.js +0 -0
- package/cjs/object/RecursiveRequired.js.map +1 -0
- package/{lib → cjs}/object/Required.d.ts +0 -0
- package/{lib → cjs}/object/Required.js +0 -0
- package/cjs/object/Required.js.map +1 -0
- package/{lib → cjs}/object/RequiredKeys.d.ts +0 -0
- package/{lib → cjs}/object/RequiredKeys.js +0 -0
- package/cjs/object/RequiredKeys.js.map +1 -0
- package/{lib → cjs}/object/SpreadRecord.d.ts +0 -0
- package/{lib → cjs}/object/SpreadRecord.js +0 -0
- package/cjs/object/SpreadRecord.js.map +1 -0
- package/{lib → cjs}/object/ValueOf.d.ts +0 -0
- package/{lib → cjs}/object/ValueOf.js +0 -0
- package/cjs/object/ValueOf.js.map +1 -0
- package/{lib → cjs}/object/everyKey.d.ts +0 -0
- package/{lib → cjs}/object/everyKey.js +0 -0
- package/cjs/object/everyKey.js.map +1 -0
- package/{lib → cjs}/object/facade.d.ts +0 -0
- package/cjs/object/facade.js +31 -0
- package/cjs/object/facade.js.map +1 -0
- package/{lib → cjs}/object/filterKey.d.ts +0 -0
- package/{lib → cjs}/object/filterKey.js +0 -0
- package/cjs/object/filterKey.js.map +1 -0
- package/{lib → cjs}/object/findKey.d.ts +0 -0
- package/{lib → cjs}/object/findKey.js +0 -0
- package/cjs/object/findKey.js.map +1 -0
- package/{lib → cjs}/object/forEachKey.d.ts +0 -0
- package/{lib → cjs}/object/forEachKey.js +0 -0
- package/cjs/object/forEachKey.js.map +1 -0
- package/{lib → cjs}/object/getField.d.ts +0 -0
- package/{lib → cjs}/object/getField.js +0 -0
- package/cjs/object/getField.js.map +1 -0
- package/{lib → cjs}/object/hasKey.d.ts +0 -0
- package/{lib → cjs}/object/hasKey.js +0 -0
- package/cjs/object/hasKey.js.map +1 -0
- package/{lib → cjs}/object/hasProperty.d.ts +0 -0
- package/{lib → cjs}/object/hasProperty.js +0 -0
- package/cjs/object/hasProperty.js.map +1 -0
- package/{lib → cjs}/object/index.d.ts +0 -0
- package/{lib → cjs}/object/index.js +0 -0
- package/cjs/object/index.js.map +1 -0
- package/{lib → cjs}/object/mapKey.d.ts +0 -0
- package/{lib → cjs}/object/mapKey.js +0 -0
- package/cjs/object/mapKey.js.map +1 -0
- package/{lib → cjs}/object/mapProperties.d.ts +0 -0
- package/cjs/object/mapProperties.js +18 -0
- package/cjs/object/mapProperties.js.map +1 -0
- package/{lib → cjs}/object/omit.d.ts +0 -0
- package/cjs/object/omit.js +17 -0
- package/cjs/object/omit.js.map +1 -0
- package/{lib → cjs}/object/pick.d.ts +0 -0
- package/cjs/object/pick.js +17 -0
- package/cjs/object/pick.js.map +1 -0
- package/{lib → cjs}/object/reduceKey.d.ts +0 -0
- package/{lib → cjs}/object/reduceKey.js +0 -0
- package/cjs/object/reduceKey.js.map +1 -0
- package/{lib → cjs}/object/replaceProperty.d.ts +0 -0
- package/{lib → cjs}/object/replaceProperty.js +0 -0
- package/cjs/object/replaceProperty.js.map +1 -0
- package/{lib → cjs}/object/someKey.d.ts +0 -0
- package/{lib → cjs}/object/someKey.js +0 -0
- package/cjs/object/someKey.js.map +1 -0
- package/{lib → cjs}/object/typeOverrideIncompatible.d.ts +0 -0
- package/{lib → cjs}/object/typeOverrideIncompatible.js +0 -0
- package/cjs/object/typeOverrideIncompatible.js.map +1 -0
- package/cjs/predicates/CanAssign.d.ts +9 -0
- package/{lib → cjs}/predicates/CanAssign.js +0 -0
- package/cjs/predicates/CanAssign.js.map +1 -0
- package/{lib → cjs}/predicates/Equal.d.ts +0 -0
- package/{lib → cjs}/predicates/Equal.js +0 -0
- package/cjs/predicates/Equal.js.map +1 -0
- package/{lib → cjs}/predicates/Extends.d.ts +0 -0
- package/{lib → cjs}/predicates/Extends.js +0 -0
- package/cjs/predicates/Extends.js.map +1 -0
- package/{lib → cjs}/predicates/If.d.ts +0 -0
- package/{lib → cjs}/predicates/If.js +0 -0
- package/cjs/predicates/If.js.map +1 -0
- package/cjs/predicates/index.d.ts +11 -0
- package/cjs/predicates/index.js +20 -0
- package/cjs/predicates/index.js.map +1 -0
- package/cjs/predicates/isEmptyObject.d.ts +1 -0
- package/cjs/predicates/isEmptyObject.js +3 -0
- package/cjs/predicates/isEmptyObject.js.map +1 -0
- package/cjs/predicates/isType.d.ts +10 -0
- package/cjs/predicates/isType.js +28 -0
- package/cjs/predicates/isType.js.map +1 -0
- package/{lib → cjs}/predicates/logical.d.ts +0 -0
- package/{lib → cjs}/predicates/logical.js +0 -0
- package/cjs/predicates/logical.js.map +1 -0
- package/{lib → cjs}/promise/PromiseValue.d.ts +0 -0
- package/{lib → cjs}/promise/PromiseValue.js +0 -0
- package/cjs/promise/PromiseValue.js.map +1 -0
- package/{lib → cjs}/promise/PromiseValueMerge.d.ts +0 -0
- package/{lib → cjs}/promise/PromiseValueMerge.js +0 -0
- package/cjs/promise/PromiseValueMerge.js.map +1 -0
- package/{lib → cjs}/promise/index.d.ts +0 -0
- package/{lib → cjs}/promise/index.js +0 -0
- package/cjs/promise/index.js.map +1 -0
- package/cjs/promise/isPromise.d.ts +1 -0
- package/cjs/promise/isPromise.js +9 -0
- package/cjs/promise/isPromise.js.map +1 -0
- package/{lib → cjs}/promise/mapSeries.d.ts +0 -0
- package/cjs/promise/mapSeries.js +8 -0
- package/cjs/promise/mapSeries.js.map +1 -0
- package/{lib → cjs}/types/AllType.d.ts +0 -0
- package/{lib → cjs}/types/AllType.js +0 -0
- package/cjs/types/AllType.js.map +1 -0
- package/{lib → cjs}/types/Any.d.ts +0 -0
- package/{lib → cjs}/types/Any.js +0 -0
- package/cjs/types/Any.js.map +1 -0
- package/{lib → cjs}/types/Array.d.ts +0 -0
- package/{lib → cjs}/types/Array.js +0 -0
- package/cjs/types/Array.js.map +1 -0
- package/{lib → cjs}/types/Boolean.d.ts +0 -0
- package/{lib → cjs}/types/Boolean.js +0 -0
- package/cjs/types/Boolean.js.map +1 -0
- package/{lib → cjs}/types/Generate.d.ts +0 -0
- package/{lib → cjs}/types/Generate.js +0 -0
- package/cjs/types/Generate.js.map +1 -0
- package/{lib → cjs}/types/Null.d.ts +0 -0
- package/{lib → cjs}/types/Null.js +0 -0
- package/cjs/types/Null.js.map +1 -0
- package/{lib → cjs}/types/Number.d.ts +0 -0
- package/cjs/types/Number.js +50 -0
- package/cjs/types/Number.js.map +1 -0
- package/cjs/types/Object.d.ts +313 -0
- package/cjs/types/Object.js +35 -0
- package/cjs/types/Object.js.map +1 -0
- package/{lib → cjs}/types/Record.d.ts +0 -0
- package/{lib → cjs}/types/Record.js +0 -0
- package/cjs/types/Record.js.map +1 -0
- package/{lib → cjs}/types/String.d.ts +0 -0
- package/cjs/types/String.js +51 -0
- package/cjs/types/String.js.map +1 -0
- package/{lib → cjs}/types/Symbol.d.ts +0 -0
- package/{lib → cjs}/types/Symbol.js +0 -0
- package/cjs/types/Symbol.js.map +1 -0
- package/{lib → cjs}/types/Tuple.d.ts +0 -0
- package/cjs/types/Tuple.js +43 -0
- package/cjs/types/Tuple.js.map +1 -0
- package/{lib → cjs}/types/Undefined.d.ts +0 -0
- package/{lib → cjs}/types/Undefined.js +0 -0
- package/cjs/types/Undefined.js.map +1 -0
- package/{lib → cjs}/types/Union.d.ts +0 -0
- package/cjs/types/Union.js +52 -0
- package/cjs/types/Union.js.map +1 -0
- package/{lib → cjs}/types/Unknown.d.ts +0 -0
- package/{lib → cjs}/types/Unknown.js +0 -0
- package/cjs/types/Unknown.js.map +1 -0
- package/{lib → cjs}/types/analyze.d.ts +0 -0
- package/cjs/types/analyze.js +159 -0
- package/cjs/types/analyze.js.map +1 -0
- package/{lib → cjs}/types/check.d.ts +0 -0
- package/cjs/types/check.js +25 -0
- package/cjs/types/check.js.map +1 -0
- package/{lib → cjs}/types/conform.d.ts +0 -0
- package/cjs/types/conform.js +26 -0
- package/cjs/types/conform.js.map +1 -0
- package/{lib → cjs}/types/getPlainAnalysisReport.d.ts +0 -0
- package/cjs/types/getPlainAnalysisReport.js +120 -0
- package/cjs/types/getPlainAnalysisReport.js.map +1 -0
- package/{lib → cjs}/types/index.d.ts +0 -0
- package/{lib → cjs}/types/index.js +0 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/optional.d.ts +328 -0
- package/{lib → cjs}/types/optional.js +0 -0
- package/cjs/types/optional.js.map +1 -0
- package/cjs/types/required.d.ts +664 -0
- package/{lib → cjs}/types/required.js +0 -0
- package/cjs/types/required.js.map +1 -0
- package/{lib → cjs}/types/satisfy.d.ts +0 -0
- package/cjs/types/satisfy.js +26 -0
- package/cjs/types/satisfy.js.map +1 -0
- package/{lib → cjs}/types/types.d.ts +0 -0
- package/{lib → cjs}/types/types.js +0 -0
- package/cjs/types/types.js.map +1 -0
- package/{lib → cjs}/utils/Widen.d.ts +0 -0
- package/{lib → cjs}/utils/Widen.js +0 -0
- package/cjs/utils/Widen.js.map +1 -0
- package/{lib → cjs}/utils/as.d.ts +0 -0
- package/{lib → cjs}/utils/as.js +0 -0
- package/cjs/utils/as.js.map +1 -0
- package/{lib → cjs}/utils/index.d.ts +0 -0
- package/{lib → cjs}/utils/index.js +0 -0
- package/cjs/utils/index.js.map +1 -0
- package/esm/ComposableTypes.js +2 -0
- package/esm/ComposableTypes.js.map +1 -0
- package/esm/JSONTypes.js +11 -0
- package/esm/JSONTypes.js.map +1 -0
- package/{libm → esm}/PrimitiveTypes.js +0 -0
- package/esm/PrimitiveTypes.js.map +1 -0
- package/{libm → esm}/UnionKeys.js +0 -0
- package/esm/UnionKeys.js.map +1 -0
- package/{libm → esm}/array/CommonPropKeys.js +0 -0
- package/esm/array/CommonPropKeys.js.map +1 -0
- package/{libm → esm}/array/Concat.js +0 -0
- package/esm/array/Concat.js.map +1 -0
- package/{libm → esm}/array/CreateTuple.js +0 -0
- package/esm/array/CreateTuple.js.map +1 -0
- package/{libm → esm}/array/DropFirst.js +0 -0
- package/esm/array/DropFirst.js.map +1 -0
- package/{libm → esm}/array/DropLast.js +0 -0
- package/esm/array/DropLast.js.map +1 -0
- package/{libm → esm}/array/Filter.js +0 -0
- package/esm/array/Filter.js.map +1 -0
- package/{libm → esm}/array/FindFirst.js +0 -0
- package/esm/array/FindFirst.js.map +1 -0
- package/{libm → esm}/array/FindLast.js +0 -0
- package/esm/array/FindLast.js.map +1 -0
- package/{libm → esm}/array/Head.js +0 -0
- package/esm/array/Head.js.map +1 -0
- package/{libm → esm}/array/IntersectOfProps.js +0 -0
- package/esm/array/IntersectOfProps.js.map +1 -0
- package/{libm → esm}/array/IsArray.js +0 -0
- package/esm/array/IsArray.js.map +1 -0
- package/{libm → esm}/array/PadLeft.js +0 -0
- package/esm/array/PadLeft.js.map +1 -0
- package/{libm → esm}/array/Reverse.js +0 -0
- package/esm/array/Reverse.js.map +1 -0
- package/{libm → esm}/array/Some.js +0 -0
- package/esm/array/Some.js.map +1 -0
- package/{libm → esm}/array/Tail.js +0 -0
- package/esm/array/Tail.js.map +1 -0
- package/{libm → esm}/array/UnionOfProps.js +0 -0
- package/esm/array/UnionOfProps.js.map +1 -0
- package/{libm → esm}/array/UnionOfValues.js +0 -0
- package/esm/array/UnionOfValues.js.map +1 -0
- package/{libm → esm}/array/index.js +0 -0
- package/esm/array/index.js.map +1 -0
- package/{libm → esm}/array/literalArray.js +0 -0
- package/esm/array/literalArray.js.map +1 -0
- package/{libm → esm}/array/reduceWhile.js +0 -0
- package/esm/array/reduceWhile.js.map +1 -0
- package/{libm → esm}/assertion/assertType.js +0 -0
- package/esm/assertion/assertType.js.map +1 -0
- package/{libm → esm}/assertion/index.js +0 -0
- package/esm/assertion/index.js.map +1 -0
- package/{libm → esm}/class/AnyConstructor.js +0 -0
- package/esm/class/AnyConstructor.js.map +1 -0
- package/{libm → esm}/class/index.js +0 -0
- package/esm/class/index.js.map +1 -0
- package/esm/class/isConstructor.js +13 -0
- package/esm/class/isConstructor.js.map +1 -0
- package/{libm → esm}/function/AnyFunction.js +0 -0
- package/esm/function/AnyFunction.js.map +1 -0
- package/{libm → esm}/function/index.js +0 -0
- package/esm/function/index.js.map +1 -0
- package/{libm → esm}/functional/ChainFn.js +0 -0
- package/esm/functional/ChainFn.js.map +1 -0
- package/{libm → esm}/functional/index.js +0 -0
- package/esm/functional/index.js.map +1 -0
- package/esm/index.js +22 -0
- package/esm/index.js.map +1 -0
- package/{libm → esm}/math/Abs.js +0 -0
- package/esm/math/Abs.js.map +1 -0
- package/{libm → esm}/math/Add.js +0 -0
- package/esm/math/Add.js.map +1 -0
- package/{libm → esm}/math/Digit.js +0 -0
- package/esm/math/Digit.js.map +1 -0
- package/{libm → esm}/math/GreaterThan.js +0 -0
- package/esm/math/GreaterThan.js.map +1 -0
- package/{libm → esm}/math/IsPositive.js +0 -0
- package/esm/math/IsPositive.js.map +1 -0
- package/{libm → esm}/math/IsWhole.js +0 -0
- package/esm/math/IsWhole.js.map +1 -0
- package/{libm → esm}/math/Max.js +0 -0
- package/esm/math/Max.js.map +1 -0
- package/{libm → esm}/math/Subtract.js +0 -0
- package/esm/math/Subtract.js.map +1 -0
- package/{libm → esm}/math/index.js +0 -0
- package/esm/math/index.js.map +1 -0
- package/esm/nodejs/index.js +2 -0
- package/esm/nodejs/index.js.map +1 -0
- package/esm/nodejs/isNodeError.js +9 -0
- package/esm/nodejs/isNodeError.js.map +1 -0
- package/{libm → esm}/nominal-types/Brand.js +0 -0
- package/esm/nominal-types/Brand.js.map +1 -0
- package/esm/nominal-types/Flavor.js +13 -0
- package/esm/nominal-types/Flavor.js.map +1 -0
- package/{libm → esm}/nominal-types/index.js +0 -0
- package/esm/nominal-types/index.js.map +1 -0
- package/{libm → esm}/nominal-types/nominalMatch.js +0 -0
- package/esm/nominal-types/nominalMatch.js.map +1 -0
- package/{libm → esm}/nominal-types/types.js +0 -0
- package/esm/nominal-types/types.js.map +1 -0
- package/{libm → esm}/object/ANotB.js +0 -0
- package/esm/object/ANotB.js.map +1 -0
- package/{libm → esm}/object/AnyRecord.js +0 -0
- package/esm/object/AnyRecord.js.map +1 -0
- package/{libm → esm}/object/ExcludePropType.js +0 -0
- package/esm/object/ExcludePropType.js.map +1 -0
- package/{libm → esm}/object/IsDisjoint.js +0 -0
- package/esm/object/IsDisjoint.js.map +1 -0
- package/{libm → esm}/object/IsRecord.js +0 -0
- package/esm/object/IsRecord.js.map +1 -0
- package/{libm → esm}/object/KeyTypes.js +0 -0
- package/esm/object/KeyTypes.js.map +1 -0
- package/{libm → esm}/object/KeyofOptional.js +0 -0
- package/esm/object/KeyofOptional.js.map +1 -0
- package/{libm → esm}/object/KeysWithDiffType.js +0 -0
- package/esm/object/KeysWithDiffType.js.map +1 -0
- package/{libm → esm}/object/KnownKeys.js +0 -0
- package/esm/object/KnownKeys.js.map +1 -0
- package/{libm → esm}/object/OptionalKeys.js +0 -0
- package/esm/object/OptionalKeys.js.map +1 -0
- package/{libm → esm}/object/Partial.js +0 -0
- package/esm/object/Partial.js.map +1 -0
- package/{libm → esm}/object/RecursiveIntersect.js +0 -0
- package/esm/object/RecursiveIntersect.js.map +1 -0
- package/{libm → esm}/object/RecursivePartial.js +0 -0
- package/esm/object/RecursivePartial.js.map +1 -0
- package/{libm → esm}/object/RecursiveRequired.js +0 -0
- package/esm/object/RecursiveRequired.js.map +1 -0
- package/{libm → esm}/object/Required.js +0 -0
- package/esm/object/Required.js.map +1 -0
- package/{libm → esm}/object/RequiredKeys.js +0 -0
- package/esm/object/RequiredKeys.js.map +1 -0
- package/{libm → esm}/object/SpreadRecord.js +0 -0
- package/esm/object/SpreadRecord.js.map +1 -0
- package/{libm → esm}/object/ValueOf.js +0 -0
- package/esm/object/ValueOf.js.map +1 -0
- package/{libm → esm}/object/everyKey.js +0 -0
- package/esm/object/everyKey.js.map +1 -0
- package/esm/object/facade.js +23 -0
- package/esm/object/facade.js.map +1 -0
- package/{libm → esm}/object/filterKey.js +0 -0
- package/esm/object/filterKey.js.map +1 -0
- package/{libm → esm}/object/findKey.js +0 -0
- package/esm/object/findKey.js.map +1 -0
- package/{libm → esm}/object/forEachKey.js +0 -0
- package/esm/object/forEachKey.js.map +1 -0
- package/{libm → esm}/object/getField.js +0 -0
- package/esm/object/getField.js.map +1 -0
- package/{libm → esm}/object/hasKey.js +0 -0
- package/esm/object/hasKey.js.map +1 -0
- package/{libm → esm}/object/hasProperty.js +0 -0
- package/esm/object/hasProperty.js.map +1 -0
- package/{libm → esm}/object/index.js +0 -0
- package/esm/object/index.js.map +1 -0
- package/{libm → esm}/object/mapKey.js +0 -0
- package/esm/object/mapKey.js.map +1 -0
- package/{libm → esm}/object/mapProperties.js +0 -0
- package/esm/object/mapProperties.js.map +1 -0
- package/{libm → esm}/object/omit.js +0 -0
- package/esm/object/omit.js.map +1 -0
- package/{libm → esm}/object/pick.js +0 -0
- package/esm/object/pick.js.map +1 -0
- package/{libm → esm}/object/reduceKey.js +0 -0
- package/esm/object/reduceKey.js.map +1 -0
- package/{libm → esm}/object/replaceProperty.js +0 -0
- package/esm/object/replaceProperty.js.map +1 -0
- package/{libm → esm}/object/someKey.js +0 -0
- package/esm/object/someKey.js.map +1 -0
- package/{libm → esm}/object/typeOverrideIncompatible.js +0 -0
- package/esm/object/typeOverrideIncompatible.js.map +1 -0
- package/{libm → esm}/predicates/CanAssign.js +0 -0
- package/esm/predicates/CanAssign.js.map +1 -0
- package/{libm → esm}/predicates/Equal.js +0 -0
- package/esm/predicates/Equal.js.map +1 -0
- package/{libm → esm}/predicates/Extends.js +0 -0
- package/esm/predicates/Extends.js.map +1 -0
- package/{libm → esm}/predicates/If.js +0 -0
- package/esm/predicates/If.js.map +1 -0
- package/esm/predicates/index.js +8 -0
- package/esm/predicates/index.js.map +1 -0
- package/esm/predicates/isEmptyObject.js +2 -0
- package/esm/predicates/isEmptyObject.js.map +1 -0
- package/esm/predicates/isType.js +24 -0
- package/esm/predicates/isType.js.map +1 -0
- package/{libm → esm}/predicates/logical.js +0 -0
- package/esm/predicates/logical.js.map +1 -0
- package/{libm → esm}/promise/PromiseValue.js +0 -0
- package/esm/promise/PromiseValue.js.map +1 -0
- package/{libm → esm}/promise/PromiseValueMerge.js +0 -0
- package/esm/promise/PromiseValueMerge.js.map +1 -0
- package/{libm → esm}/promise/index.js +0 -0
- package/esm/promise/index.js.map +1 -0
- package/esm/promise/isPromise.js +5 -0
- package/esm/promise/isPromise.js.map +1 -0
- package/esm/promise/mapSeries.js +4 -0
- package/esm/promise/mapSeries.js.map +1 -0
- package/{libm → esm}/types/AllType.js +0 -0
- package/esm/types/AllType.js.map +1 -0
- package/{libm → esm}/types/Any.js +0 -0
- package/esm/types/Any.js.map +1 -0
- package/{libm → esm}/types/Array.js +0 -0
- package/esm/types/Array.js.map +1 -0
- package/{libm → esm}/types/Boolean.js +0 -0
- package/esm/types/Boolean.js.map +1 -0
- package/{libm → esm}/types/Generate.js +0 -0
- package/esm/types/Generate.js.map +1 -0
- package/{libm → esm}/types/Null.js +0 -0
- package/esm/types/Null.js.map +1 -0
- package/{libm → esm}/types/Number.js +0 -0
- package/esm/types/Number.js.map +1 -0
- package/{libm → esm}/types/Object.js +0 -0
- package/esm/types/Object.js.map +1 -0
- package/{libm → esm}/types/Record.js +0 -0
- package/esm/types/Record.js.map +1 -0
- package/{libm → esm}/types/String.js +0 -0
- package/esm/types/String.js.map +1 -0
- package/{libm → esm}/types/Symbol.js +0 -0
- package/esm/types/Symbol.js.map +1 -0
- package/{libm → esm}/types/Tuple.js +0 -0
- package/esm/types/Tuple.js.map +1 -0
- package/{libm → esm}/types/Undefined.js +0 -0
- package/esm/types/Undefined.js.map +1 -0
- package/{libm → esm}/types/Union.js +0 -0
- package/esm/types/Union.js.map +1 -0
- package/{libm → esm}/types/Unknown.js +0 -0
- package/esm/types/Unknown.js.map +1 -0
- package/{libm → esm}/types/analyze.js +0 -0
- package/esm/types/analyze.js.map +1 -0
- package/{libm → esm}/types/check.js +0 -0
- package/esm/types/check.js.map +1 -0
- package/{libm → esm}/types/conform.js +0 -0
- package/esm/types/conform.js.map +1 -0
- package/{libm → esm}/types/getPlainAnalysisReport.js +0 -0
- package/esm/types/getPlainAnalysisReport.js.map +1 -0
- package/{libm → esm}/types/index.js +0 -0
- package/esm/types/index.js.map +1 -0
- package/{libm → esm}/types/optional.js +0 -0
- package/esm/types/optional.js.map +1 -0
- package/{libm → esm}/types/required.js +0 -0
- package/esm/types/required.js.map +1 -0
- package/{libm → esm}/types/satisfy.js +0 -0
- package/esm/types/satisfy.js.map +1 -0
- package/{libm → esm}/types/types.js +0 -0
- package/esm/types/types.js.map +1 -0
- package/{libm → esm}/utils/Widen.js +0 -0
- package/esm/utils/Widen.js.map +1 -0
- package/{libm → esm}/utils/as.js +0 -0
- package/esm/utils/as.js.map +1 -0
- package/{libm → esm}/utils/index.js +0 -0
- package/esm/utils/index.js.map +1 -0
- package/package.json +45 -49
- package/ts/ComposableTypes.spec.ts +29 -0
- package/ts/ComposableTypes.ts +10 -0
- package/ts/JSONTypes.spec.ts +43 -0
- package/ts/JSONTypes.ts +18 -0
- package/ts/PrimitiveTypes.ts +2 -0
- package/{src → ts}/UnionKeys.ts +0 -0
- package/ts/UnionToIntersection.ts +7 -0
- package/ts/array/CommonPropKeys.spec.ts +20 -0
- package/ts/array/CommonPropKeys.ts +18 -0
- package/ts/array/Concat.spec.ts +21 -0
- package/ts/array/Concat.ts +1 -0
- package/ts/array/CreateTuple.spec.ts +21 -0
- package/ts/array/CreateTuple.ts +7 -0
- package/ts/array/DropFirst.spec.ts +21 -0
- package/ts/array/DropFirst.ts +9 -0
- package/ts/array/DropLast.spec.ts +21 -0
- package/ts/array/DropLast.ts +9 -0
- package/ts/array/Filter.spec.ts +21 -0
- package/ts/array/Filter.ts +12 -0
- package/ts/array/FindFirst.spec.ts +27 -0
- package/ts/array/FindFirst.ts +13 -0
- package/ts/array/FindLast.spec.ts +27 -0
- package/ts/array/FindLast.ts +8 -0
- package/ts/array/Head.spec.ts +21 -0
- package/ts/array/Head.ts +1 -0
- package/ts/array/IntersectOfProps.spec.ts +14 -0
- package/ts/array/IntersectOfProps.ts +20 -0
- package/ts/array/IsArray.ts +1 -0
- package/ts/array/PadLeft.spec.ts +26 -0
- package/ts/array/PadLeft.ts +16 -0
- package/ts/array/Reverse.spec.ts +17 -0
- package/ts/array/Reverse.ts +10 -0
- package/ts/array/Some.spec.ts +79 -0
- package/ts/array/Some.ts +24 -0
- package/ts/array/Tail.spec.ts +32 -0
- package/ts/array/Tail.ts +7 -0
- package/ts/array/UnionOfProps.spec.ts +14 -0
- package/ts/array/UnionOfProps.ts +18 -0
- package/ts/array/UnionOfValues.spec.ts +11 -0
- package/ts/array/UnionOfValues.ts +10 -0
- package/ts/array/index.ts +19 -0
- package/{src → ts}/array/literalArray.spec.ts +0 -0
- package/{src → ts}/array/literalArray.ts +0 -0
- package/{src → ts}/array/reduceWhile.spec.ts +0 -0
- package/{src → ts}/array/reduceWhile.ts +0 -0
- package/ts/assertion/assertType.spec.ts +507 -0
- package/ts/assertion/assertType.ts +105 -0
- package/ts/assertion/index.ts +1 -0
- package/{src → ts}/binary/Bit.ts +0 -0
- package/{src → ts}/binary/_binary.ts +0 -0
- package/{src → ts}/binary/index.spec.ts +0 -0
- package/{src → ts}/binary/index.ts +0 -0
- package/ts/class/AnyConstructor.spec.ts +13 -0
- package/{src → ts}/class/AnyConstructor.ts +0 -0
- package/{src → ts}/class/index.ts +0 -0
- package/ts/class/isConstructor.spec.ts +35 -0
- package/ts/class/isConstructor.ts +14 -0
- package/ts/function/AnyFunction.spec.ts +21 -0
- package/{src → ts}/function/AnyFunction.ts +0 -0
- package/{src → ts}/function/index.ts +0 -0
- package/ts/functional/ChainFn.spec.ts +7 -0
- package/ts/functional/ChainFn.ts +6 -0
- package/ts/functional/Maybe.spec.ts +42 -0
- package/ts/functional/Maybe.ts +19 -0
- package/ts/functional/index.ts +2 -0
- package/{src → ts}/index.spec.ts +0 -0
- package/ts/index.ts +21 -0
- package/ts/math/Abs.spec.ts +14 -0
- package/ts/math/Abs.ts +4 -0
- package/ts/math/Add.spec.ts +82 -0
- package/ts/math/Add.ts +49 -0
- package/ts/math/Digit.spec.ts +185 -0
- package/ts/math/Digit.ts +115 -0
- package/ts/math/GreaterThan.spec.ts +40 -0
- package/ts/math/GreaterThan.ts +36 -0
- package/{src → ts}/math/IsPositive.spec.ts +0 -0
- package/ts/math/IsPositive.ts +9 -0
- package/ts/math/IsWhole.spec.ts +19 -0
- package/ts/math/IsWhole.ts +9 -0
- package/ts/math/Max.spec.ts +35 -0
- package/ts/math/Max.ts +31 -0
- package/ts/math/README.md +7 -0
- package/ts/math/Subtract.spec.ts +40 -0
- package/ts/math/Subtract.ts +40 -0
- package/ts/math/index.ts +7 -0
- package/ts/nodejs/index.ts +1 -0
- package/ts/nodejs/isNodeError.spec.ts +11 -0
- package/ts/nodejs/isNodeError.ts +28 -0
- package/ts/nominal-types/Brand.spec.ts +43 -0
- package/ts/nominal-types/Brand.ts +32 -0
- package/ts/nominal-types/Flavor.spec.ts +51 -0
- package/ts/nominal-types/Flavor.ts +32 -0
- package/{src → ts}/nominal-types/index.ts +0 -0
- package/{src → ts}/nominal-types/nominalMatch.spec.ts +0 -0
- package/{src → ts}/nominal-types/nominalMatch.ts +0 -0
- package/{src → ts}/nominal-types/types.ts +0 -0
- package/{src → ts}/object/ANotB.spec.ts +0 -0
- package/ts/object/ANotB.ts +21 -0
- package/{src → ts}/object/AnyRecord.ts +0 -0
- package/ts/object/ExcludePropType.spec.ts +13 -0
- package/{src → ts}/object/ExcludePropType.ts +0 -0
- package/ts/object/IsDisjoint.spec.ts +25 -0
- package/ts/object/IsDisjoint.ts +12 -0
- package/ts/object/IsRecord.spec.ts +22 -0
- package/ts/object/IsRecord.ts +4 -0
- package/{src → ts}/object/KeyTypes.spec.ts +0 -0
- package/{src → ts}/object/KeyTypes.ts +0 -0
- package/ts/object/KeyofOptional.spec.ts +8 -0
- package/{src → ts}/object/KeyofOptional.ts +0 -0
- package/ts/object/KeysWithDiffType.spec.ts +21 -0
- package/{src → ts}/object/KeysWithDiffType.ts +0 -0
- package/ts/object/KnownKeys.spec.ts +39 -0
- package/ts/object/KnownKeys.ts +16 -0
- package/{src → ts}/object/OptionalKeys.spec.ts +0 -0
- package/{src → ts}/object/OptionalKeys.ts +0 -0
- package/ts/object/Partial.spec.ts +49 -0
- package/{src → ts}/object/Partial.ts +0 -0
- package/ts/object/RecursiveIntersect.spec.ts +39 -0
- package/{src → ts}/object/RecursiveIntersect.ts +0 -0
- package/{src → ts}/object/RecursivePartial.ts +0 -0
- package/{src → ts}/object/RecursiveRequired.spec.ts +0 -0
- package/{src → ts}/object/RecursiveRequired.ts +0 -0
- package/ts/object/Required.spec.ts +29 -0
- package/{src → ts}/object/Required.ts +0 -0
- package/{src → ts}/object/RequiredKeys.spec.ts +0 -0
- package/{src → ts}/object/RequiredKeys.ts +0 -0
- package/ts/object/SpreadRecord.spec.ts +14 -0
- package/ts/object/SpreadRecord.ts +6 -0
- package/ts/object/ValueOf.spec.ts +36 -0
- package/{src → ts}/object/ValueOf.ts +0 -0
- package/{src → ts}/object/everyKey.spec.ts +0 -0
- package/{src → ts}/object/everyKey.ts +0 -0
- package/{src → ts}/object/facade.spec.ts +0 -0
- package/ts/object/facade.ts +39 -0
- package/{src → ts}/object/filterKey.spec.ts +0 -0
- package/{src → ts}/object/filterKey.ts +0 -0
- package/{src → ts}/object/findKey.spec.ts +0 -0
- package/{src → ts}/object/findKey.ts +0 -0
- package/{src → ts}/object/forEachKey.spec.ts +0 -0
- package/{src → ts}/object/forEachKey.ts +0 -0
- package/ts/object/getField.spec.ts +21 -0
- package/ts/object/getField.ts +21 -0
- package/{src → ts}/object/hasKey.spec.ts +0 -0
- package/ts/object/hasKey.ts +7 -0
- package/ts/object/hasProperty.spec.ts +15 -0
- package/{src → ts}/object/hasProperty.ts +0 -0
- package/ts/object/index.ts +35 -0
- package/{src → ts}/object/mapKey.spec.ts +0 -0
- package/{src → ts}/object/mapKey.ts +0 -0
- package/ts/object/mapProperties.spec.ts +27 -0
- package/{src → ts}/object/mapProperties.ts +0 -0
- package/ts/object/omit.spec.ts +104 -0
- package/ts/object/omit.ts +36 -0
- package/ts/object/pick.spec.ts +66 -0
- package/ts/object/pick.ts +35 -0
- package/{src → ts}/object/reduceKey.spec.ts +0 -0
- package/{src → ts}/object/reduceKey.ts +0 -0
- package/{src → ts}/object/replaceProperty.spec.ts +0 -0
- package/{src → ts}/object/replaceProperty.ts +0 -0
- package/{src → ts}/object/someKey.spec.ts +0 -0
- package/{src → ts}/object/someKey.ts +0 -0
- package/ts/object/typeOverrideIncompatible.spec.ts +24 -0
- package/ts/object/typeOverrideIncompatible.ts +10 -0
- package/ts/predicates/CanAssign.spec.ts +57 -0
- package/ts/predicates/CanAssign.ts +21 -0
- package/ts/predicates/Equal.spec.ts +71 -0
- package/ts/predicates/Equal.ts +14 -0
- package/ts/predicates/Extends.ts +4 -0
- package/ts/predicates/If.spec.ts +14 -0
- package/ts/predicates/If.ts +5 -0
- package/ts/predicates/index.spec.ts +73 -0
- package/ts/predicates/index.ts +17 -0
- package/ts/predicates/isEmptyObject.spec.ts +15 -0
- package/ts/predicates/isEmptyObject.ts +2 -0
- package/ts/predicates/isType.spec.ts +106 -0
- package/ts/predicates/isType.ts +30 -0
- package/ts/predicates/logical.spec.ts +59 -0
- package/ts/predicates/logical.ts +4 -0
- package/ts/promise/PromiseValue.spec.ts +6 -0
- package/{src → ts}/promise/PromiseValue.ts +0 -0
- package/{src → ts}/promise/PromiseValueMerge.spec.ts +0 -0
- package/{src → ts}/promise/PromiseValueMerge.ts +0 -0
- package/{src → ts}/promise/index.ts +0 -0
- package/{src → ts}/promise/isPromise.spec.ts +0 -0
- package/ts/promise/isPromise.ts +4 -0
- package/{src → ts}/promise/mapSeries.spec.ts +0 -0
- package/ts/promise/mapSeries.ts +5 -0
- package/{src → ts}/type-checker/.eslintrc.json +0 -0
- package/ts/type-checker/AnyType.ts +13 -0
- package/{src → ts}/type-checker/Boolean.ts +0 -0
- package/{src → ts}/type-checker/Tuple.spec.ts +0 -0
- package/{src → ts}/type-checker/Tuple.ts +0 -0
- package/ts/type-checker/buildTypes.spec.ts +28 -0
- package/{src → ts}/type-checker/index.ts +0 -0
- package/{src → ts}/type-checker/typeChecker.spec.ts +0 -0
- package/{src → ts}/type-checker/typeChecker.ts +0 -0
- package/{src → ts}/type-checker/types.ts +0 -0
- package/{src → ts}/types/.eslintrc.json +0 -0
- package/{src → ts}/types/AllType.ts +0 -0
- package/{src → ts}/types/Any.ts +0 -0
- package/{src → ts}/types/Array.ts +0 -0
- package/{src → ts}/types/BigInt.ts +0 -0
- package/{src → ts}/types/Boolean.ts +0 -0
- package/ts/types/Generate.ts +48 -0
- package/{src → ts}/types/Null.ts +0 -0
- package/ts/types/Number.ts +56 -0
- package/ts/types/Object.ts +53 -0
- package/{src → ts}/types/Record.ts +0 -0
- package/ts/types/String.ts +56 -0
- package/ts/types/Symbol.ts +19 -0
- package/ts/types/Tuple.ts +50 -0
- package/{src → ts}/types/Undefined.ts +0 -0
- package/{src → ts}/types/Union.ts +0 -0
- package/{src → ts}/types/Unknown.ts +0 -0
- package/{src → ts}/types/analyze.spec.ts +0 -0
- package/{src → ts}/types/analyze.ts +0 -0
- package/{src → ts}/types/check.spec.ts +0 -0
- package/{src → ts}/types/check.ts +0 -0
- package/{src → ts}/types/conform.spec.ts +0 -0
- package/{src → ts}/types/conform.ts +0 -0
- package/{src → ts}/types/getPlainAnalysisReport.spec.ts +0 -0
- package/ts/types/getPlainAnalysisReport.ts +115 -0
- package/ts/types/index.ts +28 -0
- package/ts/types/optional.ts +30 -0
- package/ts/types/required.ts +30 -0
- package/ts/types/satisfy.accept.ts +38 -0
- package/{src → ts}/types/satisfy.spec.ts +0 -0
- package/{src → ts}/types/satisfy.ts +0 -0
- package/{src → ts}/types/types.ts +0 -0
- package/{src → ts}/utils/Widen.ts +0 -0
- package/ts/utils/as.spec.ts +24 -0
- package/ts/utils/as.ts +7 -0
- package/ts/utils/index.ts +2 -0
- package/lib/JSONTypes.js +0 -22
- package/lib/JSONTypes.js.map +0 -1
- package/lib/PrimitiveTypes.js.map +0 -1
- package/lib/UnionKeys.js.map +0 -1
- package/lib/array/CommonPropKeys.js.map +0 -1
- package/lib/array/Concat.js.map +0 -1
- package/lib/array/CreateTuple.js.map +0 -1
- package/lib/array/DropFirst.js.map +0 -1
- package/lib/array/DropLast.js.map +0 -1
- package/lib/array/Filter.js.map +0 -1
- package/lib/array/FindFirst.js.map +0 -1
- package/lib/array/FindLast.js.map +0 -1
- package/lib/array/Head.js.map +0 -1
- package/lib/array/IntersectOfProps.js.map +0 -1
- package/lib/array/IsArray.js.map +0 -1
- package/lib/array/PadLeft.js.map +0 -1
- package/lib/array/Reverse.js.map +0 -1
- package/lib/array/Some.js.map +0 -1
- package/lib/array/Tail.js.map +0 -1
- package/lib/array/UnionOfProps.js.map +0 -1
- package/lib/array/UnionOfValues.js.map +0 -1
- package/lib/array/index.js.map +0 -1
- package/lib/array/literalArray.js.map +0 -1
- package/lib/array/reduceWhile.js.map +0 -1
- package/lib/assertion/assertType.d.ts +0 -78
- package/lib/assertion/assertType.js +0 -107
- package/lib/assertion/assertType.js.map +0 -1
- package/lib/assertion/index.js.map +0 -1
- package/lib/class/AnyConstructor.js.map +0 -1
- package/lib/class/index.js.map +0 -1
- package/lib/class/isConstructor.js +0 -17
- package/lib/class/isConstructor.js.map +0 -1
- package/lib/function/AnyFunction.js.map +0 -1
- package/lib/function/index.js.map +0 -1
- package/lib/functional/ChainFn.js.map +0 -1
- package/lib/functional/index.js.map +0 -1
- package/lib/index.d.ts +0 -19
- package/lib/index.js +0 -48
- package/lib/index.js.map +0 -1
- package/lib/math/Abs.js.map +0 -1
- package/lib/math/Add.js.map +0 -1
- package/lib/math/Digit.js.map +0 -1
- package/lib/math/GreaterThan.js.map +0 -1
- package/lib/math/IsPositive.js.map +0 -1
- package/lib/math/IsWhole.js.map +0 -1
- package/lib/math/Max.js.map +0 -1
- package/lib/math/Subtract.d.ts +0 -14
- package/lib/math/Subtract.js.map +0 -1
- package/lib/math/index.js.map +0 -1
- package/lib/nominal-types/Brand.js.map +0 -1
- package/lib/nominal-types/Flavor.js +0 -18
- package/lib/nominal-types/Flavor.js.map +0 -1
- package/lib/nominal-types/index.js.map +0 -1
- package/lib/nominal-types/nominalMatch.js.map +0 -1
- package/lib/nominal-types/types.js.map +0 -1
- package/lib/object/ANotB.js.map +0 -1
- package/lib/object/AnyRecord.js.map +0 -1
- package/lib/object/ExcludePropType.js.map +0 -1
- package/lib/object/IsDisjoint.js.map +0 -1
- package/lib/object/IsRecord.js.map +0 -1
- package/lib/object/KeyTypes.js.map +0 -1
- package/lib/object/KeyofOptional.js.map +0 -1
- package/lib/object/KeysWithDiffType.js.map +0 -1
- package/lib/object/KnownKeys.js.map +0 -1
- package/lib/object/OptionalKeys.js.map +0 -1
- package/lib/object/Partial.js.map +0 -1
- package/lib/object/RecursiveIntersect.js.map +0 -1
- package/lib/object/RecursivePartial.js.map +0 -1
- package/lib/object/RecursiveRequired.js.map +0 -1
- package/lib/object/Required.js.map +0 -1
- package/lib/object/RequiredKeys.js.map +0 -1
- package/lib/object/SpreadRecord.js.map +0 -1
- package/lib/object/ValueOf.js.map +0 -1
- package/lib/object/everyKey.js.map +0 -1
- package/lib/object/facade.js +0 -28
- package/lib/object/facade.js.map +0 -1
- package/lib/object/filterKey.js.map +0 -1
- package/lib/object/findKey.js.map +0 -1
- package/lib/object/forEachKey.js.map +0 -1
- package/lib/object/getField.js.map +0 -1
- package/lib/object/hasKey.js.map +0 -1
- package/lib/object/hasProperty.js.map +0 -1
- package/lib/object/index.js.map +0 -1
- package/lib/object/mapKey.js.map +0 -1
- package/lib/object/mapProperties.js +0 -18
- package/lib/object/mapProperties.js.map +0 -1
- package/lib/object/omit.js +0 -17
- package/lib/object/omit.js.map +0 -1
- package/lib/object/pick.js +0 -17
- package/lib/object/pick.js.map +0 -1
- package/lib/object/reduceKey.js.map +0 -1
- package/lib/object/replaceProperty.js.map +0 -1
- package/lib/object/someKey.js.map +0 -1
- package/lib/object/typeOverrideIncompatible.js.map +0 -1
- package/lib/predicates/CanAssign.d.ts +0 -8
- package/lib/predicates/CanAssign.js.map +0 -1
- package/lib/predicates/Equal.js.map +0 -1
- package/lib/predicates/Extends.js.map +0 -1
- package/lib/predicates/If.js.map +0 -1
- package/lib/predicates/index.d.ts +0 -10
- package/lib/predicates/index.js +0 -19
- package/lib/predicates/index.js.map +0 -1
- package/lib/predicates/isType.d.ts +0 -19
- package/lib/predicates/isType.js +0 -31
- package/lib/predicates/isType.js.map +0 -1
- package/lib/predicates/logical.js.map +0 -1
- package/lib/promise/PromiseValue.js.map +0 -1
- package/lib/promise/PromiseValueMerge.js.map +0 -1
- package/lib/promise/index.js.map +0 -1
- package/lib/promise/isPromise.d.ts +0 -1
- package/lib/promise/isPromise.js +0 -8
- package/lib/promise/isPromise.js.map +0 -1
- package/lib/promise/mapSeries.js +0 -14
- package/lib/promise/mapSeries.js.map +0 -1
- package/lib/types/AllType.js.map +0 -1
- package/lib/types/Any.js.map +0 -1
- package/lib/types/Array.js.map +0 -1
- package/lib/types/Boolean.js.map +0 -1
- package/lib/types/Generate.js.map +0 -1
- package/lib/types/Null.js.map +0 -1
- package/lib/types/Number.js +0 -46
- package/lib/types/Number.js.map +0 -1
- package/lib/types/Object.d.ts +0 -329
- package/lib/types/Object.js +0 -35
- package/lib/types/Object.js.map +0 -1
- package/lib/types/Record.js.map +0 -1
- package/lib/types/String.js +0 -47
- package/lib/types/String.js.map +0 -1
- package/lib/types/Symbol.js.map +0 -1
- package/lib/types/Tuple.js +0 -39
- package/lib/types/Tuple.js.map +0 -1
- package/lib/types/Undefined.js.map +0 -1
- package/lib/types/Union.js +0 -48
- package/lib/types/Union.js.map +0 -1
- package/lib/types/Unknown.js.map +0 -1
- package/lib/types/analyze.js +0 -158
- package/lib/types/analyze.js.map +0 -1
- package/lib/types/check.js +0 -25
- package/lib/types/check.js.map +0 -1
- package/lib/types/conform.js +0 -26
- package/lib/types/conform.js.map +0 -1
- package/lib/types/getPlainAnalysisReport.js +0 -116
- package/lib/types/getPlainAnalysisReport.js.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/types/optional.d.ts +0 -344
- package/lib/types/optional.js.map +0 -1
- package/lib/types/required.d.ts +0 -696
- package/lib/types/required.js.map +0 -1
- package/lib/types/satisfy.js +0 -26
- package/lib/types/satisfy.js.map +0 -1
- package/lib/types/types.js.map +0 -1
- package/lib/utils/Widen.js.map +0 -1
- package/lib/utils/as.js.map +0 -1
- package/lib/utils/index.js.map +0 -1
- package/libm/JSONTypes.js +0 -10
- package/libm/JSONTypes.js.map +0 -1
- package/libm/PrimitiveTypes.js.map +0 -1
- package/libm/UnionKeys.js.map +0 -1
- package/libm/array/CommonPropKeys.js.map +0 -1
- package/libm/array/Concat.js.map +0 -1
- package/libm/array/CreateTuple.js.map +0 -1
- package/libm/array/DropFirst.js.map +0 -1
- package/libm/array/DropLast.js.map +0 -1
- package/libm/array/Filter.js.map +0 -1
- package/libm/array/FindFirst.js.map +0 -1
- package/libm/array/FindLast.js.map +0 -1
- package/libm/array/Head.js.map +0 -1
- package/libm/array/IntersectOfProps.js.map +0 -1
- package/libm/array/IsArray.js.map +0 -1
- package/libm/array/PadLeft.js.map +0 -1
- package/libm/array/Reverse.js.map +0 -1
- package/libm/array/Some.js.map +0 -1
- package/libm/array/Tail.js.map +0 -1
- package/libm/array/UnionOfProps.js.map +0 -1
- package/libm/array/UnionOfValues.js.map +0 -1
- package/libm/array/index.js.map +0 -1
- package/libm/array/literalArray.js.map +0 -1
- package/libm/array/reduceWhile.js.map +0 -1
- package/libm/assertion/assertType.js.map +0 -1
- package/libm/assertion/index.js.map +0 -1
- package/libm/class/AnyConstructor.js.map +0 -1
- package/libm/class/index.js.map +0 -1
- package/libm/class/isConstructor.js +0 -12
- package/libm/class/isConstructor.js.map +0 -1
- package/libm/function/AnyFunction.js.map +0 -1
- package/libm/function/index.js.map +0 -1
- package/libm/functional/ChainFn.js.map +0 -1
- package/libm/functional/index.js.map +0 -1
- package/libm/index.js +0 -20
- package/libm/index.js.map +0 -1
- package/libm/math/Abs.js.map +0 -1
- package/libm/math/Add.js.map +0 -1
- package/libm/math/Digit.js.map +0 -1
- package/libm/math/GreaterThan.js.map +0 -1
- package/libm/math/IsPositive.js.map +0 -1
- package/libm/math/IsWhole.js.map +0 -1
- package/libm/math/Max.js.map +0 -1
- package/libm/math/Subtract.js.map +0 -1
- package/libm/math/index.js.map +0 -1
- package/libm/nominal-types/Brand.js.map +0 -1
- package/libm/nominal-types/Flavor.js +0 -14
- package/libm/nominal-types/Flavor.js.map +0 -1
- package/libm/nominal-types/index.js.map +0 -1
- package/libm/nominal-types/nominalMatch.js.map +0 -1
- package/libm/nominal-types/types.js.map +0 -1
- package/libm/object/ANotB.js.map +0 -1
- package/libm/object/AnyRecord.js.map +0 -1
- package/libm/object/ExcludePropType.js.map +0 -1
- package/libm/object/IsDisjoint.js.map +0 -1
- package/libm/object/IsRecord.js.map +0 -1
- package/libm/object/KeyTypes.js.map +0 -1
- package/libm/object/KeyofOptional.js.map +0 -1
- package/libm/object/KeysWithDiffType.js.map +0 -1
- package/libm/object/KnownKeys.js.map +0 -1
- package/libm/object/OptionalKeys.js.map +0 -1
- package/libm/object/Partial.js.map +0 -1
- package/libm/object/RecursiveIntersect.js.map +0 -1
- package/libm/object/RecursivePartial.js.map +0 -1
- package/libm/object/RecursiveRequired.js.map +0 -1
- package/libm/object/Required.js.map +0 -1
- package/libm/object/RequiredKeys.js.map +0 -1
- package/libm/object/SpreadRecord.js.map +0 -1
- package/libm/object/ValueOf.js.map +0 -1
- package/libm/object/everyKey.js.map +0 -1
- package/libm/object/facade.js +0 -20
- package/libm/object/facade.js.map +0 -1
- package/libm/object/filterKey.js.map +0 -1
- package/libm/object/findKey.js.map +0 -1
- package/libm/object/forEachKey.js.map +0 -1
- package/libm/object/getField.js.map +0 -1
- package/libm/object/hasKey.js.map +0 -1
- package/libm/object/hasProperty.js.map +0 -1
- package/libm/object/index.js.map +0 -1
- package/libm/object/mapKey.js.map +0 -1
- package/libm/object/mapProperties.js.map +0 -1
- package/libm/object/omit.js.map +0 -1
- package/libm/object/pick.js.map +0 -1
- package/libm/object/reduceKey.js.map +0 -1
- package/libm/object/replaceProperty.js.map +0 -1
- package/libm/object/someKey.js.map +0 -1
- package/libm/object/typeOverrideIncompatible.js.map +0 -1
- package/libm/predicates/CanAssign.js.map +0 -1
- package/libm/predicates/Equal.js.map +0 -1
- package/libm/predicates/Extends.js.map +0 -1
- package/libm/predicates/If.js.map +0 -1
- package/libm/predicates/index.js +0 -7
- package/libm/predicates/index.js.map +0 -1
- package/libm/predicates/isType.js +0 -25
- package/libm/predicates/isType.js.map +0 -1
- package/libm/predicates/logical.js.map +0 -1
- package/libm/promise/PromiseValue.js.map +0 -1
- package/libm/promise/PromiseValueMerge.js.map +0 -1
- package/libm/promise/index.js.map +0 -1
- package/libm/promise/isPromise.js +0 -4
- package/libm/promise/isPromise.js.map +0 -1
- package/libm/promise/mapSeries.js +0 -10
- package/libm/promise/mapSeries.js.map +0 -1
- package/libm/types/AllType.js.map +0 -1
- package/libm/types/Any.js.map +0 -1
- package/libm/types/Array.js.map +0 -1
- package/libm/types/Boolean.js.map +0 -1
- package/libm/types/Generate.js.map +0 -1
- package/libm/types/Null.js.map +0 -1
- package/libm/types/Number.js.map +0 -1
- package/libm/types/Object.js.map +0 -1
- package/libm/types/Record.js.map +0 -1
- package/libm/types/String.js.map +0 -1
- package/libm/types/Symbol.js.map +0 -1
- package/libm/types/Tuple.js.map +0 -1
- package/libm/types/Undefined.js.map +0 -1
- package/libm/types/Union.js.map +0 -1
- package/libm/types/Unknown.js.map +0 -1
- package/libm/types/analyze.js.map +0 -1
- package/libm/types/check.js.map +0 -1
- package/libm/types/conform.js.map +0 -1
- package/libm/types/getPlainAnalysisReport.js.map +0 -1
- package/libm/types/index.js.map +0 -1
- package/libm/types/optional.js.map +0 -1
- package/libm/types/required.js.map +0 -1
- package/libm/types/satisfy.js.map +0 -1
- package/libm/types/types.js.map +0 -1
- package/libm/utils/Widen.js.map +0 -1
- package/libm/utils/as.js.map +0 -1
- package/libm/utils/index.js.map +0 -1
- package/src/JSONTypes.spec.ts +0 -43
- package/src/JSONTypes.ts +0 -17
- package/src/PrimitiveTypes.ts +0 -2
- package/src/UnionToIntersection.ts +0 -7
- package/src/array/CommonPropKeys.spec.ts +0 -20
- package/src/array/CommonPropKeys.ts +0 -18
- package/src/array/Concat.spec.ts +0 -21
- package/src/array/Concat.ts +0 -1
- package/src/array/CreateTuple.spec.ts +0 -21
- package/src/array/CreateTuple.ts +0 -7
- package/src/array/DropFirst.spec.ts +0 -21
- package/src/array/DropFirst.ts +0 -9
- package/src/array/DropLast.spec.ts +0 -21
- package/src/array/DropLast.ts +0 -9
- package/src/array/Filter.spec.ts +0 -21
- package/src/array/Filter.ts +0 -12
- package/src/array/FindFirst.spec.ts +0 -27
- package/src/array/FindFirst.ts +0 -13
- package/src/array/FindLast.spec.ts +0 -27
- package/src/array/FindLast.ts +0 -8
- package/src/array/Head.spec.ts +0 -21
- package/src/array/Head.ts +0 -1
- package/src/array/IntersectOfProps.spec.ts +0 -14
- package/src/array/IntersectOfProps.ts +0 -20
- package/src/array/IsArray.ts +0 -1
- package/src/array/PadLeft.spec.ts +0 -26
- package/src/array/PadLeft.ts +0 -16
- package/src/array/Reverse.spec.ts +0 -17
- package/src/array/Reverse.ts +0 -10
- package/src/array/Some.spec.ts +0 -79
- package/src/array/Some.ts +0 -24
- package/src/array/Tail.spec.ts +0 -32
- package/src/array/Tail.ts +0 -7
- package/src/array/UnionOfProps.spec.ts +0 -14
- package/src/array/UnionOfProps.ts +0 -18
- package/src/array/UnionOfValues.spec.ts +0 -11
- package/src/array/UnionOfValues.ts +0 -10
- package/src/array/index.ts +0 -19
- package/src/assertion/assertType.spec.ts +0 -504
- package/src/assertion/assertType.ts +0 -105
- package/src/assertion/index.ts +0 -1
- package/src/class/AnyConstructor.spec.ts +0 -13
- package/src/class/isConstructor.spec.ts +0 -30
- package/src/class/isConstructor.ts +0 -13
- package/src/function/AnyFunction.spec.ts +0 -21
- package/src/functional/ChainFn.spec.ts +0 -7
- package/src/functional/ChainFn.ts +0 -6
- package/src/functional/Maybe.spec.ts +0 -43
- package/src/functional/Maybe.ts +0 -18
- package/src/functional/index.ts +0 -2
- package/src/index.ts +0 -19
- package/src/math/Abs.spec.ts +0 -14
- package/src/math/Abs.ts +0 -4
- package/src/math/Add.spec.ts +0 -82
- package/src/math/Add.ts +0 -49
- package/src/math/Digit.spec.ts +0 -185
- package/src/math/Digit.ts +0 -115
- package/src/math/GreaterThan.spec.ts +0 -40
- package/src/math/GreaterThan.ts +0 -36
- package/src/math/IsPositive.ts +0 -9
- package/src/math/IsWhole.spec.ts +0 -19
- package/src/math/IsWhole.ts +0 -9
- package/src/math/Max.spec.ts +0 -35
- package/src/math/Max.ts +0 -31
- package/src/math/README.md +0 -7
- package/src/math/Subtract.spec.ts +0 -40
- package/src/math/Subtract.ts +0 -40
- package/src/math/index.ts +0 -7
- package/src/nominal-types/Brand.spec.ts +0 -43
- package/src/nominal-types/Brand.ts +0 -32
- package/src/nominal-types/Flavor.spec.ts +0 -51
- package/src/nominal-types/Flavor.ts +0 -34
- package/src/object/ANotB.ts +0 -21
- package/src/object/ExcludePropType.spec.ts +0 -13
- package/src/object/IsDisjoint.spec.ts +0 -25
- package/src/object/IsDisjoint.ts +0 -12
- package/src/object/IsRecord.spec.ts +0 -22
- package/src/object/IsRecord.ts +0 -4
- package/src/object/KeyofOptional.spec.ts +0 -8
- package/src/object/KeysWithDiffType.spec.ts +0 -21
- package/src/object/KnownKeys.spec.ts +0 -39
- package/src/object/KnownKeys.ts +0 -16
- package/src/object/Partial.spec.ts +0 -50
- package/src/object/RecursiveIntersect.spec.ts +0 -39
- package/src/object/Required.spec.ts +0 -29
- package/src/object/SpreadRecord.spec.ts +0 -14
- package/src/object/SpreadRecord.ts +0 -6
- package/src/object/ValueOf.spec.ts +0 -36
- package/src/object/facade.ts +0 -36
- package/src/object/getField.spec.ts +0 -21
- package/src/object/getField.ts +0 -21
- package/src/object/hasKey.ts +0 -7
- package/src/object/hasProperty.spec.ts +0 -15
- package/src/object/index.ts +0 -35
- package/src/object/mapProperties.spec.ts +0 -27
- package/src/object/omit.spec.ts +0 -104
- package/src/object/omit.ts +0 -36
- package/src/object/pick.spec.ts +0 -66
- package/src/object/pick.ts +0 -35
- package/src/object/typeOverrideIncompatible.spec.ts +0 -24
- package/src/object/typeOverrideIncompatible.ts +0 -10
- package/src/predicates/CanAssign.spec.ts +0 -57
- package/src/predicates/CanAssign.ts +0 -18
- package/src/predicates/Equal.spec.ts +0 -71
- package/src/predicates/Equal.ts +0 -14
- package/src/predicates/Extends.ts +0 -4
- package/src/predicates/If.spec.ts +0 -14
- package/src/predicates/If.ts +0 -5
- package/src/predicates/index.spec.ts +0 -73
- package/src/predicates/index.ts +0 -16
- package/src/predicates/isType.spec.ts +0 -106
- package/src/predicates/isType.ts +0 -32
- package/src/predicates/logical.spec.ts +0 -59
- package/src/predicates/logical.ts +0 -4
- package/src/promise/PromiseValue.spec.ts +0 -6
- package/src/promise/isPromise.ts +0 -3
- package/src/promise/mapSeries.ts +0 -9
- package/src/type-checker/AnyType.ts +0 -13
- package/src/type-checker/buildTypes.spec.ts +0 -28
- package/src/types/Generate.ts +0 -48
- package/src/types/Number.ts +0 -56
- package/src/types/Object.ts +0 -53
- package/src/types/String.ts +0 -56
- package/src/types/Symbol.ts +0 -19
- package/src/types/Tuple.ts +0 -50
- package/src/types/getPlainAnalysisReport.ts +0 -115
- package/src/types/index.ts +0 -28
- package/src/types/optional.ts +0 -30
- package/src/types/required.ts +0 -30
- package/src/types/satisfy.accept.ts +0 -36
- package/src/utils/as.spec.ts +0 -24
- package/src/utils/as.ts +0 -7
- package/src/utils/index.ts +0 -2
package/README.md
CHANGED
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
Provides additional types and type adjusted utilities for [TypeScript](https://www.typescriptlang.org/).
|
|
15
15
|
|
|
16
|
-
## What's new
|
|
17
|
-
|
|
18
|
-
Please check out the [release note](./docs/releases/whats-new-in-3.9.md) to see what's new in 3.9!
|
|
19
|
-
|
|
20
16
|
## Feature Highlights
|
|
21
17
|
|
|
22
18
|
- [Runtime type checker](#runtime-type-checker)
|
|
@@ -35,8 +31,8 @@ yarn add type-plus
|
|
|
35
31
|
## Runtime type checker
|
|
36
32
|
|
|
37
33
|
Bringing the power of TypeScript to JavaScript runtime.
|
|
38
|
-
At the moment, this
|
|
39
|
-
If you need more
|
|
34
|
+
At the moment, this provides some basic functionalities.
|
|
35
|
+
If you need more features, I would recommend other excellent type checking libraries such as [zod](https://github.com/colinhacks/zod).
|
|
40
36
|
|
|
41
37
|
```ts
|
|
42
38
|
const eslintConfig = T.object.create({
|
|
@@ -74,13 +70,13 @@ Types supported: `any`, `array`, `boolean`, `null`, `number`, `object`, `record`
|
|
|
74
70
|
i.e., most of the basic types are supported except `bigint`.
|
|
75
71
|
It is left out for backward compatibility reasons.
|
|
76
72
|
|
|
77
|
-
You can use one of the three functions to perform type
|
|
73
|
+
You can use one of the three functions to perform type-check:
|
|
78
74
|
|
|
79
75
|
`satisfy(type, subject)`:
|
|
80
76
|
A loose type check that permits extra elements in `Tuple` and properties in `Object`.
|
|
81
77
|
|
|
82
78
|
`conform(type, subject)`:
|
|
83
|
-
A
|
|
79
|
+
A strict type check that does not allow extra elements in `Tuple` and properties in `Object`.
|
|
84
80
|
|
|
85
81
|
`check(options, type, subject)`:
|
|
86
82
|
A general form of `satisfy()` and `conform()`.
|
|
@@ -107,7 +103,7 @@ Use the one that fits your specific needs.
|
|
|
107
103
|
✔️ `immediate`
|
|
108
104
|
|
|
109
105
|
It ensures `subject` satisfies `T`.
|
|
110
|
-
It is similar to `const x: T = subject` without introducing unused variable.
|
|
106
|
+
It is similar to `const x: T = subject` without introducing an unused variable.
|
|
111
107
|
You need to specify `T` for it to work.
|
|
112
108
|
|
|
113
109
|
`assertType<T>(subject, validator)`:
|
|
@@ -116,7 +112,7 @@ You need to specify `T` for it to work.
|
|
|
116
112
|
|
|
117
113
|
✔️ `assertion function`, `runtime`
|
|
118
114
|
|
|
119
|
-
These overloads of `assertType`
|
|
115
|
+
These overloads of `assertType` allow you to specify a `validator`.
|
|
120
116
|
With these overloads, `subject` can be `unknown` or `any`.
|
|
121
117
|
|
|
122
118
|
If `subject` fails the assertion,
|
|
@@ -163,7 +159,7 @@ const s: number | undefined = undefined
|
|
|
163
159
|
assertType.isUndefined(s) // TypeScript complains
|
|
164
160
|
```
|
|
165
161
|
|
|
166
|
-
They
|
|
162
|
+
They accept `any` and will be narrowed to the specific type.
|
|
167
163
|
|
|
168
164
|
```ts
|
|
169
165
|
const s: any = undefined
|
|
@@ -177,9 +173,9 @@ s // type is undefined
|
|
|
177
173
|
|
|
178
174
|
Check if the subject type is `never`.
|
|
179
175
|
This function is not very useful in actual code as TypeScript will indicate the error.
|
|
180
|
-
But it can be useful when writing tests for
|
|
176
|
+
But it can be useful when writing tests for types.
|
|
181
177
|
|
|
182
|
-
This is useful for
|
|
178
|
+
This is useful for variables. For type level only check, do the following:
|
|
183
179
|
|
|
184
180
|
```ts
|
|
185
181
|
assertType.isTrue(true as Equal<YourType, never>)
|
|
@@ -214,8 +210,8 @@ const s: number | undefined = 1
|
|
|
214
210
|
assertType.noUndefined(s) // TypeScript complains
|
|
215
211
|
```
|
|
216
212
|
|
|
217
|
-
They
|
|
218
|
-
assertion will
|
|
213
|
+
They accept `subject` with type `any` or `unknown`,
|
|
214
|
+
the assertion will happen in runtime to ensure `subject` is the specific type.
|
|
219
215
|
|
|
220
216
|
`isType<T>(subject: T)`:
|
|
221
217
|
|
|
@@ -250,11 +246,11 @@ It returns `true` when passes (which is the only case when used in TypeScript).
|
|
|
250
246
|
✔️ `immediate`
|
|
251
247
|
|
|
252
248
|
Slightly easier to use then `isType.t<>()` and `isType.f<>()`,
|
|
253
|
-
when doing type
|
|
249
|
+
when doing type-level only equality comparison as you don't have to import `Equal<>`.
|
|
254
250
|
|
|
255
251
|
✔️ `type guard`, `runtime`
|
|
256
252
|
|
|
257
|
-
These overloads of `isType`
|
|
253
|
+
These overloads of `isType` allow you to specify a `validator`.
|
|
258
254
|
With these overloads, `subject` can be `unknown` or `any`.
|
|
259
255
|
|
|
260
256
|
`Equal<A, B>`:
|
|
@@ -302,7 +298,7 @@ assertType.isTrue(true as CanAssign<{ a:string, b:number }, { a: string }>)
|
|
|
302
298
|
|
|
303
299
|
✔️ `immediate`, `logical`
|
|
304
300
|
|
|
305
|
-
Returns a compile
|
|
301
|
+
Returns a compile-time validating function to ensure `subject` is assignable to `T`.
|
|
306
302
|
|
|
307
303
|
```ts
|
|
308
304
|
const isConfig = canAssign<{ a: string }>()
|
|
@@ -313,7 +309,7 @@ assertType.isTrue(isConfig({ a: 'a' }))
|
|
|
313
309
|
|
|
314
310
|
✔️ `immediate`, `logical`
|
|
315
311
|
|
|
316
|
-
Returns a compile
|
|
312
|
+
Returns a compile-time validating function to ensure `subject` is not assignable to `T`.
|
|
317
313
|
|
|
318
314
|
```ts
|
|
319
315
|
const notA = canAssign<{ a: string }>(false)
|
|
@@ -324,7 +320,7 @@ notA({ a: '' }) // TypeScript complains
|
|
|
324
320
|
|
|
325
321
|
## Nominal Type
|
|
326
322
|
|
|
327
|
-
TypeScript type system is structural.
|
|
323
|
+
The TypeScript type system is structural.
|
|
328
324
|
|
|
329
325
|
In some cases, we want to express a type with nominal behavior.
|
|
330
326
|
`type-plus` provides two kinds of nominal types: `Brand` and `Flavor`.
|
|
@@ -383,12 +379,12 @@ nominalMatch(b1, b2) // false
|
|
|
383
379
|
|
|
384
380
|
## Functional Types
|
|
385
381
|
|
|
386
|
-
- `ChainFn<T>: T`: chain function that
|
|
382
|
+
- `ChainFn<T>: T`: chain function that returns the input type.
|
|
387
383
|
|
|
388
384
|
## Type Utilities
|
|
389
385
|
|
|
390
386
|
`type-plus` also provides additional type utilities.
|
|
391
|
-
These utilities
|
|
387
|
+
These utilities include utility types and type-adjusted functions.
|
|
392
388
|
|
|
393
389
|
Note that most `predicate` types (such as `IsAny<>`) have a `Then` and `Else` that you can override.
|
|
394
390
|
|
|
@@ -406,13 +402,13 @@ type No = IsAny<1, 'yes', 'no'> // 'no'
|
|
|
406
402
|
- `CreateTuple<L, T>`: creates `Tuple<T>` with `L` number of elements.
|
|
407
403
|
- `DropFirst<A>`: drops the first value type of `A`.
|
|
408
404
|
- `DropLast<A>`: drops the last value type of `A`.
|
|
409
|
-
- `Filter<A, Criteria>`: gets array of types satisfying `Criteria` in `A`.
|
|
410
|
-
- `FindFirst<A, Criteria>`: gets first type satisfying `Criteria`.
|
|
411
|
-
- `FindLast<A, Criteria>`: gets last type satisfying `Criteria`.
|
|
405
|
+
- `Filter<A, Criteria>`: gets the array of types satisfying `Criteria` in `A`.
|
|
406
|
+
- `FindFirst<A, Criteria>`: gets the first type satisfying `Criteria`.
|
|
407
|
+
- `FindLast<A, Criteria>`: gets the last type satisfying `Criteria`.
|
|
412
408
|
- `Head<A>`: gets the first entry in the array.
|
|
413
409
|
- `IntersectOfProps<A, K>`: gets the intersect of `A[K]` types (deprecate `MapToProp`)
|
|
414
410
|
- `IsArray<T>`: `logical` predicate for `Array`.
|
|
415
|
-
- `literalArray(...entries)`: return an array
|
|
411
|
+
- `literalArray(...entries)`: return an array whose items are restricted to the provided literals.
|
|
416
412
|
- `PadLeft<A, Total, PadWith>`: pads `A` with `PadWith` if the length of `A` is less than `L`.
|
|
417
413
|
- `reduceWhile()`: `reduce()` with predicate for early termination. \
|
|
418
414
|
A simple version of the same function in the `ramda` package.
|
|
@@ -426,6 +422,8 @@ type No = IsAny<1, 'yes', 'no'> // 'no'
|
|
|
426
422
|
|
|
427
423
|
- `KeyTypes`: type of all keys.
|
|
428
424
|
- `PrimitiveTypes`: all primitive types, including `Function`, `symbol`, and `bigint`.
|
|
425
|
+
- `ComposableTypes`: Types that can contain custom properties. i.e. `object`, `array`, `function`.
|
|
426
|
+
- `NonComposableTypes`: Types that cannot contain custom properties. i.e. not composable.
|
|
429
427
|
|
|
430
428
|
### JSON Support
|
|
431
429
|
|
|
@@ -467,9 +465,9 @@ JSONTypes.get<string>(someJson, 'a', 'b', 1, 'c') // miku
|
|
|
467
465
|
|
|
468
466
|
### Type manipulation
|
|
469
467
|
|
|
470
|
-
- `ANotB<A, B>`: get object with properties in `A` and not in `B`, including properties with different value type.
|
|
468
|
+
- `ANotB<A, B>`: get object with properties in `A` and not in `B`, including properties with a different value type.
|
|
471
469
|
- `BNotA<A, B>`: flip of `ANotB`
|
|
472
|
-
- `as<T>(subject)`: assert `subject` as `T`. Avoid ASI
|
|
470
|
+
- `as<T>(subject)`: assert `subject` as `T`. Avoid ASI issues such as `;(x as any).abc`
|
|
473
471
|
- `asAny(subject)`: assert `subject` as `any`. Avoid ASI issue such as `;(x as any).abc`
|
|
474
472
|
- `Except<T, K>`: Deprecated. Same as `Omit<T, K>`.
|
|
475
473
|
- `ExcludePropType<T, U>`: excludes type `U` from properties in `T`.
|
|
@@ -481,13 +479,13 @@ JSONTypes.get<string>(someJson, 'a', 'b', 1, 'c') // miku
|
|
|
481
479
|
- `PartialExcept<T, U>`: Deprecated. Same as `PartialOmit<T, U>`.
|
|
482
480
|
- `PartialOmit<T, U>`: makes the properties not specified in `U` becomes optional.
|
|
483
481
|
- `PartialPick<T, U>`: makes the properties specified in `U` becomes optional.
|
|
484
|
-
- `Pick<T, K>`: pick properties `K` from `T`. Works with
|
|
482
|
+
- `Pick<T, K>`: pick properties `K` from `T`. Works with unions.
|
|
485
483
|
- `RecursivePartial<T>`: make type `T` optional recursively.
|
|
486
484
|
- `RecursiveRequired<T>`: make type `T` required recursively.
|
|
487
485
|
- `ReplaceProperty<T, K, V>`: replace property `K` in `T` with `V`.
|
|
488
486
|
- `RequiredKeys<T>`: gets keys of required properties in `T`.
|
|
489
|
-
- `RequiredPick<T, U>`: makes the properties specified in `U`
|
|
490
|
-
- `RequiredExcept<T, U>`: makes the properties not specified in `U`
|
|
487
|
+
- `RequiredPick<T, U>`: makes the properties specified in `U` become required.
|
|
488
|
+
- `RequiredExcept<T, U>`: makes the properties not specified in `U` become required.
|
|
491
489
|
- `RecursiveIntersect<T, U>`: intersect type `U` onto `T` recursively.
|
|
492
490
|
- `ValueOf<T>`: type of the value of the properties of `T`.
|
|
493
491
|
- `Widen<T>`: widen literal types.
|
|
@@ -502,6 +500,7 @@ They can be used to compose complex types.
|
|
|
502
500
|
- `IsAny<T>`: `T === any`.
|
|
503
501
|
- `IsBoolean<T>`: check for `boolean`, but not for `true` nor `false`.
|
|
504
502
|
- `IsDisjoint<A, B>`: is `A` and `B` is a disjoint set.
|
|
503
|
+
- `IsEmptyObject<T>`: is `T === {}`.
|
|
505
504
|
- `IsLiteral<T>`: is `T` a literal type (literal string or number).
|
|
506
505
|
|
|
507
506
|
#### Logical
|
|
@@ -512,7 +511,7 @@ They can be used to compose complex types.
|
|
|
512
511
|
- `Xor<A, B>`: logical `XOR`.
|
|
513
512
|
- `Not<X>`: logical `NOT`.
|
|
514
513
|
|
|
515
|
-
Note that these types work correctly with `boolean` type.
|
|
514
|
+
Note that these types work correctly with the `boolean` type.
|
|
516
515
|
e.g.:
|
|
517
516
|
|
|
518
517
|
- `And<boolean, true> -> boolean`
|
|
@@ -532,8 +531,7 @@ So you may encounter some weird behavior if your logic is complex.
|
|
|
532
531
|
#### Arithmetics
|
|
533
532
|
|
|
534
533
|
- `Add<A, B, Fail=never>`: `A + B` for positive and whole numbers, `Fail` otherwise.
|
|
535
|
-
- `Subtract<A, B, Fail=never>`: `A - B` for positive and whole numbers, `Fail` otherwise
|
|
536
|
-
Negative result also returns `Fail`.
|
|
534
|
+
- `Subtract<A, B, Fail=never>`: `A - B` for positive and whole numbers, `Fail` otherwise.
|
|
537
535
|
- `Increment<A, Fail=never>`: alias of `Add<A, 1, Fail>`.
|
|
538
536
|
- `Decrement<A, Fail=never>`: alias of `Subtract<A, 1, Fail>`.
|
|
539
537
|
|
|
@@ -544,6 +542,7 @@ So you may encounter some weird behavior if your logic is complex.
|
|
|
544
542
|
- `hasKey()`: function of `HasKey`.
|
|
545
543
|
- `hasProperty(value, prop)`: assert `value` has property `prop`. This will pick the correct union type.
|
|
546
544
|
- `isConstructor(subject)`: type guard `subject` is a constructor.
|
|
545
|
+
- `isSystemError(code, err)`: type guard `err` with Nodejs error code.
|
|
547
546
|
- `pick(obj, ...props)`: pick properties from `obj`.
|
|
548
547
|
- `omit(obj, ...props)`: omit properties from `obj`.
|
|
549
548
|
- `required(...)`: merge options and removing `Partial<T>`. From [`unpartial`](https://github.com/unional/unpartial)
|
|
@@ -570,9 +569,9 @@ overrider(source, { foo: !!source.foo })
|
|
|
570
569
|
|
|
571
570
|
## Attribution
|
|
572
571
|
|
|
573
|
-
Some of the code in this library
|
|
574
|
-
I merely adding them in and
|
|
575
|
-
|
|
572
|
+
Some of the code in this library is created by other people in the TypeScript community.
|
|
573
|
+
I merely adding them in and maybe making some adjustments.
|
|
574
|
+
Whenever possible, I add attribution to the person who created those **codes** in the file.
|
|
576
575
|
|
|
577
576
|
## Similar projects
|
|
578
577
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types that can contain custom properties.
|
|
3
|
+
*/
|
|
4
|
+
export declare type ComposableTypes = object | Function;
|
|
5
|
+
/**
|
|
6
|
+
* Types that cannot contain custom properties.
|
|
7
|
+
*/
|
|
8
|
+
export declare type NonComposableTypes = boolean | number | string | symbol | bigint | undefined | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposableTypes.js","sourceRoot":"","sources":["../ts/ComposableTypes.ts"],"names":[],"mappings":""}
|
|
File without changes
|
package/cjs/JSONTypes.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.JSONTypes = void 0;
|
|
13
|
+
exports.JSONTypes = { get: get };
|
|
14
|
+
function get(obj) {
|
|
15
|
+
var props = [];
|
|
16
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
17
|
+
props[_i - 1] = arguments[_i];
|
|
18
|
+
}
|
|
19
|
+
if (props.length === 0)
|
|
20
|
+
return obj;
|
|
21
|
+
if (typeof obj !== 'object' || obj === null)
|
|
22
|
+
return undefined;
|
|
23
|
+
var p = props.shift();
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
return get.apply(void 0, __spreadArray([obj[p]], props, false));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=JSONTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSONTypes.js","sourceRoot":"","sources":["../ts/JSONTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;AASa,QAAA,SAAS,GAAG,EAAE,GAAG,KAAA,EAAE,CAAA;AAEhC,SAAS,GAAG,CAAsB,GAAc;IAAE,eAAgC;SAAhC,UAAgC,EAAhC,qBAAgC,EAAhC,IAAgC;QAAhC,8BAAgC;;IAChF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAQ,CAAA;IACvC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IAC7D,IAAM,CAAC,GAAG,KAAK,CAAC,KAAK,EAAG,CAAA;IACxB,aAAa;IACb,OAAO,GAAG,8BAAC,GAAG,CAAC,CAAC,CAAC,GAAK,KAAK,SAAM,CAAA;AACnC,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveTypes.js","sourceRoot":"","sources":["../ts/PrimitiveTypes.ts"],"names":[],"mappings":""}
|
|
File without changes
|
package/{lib → cjs}/UnionKeys.js
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionKeys.js","sourceRoot":"","sources":["../ts/UnionKeys.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommonPropKeys.js","sourceRoot":"","sources":["../../ts/array/CommonPropKeys.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Concat.js","sourceRoot":"","sources":["../../ts/array/Concat.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateTuple.js","sourceRoot":"","sources":["../../ts/array/CreateTuple.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropFirst.js","sourceRoot":"","sources":["../../ts/array/DropFirst.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropLast.js","sourceRoot":"","sources":["../../ts/array/DropLast.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../ts/array/Filter.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FindFirst.js","sourceRoot":"","sources":["../../ts/array/FindFirst.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FindLast.js","sourceRoot":"","sources":["../../ts/array/FindLast.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Head.js","sourceRoot":"","sources":["../../ts/array/Head.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntersectOfProps.js","sourceRoot":"","sources":["../../ts/array/IntersectOfProps.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsArray.js","sourceRoot":"","sources":["../../ts/array/IsArray.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PadLeft.js","sourceRoot":"","sources":["../../ts/array/PadLeft.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reverse.js","sourceRoot":"","sources":["../../ts/array/Reverse.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Some.js","sourceRoot":"","sources":["../../ts/array/Some.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tail.js","sourceRoot":"","sources":["../../ts/array/Tail.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionOfProps.js","sourceRoot":"","sources":["../../ts/array/UnionOfProps.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionOfValues.js","sourceRoot":"","sources":["../../ts/array/UnionOfValues.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/array/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAgC;AAChC,2CAAwB;AACxB,gDAA6B;AAC7B,8CAA2B;AAC3B,6CAA0B;AAC1B,2CAAwB;AACxB,8CAA2B;AAC3B,6CAA0B;AAC1B,yCAAsB;AACtB,qDAAkC;AAClC,4CAAyB;AACzB,iDAA8B;AAC9B,4CAAyB;AACzB,gDAA6B;AAC7B,4CAAyB;AACzB,yCAAsB;AACtB,yCAAsB;AACtB,iDAA8B;AAC9B,kDAA+B"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literalArray.js","sourceRoot":"","sources":["../../ts/array/literalArray.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY;IAAqB,iBAAe;SAAf,UAAe,EAAf,qBAAe,EAAf,IAAe;QAAf,4BAAe;;IAC9D,OAAO,OAAO,CAAA;AAChB,CAAC;AAFD,oCAEC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reduceWhile.js","sourceRoot":"","sources":["../../ts/array/reduceWhile.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CACzB,SAA+C,EAC/C,UAAsF,EACtF,YAAe,EACf,KAAU;IAEV,IAAI,GAAG,GAAG,YAAY,CAAA;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACtB,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC;YAAE,OAAO,GAAG,CAAA;QACtC,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;KACvC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAbD,kCAaC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AnyConstructor } from '../class';
|
|
2
|
+
import { AnyFunction } from '../function';
|
|
3
|
+
/**
|
|
4
|
+
* assert the subject satisfies the specified type T
|
|
5
|
+
* @type T the type to check against.
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertType<T>(subject: T): asserts subject is T;
|
|
8
|
+
export declare function assertType<T>(subject: unknown, validator: (s: T) => boolean): asserts subject is T;
|
|
9
|
+
export declare function assertType<T extends new (...args: any) => any>(subject: unknown, constructor: T): asserts subject is InstanceType<T>;
|
|
10
|
+
export declare namespace assertType {
|
|
11
|
+
var isUndefined: (subject: undefined) => asserts subject is undefined;
|
|
12
|
+
var noUndefined: <S>(subject: Exclude<S, undefined>) => void;
|
|
13
|
+
var isNull: (subject: null) => asserts subject is null;
|
|
14
|
+
var noNull: <S>(subject: Exclude<S, null>) => void;
|
|
15
|
+
var isNumber: (subject: number) => asserts subject is number;
|
|
16
|
+
var noNumber: <S>(subject: Exclude<S, number>) => void;
|
|
17
|
+
var isBoolean: (subject: boolean) => asserts subject is boolean;
|
|
18
|
+
var noBoolean: <S>(subject: Exclude<S, boolean>) => void;
|
|
19
|
+
var isTrue: (subject: true) => asserts subject is true;
|
|
20
|
+
var noTrue: <S>(subject: Exclude<S, true>) => void;
|
|
21
|
+
var isFalse: (subject: false) => asserts subject is false;
|
|
22
|
+
var noFalse: <S>(subject: Exclude<S, false>) => void;
|
|
23
|
+
var isString: (subject: string) => asserts subject is string;
|
|
24
|
+
var noString: <S>(subject: Exclude<S, string>) => void;
|
|
25
|
+
var isFunction: (subject: AnyFunction<any[], any>) => asserts subject is AnyFunction<any[], any>;
|
|
26
|
+
var noFunction: <S>(subject: Exclude<S, AnyFunction<any[], any>>) => void;
|
|
27
|
+
var isConstructor: (subject: AnyConstructor<any[]>) => asserts subject is AnyConstructor<any[]>;
|
|
28
|
+
var isError: (subject: Error) => asserts subject is Error;
|
|
29
|
+
var noError: <S>(subject: Exclude<S, Error>) => void;
|
|
30
|
+
var isNever: (subject: never) => asserts subject is never;
|
|
31
|
+
var custom: <T>(validator: (s: T) => boolean) => (subject: unknown) => asserts subject is T;
|
|
32
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertType = void 0;
|
|
4
|
+
var tersify_1 = require("tersify");
|
|
5
|
+
var class_1 = require("../class");
|
|
6
|
+
function assertType(subject, validator) {
|
|
7
|
+
if (validator) {
|
|
8
|
+
if (((0, class_1.isConstructor)(validator) && !(subject instanceof validator)) || !validator(subject))
|
|
9
|
+
throw new TypeError("subject fails to satisfy ".concat((0, tersify_1.tersify)(validator)));
|
|
10
|
+
}
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
exports.assertType = assertType;
|
|
14
|
+
assertType.isUndefined = function (subject) {
|
|
15
|
+
if (typeof subject !== 'undefined')
|
|
16
|
+
throw TypeError("subject is not undefined");
|
|
17
|
+
};
|
|
18
|
+
assertType.noUndefined = function (subject) {
|
|
19
|
+
if (typeof subject === 'undefined')
|
|
20
|
+
throw TypeError("subject is undefined");
|
|
21
|
+
};
|
|
22
|
+
assertType.isNull = function (subject) {
|
|
23
|
+
if (subject !== null)
|
|
24
|
+
throw TypeError("subject is not null");
|
|
25
|
+
};
|
|
26
|
+
assertType.noNull = function (subject) {
|
|
27
|
+
if (subject === null)
|
|
28
|
+
throw TypeError("subject is null");
|
|
29
|
+
};
|
|
30
|
+
assertType.isNumber = function (subject) {
|
|
31
|
+
if (typeof subject !== 'number')
|
|
32
|
+
throw TypeError("subject is not number");
|
|
33
|
+
};
|
|
34
|
+
assertType.noNumber = function (subject) {
|
|
35
|
+
if (typeof subject === 'number')
|
|
36
|
+
throw TypeError("subject is number");
|
|
37
|
+
};
|
|
38
|
+
assertType.isBoolean = function (subject) {
|
|
39
|
+
if (typeof subject !== 'boolean')
|
|
40
|
+
throw TypeError("subject is not boolean");
|
|
41
|
+
};
|
|
42
|
+
assertType.noBoolean = function (subject) {
|
|
43
|
+
if (typeof subject === 'boolean')
|
|
44
|
+
throw TypeError("subject is boolean");
|
|
45
|
+
};
|
|
46
|
+
assertType.isTrue = function (subject) {
|
|
47
|
+
if (subject !== true)
|
|
48
|
+
throw TypeError("subject is not true");
|
|
49
|
+
};
|
|
50
|
+
assertType.noTrue = function (subject) {
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
if (subject === true)
|
|
53
|
+
throw TypeError("subject is true");
|
|
54
|
+
};
|
|
55
|
+
assertType.isFalse = function (subject) {
|
|
56
|
+
if (subject !== false)
|
|
57
|
+
throw TypeError("subject is not false");
|
|
58
|
+
};
|
|
59
|
+
assertType.noFalse = function (subject) {
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
if (subject === false)
|
|
62
|
+
throw TypeError("subject is false");
|
|
63
|
+
};
|
|
64
|
+
assertType.isString = function (subject) {
|
|
65
|
+
if (typeof subject !== 'string')
|
|
66
|
+
throw TypeError("subject is not string");
|
|
67
|
+
};
|
|
68
|
+
assertType.noString = function (subject) {
|
|
69
|
+
if (typeof subject === 'string')
|
|
70
|
+
throw TypeError("subject is string");
|
|
71
|
+
};
|
|
72
|
+
assertType.isFunction = function (subject) {
|
|
73
|
+
if (typeof subject !== 'function')
|
|
74
|
+
throw TypeError("subject is not function");
|
|
75
|
+
};
|
|
76
|
+
assertType.noFunction = function (subject) {
|
|
77
|
+
if (typeof subject === 'function')
|
|
78
|
+
throw TypeError("subject is function");
|
|
79
|
+
};
|
|
80
|
+
assertType.isConstructor = function (subject) {
|
|
81
|
+
if (!(0, class_1.isConstructor)(subject))
|
|
82
|
+
throw TypeError("subject is not a constructor");
|
|
83
|
+
};
|
|
84
|
+
assertType.isError = function (subject) {
|
|
85
|
+
if (!(subject instanceof Error))
|
|
86
|
+
throw TypeError("subject is not an Error");
|
|
87
|
+
};
|
|
88
|
+
assertType.noError = function (subject) {
|
|
89
|
+
if (subject instanceof Error)
|
|
90
|
+
throw TypeError("subject is an Error");
|
|
91
|
+
};
|
|
92
|
+
assertType.isNever = function (subject) {
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* creates a custom assertion function with standard TypeError.
|
|
96
|
+
* Currently this requires explicity type annotation,
|
|
97
|
+
* thus making it hard to use:
|
|
98
|
+
* https://github.com/microsoft/TypeScript/issues/41047
|
|
99
|
+
*/
|
|
100
|
+
assertType.custom = function (validator) {
|
|
101
|
+
return function (subject) {
|
|
102
|
+
if (!validator(subject))
|
|
103
|
+
throw new TypeError("subject fails to satisfy ".concat((0, tersify_1.tersify)(validator)));
|
|
104
|
+
return;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=assertType.js.map
|