mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Go back to using or check instead of pattern
This commit is contained in:
@@ -132,8 +132,10 @@ transpile = (sourceCode, filePath, cachePath) ->
|
||||
# either generated on the fly or pulled from cache.
|
||||
loadFile = (module, filePath) ->
|
||||
sourceCode = fs.readFileSync(filePath, 'utf8')
|
||||
unless /^("use 6to5"|'use 6to5'|"use babel"|'use babel')/.test(sourceCode)
|
||||
return module._compile(sourceCode, filePath)
|
||||
return module._compile(sourceCode, filePath) unless sourceCode.startsWith('"use 6to5"') or
|
||||
sourceCode.startsWith("'use 6to5'") or
|
||||
sourceCode.startsWith('"use babel"') or
|
||||
sourceCode.startsWith("'use babel'")
|
||||
|
||||
cachePath = getCachePath(sourceCode)
|
||||
js = getCachedJavaScript(cachePath) ? transpile(sourceCode, filePath, cachePath)
|
||||
|
||||
Reference in New Issue
Block a user