Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@stein197/ts-util

stein19730MIT1.10.0

TypeScript utility types

ts, typescript, util, utility, utils, utilities, cloneable, comparable, equalable, nullable, json, mime, attributes, css, tuple

readme

TypeScript utility types

This package contains most frequently used types that most projects need.

Installation

npm install @stein197/ts-util

Interfaces

  • Cloneable<T>
  • Comparable<T>
  • Equalable<T>

Types

  • Nullable<T>
  • ObjectMap<T>
  • Json
  • JsonArray
  • JsonObject
  • Large MIME module that contains all available MIME-types, described here
  • Large css module that contains types related to CSS properties and their types.
  • Large HTMLAttributes module that contains HTML-related typings
  • Tuple module

NOTE: For more detailed documentation, please, refer to the TSDoc comments in the source code.

NPM scripts

  • make:index generates at the root index.ts
  • make:mime generates MIME.ts file
  • build runs all scripts

changelog

CHANGELOG

[Unreleased]

  • Change file extensions from ts to d.ts

1.10.0 - 2022-12-04

Added

  • HTMLAttributes typings

1.9.0 - 2022-11-13

Added

  • Tuple module which contains three new types: Optional, TrimStart and TrimEnd

1.8.0 - 2022-11-04

Removed

1.7.0 - 2022-11-04

Added

  • KeyboardCode enum

1.6.0 - 2022-11-03

Added

  • PromiseState enum

1.5.0 - 2022-11-01

Added

  • CSS module

1.4.1 - 2022-09-19

Added

  • */* mime type

1.4.0 - 2022-09-18

Added

  • MIME* types

1.3.2 - 2021-11-09

Changed

  • JsonObject type accepts both string and number keys

1.3.1 - 2021-11-09

Changed

  • JsonObject type now accepts only string keys

1.3.0 - 2021-11-08

Added

  • JsonArray type
  • JsonObject type

1.2.0 - 2021-11-02

Added

  • Json type

1.1.0 - 2021-10-14

Added

  • ObjectMap<T> type

1.0.1 - 2021-10-03

Fixed

  • README

1.0.0 - 2021-10-03

Added

  • Nullable<T> type

    Removed

  • Observer, ObserverGroup classes

0.2.0 - 2021-10-02

Added

  • Observer, ObserverGroup classes

0.1.0 - 2021-09-29

Release