Socket
Socket
Sign inDemoInstall

object.fromentries

Package Overview
Dependencies
65
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

object.fromentries

ES proposal-spec-compliant Object.fromEntries shim.


Version published
Maintainers
1
Weekly downloads
21,548,784
decreased by-4.75%

Weekly downloads

Readme

Source

object.fromentries Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES spec-proposal-compliant Object.fromEntries shim. Invoke its "shim" method to shim Object.fromEntries if it is unavailable or noncompliant.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.

Most common usage:

var assert = require('assert');
var fromEntries = require('object.fromentries');

var obj = { a: 1, b: 2, c: 3 };
var actual = fromEntries(Object.entries(obj));

assert.deepEqual(obj, actual);

if (!Object.fromEntries) {
	fromEntries.shim();
}

assert.deepEqual(Object.fromEntries(Object.entries(obj)), obj);

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Last updated on 03 Oct 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc