typed-conversions
v0.12.0
Published
typed-conversions
Downloads
160
Readme
typed-conversions
A small set of data conversion functions with Typescript 2.x typing. Conversions include:
General Use
- hashToArray< T = any >(hash: IDictionary< T >): T[]
- arrayToHash< T = any >(arr: T[]): IDictionary< T >
- removeIdPropertyFromHash< T = any >(hash: IDictionary, keyProp: keyof T = "id"): IDictionary<Exclude<T, "id">>
- flatten< T = any >(list: T[]): T[]
Firebase Specific
snapshotToArray<T>: T[]
snapshotToHash<T>: IDictionary<T>
- combines snap.val() and snap.key into a JS ObjectsnapshotToOrderedArray<T>: T[]
snapshotToOrderedHash<T>: Array<IDictionary<T>>