Skip to content

Commit

Permalink
Undo commits in TypeValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
dana-gill committed Dec 27, 2024
1 parent 2b43d3d commit ad473cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/workflow/src/TypeValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,10 @@ export function validateFieldType(
}
case 'number': {
try {
return strict
? { valid: false, errorMessage: defaultErrorMessage }
: { valid: true, newValue: tryToParseNumber(value) };
if (strict && typeof value !== 'number') {
return { valid: false, errorMessage: defaultErrorMessage };
}
return { valid: true, newValue: tryToParseNumber(value) };
} catch (e) {
return { valid: false, errorMessage: defaultErrorMessage };
}
Expand Down

0 comments on commit ad473cc

Please sign in to comment.