@jsfx/utils
v0.1.12
Published
@jsfx/utils ===================
Downloads
4
Readme
@jsfx/utils
Utility methods used in webassemb.ly.
Methods
invariant
- check that an assertion is true or raise an error message.testy
- create a declaration and test whether one or more assertions hold true.iterate
- evaluate an iterator through a protocol for each yielded or returned value.
Types
This repository uses the Flow type system. The following types are exposed by the utils
library.
ReturnType
- A generic type which will resolve the type returned by any function.ArgsType
- A generic type which will resolve the arguments passed to any function.PromiseResolveType
- A generic type which will resolve the value resolved by any promise.PromisesResolveType
- A generic type which will resolve the values resolved by any array of promises (such as throughPromise.all
andPromise.race
API methods ').
Types exported by testy
DeclarationType
- Defines the possible types for atesty
declaration.AssertionType
- Defines the posible types for eachtesty
assertion.AssertionFactoryType
- Defines the type for thetesty
assertion factory method.
Contributing
- One function per file.
- Use flow comment types
- Each file must have 100% flow coverage.
- Write unit tests
- Types must end with the word "Type", Iterfaces with "Interface"