mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Update isModularize and isStrict detection.
This commit is contained in:
committed by
jdalton
parent
2ca75970c0
commit
5aaa0a7b5f
@@ -124,18 +124,18 @@
|
|||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Used to indicate that Lo-Dash is in strict mode.
|
|
||||||
ui.isStrict = /\b(?:lodash-es6|transpiled)\b/.test([location.pathname, location.search]);
|
|
||||||
|
|
||||||
// Used to indicate testing a foreign file.
|
// Used to indicate testing a foreign file.
|
||||||
ui.isForeign = RegExp('^(\\w+:)?//').test(build);
|
ui.isForeign = RegExp('^(\\w+:)?//').test(build);
|
||||||
|
|
||||||
// Used to indicate testing a modularized build.
|
// Used to indicate testing a modularized build.
|
||||||
ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|es6|node)|modularize|npm|transpiled)\b/.test([location.pathname, location.search]);
|
ui.isModularize = /\b(?:amd|commonjs|es6|node|npm|(index|main)\.js)\b/.test([location.pathname, location.search]);
|
||||||
|
|
||||||
// Used to indicate testing in Sauce Labs' automated test cloud.
|
// Used to indicate testing in Sauce Labs' automated test cloud.
|
||||||
ui.isSauceLabs = location.port == '9001';
|
ui.isSauceLabs = location.port == '9001';
|
||||||
|
|
||||||
|
// Used to indicate that Lo-Dash is in strict mode.
|
||||||
|
ui.isStrict = /\bes6\b/.test([location.pathname, location.search]);
|
||||||
|
|
||||||
// The Lo-Dash build file path.
|
// The Lo-Dash build file path.
|
||||||
ui.buildPath = (function() {
|
ui.buildPath = (function() {
|
||||||
var result;
|
var result;
|
||||||
|
|||||||
@@ -94,8 +94,8 @@
|
|||||||
var ui = root.ui || (root.ui = {
|
var ui = root.ui || (root.ui = {
|
||||||
'buildPath': filePath,
|
'buildPath': filePath,
|
||||||
'loaderPath': '',
|
'loaderPath': '',
|
||||||
'isModularize': /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|es6|node)|modularize|npm|transpiled)\b/.test(filePath),
|
'isModularize': /\b(?:amd|commonjs|es6|node|npm|(index|main)\.js)\b/.test(filePath),
|
||||||
'isStrict': /\b(?:lodash-es6|transpiled)\b/.test(filePath),
|
'isStrict': /\bes6\b/.test(filePath),
|
||||||
'urlParams': {}
|
'urlParams': {}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user