mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 699fbdc06c27cfec9d0f7b9809921f81884948f1
This commit is contained in:
2
build.js
2
build.js
@@ -902,7 +902,7 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var deps = _.invoke(categories, 'toLowerCase'),
|
var deps = _.invoke(categories, 'toLowerCase'),
|
||||||
depArgs = deps.join(', '),
|
depArgs = deps.join(', '),
|
||||||
depPaths = "['" + deps.join("', './") + "'], ",
|
depPaths = "['" + (deps.length ? './' + deps.join("', './") : '') + "'], ",
|
||||||
iife = [];
|
iife = [];
|
||||||
|
|
||||||
if (isAMD) {
|
if (isAMD) {
|
||||||
|
|||||||
@@ -331,6 +331,11 @@
|
|||||||
'sortBy'
|
'sortBy'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
var depObjProps = [
|
||||||
|
'isEqual',
|
||||||
|
'keys'
|
||||||
|
];
|
||||||
|
|
||||||
var props = [
|
var props = [
|
||||||
'cache',
|
'cache',
|
||||||
'criteria',
|
'criteria',
|
||||||
@@ -339,18 +344,19 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
// minify `dependencyObject` properties
|
// minify `dependencyObject` properties
|
||||||
source = source.replace(/\b(dependencyObject(?:\.|\['))\w+/g, function(match, prelude) {
|
depObjProps.forEach(function(prop, index) {
|
||||||
return prelude + minNames[iteratorOptions.length + props.length];
|
source = source.replace(RegExp("\\b(dependencyObject(?:\\.|\\['))" + prop + '\\b', 'g'), function(match, prelude) {
|
||||||
|
return prelude + minNames[iteratorOptions.length + props.length + index];
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// minify other properties used in functions
|
||||||
var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + funcNames.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm'));
|
var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + funcNames.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm'));
|
||||||
if (!snippets) {
|
if (!snippets) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
snippets.forEach(function(snippet) {
|
snippets.forEach(function(snippet) {
|
||||||
var modified = snippet;
|
var modified = snippet;
|
||||||
|
|
||||||
// minify properties
|
|
||||||
props.forEach(function(prop, index) {
|
props.forEach(function(prop, index) {
|
||||||
// use minified names different than those chosen for `iteratorOptions`
|
// use minified names different than those chosen for `iteratorOptions`
|
||||||
var minName = minNames[iteratorOptions.length + index],
|
var minName = minNames[iteratorOptions.length + index],
|
||||||
|
|||||||
Reference in New Issue
Block a user