Skip to content

Commit c551632

Browse files
committed
Avoid RegExp when we can use simple JS
1 parent 89a6b74 commit c551632

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/previous-map.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class PreviousMap {
5151
return fromBase64(text.substr(baseUriMatch[0].length))
5252
}
5353

54-
let encoding = text.match(/data:application\/json;([^,]+),/)[1]
54+
let encoding = text.slice('data:application/json;'.length)
55+
encoding = encoding.slice(0, encoding.indexOf(','))
5556
throw new Error('Unsupported source map encoding ' + encoding)
5657
}
5758

0 commit comments

Comments
 (0)