@travetto/yaml
Advanced tools
Comparing version 4.0.0-rc.0 to 4.0.0-rc.1
{ | ||
"name": "@travetto/yaml", | ||
"version": "4.0.0-rc.0", | ||
"version": "4.0.0-rc.1", | ||
"description": "Simple YAML support, provides only clean subset of yaml", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@travetto/base": "^4.0.0-rc.0" | ||
"@travetto/base": "^4.0.0-rc.1" | ||
}, | ||
@@ -30,0 +30,0 @@ "travetto": { |
@@ -1,2 +0,1 @@ | ||
import { DataUtil } from '@travetto/base'; | ||
import { SimpleType } from './common'; | ||
@@ -25,3 +24,6 @@ | ||
constructor(token: string) { | ||
this.value = DataUtil.coerceType(token, Number, true); | ||
this.value = token.includes('.') ? parseFloat(token) : parseInt(token, 10); | ||
if (Number.isNaN(this.value)) { | ||
throw new Error(`Invalid numeric input: ${token}`); | ||
} | ||
} | ||
@@ -34,3 +36,3 @@ } | ||
constructor(token: string) { | ||
this.value = DataUtil.coerceType(token, Boolean, true); | ||
this.value = /^(yes|on|1|true)/i.test(token); | ||
} | ||
@@ -37,0 +39,0 @@ } |
25811
684
Updated@travetto/base@^4.0.0-rc.1