Skip to content

Commit 7f1e953

Browse files
committed
Clean up RegExps
1 parent 33ee989 commit 7f1e953

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

lib/hacks/grid-template-areas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let {
1010
} = require('./grid-utils')
1111

1212
function getGridRows (tpl) {
13-
return tpl.trim().slice(1, -1).split(/['"]\s*['"]?/g)
13+
return tpl.trim().slice(1, -1).split(/["']\s*["']?/g)
1414
}
1515

1616
class GridTemplateAreas extends Declaration {

lib/hacks/grid-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function parseGridAreas ({
202202
// Parse grid-template
203203

204204
function testTrack (node) {
205-
return node.type === 'word' && /^\[.+\]$/.test(node.value)
205+
return node.type === 'word' && /^\[.+]$/.test(node.value)
206206
}
207207

208208
function verifyRowSize (result) {

lib/hacks/transform-decl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TransformDecl extends Declaration {
4545
set (decl, prefix) {
4646
decl = super.set(decl, prefix)
4747
if (prefix === '-ms-') {
48-
decl.value = decl.value.replace(/rotateZ/gi, 'rotate')
48+
decl.value = decl.value.replace(/rotatez/gi, 'rotate')
4949
}
5050
return decl
5151
}

lib/selector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Selector extends Prefixer {
2626
* Return prefixed version of selector
2727
*/
2828
prefixed (prefix) {
29-
return this.name.replace(/^([^\w]*)/, `$1${ prefix }`)
29+
return this.name.replace(/^(\W*)/, `$1${ prefix }`)
3030
}
3131

3232
/**

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
* Escape RegExp symbols
4141
*/
4242
escapeRegexp (string) {
43-
return string.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&')
43+
return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&')
4444
},
4545

4646
/**

0 commit comments

Comments
 (0)