Skip to content

Commit 193daf2

Browse files
authored
Revert "ensure a cache miss (#283)" (#294)
This reverts commit b1dcfda.
1 parent ccc15c5 commit 193daf2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/utils/detectors.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const VALID_TOP_LEVEL_IMPORT_PATHS = [
44
'styled-components/native',
55
'styled-components/primitives',
66
]
7-
const CACHE_MISS = Symbol('CACHE_MISS');
87

98
export const isValidTopLevelImport = x =>
109
VALID_TOP_LEVEL_IMPORT_PATHS.includes(x)
@@ -14,15 +13,15 @@ const localNameCache = {}
1413
export const importLocalName = (name, state, bypassCache = false) => {
1514
const cacheKey = name + state.file.opts.filename
1615

17-
if (!bypassCache && cacheKey in localNameCache && localNameCache[cacheKey] !== CACHE_MISS) {
16+
if (!bypassCache && cacheKey in localNameCache) {
1817
return localNameCache[cacheKey]
1918
}
2019

2120
let localName = state.styledRequired
2221
? name === 'default'
2322
? 'styled'
2423
: name
25-
: CACHE_MISS
24+
: false
2625

2726
state.file.path.traverse({
2827
ImportDeclaration: {

0 commit comments

Comments
 (0)