mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
fix regex syntaxt
This commit is contained in:
parent
c2fef5d238
commit
34af7e029f
1 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ export function evaluateExpression (expression, forms) {
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
// Allow to use match(var,regexp) function
|
// Allow to use match(var,regexp) function
|
||||||
const matchRe = new RegExp('match\\(\\s*(\\w+)\\s*,\\s*"([^"]+)"\\s*\\)', 'g')
|
const matchRe = /match(\s*(\w+)\s*,\s*"([^"]+)"\s*)/g
|
||||||
for (const matched of expression.matchAll(matchRe)) {
|
for (const matched of expression.matchAll(matchRe)) {
|
||||||
const [fullMatch, varMatch, regExpMatch] = matched
|
const [fullMatch, varMatch, regExpMatch] = matched
|
||||||
const varName = varMatch + '__re' + matched.index
|
const varName = varMatch + '__re' + matched.index
|
||||||
|
@ -171,7 +171,7 @@ export function formatYunoHostArgument (arg) {
|
||||||
if (!isNaN(parseInt(arg.max))) {
|
if (!isNaN(parseInt(arg.max))) {
|
||||||
validation.maxValue = validators.maxValue(parseInt(arg.max))
|
validation.maxValue = validators.maxValue(parseInt(arg.max))
|
||||||
}
|
}
|
||||||
validation.numValue = validators.helpers.regex('Please provide an integer', new RegExp('^-?[0-9]+$'))
|
validation.numValue = validators.integer
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue