Skip to content

Commit 30b8b21

Browse files
committed
updated build scripts
1 parent 338f493 commit 30b8b21

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

build/deepcopy.js

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,20 @@ return /******/ (function(modules) { // webpackBootstrap
7979
return false;
8080
};
8181

82-
var getKeys = Object.keys ? function getKeys(obj) {
82+
var getKeys = typeof Object.keys === 'function' ? function getKeys(obj) {
8383
return Object.keys(obj);
8484
} : function getKeys(obj) {
8585
var objType = typeof obj;
8686

87-
if (obj === null || objType !== 'function' || objType !== 'object') {
87+
if (obj === null || objType !== 'function' && objType !== 'object') {
8888
throw new TypeError('obj must be an Object');
8989
}
9090

9191
var resultKeys = [],
92-
key = undefined;
92+
key = void 0;
9393

9494
for (key in obj) {
95-
obj.hasOwnProperty(key) && resultKeys.push(key);
95+
Object.prototype.hasOwnProperty.call(obj, key) && resultKeys.push(key);
9696
}
9797

9898
return resultKeys;
@@ -116,31 +116,31 @@ return /******/ (function(modules) { // webpackBootstrap
116116
throw new TypeError('array must be an Array');
117117
}
118118

119-
var i = undefined,
120-
len = undefined,
121-
value = undefined;
119+
var i = void 0,
120+
len = void 0,
121+
value = void 0;
122122

123123
for (i = 0, len = array.length; i < len; ++i) {
124124
value = array[i];
125125

126-
// it is SameValue algorithm
127-
// http://stackoverflow.com/questions/27144277/comparing-a-variable-with-itself
126+
// NOTE:
127+
//
128+
// it is SameValue algorithm
129+
// http://stackoverflow.com/questions/27144277/comparing-a-variable-with-itself
130+
//
131+
// eslint-disable-next-line no-self-compare
128132
if (value === s || value !== value && s !== s) {
129-
// eslint-disable-line no-self-compare
130133
return i;
131134
}
132135
}
133136

134137
return -1;
135138
}
136139

137-
exports['default'] = {
138-
getKeys: getKeys,
139-
getSymbols: getSymbols,
140-
indexOf: indexOf,
141-
isBuffer: isBuffer
142-
};
143-
module.exports = exports['default'];
140+
exports.getKeys = getKeys;
141+
exports.getSymbols = getSymbols;
142+
exports.indexOf = indexOf;
143+
exports.isBuffer = isBuffer;
144144

145145
/***/ },
146146
/* 2 */
@@ -149,6 +149,7 @@ return /******/ (function(modules) { // webpackBootstrap
149149
'use strict';
150150

151151
exports.__esModule = true;
152+
exports.copyValue = exports.copyCollection = exports.copy = void 0;
152153

153154
var _polyfill = __webpack_require__(1);
154155

@@ -206,7 +207,7 @@ return /******/ (function(modules) { // webpackBootstrap
206207
return target;
207208
} else {
208209
// user defined function
209-
return new Function('return ' + source)();
210+
return new Function('return ' + String(source))();
210211
}
211212
}
212213

@@ -236,7 +237,7 @@ return /******/ (function(modules) { // webpackBootstrap
236237
// +date; // 1420909757913
237238
// +new Date(date); // 1420909757913
238239
// +new Date(+date); // 1420909757913
239-
return new Date(+target);
240+
return new Date(target.getTime());
240241
}
241242

242243
if (targetClass === '[object RegExp]') {
@@ -256,7 +257,7 @@ return /******/ (function(modules) { // webpackBootstrap
256257
return new RegExp(regexpText.slice(1, slashIndex), regexpText.slice(slashIndex + 1));
257258
}
258259

259-
if (_polyfill.isBuffer(target)) {
260+
if ((0, _polyfill.isBuffer)(target)) {
260261
var buffer = new Buffer(target.length);
261262

262263
target.copy(buffer);
@@ -285,12 +286,9 @@ return /******/ (function(modules) { // webpackBootstrap
285286
return null;
286287
}
287288

288-
exports['default'] = {
289-
copy: copy,
290-
copyCollection: copyCollection,
291-
copyValue: copyValue
292-
};
293-
module.exports = exports['default'];
289+
exports.copy = copy;
290+
exports.copyCollection = copyCollection;
291+
exports.copyValue = copyValue;
294292

295293
/***/ },
296294
/* 3 */
@@ -309,21 +307,21 @@ return /******/ (function(modules) { // webpackBootstrap
309307
}
310308

311309
function deepcopy(target) {
312-
var customizer = arguments.length <= 1 || arguments[1] === undefined ? defaultCustomizer : arguments[1];
310+
var customizer = arguments.length <= 1 || arguments[1] === void 0 ? defaultCustomizer : arguments[1];
313311

314312
if (target === null) {
315313
// copy null
316314
return null;
317315
}
318316

319-
var resultValue = _copy.copyValue(target);
317+
var resultValue = (0, _copy.copyValue)(target);
320318

321319
if (resultValue !== null) {
322320
// copy some primitive types
323321
return resultValue;
324322
}
325323

326-
var resultCollection = _copy.copyCollection(target, customizer),
324+
var resultCollection = (0, _copy.copyCollection)(target, customizer),
327325
clone = resultCollection !== null ? resultCollection : target;
328326

329327
var visited = [target],
@@ -339,37 +337,39 @@ return /******/ (function(modules) { // webpackBootstrap
339337
return null;
340338
}
341339

342-
var resultValue = _copy.copyValue(target);
340+
var resultValue = (0, _copy.copyValue)(target);
343341

344342
if (resultValue !== null) {
345343
// copy some primitive types
346344
return resultValue;
347345
}
348346

349-
var keys = _polyfill.getKeys(target).concat(_polyfill.getSymbols(target));
347+
var keys = (0, _polyfill.getKeys)(target).concat((0, _polyfill.getSymbols)(target));
350348

351-
var i = undefined,
352-
len = undefined;
349+
var i = void 0,
350+
len = void 0;
353351

354-
var key = undefined,
355-
value = undefined,
356-
index = undefined,
357-
resultCopy = undefined,
358-
result = undefined,
359-
ref = undefined;
352+
var key = void 0,
353+
value = void 0,
354+
index = void 0,
355+
resultCopy = void 0,
356+
result = void 0,
357+
ref = void 0;
360358

361359
for (i = 0, len = keys.length; i < len; ++i) {
362360
key = keys[i];
363361
value = target[key];
364-
index = _polyfill.indexOf(visited, value);
362+
index = (0, _polyfill.indexOf)(visited, value);
365363

366364
if (index === -1) {
367-
resultCopy = _copy.copy(value, customizer);
365+
resultCopy = (0, _copy.copy)(value, customizer);
368366
result = resultCopy !== null ? resultCopy : value;
369367

370368
if (value !== null && /^(?:function|object)$/.test(typeof value)) {
371369
visited.push(value);
372370
reference.push(result);
371+
} else {
372+
ref = result;
373373
}
374374
} else {
375375
// circular reference

build/deepcopy.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)