@bodar/totallylazy
Advanced tools
Comparing version 0.418.261 to 0.419.262
@@ -10,2 +10,3 @@ import { MonthFormat, Options, WeekdayFormat } from "./core"; | ||
parse(value: string): number; | ||
get characters(): string[]; | ||
static formats: Options[]; | ||
@@ -12,0 +13,0 @@ static cache: { |
@@ -17,4 +17,7 @@ "use strict"; | ||
const number = functions_1.get(() => this.numerals.parse(value)); | ||
return isNaN(number) ? super.parse(value) : number; | ||
return isNaN(number) ? super.parse(cleanValue(value)) : number; | ||
} | ||
get characters() { | ||
return [...super.characters, '.']; | ||
} | ||
static get(locale, additionalData = []) { | ||
@@ -102,4 +105,4 @@ return Months.cache[locale] = Months.cache[locale] || Months.create(locale, additionalData); | ||
if (native) | ||
return new NativeDataExtractor(locale, options, dates, 'weekday').extract().map(cleanValue); | ||
return new FromFormatStringWeekdayExtractor(locale, options, dates).extract().map(cleanValue); | ||
return new NativeDataExtractor(locale, options, dates, 'weekday').extract(); | ||
return new FromFormatStringWeekdayExtractor(locale, options, dates).extract(); | ||
})(); | ||
@@ -106,0 +109,0 @@ } |
{ | ||
"name": "@bodar/totallylazy", | ||
"version": "0.418.261", | ||
"version": "0.419.262", | ||
"description": "Totallylazy", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:bodar/totallylazy.js.git", |
@@ -41,2 +41,6 @@ import { NamedMatch, NamedRegExp } from "./characters"; | ||
get pattern(): string; | ||
get minMax(): { | ||
min: number; | ||
max: number; | ||
}; | ||
get characters(): string[]; | ||
@@ -43,0 +47,0 @@ } |
@@ -89,8 +89,11 @@ "use strict"; | ||
get pattern() { | ||
const [min, max] = this.data.reduce(([min, max], l) => { | ||
const length = characters_1.characters(l.name).length; | ||
return [Math.min(min, length), Math.max(max, length)]; | ||
}, [Number.MAX_VALUE, Number.MIN_VALUE]); | ||
const { min, max } = this.minMax; | ||
return `[${this.characters.join('')}]{${min},${max}}`; | ||
} | ||
get minMax() { | ||
return this.data.reduce(({ min, max }, l) => { | ||
const length = characters_1.characters(l.name).length; | ||
return { min: Math.min(min, length), max: Math.max(max, length) }; | ||
}, { min: Number.MAX_VALUE, max: Number.MIN_VALUE }); | ||
} | ||
get characters() { | ||
@@ -97,0 +100,0 @@ return arrays_1.unique(arrays_1.flatten(this.data.map(d => d.name).map(characters_1.characters))).sort(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
427448
6236