Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 2.35 KB

File metadata and controls

36 lines (29 loc) · 2.35 KB

Module: lib.hash

README -> API Index -> Modules Index -> lib.hash

Source: src/lib/hash.js

Plain-object utilities for deep path access, transforms, and filtering.

Exported Functions

  • get - Safely get a nested value from an object using a dot-path.
  • set - Set a deep property on an object using a dotted path, creating missing intermediate objects as needed.
  • legacySet - Legacy non-destructive dotted-path setter.
  • expand - Expand a list of property paths from an object into an array of values.
  • to - Coerce any input into a hash (plain object).
  • is - Determine whether a value is a plain hash object.
  • hasKeys - Check that an object has all of the given keys / paths.
  • append - Shallow key/value decoration helper.
  • merge - Deep merge two plain hashes (non-destructive).
  • mergeMany - Merge a list of hashes left-to-right.
  • flatten - Flatten a nested hash or array into a shallow key/value object.
  • inflate - Inflate a flat hash of key/value pairs into a nested object.
  • exists - Check whether a deep property path exists.
  • strip - Deep-strip unwanted values from a hash/array structure.
  • filter - Filter an object or array by predicate.
  • getUntilNotEmpty - Return the first non-null / non-undefined value found at any of the given paths.
  • deepCopy - Deep copy utility with class / DOM safeguards.
  • keys - Return the enumerable keys of a hash.
  • empty - Test whether a value is an empty hash (plain object with no keys).
  • slice - Slice selected keys/paths from a record into a new object.

Related