
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Simple objects' utilities for Node.js
Simple utility libraries that have common methods to deal with objects.
Install
npm install objects
Code
objects = require "objects"
That's easy!
Report the type of the variable safely as a string.
Possible return values:
undefined
, null
boolean
, number
, string
, function
, array
, date
, regexp
object
exports.type = (obj) ->
Merge two array into one.
exports.mergeArrays = (first, second) -> Array::push.apply first, second
Get only plain properties from object and skip nested objects.
exports.plainProperties = (object) ->
Removes all functions (and other non-JSON-safe types) from keys (deep search)
exports.onlyData = (object) =>
exports.diff = (object1, object2) ->
a = {
aa: 2
ab: {a:1, c:3}
}
b = {
aa: 1
ab: {a:1, b:2, c:3}
}
objects.subtract a, b
results in a return object of:
{
added: {}
changed: { aa: 2 }
removed: { ab: { b: 2 } }
numChanged:
{
add: 0
modify: 1
removed: 1
total: 2
}
}
Deep object extension (merge).
mergedObject = objects.merge(grandparent, child, grandchild, greatgrandchild)
Deep clone
exports.clone = (obj) ->
Find a specific object in an array of objects where a specific property equals a specific value.
Usage: theContainedObject = objects.find(myArray, "id", 4)
exports.find = (array, property, value) ->
Find a specific object in an array of objects where a specific property equals a specific value.
Usage: theContainedObject = objects.findIndex(myArray, "id", 4)
exports.findIndex = (array, property, value) ->
Add a prefix to the name of all properties of an Object.
exports.prefix = (theObject, prefix) ->
Pretty print an object to disk.
exports.write = (theObject, filename) ->
fs.writeFileSync filename, JSON.stringify theObject, undefined, "\t"
Object to JSON string
exports.stringify = (theObject) ->
If you need any feature tell us or fork project and implement it by yourself.
We appreciate feedback!
(The MIT License)
Copyright (c) 2011 CircuitHub., https://circuithub.com/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Simple objects' utilities for Node.js
The npm package objects receives a total of 20 weekly downloads. As such, objects popularity was classified as not popular.
We found that objects demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.