You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
rosh 459aece669 first commit 4 years ago
..
.github/workflows first commit 4 years ago
test first commit 4 years ago
.eslintrc first commit 4 years ago
.travis.yml first commit 4 years ago
CHANGELOG.md first commit 4 years ago
LICENSE first commit 4 years ago
README.md first commit 4 years ago
auto.js first commit 4 years ago
implementation.js first commit 4 years ago
index.js first commit 4 years ago
package.json first commit 4 years ago
polyfill.js first commit 4 years ago
shim.js first commit 4 years ago

README.md

object.fromentries Version Badge

Build Status 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