Skip to content

Commit

Permalink
Fix regex for #27
Browse files Browse the repository at this point in the history
  • Loading branch information
ktk authored and tpluscode committed Dec 18, 2023
1 parent 12ed3ad commit 5188f8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validators.ts
Expand Up @@ -141,7 +141,7 @@ validators.register(xsd.boolean, value => (
value === 'false'
))

const decimalSeg = `${signSeg}\\d+(\\.\\d+)?`
const decimalSeg = `${signSeg}(\\d+\\.?\\d*|\\.\\d+)`

const decimalPattern = new RegExp(`^${signSeg}${decimalSeg}$`)
validators.register(xsd.decimal, value => decimalPattern.test(value))
Expand Down

0 comments on commit 5188f8b

Please sign in to comment.