Skip to content

Commit

Permalink
Fix regex for #27
Browse files Browse the repository at this point in the history
  • Loading branch information
ktk committed Dec 15, 2023
1 parent d081e61 commit a7005f1
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 a7005f1

Please sign in to comment.