@bedrockio/yada 1.2.1 → 1.2.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.
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  exports.isSchema = isSchema;
8
8
  var _errors = require("./errors");
9
9
  var _utils = require("./utils");
10
- const INITIAL_TYPES = ['default', 'required', 'type', 'transform'];
10
+ const INITIAL_TYPES = ['default', 'required', 'type', 'transform', 'empty'];
11
11
  const REQUIRED_TYPES = ['default', 'required'];
12
12
  class Schema {
13
13
  constructor(meta = {}) {
@@ -157,12 +157,15 @@ class Schema {
157
157
  const {
158
158
  type
159
159
  } = assertion;
160
+ const {
161
+ message
162
+ } = error;
160
163
  if (type === 'type') {
161
- details.push(new _errors.TypeError(error, this.meta.type));
164
+ details.push(new _errors.TypeError(message, this.meta.type));
162
165
  } else if (type === 'format') {
163
- details.push(new _errors.FormatError(error, this.meta.format));
166
+ details.push(new _errors.FormatError(message, this.meta.format));
164
167
  } else if (error instanceof _errors.LocalizedError) {
165
- details.push(new _errors.AssertionError(error, type));
168
+ details.push(new _errors.AssertionError(message, type));
166
169
  } else {
167
170
  details.push(error);
168
171
  }
@@ -15,8 +15,8 @@ class LocalizedError extends Error {
15
15
  exports.LocalizedError = LocalizedError;
16
16
  class ValidationError extends Error {
17
17
  static DEFAULT_MESSAGE = 'Validation failed.';
18
- constructor(arg, details = []) {
19
- super(getLocalizedMessage(arg) || ValidationError.DEFAULT_MESSAGE);
18
+ constructor(message = ValidationError.DEFAULT_MESSAGE, details = []) {
19
+ super(message);
20
20
  this.type = 'validation';
21
21
  this.details = details;
22
22
  }
@@ -24,12 +24,9 @@ class ValidationError extends Error {
24
24
  const {
25
25
  details
26
26
  } = this;
27
- const message = this.getMessage();
28
27
  return {
29
28
  type: this.type,
30
- ...(message && {
31
- message
32
- }),
29
+ message: this.getMessage(),
33
30
  ...(details.length && {
34
31
  details: details.map(error => {
35
32
  return serializeError(error);
@@ -46,7 +43,7 @@ class ValidationError extends Error {
46
43
  DEFAULT_MESSAGE
47
44
  } = this.constructor;
48
45
  if (message && message !== DEFAULT_MESSAGE) {
49
- return message;
46
+ return getLocalizedMessage(message);
50
47
  }
51
48
  }
52
49
  getFullMessage(options) {
@@ -96,7 +93,8 @@ class FormatError extends ValidationError {
96
93
  }
97
94
  exports.FormatError = FormatError;
98
95
  class FieldError extends ValidationError {
99
- constructor(message, field, details) {
96
+ static DEFAULT_MESSAGE = 'Field failed validation.';
97
+ constructor(message = FieldError.DEFAULT_MESSAGE, field, details) {
100
98
  super(message, details);
101
99
  this.type = 'field';
102
100
  this.field = field;
@@ -110,7 +108,8 @@ class FieldError extends ValidationError {
110
108
  }
111
109
  exports.FieldError = FieldError;
112
110
  class ElementError extends ValidationError {
113
- constructor(message, index, details) {
111
+ static DEFAULT_MESSAGE = 'Element failed validation.';
112
+ constructor(message = ElementError.DEFAULT_MESSAGE, index, details) {
114
113
  super(message, details);
115
114
  this.type = 'element';
116
115
  this.index = index;
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.getErrorMessage = getErrorMessage;
6
7
  exports.getFullMessage = getFullMessage;
7
8
  var _localization = require("./localization");
8
9
  function getFullMessage(error, options) {
@@ -20,14 +21,15 @@ function getFullMessage(error, options) {
20
21
  }).join(delimiter);
21
22
  }
22
23
  }
23
- function hasMessage(error) {
24
- let message;
24
+ function getErrorMessage(error) {
25
25
  if (error.getMessage) {
26
- message = error.getMessage();
26
+ return error.getMessage();
27
27
  } else {
28
- message = error.message;
28
+ return error.message;
29
29
  }
30
- return !!message;
30
+ }
31
+ function hasMessage(error) {
32
+ return !!getErrorMessage(error);
31
33
  }
32
34
  function getInnerPath(error, options) {
33
35
  const {
@@ -11,24 +11,30 @@ var _password = require("./password");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  const SLUG_REG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
13
13
  const PHONE_REG = /^\+\d{1,3}\d{3,14}$/;
14
- const PHONE_DESCRIPTION = 'A phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.';
14
+ const NANP_REG = /^\+1[2-9]\d{2}[2-9]\d{6}$/;
15
+ const E164_DESCRIPTION = 'A phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.';
16
+ const NANP_DESCRIPTION = 'A phone number in [NANP](https://en.wikipedia.org/wiki/North_American_Numbering_Plan) format.';
15
17
  class StringSchema extends _TypeSchema.default {
16
18
  constructor() {
17
- super(String, {
18
- allowEmpty: true
19
- });
19
+ super(String);
20
20
  this.assert('type', (val, options) => {
21
21
  const {
22
- cast,
23
- required,
24
- allowEmpty
22
+ cast
25
23
  } = options;
26
24
  if (cast && typeof val !== 'string') {
27
25
  val = String(val);
28
26
  }
29
27
  if (typeof val !== 'string') {
30
28
  throw new _errors.LocalizedError('Must be a string.');
31
- } else if ((required || !allowEmpty) && val === '') {
29
+ }
30
+ return val;
31
+ });
32
+ this.assert('empty', (val, options) => {
33
+ const {
34
+ required,
35
+ allowEmpty
36
+ } = options;
37
+ if (val === '' && (required || allowEmpty === false)) {
32
38
  throw new _errors.LocalizedError('String may not be empty.');
33
39
  }
34
40
  return val;
@@ -150,12 +156,15 @@ class StringSchema extends _TypeSchema.default {
150
156
  }
151
157
  });
152
158
  }
153
- phone() {
159
+ phone(code) {
160
+ const isNANP = code === 'US' || code === 'NANP';
161
+ const reg = isNANP ? NANP_REG : PHONE_REG;
162
+ const description = isNANP ? NANP_DESCRIPTION : E164_DESCRIPTION;
154
163
  return this.format('phone', str => {
155
- if (!PHONE_REG.test(str)) {
164
+ if (!reg.test(str)) {
156
165
  throw new _errors.LocalizedError('Must be a valid phone number.');
157
166
  }
158
- }).description(PHONE_DESCRIPTION);
167
+ }).description(description);
159
168
  }
160
169
  hex() {
161
170
  return this.format('hex', str => {
@@ -377,6 +386,19 @@ class StringSchema extends _TypeSchema.default {
377
386
  }
378
387
  });
379
388
  }
389
+ format(name, fn) {
390
+ return this.clone({
391
+ format: name
392
+ }).assert('format', function (val, options) {
393
+ const {
394
+ allowEmpty
395
+ } = options;
396
+ if (val === '' && allowEmpty !== false) {
397
+ return;
398
+ }
399
+ fn(val, options);
400
+ });
401
+ }
380
402
  toOpenApi(extra) {
381
403
  const {
382
404
  min,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/yada",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Validation library inspired by Joi.",
5
5
  "scripts": {
6
6
  "test": "jest",
package/src/Schema.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from './errors';
9
9
  import { omit } from './utils';
10
10
 
11
- const INITIAL_TYPES = ['default', 'required', 'type', 'transform'];
11
+ const INITIAL_TYPES = ['default', 'required', 'type', 'transform', 'empty'];
12
12
  const REQUIRED_TYPES = ['default', 'required'];
13
13
 
14
14
  export default class Schema {
@@ -149,13 +149,14 @@ export default class Schema {
149
149
  }
150
150
  } catch (error) {
151
151
  const { type } = assertion;
152
+ const { message } = error;
152
153
 
153
154
  if (type === 'type') {
154
- details.push(new TypeError(error, this.meta.type));
155
+ details.push(new TypeError(message, this.meta.type));
155
156
  } else if (type === 'format') {
156
- details.push(new FormatError(error, this.meta.format));
157
+ details.push(new FormatError(message, this.meta.format));
157
158
  } else if (error instanceof LocalizedError) {
158
- details.push(new AssertionError(error, type));
159
+ details.push(new AssertionError(message, type));
159
160
  } else {
160
161
  details.push(error);
161
162
  }
package/src/errors.js CHANGED
@@ -10,20 +10,17 @@ export class LocalizedError extends Error {
10
10
  export class ValidationError extends Error {
11
11
  static DEFAULT_MESSAGE = 'Validation failed.';
12
12
 
13
- constructor(arg, details = []) {
14
- super(getLocalizedMessage(arg) || ValidationError.DEFAULT_MESSAGE);
13
+ constructor(message = ValidationError.DEFAULT_MESSAGE, details = []) {
14
+ super(message);
15
15
  this.type = 'validation';
16
16
  this.details = details;
17
17
  }
18
18
 
19
19
  toJSON() {
20
20
  const { details } = this;
21
- const message = this.getMessage();
22
21
  return {
23
22
  type: this.type,
24
- ...(message && {
25
- message,
26
- }),
23
+ message: this.getMessage(),
27
24
  ...(details.length && {
28
25
  details: details.map((error) => {
29
26
  return serializeError(error);
@@ -37,7 +34,7 @@ export class ValidationError extends Error {
37
34
  // @ts-ignore
38
35
  const { DEFAULT_MESSAGE } = this.constructor;
39
36
  if (message && message !== DEFAULT_MESSAGE) {
40
- return message;
37
+ return getLocalizedMessage(message);
41
38
  }
42
39
  }
43
40
 
@@ -91,7 +88,9 @@ export class FormatError extends ValidationError {
91
88
  }
92
89
 
93
90
  export class FieldError extends ValidationError {
94
- constructor(message, field, details) {
91
+ static DEFAULT_MESSAGE = 'Field failed validation.';
92
+
93
+ constructor(message = FieldError.DEFAULT_MESSAGE, field, details) {
95
94
  super(message, details);
96
95
  this.type = 'field';
97
96
  this.field = field;
@@ -106,7 +105,9 @@ export class FieldError extends ValidationError {
106
105
  }
107
106
 
108
107
  export class ElementError extends ValidationError {
109
- constructor(message, index, details) {
108
+ static DEFAULT_MESSAGE = 'Element failed validation.';
109
+
110
+ constructor(message = ElementError.DEFAULT_MESSAGE, index, details) {
110
111
  super(message, details);
111
112
  this.type = 'element';
112
113
  this.index = index;
package/src/messages.js CHANGED
@@ -16,14 +16,16 @@ export function getFullMessage(error, options) {
16
16
  }
17
17
  }
18
18
 
19
- function hasMessage(error) {
20
- let message;
19
+ export function getErrorMessage(error) {
21
20
  if (error.getMessage) {
22
- message = error.getMessage();
21
+ return error.getMessage();
23
22
  } else {
24
- message = error.message;
23
+ return error.message;
25
24
  }
26
- return !!message;
25
+ }
26
+
27
+ function hasMessage(error) {
28
+ return !!getErrorMessage(error);
27
29
  }
28
30
 
29
31
  function getInnerPath(error, options) {
package/src/string.js CHANGED
@@ -12,21 +12,31 @@ import {
12
12
 
13
13
  const SLUG_REG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
14
14
  const PHONE_REG = /^\+\d{1,3}\d{3,14}$/;
15
+ const NANP_REG = /^\+1[2-9]\d{2}[2-9]\d{6}$/;
15
16
 
16
- const PHONE_DESCRIPTION =
17
+ const E164_DESCRIPTION =
17
18
  'A phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.';
18
19
 
20
+ const NANP_DESCRIPTION =
21
+ 'A phone number in [NANP](https://en.wikipedia.org/wiki/North_American_Numbering_Plan) format.';
22
+
19
23
  class StringSchema extends TypeSchema {
20
24
  constructor() {
21
- super(String, { allowEmpty: true });
25
+ super(String);
22
26
  this.assert('type', (val, options) => {
23
- const { cast, required, allowEmpty } = options;
27
+ const { cast } = options;
28
+
24
29
  if (cast && typeof val !== 'string') {
25
30
  val = String(val);
26
31
  }
27
32
  if (typeof val !== 'string') {
28
33
  throw new LocalizedError('Must be a string.');
29
- } else if ((required || !allowEmpty) && val === '') {
34
+ }
35
+ return val;
36
+ });
37
+ this.assert('empty', (val, options) => {
38
+ const { required, allowEmpty } = options;
39
+ if (val === '' && (required || allowEmpty === false)) {
30
40
  throw new LocalizedError('String may not be empty.');
31
41
  }
32
42
  return val;
@@ -143,12 +153,15 @@ class StringSchema extends TypeSchema {
143
153
  });
144
154
  }
145
155
 
146
- phone() {
156
+ phone(code) {
157
+ const isNANP = code === 'US' || code === 'NANP';
158
+ const reg = isNANP ? NANP_REG : PHONE_REG;
159
+ const description = isNANP ? NANP_DESCRIPTION : E164_DESCRIPTION;
147
160
  return this.format('phone', (str) => {
148
- if (!PHONE_REG.test(str)) {
161
+ if (!reg.test(str)) {
149
162
  throw new LocalizedError('Must be a valid phone number.');
150
163
  }
151
- }).description(PHONE_DESCRIPTION);
164
+ }).description(description);
152
165
  }
153
166
 
154
167
  hex() {
@@ -390,6 +403,19 @@ class StringSchema extends TypeSchema {
390
403
  });
391
404
  }
392
405
 
406
+ format(name, fn) {
407
+ return this.clone({ format: name }).assert(
408
+ 'format',
409
+ function (val, options) {
410
+ const { allowEmpty } = options;
411
+ if (val === '' && allowEmpty !== false) {
412
+ return;
413
+ }
414
+ fn(val, options);
415
+ }
416
+ );
417
+ }
418
+
393
419
  toOpenApi(extra) {
394
420
  const { min, max } = this.meta;
395
421
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.js"],"names":[],"mappings":"AAkYA,4CAEC;AAvXD;IACE,uBAGC;IAFC,kBAAoB;IACpB,SAAgB;IAKlB;;OAEG;IACH,YAFa,IAAI,CAQhB;IAED;;;OAGG;IACH,mBAFa,IAAI,CAShB;IAED;;;;OAIG;IACH,sBAFa,IAAI,CAShB;IAED;;;;OAIG;IACH,mBAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,sBAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,uBAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,YAFa,IAAI,CAIhB;IAED;;OAEG;IACH,uBAFa,IAAI,CAIhB;IAED;;OAEG;IACH,gBAFa,IAAI,CAShB;IAED;;OAEG;IACH,+BAFa,IAAI,CAMhB;IAED;;OAEG;IACH,uBAFa,IAAI,CAIhB;IAED,iDA6CC;IAED;;OAEG;IACH,kBAFa,IAAI,CAOhB;IAED;;;OAGG;IACH,qBAFa,IAAI,CAMhB;IAED,2BAYC;IAED;;MAOC;IAED;;;;MASC;IAED;;MAOC;IAED,4BAMC;IAED,kBAEC;IAID;;OAEG;IACH,kCAFa,IAAI,CAiDhB;IAED;;OAEG;IACH,4BAFa,IAAI,CAUhB;IAED,oCAKC;IAED;;OAEG;IACH,oBAFa,IAAI,CAShB;IAED,gCAGC;IAED,qEAGC;IAED;;;;;;;;MAsCC;CACF"}
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.js"],"names":[],"mappings":"AAmYA,4CAEC;AAxXD;IACE,uBAGC;IAFC,kBAAoB;IACpB,SAAgB;IAKlB;;OAEG;IACH,YAFa,IAAI,CAQhB;IAED;;;OAGG;IACH,mBAFa,IAAI,CAShB;IAED;;;;OAIG;IACH,sBAFa,IAAI,CAShB;IAED;;;;OAIG;IACH,mBAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,sBAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,uBAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,YAFa,IAAI,CAIhB;IAED;;OAEG;IACH,uBAFa,IAAI,CAIhB;IAED;;OAEG;IACH,gBAFa,IAAI,CAShB;IAED;;OAEG;IACH,+BAFa,IAAI,CAMhB;IAED;;OAEG;IACH,uBAFa,IAAI,CAIhB;IAED,iDA8CC;IAED;;OAEG;IACH,kBAFa,IAAI,CAOhB;IAED;;;OAGG;IACH,qBAFa,IAAI,CAMhB;IAED,2BAYC;IAED;;MAOC;IAED;;;;MASC;IAED;;MAOC;IAED,4BAMC;IAED,kBAEC;IAID;;OAEG;IACH,kCAFa,IAAI,CAiDhB;IAED;;OAEG;IACH,4BAFa,IAAI,CAUhB;IAED,oCAKC;IAED;;OAEG;IACH,oBAFa,IAAI,CAShB;IAED,gCAGC;IAED,qEAGC;IAED;;;;;;;;MAsCC;CACF"}
package/types/errors.d.ts CHANGED
@@ -4,15 +4,15 @@ export class LocalizedError extends Error {
4
4
  }
5
5
  export class ValidationError extends Error {
6
6
  static DEFAULT_MESSAGE: string;
7
- constructor(arg: any, details?: any[]);
7
+ constructor(message?: string, details?: any[]);
8
8
  type: string;
9
9
  details: any[];
10
10
  toJSON(): {
11
11
  details: any[];
12
- message: string;
13
12
  type: string;
13
+ message: any;
14
14
  };
15
- getMessage(): string;
15
+ getMessage(): any;
16
16
  getFullMessage(options: any): any;
17
17
  }
18
18
  export class AssertionError extends ValidationError {
@@ -25,8 +25,8 @@ export class TypeError extends ValidationError {
25
25
  toJSON(): {
26
26
  kind: any;
27
27
  details: any[];
28
- message: string;
29
28
  type: string;
29
+ message: any;
30
30
  };
31
31
  }
32
32
  export class FormatError extends ValidationError {
@@ -35,28 +35,28 @@ export class FormatError extends ValidationError {
35
35
  toJSON(): {
36
36
  format: any;
37
37
  details: any[];
38
- message: string;
39
38
  type: string;
39
+ message: any;
40
40
  };
41
41
  }
42
42
  export class FieldError extends ValidationError {
43
- constructor(message: any, field: any, details: any);
43
+ constructor(message: string, field: any, details: any);
44
44
  field: any;
45
45
  toJSON(): {
46
46
  field: any;
47
47
  details: any[];
48
- message: string;
49
48
  type: string;
49
+ message: any;
50
50
  };
51
51
  }
52
52
  export class ElementError extends ValidationError {
53
- constructor(message: any, index: any, details: any);
53
+ constructor(message: string, index: any, details: any);
54
54
  index: any;
55
55
  toJSON(): {
56
56
  index: any;
57
57
  details: any[];
58
- message: string;
59
58
  type: string;
59
+ message: any;
60
60
  };
61
61
  }
62
62
  export class ArrayError extends ValidationError {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.js"],"names":[],"mappings":"AAwIA,iDAEC;AAvID;IACE,uCAEC;CACF;AAED;IACE,+BAA8C;IAE9C,uCAIC;IAFC,aAAwB;IACxB,eAAsB;IAGxB;;;;MAcC;IAED,qBAOC;IAED,kCAKC;CACF;AAED;IACE,yCAGC;CACF;AAED;IACE,qCAIC;IADC,UAAgB;IAGlB,2BAEC;IAED;;;;;MAKC;CACF;AAED;IACE,uCAIC;IADC,YAAoB;IAGtB;;;;;MAKC;CACF;AAED;IACE,oDAIC;IADC,WAAkB;IAGpB;;;;;MAKC;CACF;AAED;IACE,oDAIC;IADC,WAAkB;IAGpB;;;;;MAKC;CACF;AAED;IACE,wCAGC;CACF;AAED;IACE,wCAGC;CACF"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.js"],"names":[],"mappings":"AAyIA,iDAEC;AAxID;IACE,uCAEC;CACF;AAED;IACE,+BAA8C;IAE9C,+CAIC;IAFC,aAAwB;IACxB,eAAsB;IAGxB;;;;MAWC;IAED,kBAOC;IAED,kCAKC;CACF;AAED;IACE,yCAGC;CACF;AAED;IACE,qCAIC;IADC,UAAgB;IAGlB,2BAEC;IAED;;;;;MAKC;CACF;AAED;IACE,uCAIC;IADC,YAAoB;IAGtB;;;;;MAKC;CACF;AAED;IAGE,uDAIC;IADC,WAAkB;IAGpB;;;;;MAKC;CACF;AAED;IAGE,uDAIC;IADC,WAAkB;IAGpB;;;;;MAKC;CACF;AAED;IACE,wCAGC;CACF;AAED;IACE,wCAGC;CACF"}
@@ -1,2 +1,3 @@
1
1
  export function getFullMessage(error: any, options: any): any;
2
+ export function getErrorMessage(error: any): any;
2
3
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.js"],"names":[],"mappings":"AAEA,8DAcC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.js"],"names":[],"mappings":"AAEA,8DAcC;AAED,iDAMC"}
package/types/string.d.ts CHANGED
@@ -34,7 +34,7 @@ declare class StringSchema extends TypeSchema {
34
34
  */
35
35
  match(reg: RegExp): StringSchema;
36
36
  email(): StringSchema;
37
- phone(): StringSchema;
37
+ phone(code: any): StringSchema;
38
38
  hex(): StringSchema;
39
39
  md5(): StringSchema;
40
40
  sha1(): StringSchema;
@@ -121,6 +121,7 @@ declare class StringSchema extends TypeSchema {
121
121
  eth(): StringSchema;
122
122
  swift(): StringSchema;
123
123
  mongo(): StringSchema;
124
+ format(name: any, fn: any): StringSchema;
124
125
  }
125
126
  import TypeSchema from "./TypeSchema";
126
127
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.js"],"names":[],"mappings":"AAsZA;;GAEG;AACH,iDAEC;AAzYD;IACE,cAcC;IAED;;OAEG;IACH,YAFa,IAAI,CAQhB;IAED;;OAEG;IACH,eAFW,MAAM,gBAUhB;IAED;;OAEG;IACH,YAFW,MAAM,gBAUhB;IAED;;OAEG;IACH,YAFW,MAAM,gBAUhB;IAED,qBAIC;IAED;;OAEG;IACH,mBAFW,OAAO,gBAYjB;IAED;;OAEG;IACH,mBAFW,OAAO,gBAYjB;IAED;;OAEG;IACH,WAFW,MAAM,gBAahB;IAED,sBAMC;IAED,sBAMC;IAED,oBAMC;IAED,oBAMC;IAED,qBAMC;IAED,sBAMC;IAED;;;OAGG;IACH;QAF6B,OAAO,GAAzB,OAAO;qBAQjB;IAED,2BAMC;IAED,mBAMC;IAED,wBAMC;IAED,uBAMC;IAED,oBAMC;IAED,qBAOC;IAED,uBAMC;IAED;;OAEG;IACH,oBAFW,MAAM,gBAQhB;IAED,wBAMC;IAED;;;;;;;OAOG;IACH;QAN4B,SAAS,GAA1B,MAAM;QACW,UAAU,GAA3B,MAAM;QACW,UAAU,GAA3B,MAAM;QACW,YAAY,GAA7B,MAAM;QACW,YAAY,GAA7B,MAAM;qBA+BhB;IAED;;;;;;;;;;;OAWG;IACH;QAV6B,gBAAgB,GAAlC,OAAO;QACW,sBAAsB,GAAxC,OAAO;QACW,YAAY,GAA9B,OAAO;QACW,YAAY,GAA9B,OAAO;QACW,4BAA4B,GAA9C,OAAO;QACW,eAAe,GAAjC,OAAO;QACW,sBAAsB,GAAxC,OAAO;QACW,eAAe,GAAjC,OAAO;QACY,SAAS,GAA5B,MAAM,EAAE;qBAQlB;IAED;;;;;;;;OAQG;IACH;QAP6B,WAAW,GAA7B,OAAO;QACW,iBAAiB,GAAnC,OAAO;QACW,kBAAkB,GAApC,OAAO;QACW,iBAAiB,GAAnC,OAAO;QACW,cAAc,GAAhC,OAAO;QACW,iBAAiB,GAAnC,OAAO;qBAQjB;IAED;;OAEG;IACH,eAFW,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,gBAQ3B;IAED,oBAMC;IAED,oBAMC;IAED,sBAMC;IAED,sBAMC;CAcF"}
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.js"],"names":[],"mappings":"AAgbA;;GAEG;AACH,iDAEC;AA/ZD;IACE,cAoBC;IAED;;OAEG;IACH,YAFa,IAAI,CAQhB;IAED;;OAEG;IACH,eAFW,MAAM,gBAUhB;IAED;;OAEG;IACH,YAFW,MAAM,gBAUhB;IAED;;OAEG;IACH,YAFW,MAAM,gBAUhB;IAED,qBAIC;IAED;;OAEG;IACH,mBAFW,OAAO,gBAYjB;IAED;;OAEG;IACH,mBAFW,OAAO,gBAYjB;IAED;;OAEG;IACH,WAFW,MAAM,gBAahB;IAED,sBAMC;IAED,+BASC;IAED,oBAMC;IAED,oBAMC;IAED,qBAMC;IAED,sBAMC;IAED;;;OAGG;IACH;QAF6B,OAAO,GAAzB,OAAO;qBAQjB;IAED,2BAMC;IAED,mBAMC;IAED,wBAMC;IAED,uBAMC;IAED,oBAMC;IAED,qBAOC;IAED,uBAMC;IAED;;OAEG;IACH,oBAFW,MAAM,gBAQhB;IAED,wBAMC;IAED;;;;;;;OAOG;IACH;QAN4B,SAAS,GAA1B,MAAM;QACW,UAAU,GAA3B,MAAM;QACW,UAAU,GAA3B,MAAM;QACW,YAAY,GAA7B,MAAM;QACW,YAAY,GAA7B,MAAM;qBA+BhB;IAED;;;;;;;;;;;OAWG;IACH;QAV6B,gBAAgB,GAAlC,OAAO;QACW,sBAAsB,GAAxC,OAAO;QACW,YAAY,GAA9B,OAAO;QACW,YAAY,GAA9B,OAAO;QACW,4BAA4B,GAA9C,OAAO;QACW,eAAe,GAAjC,OAAO;QACW,sBAAsB,GAAxC,OAAO;QACW,eAAe,GAAjC,OAAO;QACY,SAAS,GAA5B,MAAM,EAAE;qBAQlB;IAED;;;;;;;;OAQG;IACH;QAP6B,WAAW,GAA7B,OAAO;QACW,iBAAiB,GAAnC,OAAO;QACW,kBAAkB,GAApC,OAAO;QACW,iBAAiB,GAAnC,OAAO;QACW,cAAc,GAAhC,OAAO;QACW,iBAAiB,GAAnC,OAAO;qBAQjB;IAED;;OAEG;IACH,eAFW,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,gBAQ3B;IAED,oBAMC;IAED,oBAMC;IAED,sBAMC;IAED,sBAMC;IAED,yCAWC;CAcF"}