0.1.12 • Published 7 years ago
@jsfx/utils v0.1.12
@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.allandPromise.raceAPI methods ').
Types exported by testy
DeclarationType- Defines the possible types for atestydeclaration.AssertionType- Defines the posible types for eachtestyassertion.AssertionFactoryType- Defines the type for thetestyassertion 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"