mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Fix _.sortBy in the mobile build attempt two.
Former-commit-id: 8f54b16a901acc4ce91f071c5b36c632334f7dde
This commit is contained in:
@@ -258,13 +258,14 @@
|
||||
}
|
||||
snippets.forEach(function(snippet) {
|
||||
var result = snippet,
|
||||
isSortBy = /var sortBy\b/.test(result);
|
||||
isSortBy = /var sortBy\b/.test(result),
|
||||
isInlined = !/\bcreateIterator\b/.test(result);
|
||||
|
||||
// minify properties
|
||||
properties.forEach(function(property, index) {
|
||||
// add quotes around properties in the inlined method of the mobile build
|
||||
// so Closure Compiler won't mung them
|
||||
if (isSortBy) {
|
||||
// add quotes around properties in the inlined `sortBy` of the mobile
|
||||
// build so Closure Compiler won't mung them
|
||||
if (isSortBy && isInlined) {
|
||||
result = result
|
||||
.replace(RegExp('\\.' + property + '\\b', 'g'), "['" + minNames[index] + "']")
|
||||
.replace(RegExp('\\b' + property + ' *:', 'g'), "'" + minNames[index] + "':");
|
||||
|
||||
Reference in New Issue
Block a user