0.1.0 • Published 4 years ago
dictlist-util-pmb v0.1.0
dictlist-util-pmb
Utilities for dealing with lists of dictionaries.
API
This module exports one function:
makeDictList(x)
Returns a dictionary list (shortened "DL" from now), i.e. an array that holds some extra methods described below.
- If
xis an array, the resulting DL will contain all elements ofxthat look like dictionary objects. (Currently, any truthy value qualifies.) - Otherwise, if
xlooks like a dictionary object, the resulting DL will contain justx. - If
xis false-y (e.g. not supplied), the resulting DL will be empty.
Methods on dictionary lists
.getEachOwnProp(key)
Return an array with the values of all own key-named properties from
all dictionaries that have them.
Usage
see test/usage.mjs.
Known issues
- Needs more/better tests and docs.
License
ISC
0.1.0
4 years ago