@travetto/schema 7.0.0-rc.1 → 7.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +0,0 @@
1
- import { TypedObject } from '@travetto/runtime';
2
- import { Messages } from './messages.ts';
3
-
4
- /**
5
- * List of common regular expressions for fields
6
- */
7
- export const CommonRegExp = {
8
- email: /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
9
- telephone: /^(\+?\d{1,3}(\s*-?\s*|\s+))?((\(\d{3}\))|\d{3})(\s*|-|[.])(\d{3})(\s*|-|[.])(\d{4})(\s+(x|ext[.]?)\s*\d+)?$/,
10
- url: /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,
11
- simpleName: /^([a-zA-Z\u0080-\u024F]{0,100}(?:. |-| |')){0,10}[a-zA-Z\u0080-\u024F]+$/,
12
- postalCode: /^\d{5}(?:[-\s]\d{4})?$/
13
- };
14
-
15
- export const CommonRegExpToName = new Map<RegExp, string>();
16
-
17
- // Rebind regexes
18
- for (const k of TypedObject.keys(CommonRegExp)) {
19
- const name = `[[:${k}:]]`;
20
- CommonRegExpToName.set(CommonRegExp[k], name);
21
- Messages.set(name, Messages.get(k)!);
22
- }