@merzin/factory
v0.1.0
Published
Type `Factory<T>` is either a value `T` or a class that constructs (extends) `T` or a function that returns `T`. It also accepts a second generic that is used to declare the type of the arguments that the factory function or class constructor accepts. `Fa
Readme
Factory
Type Factory<T> is either a value T or a class that constructs (extends) T
or a function that returns T. It also accepts a second generic that is used to
declare the type of the arguments that the factory function or class constructor
accepts. Factory<number, [string, boolean]> matches function
(a: string, b: boolean) => number.
Package exports two (2) functions resolveFactory and isClass. Function
resolveFactory takes a Factory<T, A> and destructured arguments A and
returns a value of type T. Function isClass takes a value and returns
whether the value is a class or not.
