root 3bf41bf355 update | 1 jaar geleden | |
---|---|---|
.. | ||
test | 1 jaar geleden | |
.editorconfig | 1 jaar geleden | |
.eslintignore | 1 jaar geleden | |
.eslintrc | 1 jaar geleden | |
.nycrc | 1 jaar geleden | |
CHANGELOG.md | 1 jaar geleden | |
LICENSE | 1 jaar geleden | |
README.md | 1 jaar geleden | |
auto.js | 1 jaar geleden | |
implementation.js | 1 jaar geleden | |
index.js | 1 jaar geleden | |
package.json | 1 jaar geleden | |
polyfill.js | 1 jaar geleden | |
shim.js | 1 jaar geleden |
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