Skip to content

yUnreal/ts-handy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Utility package for types

Starting

Installing

npm i ts-handy

Example

All types have an example embedded in the @example tag, use them.

// Import Any/Util
import { Any } from 'ts-handy';

interface Person {
    name: string;
    more: {
        money: number;
    };
}

// Now all keys are read-only
type Readable = Any.DeepReadonly<Person>;

// Now all keys are writable
type Writable = Any.DeepWritable<Readable>;

What's coming

  • More types
  • More documentation

Importing

You can import in different ways:

TIP: Avoid importing all library types by using the wildcard (*)

  • Raw
import { Array, String, ... } from 'ts-handy';
  • Usable
import th from 'ts-handy';
  • Never do:
import * as th from 'ts-handy';

Types

Any Array Class
Boolean String Function
String

Good practices

If you found any type errors, please consider submitting a pull request.

Want to contribute? Submit a pull request.