Skip to content

convenient data transformations, including Firebase specific conversions

License

Notifications You must be signed in to change notification settings

forest-fire/typed-conversions

Folders and files

NameName
Last commit message
Last commit date
Jul 21, 2021
Jul 21, 2021
Jul 21, 2021
Jul 21, 2021
Feb 1, 2018
Mar 12, 2019
Feb 1, 2018
Feb 1, 2018
May 24, 2020
Jun 23, 2020
Jul 21, 2021
Jun 24, 2020
Jun 23, 2020
Jun 23, 2020
Jun 23, 2020
Feb 1, 2018
Jun 23, 2020
Jun 23, 2020
Jul 21, 2021

Repository files navigation

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 Object
  • snapshotToOrderedArray<T>: T[]
  • snapshotToOrderedHash<T>: Array<IDictionary<T>>

About

convenient data transformations, including Firebase specific conversions

Resources

License

Stars

Watchers

Forks

Packages

No packages published