diff --git a/src/types/Patterns.ts b/src/types/Patterns.ts index f707b039..ab759c8a 100644 --- a/src/types/Patterns.ts +++ b/src/types/Patterns.ts @@ -51,11 +51,14 @@ export const Patterns = { STREET: /^(?!.*\s$)([a-zA-Z0-9À-ÿšŚął]{1,40}( ?[.,'/-] ?| )?){1,10}[a-zA-Z0-9À-ÿšŚął.]$/, // legalEntityPattern - // \w covers A-Za-z0-9 and _ + // \p{L} or \p{Letter} covers all letters in any language (Thai does not work) + // \p{Sc} or \p{Currency_Symbol} covers currency symbols + // \u0E00-\u0E7Fa covers Thai characters + // \d digits // \s whitespace // \x22 double quote legalEntityPattern: - /^(?!.*\s$)([\wÀ-ÿ£$€¥¢@%*+\-/\\,.:;=<>!?&^#'\x22()[\]]\s?){1,160}$/, + /^(?!.*\s$)([\p{L}\u0E00-\u0E7F\d\p{Sc}@%*+_\-/\\,.:;=<>!?&^#'\x22()[\]]\s?){1,160}$/u, registeredNamePattern: /^(?!.*\s$)[a-zA-ZÀ-ÿŚął\d][a-zA-ZÀ-ÿŚął\d\s!#'$@&%()*+,\-_./:;=<>?[\]\\^]{2,60}$/, regionPattern: /^(?!.*\s$)([a-zA-Z0-9À-ÿŚął,"()'-]\s?)*$/, diff --git a/src/types/testdata/legalentity.ts b/src/types/testdata/legalentity.ts index b8780b3d..0a995698 100644 --- a/src/types/testdata/legalentity.ts +++ b/src/types/testdata/legalentity.ts @@ -33,7 +33,11 @@ export const LEGAL_ENTITY_DATA = { '+SEN Inc.', // leading special character 'La Poste S.A.', 'JPMORGAN ASIA-PACIFIC ADVANTAGE HYBRID FUND (QDII)', - 'Currency £$€¥¢', + '摩根亚太优势混合型证券投资基金 (QDII)', + 'Adis Tachov, zpracování plastů s.r.o.', + 'BURY SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ', + 'GAMMO Europe Korlátolt Felelősségű Társaság', + 'Currency £$€¥¢₫฿', 'Brackets []()', 'Punctuation !?,.;:', 'Double "Quote" Company S.A.', // special character "" in name @@ -51,26 +55,29 @@ export const LEGAL_ENTITY_DATA = { 'Icelandic: ÆÐÞ', 'Dutch: ÏËÏ', // -- not supported by the pattern - // 'ACE 9 SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ', - // '摩根亚太优势混合型证券投资基金 (QDII)', - // '삼성', // Samsung - // '三', // Samsung - // 'Czech: ČĎŇŘŠŤŽ', - // 'Estonian: ÄÖÜŠŽ', - // 'Slovak: ĽĹŔŠŤŽ', - // 'Polish: ĄĆĘŁŃÓŚŹŻ', - // 'Hungarian: ÁÉÍÓÖŐÚÜŰ', - // 'Romanian: ÂÎŞŢ', - // 'Bulgarian: ЙЪЬ', - // 'Greek: ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', - // 'Turkish: ÇĞİıÖŞÜ', - // 'Arabic: ابتثجحخدذرزسشصضطظعغفقكلمنهوي', - // 'Hebrew: שלום עולם', - // 'Hindi: अआइईउऊऋएऐओऔकखगघङचछजझञटठडढणतथदधनपफबभमयरलवशषस', - // 'Japanese: あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん', - // 'Chinese: 你好 世界', - // 'Korean: 안녕하세요 세계', - // 'Thai: สวัสดีชาวโลก', // Thai does not seem to work even with /p{L} + 'ACE 9 SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ', + '摩根亚太优势混合型证券投资基金 (QDII)', + '삼성', // Samsung + '三', // Samsung + 'Czech: ČĎŇŘŠŤŽ', + 'Estonian: ÄÖÜŠŽ', + 'Slovak: ĽĹŔŠŤŽ', + 'Polish: ĄĆĘŁŃÓŚŹŻ', + 'Hungarian: ÁÉÍÓÖŐÚÜŰ', + 'Romanian: ÂÎŞŢ', + 'Bulgarian: ЙЪЬ', + 'Greek: ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', + 'Turkish: ÇĞİıÖŞÜ', + 'Arabic: ابتثجحخدذرزسشصضطظعغفقكلمنهوي', + 'Hebrew: שלום עולם', + 'Hindi: अआइईउऊऋएऐओऔकखगघङचछजझञटठडढणतथदधनपफबभमयरलवशषस', + 'Tamil: அஆஇஈஉஊஎஏஐஒஓஔகஙசஞடணதநனபமயரலவழளஷஸஹ', + 'Japanese: あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん', + 'Chinese: 你好 世界', + 'Korean: 안녕하세요 세계', + 'Thai: สวัสดีชาวโลก', // Thai does not seem to work even with /p{L} and required additional range + 'Vietnamese: ăâắáấàằầảẳẩãẵẫạặậđêéếèềẻểẽễẹệíìỉĩịôơóốớòồờỏổởõỗỡọộợưúứùừủửũữụựýỳỷỹỵ', + 'Singapore: 你好 世界', ], invalid: [ ' Bayerische Motoren Werke Aktiengesellschaft', // leading space diff --git a/tsconfig.json b/tsconfig.json index 26d38a5f..4dd439bf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "target": "ES5", + "target": "ES6", "useDefineForClassFields": true, - "lib": ["ES5", "DOM", "DOM.Iterable"], + "lib": ["ES6", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, "esModuleInterop": true, diff --git a/tsconfig.json.orig b/tsconfig.json.orig index 27d0664d..0c4d8188 100644 --- a/tsconfig.json.orig +++ b/tsconfig.json.orig @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es6", "lib": [ "dom", "dom.iterable",