@0dep/piso
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "@0dep/piso", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "ISO 8601 interval, date, and duration parser", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -260,2 +260,4 @@ # piso | ||
Parse partial date as compared to passed date part arguments. | ||
- `Y`: required full year | ||
@@ -262,0 +264,0 @@ - `M`: required javascript month |
@@ -196,3 +196,3 @@ const FRACTIONS = ',.'; | ||
c = this.read(); | ||
if (c !== '1') throw new RangeError(`Unexpected character "${this.parsed}[${c}]" at ${this.idx}`); | ||
if (c !== '1') throw new RangeError(`Unexpected ISO 8601 interval character "${this.parsed}[${c}]" at ${this.idx}`); | ||
this.repeat = -1; | ||
@@ -208,3 +208,3 @@ return this.read(); | ||
if (value) this.repeat = Number(value); | ||
if (c !== '/') throw new RangeError(`Unexpected character "${this.parsed}[${c}]" at ${this.idx}`); | ||
if (c !== '/') throw new RangeError(`Unexpected ISO 8601 interval characted "${this.parsed}[${c}]" at ${this.idx}`); | ||
}; | ||
@@ -376,3 +376,3 @@ | ||
if (!validateDate(Y, M, day)) throw new RangeError(`Invalid ISO 8601 partial date "${this.parsed}[${this.c}]"`); | ||
if (!validateDate(Y, M, day)) throw new RangeError(`Invalid ISO 8601 partial date "${this.parsed}"`); | ||
@@ -383,3 +383,3 @@ return this; | ||
if (!validateDate(Y, M, day)) throw new RangeError(`Invalid ISO 8601 partial date "${this.parsed}[${this.c}]"`); | ||
if (!validateDate(Y, M, day)) throw new RangeError(`Invalid ISO 8601 partial date "${this.parsed}"`); | ||
@@ -401,3 +401,3 @@ this.consume(); | ||
if (!validateDate(Y, month, day)) throw new RangeError(`Invalid ISO 8601 partial date "${this.parsed}[${this.c}]"`); | ||
if (!validateDate(Y, month, day)) throw new RangeError(`Invalid ISO 8601 partial date "${this.parsed}"`); | ||
@@ -404,0 +404,0 @@ const c = this.consumeCharOrEnd(ISODATE_TIMEINSTRUCTION); |
Sorry, the diff of this file is not supported yet
82480
342