@bodar/totallylazy
Advanced tools
Comparing version 0.463.305 to 0.464.306
@@ -29,5 +29,5 @@ export declare type Names = string[]; | ||
export declare function different(values: string[]): string[]; | ||
export declare function removeUnneededUnicodeCharacters(char: string): boolean; | ||
export declare function removeUnicodeMarkers(value: string): string; | ||
export declare function characters(value: string): string[]; | ||
export declare function splitByRegex(value: string): string[]; | ||
//# sourceMappingURL=characters.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.splitByRegex = exports.characters = exports.removeUnneededUnicodeCharacters = exports.different = exports.suffix = exports.prefix = exports.replace = exports.isNonMatch = exports.isNamedMatch = exports.NamedRegExp = void 0; | ||
exports.splitByRegex = exports.characters = exports.removeUnicodeMarkers = exports.different = exports.suffix = exports.prefix = exports.replace = exports.isNonMatch = exports.isNamedMatch = exports.NamedRegExp = void 0; | ||
const namesRegex = /\(\?<([^>]+)>/g; | ||
@@ -113,9 +113,8 @@ class NamedRegExp { | ||
exports.different = different; | ||
function removeUnneededUnicodeCharacters(char) { | ||
const code = char.charCodeAt(0); | ||
return code != 8206 && code != 8207; | ||
function removeUnicodeMarkers(value) { | ||
return value.replace(/[\u200E\u200F]/g, ''); | ||
} | ||
exports.removeUnneededUnicodeCharacters = removeUnneededUnicodeCharacters; | ||
exports.removeUnicodeMarkers = removeUnicodeMarkers; | ||
function characters(value) { | ||
return split(value).filter(removeUnneededUnicodeCharacters); | ||
return split(removeUnicodeMarkers(value)); | ||
} | ||
@@ -122,0 +121,0 @@ exports.characters = characters; |
@@ -31,3 +31,3 @@ "use strict"; | ||
try { | ||
return this.parseSingle(this.pattern.match(value)); | ||
return this.parseSingle(this.pattern.match(characters_1.removeUnicodeMarkers(value))); | ||
} | ||
@@ -39,3 +39,3 @@ catch (e) { | ||
parseAll(value) { | ||
return collections_1.array(this.pattern.exec(value), parsing_1.mapIgnoreError(match => this.parseSingle(match))); | ||
return collections_1.array(this.pattern.exec(characters_1.removeUnicodeMarkers(value)), parsing_1.mapIgnoreError(match => this.parseSingle(match))); | ||
} | ||
@@ -42,0 +42,0 @@ parseSingle(result) { |
{ | ||
"name": "@bodar/totallylazy", | ||
"version": "0.463.305", | ||
"version": "0.464.306", | ||
"description": "Totallylazy", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:bodar/totallylazy.js.git", |
@@ -55,3 +55,3 @@ "use strict"; | ||
parse(value) { | ||
return this.mapper(this.parser.parse(value)); | ||
return this.mapper(this.parser.parse(characters_1.removeUnicodeMarkers(value))); | ||
} | ||
@@ -61,3 +61,3 @@ parseAll(value) { | ||
return []; | ||
return collections_1.array(this.parser.parseAll(value), transducers_1.flatMap(v => { | ||
return collections_1.array(this.parser.parseAll(characters_1.removeUnicodeMarkers(value)), transducers_1.flatMap(v => { | ||
try { | ||
@@ -64,0 +64,0 @@ return [this.mapper(v)]; |
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
Sorry, the diff of this file is not supported yet
460802
6737