parent
f35bf6a2a5
commit
55046ef68c
|
@ -5,12 +5,6 @@ const metaParser = (() => {
|
|||
require(['/vendor/usercss-meta/usercss-meta.min']); /* global usercssMeta */
|
||||
const {createParser, ParseError} = usercssMeta;
|
||||
const PREPROCESSORS = new Set(['default', 'uso', 'stylus', 'less']);
|
||||
/** Relaxed semver:
|
||||
* dot-separated digits sequence e.g. 1 or 1.2 or 1.2.3.4.5
|
||||
* optional pre-release chunk: "-" followed by dot-separated word characters, "-"
|
||||
* optional build chunk: "+" followed by dot-separated word characters, "-"
|
||||
*/
|
||||
const RX_VER = /^\d+(\.\d+)*(?:-(\w[-\w]*(\.[-\w]+)*))?(?:\+(\w[-\w]*(\.[-\w]+)*))?$/;
|
||||
const options = {
|
||||
validateKey: {
|
||||
preprocessor: state => {
|
||||
|
@ -22,15 +16,6 @@ const metaParser = (() => {
|
|||
});
|
||||
}
|
||||
},
|
||||
version: state => {
|
||||
if (!RX_VER.test(state.value)) {
|
||||
throw new ParseError({
|
||||
code: 'invalidVersion',
|
||||
message: 'Invalid @version',
|
||||
index: state.valueIndex,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
validateVar: {
|
||||
select: state => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user