babel-plugin-styled-components
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -8,12 +8,8 @@ "use strict"; | ||
var _escapeRegExp = _interopRequireDefault(require("lodash/escapeRegExp")); | ||
var _options = require("./options"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const VALID_TOP_LEVEL_IMPORT_PATH_MATCHERS = ['styled-components', 'styled-components/no-tags', 'styled-components/native', 'styled-components/primitives'].map(literal => x => x === literal); | ||
const VALID_TOP_LEVEL_IMPORT_PATH_MATCHERS = ['styled-components', 'styled-components/no-tags', 'styled-components/native', 'styled-components/primitives'].map(literal => new RegExp(`^${(0, _escapeRegExp.default)(literal)}$`)); | ||
const isValidTopLevelImport = (x, state) => { | ||
return [...VALID_TOP_LEVEL_IMPORT_PATH_MATCHERS, ...(0, _options.useTopLevelImportPathMatchers)(state)].some(re => re.test(x)); | ||
return [...VALID_TOP_LEVEL_IMPORT_PATH_MATCHERS, ...(0, _options.useTopLevelImportPathMatchers)(state)].some(isMatch => isMatch(x)); | ||
}; | ||
@@ -20,0 +16,0 @@ |
@@ -8,2 +8,6 @@ "use strict"; | ||
var _picomatch = _interopRequireDefault(require("picomatch")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function getOption({ | ||
@@ -19,3 +23,3 @@ opts | ||
const useTopLevelImportPathMatchers = state => getOption(state, 'topLevelImportPaths', []).map(pattern => new RegExp(pattern)); | ||
const useTopLevelImportPathMatchers = state => getOption(state, 'topLevelImportPaths', []).map(pattern => (0, _picomatch.default)(pattern)); | ||
@@ -22,0 +26,0 @@ exports.useTopLevelImportPathMatchers = useTopLevelImportPathMatchers; |
{ | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"name": "babel-plugin-styled-components", | ||
@@ -37,3 +37,4 @@ "description": "Improve the debugging experience and add server-side rendering support to styled-components", | ||
"babel-plugin-syntax-jsx": "^6.18.0", | ||
"lodash": "^4.17.11" | ||
"lodash": "^4.17.11", | ||
"picomatch": "^2.3.0" | ||
}, | ||
@@ -40,0 +41,0 @@ "resolutions": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40825
6
+ Addedpicomatch@^2.3.0
+ Addedpicomatch@2.3.1(transitive)