@luolapeikko/ts-common
    Preparing search index...

    @luolapeikko/ts-common

    ts-common

    Collection of common TS utility types, interfaces and utils.

    TypeScript npm version github action

    npm install @luolapeikko/ts-common
    
    • Loadable type to handle loadable value (e.g. value, value Promise, callback function returning value).
    • Array utility types like NonEmptyArray and NonEmptyReadonlyArray.
    • Object utility conditional types like RecordHaveReadonlyKeys and RecordHaveWritableKeys.
    • OneOf type to handle one of types (non-union way).
    • Object replacement functions like objectEntries, objectKeys, objectValues and objectMap to handle better return types.
    • Error utils like toError(value: unknown): Error | UnknownError, errorAs(err, TypeError): TypeError or errorWith(err, (msg) => new TypeError(msg)): TypeError
    • Helper interfaces like IToString, IToJSON.

    See more features on Package documentation