mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Simplify _.zip for the underscore build.
Former-commit-id: 18560e78f052fad5c5d7af1ef6571dd31accf690
This commit is contained in:
15
build.js
15
build.js
@@ -3598,6 +3598,21 @@
|
||||
'}'
|
||||
].join('\n'));
|
||||
}
|
||||
// replace `_.zip`
|
||||
if(!isLodashFunc('zip')) {
|
||||
source = replaceFunction(source, 'zip', [
|
||||
'function zip() {',
|
||||
' var index = -1,',
|
||||
" length = max(pluck(arguments, 'length')),",
|
||||
' result = Array(length < 0 ? 0 : length);',
|
||||
'',
|
||||
' while (++index < length) {',
|
||||
' result[index] = pluck(arguments, index);',
|
||||
' }',
|
||||
' return result;',
|
||||
'}'
|
||||
].join('\n'));
|
||||
}
|
||||
// unexpose `lodash.support`
|
||||
if (!isLodashFunc('support')) {
|
||||
source = source.replace(/\blodash\.support *= */, '');
|
||||
|
||||
Reference in New Issue
Block a user