Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed selector|value-no-vendor-prefix performance (#7016)
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
- Loading branch information
1 parent
d2c398c
commit 3065425
Showing
5 changed files
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"stylelint": patch | ||
--- | ||
|
||
Fixed: `{selector,value}-no-vendor-prefix` performance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const prefixes = new Set(['-webkit-', '-moz-', '-ms-', '-o-']); | ||
|
||
module.exports = { | ||
prefixes, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
const { prefixes } = require('../reference/prefixes'); | ||
|
||
const HAS_PREFIX_REGEX = new RegExp(`(?:${[...prefixes].join('|')})`, 'i'); | ||
|
||
/** | ||
* Check if a string contains any prefix | ||
* | ||
* @param {string} string | ||
* @returns {boolean} | ||
*/ | ||
module.exports = function hasPrefix(string) { | ||
return HAS_PREFIX_REGEX.test(string); | ||
}; |