codeql-action/node_modules/object.fromentries
github-actions[bot] 9c3b394d7f Update checked-in dependencies 2023-10-23 18:03:04 +00:00
..
test Bump packages to fix linter 2023-01-18 21:00:07 +00:00
.editorconfig Bump packages to fix linter 2023-01-18 21:00:07 +00:00
.eslintrc Bump packages to fix linter 2023-01-18 21:00:07 +00:00
.nycrc Bump packages to fix linter 2023-01-18 21:00:07 +00:00
CHANGELOG.md Update checked-in dependencies 2023-10-23 18:03:04 +00:00
LICENSE Bump packages to fix linter 2023-01-18 21:00:07 +00:00
README.md Bump packages to fix linter 2023-01-18 21:00:07 +00:00
auto.js Bump packages to fix linter 2023-01-18 21:00:07 +00:00
implementation.js Update checked-in dependencies 2023-10-23 18:03:04 +00:00
index.js Bump packages to fix linter 2023-01-18 21:00:07 +00:00
package.json Update checked-in dependencies 2023-10-23 18:03:04 +00:00
polyfill.js Bump packages to fix linter 2023-01-18 21:00:07 +00:00
shim.js Bump packages to fix linter 2023-01-18 21:00:07 +00:00

README.md

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