Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@dzeio/object-util
Advanced tools
Utility functions to manipulate an object
import { objectMap, ... } from '@dzeio/object-util'
// or
const {objectMap, ...} = require('@dzeio/object-util')
<script src="https://cdn.jsdelivr.net/npm/@dzeio/object-util@1/dist/browser.js"></script>
<!-- each functions will be available as window.{objectMap, ...} or {objectMap, ...}-->
// Does the same as Array.map
objectMap(object, (value, key) => value + "pouet")
// does the same as Array.forEach with the addition of stopping if false is returned (like break)
// and return if loop was stopped or not
objectLoop(object, (value, key) => {})
// return the values of an object as an array
objectValues(object)
// return the keys of an object as an array
ObjectKeys(object)
// return the count of an object keys
objectSize(object)
// like Array.sort it sort and return an ordered object
objectSort(object, /*optionnal*/ (key1, key2) => key1 - key2)
// You can also sort by keys
// items not set in the array won't have their order changed and will be after the sorted ones
objectSort(object, ['key2', 'key1']) // => {key2: value, key1: value, key3: value}
// deeply clone an object
cloneObject(object)
// deeply set an object value while creating empty childs if necessary
//ex: this will set {path1, [{path3: 'value'}]} if object is an empty object
objectSet(object, ['path1', 0, 'path3'], 'value')
// deeply compare two objects
objectEqual(object, object2)
// deeply clean an object from undefined, null variables
objectClean(object, /* optionnal, defaults */{cleanUndefined: true, cleanNull: false, deep: true})
// clone (not deeply) an object and remove the keys from the object, 'a' and 'b' for this one
objectOmit(object, 'a', 'b')
// check if a variable is an object
isObject(object)
note: with the exception of isObject, every function will throw an error if the object is not an object
FAQs
Utility functions to manipulate an object
The npm package @dzeio/object-util receives a total of 0 weekly downloads. As such, @dzeio/object-util popularity was classified as not popular.
We found that @dzeio/object-util demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.