Skip to content

rccyx/typyx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

444 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typyx

Bullet-proof TypeScript, even more.

Installation

npm

npm i -D typyx

pnpm

pnpm i -D typyx

Requires TypeScript v5.0+.

Documentation

Check out the full API reference for detailed usage examples and docs.

Types

Object shape, keys, and modifiers

Deep object utilities

Union and composition utilities

Array and tuple utilities

String utilities

Numeric utilities

Logic, comparison, and control flow

Type predicates and checkers

Core, primitives, callables, and nullability

  • AnyFunction - Represents any function accepting any arguments and returning any value.
  • EmptyObject - Represents a non-nullish object-like value.
  • ExcludeNull<T> - Excludes null from a type T.
  • ExcludeNullable<T> - Excludes Nullable from a type T.
  • ExcludeUndefined<T> - Excludes undefined from a type T.
  • Falsy - Represents JavaScript falsy values.
  • Maybe<T> - Represents a type that may be Nullable.
  • MaybeUndefined<T> - Represents a type that may be undefined.
  • MaybeUnknown<T> - Represents a type widened with unknown.
  • Message<T> - Used to surface readable error messages instead of never.
  • Newable - Represents constructor functions that can be invoked with new.
  • NewType<New, Base> - Creates a branded type derived from an existing base type.
  • Nullable - Represents a type that can be null or undefined.
  • Optional<T> - Represents a type that may be null, similar to Python's Optional or Rust's Option.
  • PartialExcept<T, P> - Makes all properties in T optional except those in P, which remain required.
  • Primitive - Represents all JavaScript primitive types.
  • Simplify<T> - Flattens and normalizes a type for better readability.
  • UnknownFunction - Represents a function accepting unknown arguments and returning unknown.

The best way to understand how these types work is to check the tests directory.

Changelog

See releases.

License

MIT © @rccyx

About

Meta-type algebra engine

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors