mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Use typeof x == 'undefined' checks instead of x === undefined for consistency with other typeof checks.
Former-commit-id: 8ab7d3efe54aa7017b52295b0598b75c297a6277
This commit is contained in:
@@ -29,8 +29,7 @@
|
||||
'result',
|
||||
'skipProto',
|
||||
'source',
|
||||
'thisArg',
|
||||
'undefined'
|
||||
'thisArg'
|
||||
];
|
||||
|
||||
/** Used to minify `compileIterator` option properties */
|
||||
@@ -342,8 +341,8 @@
|
||||
// ensure properties in compiled strings aren't minified
|
||||
modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minNames[index]);
|
||||
|
||||
// correct `typeof` of 'object' and 'undefined'
|
||||
if (variable == 'object' || variable == 'undefined') {
|
||||
// correct `typeof` values
|
||||
if (/^(?:boolean|function|object|number|string|undefined)$/.test(variable)) {
|
||||
modified = modified.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), '$1' + variable + "'");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user