Security News
Dutch National Police Disrupt Redline and Meta Malware Operations
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
object-keys
Advanced tools
An Object.keys replacement, in case Object.keys is not available. From https://github.com/kriskowal/es5-shim
The object-keys npm package is a utility that provides a shim for the Object.keys method, which returns an array of a given object's own enumerable property names. It is particularly useful for environments that do not support the native Object.keys method, such as older versions of JavaScript engines.
Shim for Object.keys
Provides a cross-browser implementation of Object.keys to retrieve the keys of an object.
var keys = require('object-keys');
var obj = { a: 1, b: 2, c: 3 };
console.log(keys(obj)); // ['a', 'b', 'c']
Lodash is a popular utility library that includes a method called _.keys, which is similar to object-keys. It provides a more robust solution for getting the keys of an object, handling edge cases and supporting a wider range of environments, but it is part of a larger library which may be more than needed if only this functionality is required.
Core-js is a modular standard library for JavaScript, which includes polyfills for many ECMAScript features. It offers a polyfill for Object.keys, among many other features. It is more comprehensive than object-keys, but also larger in size, which might not be ideal for projects looking to minimize dependencies.
An Object.keys shim. Uses Object.keys if available.
var keys = require('object-keys');
var assert = require('assert');
var obj = {
a: true,
b: true,
c: true
};
assert.equal(keys(obj), ['a', 'b', 'c']);
Implementation taken directly from 9
Tests currently use tape - which doesn't work in node 0.10, but works in browserify. Rest assured, they pass.
FAQs
An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim
The npm package object-keys receives a total of 30,715,946 weekly downloads. As such, object-keys popularity was classified as popular.
We found that object-keys 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.
Security News
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
Research
Security News
Socket is tracking a new trend where malicious actors are now exploiting the popularity of LLM research to spread malware through seemingly useful open source packages.
Security News
Research
Noxia, a new dark web bulletproof host, offers dirt cheap servers for Python, Node.js, Go, and Rust, enabling cybercriminals to distribute malware and execute supply chain attacks.