fix: Parse Server option maxLogFiles doesn't recognize day duration literals such as 1d to mean 1 day (#9215)

This commit is contained in:
Diamond Lewis
2024-07-18 08:41:59 -05:00
committed by GitHub
parent 901cff5edd
commit 0319cee2db
4 changed files with 27 additions and 1 deletions

View File

@@ -161,6 +161,9 @@ function mapperFor(elt, t) {
if (type == 'NumberOrBoolean') {
return wrap(t.identifier('numberOrBooleanParser'));
}
if (type == 'NumberOrString') {
return t.callExpression(wrap(t.identifier('numberOrStringParser')), [t.stringLiteral(elt.name)]);
}
if (type === 'StringOrStringArray') {
return wrap(t.identifier('arrayParser'));
}
@@ -212,6 +215,9 @@ function parseDefaultValue(elt, value, t) {
if (type == 'NumberOrBoolean') {
literalValue = t.numericLiteral(parsers.numberOrBoolParser('')(value));
}
if (type == 'NumberOrString') {
literalValue = t.numericLiteral(parsers.numberOrStringParser('')(value));
}
if (nestedOptionTypes.includes(type)) {
const object = parsers.objectParser(value);