object.fromentries
ES proposal-spec-compliant Object.fromEntries shim.
Last updated 8 months ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install object.fromentries 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.8                                ...           latest (8 months ago)

11 Versions

  • 2.0.8                                ...           8 months ago
  • 2.0.7                                ...           a year ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           3 years ago
  • 2.0.4                                ...           4 years ago
  • 2.0.3                                ...           4 years ago
  • 2.0.2                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
  • 0.0.1-security                                ...           7 years ago
Maintainers (1)
Downloads
Total 11
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (10)

© 2010 - cnpmjs.org x YWFE | Home | YWFE