mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
parent
e371df916b
commit
10dba6f0ca
1 changed files with 2 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ const {
|
|||
} = require('superstruct');
|
||||
|
||||
import { validateMultilineCode } from '@/_helpers/utility';
|
||||
import _ from 'lodash';
|
||||
import _, { isNumber } from 'lodash';
|
||||
import { reservedKeywordReplacer } from '@/_lib/reserved-keyword-replacer';
|
||||
|
||||
export const generateSchemaFromValidationDefinition = (definition, recursionDepth = 0) => {
|
||||
|
|
@ -38,7 +38,7 @@ export const generateSchemaFromValidationDefinition = (definition, recursionDept
|
|||
if (recursionDepth === 0) {
|
||||
schema = coerce(schema, string(), (value) => {
|
||||
const parsedValue = parseFloat(value);
|
||||
const finalValue = parsedValue ? parsedValue : value;
|
||||
const finalValue = isNumber(parsedValue) && Number.isFinite(parsedValue) ? parsedValue : value;
|
||||
return finalValue;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue