prc b6c02717e6 Upload complete no-internet building environment. | hai 1 ano | |
---|---|---|
.. | ||
test | hai 1 ano | |
.editorconfig | hai 1 ano | |
.eslintrc | hai 1 ano | |
.nycrc | hai 1 ano | |
CHANGELOG.md | hai 1 ano | |
LICENSE | hai 1 ano | |
README.md | hai 1 ano | |
auto.js | hai 1 ano | |
implementation.js | hai 1 ano | |
index.js | hai 1 ano | |
package.json | hai 1 ano | |
polyfill.js | hai 1 ano | |
shim.js | hai 1 ano |
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);
Simply clone the repo, npm install
, and run npm test