extendable-immutable
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -25,24 +25,13 @@ import createExtendable from './util/createExtendable'; | ||
function copy(val, update) { | ||
for (var _iterator = KEYS, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var key = _ref; | ||
val[key] = update[key]; | ||
} | ||
return val; | ||
return KEYS.reduce(function (acc, key) { | ||
acc[key] = update[key]; | ||
return acc; | ||
}, val); | ||
} | ||
function empty(val) { | ||
return Object.assign(val, EMPTY); | ||
return Object.keys(EMPTY).reduce(function (acc, key) { | ||
acc[key] = EMPTY[key]; | ||
return acc; | ||
}, val); | ||
} | ||
@@ -49,0 +38,0 @@ |
@@ -36,24 +36,13 @@ 'use strict'; | ||
function copy(val, update) { | ||
for (var _iterator = KEYS, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var key = _ref; | ||
val[key] = update[key]; | ||
} | ||
return val; | ||
return KEYS.reduce(function (acc, key) { | ||
acc[key] = update[key]; | ||
return acc; | ||
}, val); | ||
} | ||
function empty(val) { | ||
return Object.assign(val, EMPTY); | ||
return Object.keys(EMPTY).reduce(function (acc, key) { | ||
acc[key] = EMPTY[key]; | ||
return acc; | ||
}, val); | ||
} | ||
@@ -60,0 +49,0 @@ |
{ | ||
"name": "extendable-immutable", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "jsnext:main": "es/index.js", |
@@ -25,11 +25,15 @@ import createExtendable from './util/createExtendable' | ||
function copy(val, update) { | ||
for (const key of KEYS) { | ||
val[key] = update[key] | ||
} | ||
return val | ||
return KEYS.reduce((acc, key) => { | ||
acc[key] = update[key] | ||
return acc | ||
}, val) | ||
} | ||
function empty(val) { | ||
return Object.assign(val, EMPTY) | ||
return Object | ||
.keys(EMPTY) | ||
.reduce((acc, key) => { | ||
acc[key] = EMPTY[key] | ||
return acc | ||
}, val) | ||
} | ||
@@ -36,0 +40,0 @@ |
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
30817
535