type-plus

Additional types and types adjusted utilities for TypeScript

MIT License

Downloads
91.8K
Stars
378
Committers
9

Bot releases are hidden (Show)

type-plus - [email protected]

Published by unional about 1 month ago

Minor Changes

  • cb37ca4: Add AdjustExactOptionalProps.
type-plus - [email protected]

Published by unional about 1 month ago

Minor Changes

  • 17bf492: Remove $Exact namespace.
    $Exact.$Options is now $ExactOptions.
    $Exact.$Default is now $ExactDefault.
    $Exact.$IsExact is now $IsExact.

Patch Changes

  • ac73d79: Removing incorrect usage of the typesVersions field in package.json.
  • 1e5108d: Add SubUnion type.
  • 37e47dc: Remove $Exact branch type. It is not needed anymore.
type-plus - [email protected] Latest Release

Published by unional 3 months ago

Minor Changes

  • 2d4d9b4: Reintroduce CJS support.
type-plus - [email protected]

Published by unional 3 months ago

Patch Changes

  • bbe256cb5: Remove exports.default in package.json.

    That provide the wrong file to systems expecting CJS.
    May need to add a different one for browser-spec.

type-plus - [email protected]

Published by unional 7 months ago

Minor Changes

  • f9821214a: Update to require typescript 5.4.

Patch Changes

  • 4ae069b28: Fix IsPositive<number & { a: 1 }> should return boolean
  • 72272509c: Simplify Omit type as the simpler code is working with typescript 5.4
  • 8901e750a: Work around excessive stack depth error in TS 5.4 for type Zeros.
  • b480c6c2b: Update some docs under numerics
  • 3d56d1a39: Fix IsInteger<number & { a: 1 }> should returns boolean
  • cc94afdc3: Fix IsNegative<number & { a: 1 }> should return boolean
type-plus - [email protected]

Published by unional 7 months ago

Fixed excessive stack depth error around Zeros type #427 by @ehoogeveen-medweb

Simplify Omit type as the simpler code is working with typescript 5.4

type-plus - [email protected]

Published by unional about 1 year ago

Major Changes

  • 2a0d791c6: Rename case* to $* to make them easier to use.
  • 061640050: Update and release as ESM package only.

Minor Changes

  • afac18a02: Add IsStrictObject<T> type.

  • b98ed6d9f: Accept readonly for array.
    Add ArrayPlus.IsReadonly.

    Fix ArrayPlus.Reverse to support readonly.

  • 69c540985: Add Merge<A, B> and ObjectPlus.Merge<A, B>

  • de549578a: Add customize support for ArrayPlus.Filter

  • 711639289: Add Box<T> to box primitive types to their boxed types.

Patch Changes

  • 3ed4dce5e: Optimize SplitAt by moving never check of DeleteCount to the top.

  • 5535a4a6d: fix IsArray<never[]>

  • d852d76b3: Add docs for ArrayPlus.IsReadonly.

    The following are internal changes thus not considered a breaking change:

    • Replace MergeOptions/MergeCases with TypePlusOptions.Merge.
    • Rename TypePlusOptions.Predicate to TypePlusOptions.Selection.
type-plus - [email protected]

Published by unional over 1 year ago

Minor Changes

  • 036094ba5: Support Delete and Insert for SplitAt.

Patch Changes

  • e76c6895d: Add keywords
type-plus - [email protected]

Published by unional over 1 year ago

Minor Changes

  • 4f1e6e813: Add UnionType and IsUnion

  • 1bee3922b: Improve FindFirst and ArrayPlus.Find to support union_miss and never cases,
    and some bug fixes.

  • b3d0af0d2: Export the improved Required type.

  • bc535d4dd: Support customization for Head and Tail

  • d2f97ca18: Add options support for:

    • TupleType, IsTuple, NotTupleType, IsNotTuple
    • DropFirst, DropLast,
    • FindFirst, ArrayPlus.FindFirst, TuplePlus.FindFirst

    Add MergeOptions.
    Add NotUnknownOr (all use cases are handled by MergeOptions at the moment)

  • 94bb1c00c: Improve FindFirst,
    add ArrayPlus.Find and TuplePlus.Find

  • 4e7e31098: Clean up CommonPropKeys.

    Add ArrayPlus.CommonPropKeys and TuplePlus.CommonPropKeys.
    Add support of caseNever.

  • 7a647ca41: Support override never case for TupleType, IsTuple, IsNotTuple, and NotTupleType

Patch Changes

  • 91211c9b5: Rename caseNoMatch to caseNotMatch.
    Rename caseUnionMiss to caseUnionNotMatch.

    Change caseUnionNotMatch default from undefined to never,
    making it defaults to the type behavior instead of JavaScript behavior.

  • 8a60488be: Move TestType under testType so that it is exported

type-plus - [email protected]

Published by unional over 1 year ago

Minor Changes

  • b55a61de3: Deprecate drop() as it does not sufficiently support the needed types.
  • cb2c68694: Add extends(), union(), intersect(), union_*, intersect_* to InspectedType.

Patch Changes

  • 81158731b: Separate Filter and PadStart for array and tuple
  • 9f08f5635: Improve Head and Last to support empty_tuple override
  • 9f08f5635: Improve IntersectOfProps to work with array just for completeness.
  • 810181628: Improve DropFirst and DropLast to support overriding cases.
  • 58da4b3ee: Update export field to export ./package.json.
  • 2454ab228: Improve CommonPropKeys
