mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Cleanup build.js.
Former-commit-id: 01f5488ddba9f51344561c8df493d4f1bc6b0ef9
This commit is contained in:
8
build.js
8
build.js
@@ -580,12 +580,15 @@
|
||||
"'else if (thisArg) callback = iteratorBind(callback, thisArg)'"
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// DRY out isType methods
|
||||
(function() {
|
||||
var iteratorName = lodash.find(['forEach', 'forOwn'], function(funcName) {
|
||||
return !isRemoved(source, funcName);
|
||||
});
|
||||
|
||||
// skip this optimization if there is no iteration method to use
|
||||
if (!iteratorName) {
|
||||
return;
|
||||
}
|
||||
@@ -594,6 +597,7 @@
|
||||
result = [],
|
||||
token = '__isTypeToken__';
|
||||
|
||||
// build replacement code
|
||||
lodash.forOwn({
|
||||
'Arguments': "'[object Arguments]'",
|
||||
'Date': 'dateClass',
|
||||
@@ -607,6 +611,7 @@
|
||||
|
||||
if (funcCode) {
|
||||
if (!snippet) {
|
||||
// use snippet to mark the insert position
|
||||
snippet = funcCode;
|
||||
}
|
||||
funcNames.push(funcName);
|
||||
@@ -674,6 +679,9 @@
|
||||
|
||||
// remove IE `shift` and `splice` fix
|
||||
source = source.replace(/(?:\s*\/\/.*\n)*( +)if *\(value.length *=== *0[\s\S]+?\n\1}/, '');
|
||||
|
||||
// cleanup code
|
||||
source = source.replace(/^ *;\n/gm, '');
|
||||
}
|
||||
else {
|
||||
// inline `iteratorTemplate` template
|
||||
|
||||
Reference in New Issue
Block a user