object.fromentries
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -0,3 +1,8 @@ | ||
2.0.0 / 2018-08-09 | ||
================= | ||
* [Breaking] throw when `iterable` is nullish | ||
* [Docs] Fix link to proposed spec | ||
1.0.0 / 2018-03-21 | ||
================= | ||
* v1.0.0 |
@@ -28,2 +28,4 @@ 'use strict'; | ||
module.exports = function fromEntries(iterable) { | ||
ES.RequireObjectCoercible(iterable); | ||
var obj = {}; | ||
@@ -40,4 +42,12 @@ | ||
/* | ||
return ES.AddEntriesFromIterable(obj, iterable, ES.CreateBuiltinFunction('CreateDataPropertyOnObject')); | ||
function adder(key, value) { | ||
var O = this; | ||
var propertyKey = ES.ToPropertyKey(key); | ||
CreateDataPropertyOrThrow(O, propertyKey, value); | ||
} | ||
*/ | ||
var iter = ES.GetIterator(iterable); | ||
while (true) { // eslint-disable-line no-constant-condition | ||
@@ -44,0 +54,0 @@ var next = ES.IteratorStep(iter); |
{ | ||
"name": "object.fromentries", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"author": "Jordan Harband", | ||
@@ -5,0 +5,0 @@ "description": "ES proposal-spec-compliant Object.fromEntries shim.", |
@@ -15,3 +15,3 @@ # object.fromentries <sup>[![Version Badge][npm-version-svg]][package-url]</sup> | ||
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [proposed spec](https://tc39.github.io/object-from-entries/). | ||
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [proposed spec](https://tc39.github.io/proposal-object-from-entries/). | ||
@@ -18,0 +18,0 @@ Most common usage: |
@@ -15,2 +15,6 @@ 'use strict'; | ||
t.deepEqual(fromEntries(entries), obj, 'entries -> obj'); | ||
t['throws'](function () { fromEntries(); }, 'entries throws on absent iterable'); | ||
t['throws'](function () { fromEntries(undefined); }, 'entries throws on undefined'); | ||
t['throws'](function () { fromEntries(null); }, 'entries throws on null'); | ||
}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17001
144
0
15