type-plus - [email protected]

Published by unional over 1 year ago

Patch Changes

  • 90eb2a492: Update package.json try fixing readme references
type-plus - [email protected]

Published by unional over 1 year ago

Minor Changes

  • e8547eb88: Add IsOptionalKey<T, K>.
  • bd6c695a2: Add OptionalProps<T>.
    Improve OptionalKeys<T> and IsOptionalKey<T, K>
  • d3faa0bff: Add OptionalKeys<T>

Patch Changes

  • d214ce6d7: Improve testType.inspect<T>(fn) to provide more information about T.

    Not consider as breaking change as the function is not expected to be use in any code.

type-plus - [email protected]

Published by unional over 1 year ago

Patch Changes

  • 6be5fa7b0: Improve IsLiteral type to support boolean, bigint, and symbol.
  • 0f0b9f8e0: Improve LeftJoin type behavior.
type-plus - [email protected]

Published by unional over 1 year ago

Minor Changes

  • a52cce02: Add testType.inspect<T>(fn) for easy type inspection.
type-plus - [email protected]

Published by unional over 1 year ago

Patch Changes

  • 26537d8e: Improve RecursivePartial to work with function type.
    Also add | undefined to make it compliant with exactOptionalPropertyTypes.
type-plus - [email protected]

Published by unional over 1 year ago

Minor Changes

  • aacb1ff4: Add AnyOrNeverType for parity.

    Update some code's JSDocs.

Patch Changes

  • ede34c22: Improve exports field
  • 74a71e35: remove extra empty {} for LeftJoin
  • 2d74ff0b: Support verbatimModuleSyntax
type-plus - v7.0.1

Published by unional over 1 year ago

Patch Changes

  • 946c6023: Remove @internal. It is causing those types to be skipped from output (cjs/esm/*.d.ts).
type-plus - v7.0.0

Published by unional over 1 year ago

Major Changes

  • 91c954fb: Remove Digit and DigitArray.

    They are internal types to begin with.
    They were exported probably to fix the "type cannot be named" error.

  • 469c8bd2: Fix array PadStart/PadLeft that triggers an infinite loop.

    Change default PadWith from any to unknown (breaking).

Minor Changes

  • Update Add, Subtract, and added Multiply which now works with number, bigint, positive, negative, and floating point.

  • e11d43c5: Expose FindLast also as ArrayPlus.FindList.

    Improved its handling of array.

  • 25e5fcb2: add NumericPlus

  • ee14247c: Add ArrayPlus.SplitAt

  • a49abe20: Mark the following code as deprecated:

    • isType.t()
    • isType.f()
    • isType.never()
  • 4352d514: Add StringToNumber, StringToBigint, and StringToNumeric

  • e93e366d: Add alternative Partial<T> type that works with exactOptionalPropertyTypes.

  • 10af3634: Add ArrayPlus.Reverse<A>

  • 82ffd7d9: Add NumericToString

  • 72aca9d0: Add MathPlus.ToNegative

  • 09495bec: Add ArrayPlus.Entries<A>.

  • 3e0e199b: Add remaining types to testType.*.

    testType is changed to a proxy to simplify implementation.

  • 73bbcf0e: Add PadStart, deprecase PadLeft

  • 65e84c4b: Expose FindFirst also as ArrayPlus.Find.

    Improved its handling of array.

  • d2997ded: Deprecate Equal and NotEqual. They are renamed to IsEqual and IsNotEqual.

    Equal and NotEqual will be changed to filter variant (a.k.a. parse variant) in the future.

  • 180a455e: Add TuplePlus.PadStart.

  • 7bf5d39e: Add StrictCanAssign<A,B> and testType.strictCanAssign()

  • 010a7880: Deprecate assertType(subject constructor).
    Add T/F to Extendable and NotExtendable.

  • 74cc6545: Alias Some under ArrayPlus.Some.

  • 4054c64b: GreaterThan and Max now support floating point and negative numbers, and bigint

Patch Changes

  • 84617522: At should return V | undefined for tuple when N is number (or any which includes number).

  • aaffd23e: fix Some<Array<number | string>, number> to return boolean.
    This is because besides Array<number | string> can be [1, 'a'],
    it can also be:

    const v: number | string = 123
    
    const a: Array<number | string> = [v]
    

    So Some<Array<number | string>, number> should distribute and return boolean.

  • 4878eb07: At should return V | undefined for array.

  • afc1840c: Add Upper and Lower for IndexAt.

    This allow fine-grained control over the IndexAt behavior,
    when the value is out of bounds.

    This is used in cases where out-of-bounds values are coarsen to the upper and lower bound of the subject array.

  • d31ea31f: Improve Abs to work with bigint

type-plus - v6.8.1

Published by unional over 1 year ago

Patch Changes

  • caa70e9e: Support isolated stub.builder use case.
type-plus - v6.8.0

Published by unional over 1 year ago

Minor Changes

  • 38b59e9b: Add stub.builder()

  • c2b6f375: Add more testType.*:

    testType.undefined()
    testType.null()
    testType.bigint()
    testType.strictBigint()
    testType.string()
    testType.strictString()

Patch Changes

  • 38b59e9b: stub.build() should not accept no init value.