Socket
Socket
Sign inDemoInstall

object.fromentries

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object.fromentries - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

5

CHANGELOG.md

@@ -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

12

implementation.js

@@ -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);

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc