From 55046ef68cd2760d27d4b39253fbcfe15a80862f Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 1 Aug 2021 18:38:36 +0300 Subject: [PATCH] custom version validator is redundant now ...thanks to https://github.com/openstyles/usercss-meta/commit/4913ba1d2c69089d382a04d2b3fccf17df16bd24 --- js/meta-parser.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/js/meta-parser.js b/js/meta-parser.js index 5a0aa734..10058ceb 100644 --- a/js/meta-parser.js +++ b/js/meta-parser.js @@ -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 => {