@bedrockio/yada 1.8.2 → 1.9.0

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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@
6
6
 
7
7
  - Fixed bug with tagging in `toOpenApi`.
8
8
 
9
+ ## 1.9.0
10
+
11
+ - Added ISO-8601 `time` format on a string.
12
+
13
+ ## 1.8.3
14
+
15
+ - Fixed issue with incorrect JSON schema when nested.
16
+
9
17
  ## 1.8.0
10
18
 
11
19
  - Removed undefined `format` field.
package/README.md CHANGED
@@ -905,14 +905,14 @@ integration. Any schema can describe itself in JSON Schema format including
905
905
  complex nested schemas.
906
906
 
907
907
  ```js
908
- yd.string().allow('foo', 'bar').toJSON();
908
+ yd.string().allow('foo', 'bar').toJsonSchema();
909
909
  // {
910
910
  // type: 'string',
911
911
  // enum: ['foo', 'bar'],
912
912
  // }
913
913
  ```
914
914
 
915
- This also means schemas work with JSON helpers:
915
+ This also means schemas work with JSON serializers:
916
916
 
917
917
  ```js
918
918
  const schema = yd.string().allow('foo', 'bar');
@@ -929,7 +929,7 @@ The `tag` method allows tagging custom fields:
929
929
  yd.string().tag({
930
930
  description: 'my description!',
931
931
  x-field: 'my custom field!',
932
- }).toJSON();
932
+ }).toJsonSchema();
933
933
  // {
934
934
  // type: 'string',
935
935
  // description: 'my description!',
@@ -940,7 +940,7 @@ yd.string().tag({
940
940
  The `description` method is a shortcut:
941
941
 
942
942
  ```js
943
- yd.string().description('my description!').toJSON();
943
+ yd.string().description('my description!').toJsonSchema();
944
944
  // {
945
945
  // type: 'string',
946
946
  // description: 'my description!',
@@ -221,7 +221,7 @@ class Schema {
221
221
  * custom (code-based) assertions will not be output.
222
222
  * @param {Object} [extra]
223
223
  */
224
- toJSON(extra) {
224
+ toJsonSchema(extra) {
225
225
  const {
226
226
  tags
227
227
  } = this.meta;
@@ -238,10 +238,17 @@ class Schema {
238
238
 
239
239
  /**
240
240
  * Exports the schema in [JSON Schema](https://json-schema.org/) format.
241
- * @alias toJSON.
241
+ * @alias toJsonSchema.
242
242
  */
243
243
  toOpenApi(...extra) {
244
- return this.toJSON(...extra);
244
+ return this.toJsonSchema(...extra);
245
+ }
246
+
247
+ /**
248
+ * Export JSON schema when invoked by JSON serializer.
249
+ */
250
+ toJSON() {
251
+ return this.toJsonSchema();
245
252
  }
246
253
  getAnyType() {
247
254
  const {
@@ -311,7 +318,7 @@ class Schema {
311
318
  const anyOf = [];
312
319
  for (let entry of allowed) {
313
320
  if (isSchema(entry)) {
314
- anyOf.push(entry.toJSON());
321
+ anyOf.push(entry.toJsonSchema());
315
322
  } else if (entry === null) {
316
323
  anyOf.push({
317
324
  type: 'null'
@@ -375,7 +382,7 @@ class Schema {
375
382
  return rest;
376
383
  }
377
384
  inspect() {
378
- return JSON.stringify(this.toJSON(), null, 2);
385
+ return JSON.stringify(this, null, 2);
379
386
  }
380
387
  get() {
381
388
  const {
@@ -22,9 +22,9 @@ class TypeSchema extends _Schema.default {
22
22
  toString() {
23
23
  return this.meta.type;
24
24
  }
25
- toJSON(extra) {
25
+ toJsonSchema(extra) {
26
26
  return {
27
- ...super.toJSON(extra),
27
+ ...super.toJsonSchema(extra),
28
28
  type: this.meta.type
29
29
  };
30
30
  }
package/dist/cjs/array.js CHANGED
@@ -129,7 +129,7 @@ class ArraySchema extends _TypeSchema.default {
129
129
  toString() {
130
130
  return 'array';
131
131
  }
132
- toJSON(extra) {
132
+ toJsonSchema(extra) {
133
133
  let other;
134
134
  const {
135
135
  schemas
@@ -137,16 +137,16 @@ class ArraySchema extends _TypeSchema.default {
137
137
  if (schemas.length > 1) {
138
138
  other = {
139
139
  anyOf: schemas.map(schema => {
140
- return schema.toJSON();
140
+ return schema.toJsonSchema();
141
141
  })
142
142
  };
143
143
  } else if (schemas.length === 1) {
144
144
  other = {
145
- items: schemas[0].toJSON()
145
+ items: schemas[0].toJsonSchema()
146
146
  };
147
147
  }
148
148
  return {
149
- ...super.toJSON(extra),
149
+ ...super.toJsonSchema(extra),
150
150
  ...other,
151
151
  type: 'array'
152
152
  };
package/dist/cjs/date.js CHANGED
@@ -142,12 +142,12 @@ class DateSchema extends _Schema.default {
142
142
  toString() {
143
143
  return 'date';
144
144
  }
145
- toJSON(extra) {
145
+ toJsonSchema(extra) {
146
146
  const {
147
147
  format
148
148
  } = this.meta;
149
149
  return {
150
- ...super.toJSON(extra),
150
+ ...super.toJsonSchema(extra),
151
151
  type: format.includes('timestamp') ? 'number' : 'string'
152
152
  };
153
153
  }
@@ -79,14 +79,14 @@ class NumberSchema extends _TypeSchema.default {
79
79
 
80
80
  // Private
81
81
 
82
- toJSON(extra) {
82
+ toJsonSchema(extra) {
83
83
  const {
84
84
  min,
85
85
  max,
86
86
  multiple
87
87
  } = this.meta;
88
88
  return {
89
- ...super.toJSON(extra),
89
+ ...super.toJsonSchema(extra),
90
90
  ...(min != null && {
91
91
  minimum: min
92
92
  }),
@@ -300,20 +300,20 @@ class ObjectSchema extends _TypeSchema.default {
300
300
 
301
301
  // Private
302
302
 
303
- toJSON(extra) {
303
+ toJsonSchema(extra) {
304
304
  const {
305
305
  stripUnknown = false
306
306
  } = this.meta;
307
307
  const required = [];
308
308
  const properties = {};
309
309
  for (let [key, schema] of Object.entries(this.export())) {
310
- properties[key] = schema.toJSON(extra);
310
+ properties[key] = schema.toJsonSchema(extra);
311
311
  if (schema.meta.required) {
312
312
  required.push(key);
313
313
  }
314
314
  }
315
315
  return {
316
- ...super.toJSON(extra),
316
+ ...super.toJsonSchema(extra),
317
317
  ...(Object.keys(properties).length > 0 && {
318
318
  properties,
319
319
  required,
@@ -14,6 +14,8 @@ const SLUG_REG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
14
14
  const PHONE_REG = /^\+\d{1,3}\d{3,14}$/;
15
15
  const NANP_REG = /^\+1[2-9]\d{2}[2-9]\d{6}$/;
16
16
  const DATE_REG = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[01])$/;
17
+ const LOCALE_REG = /^[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?$/;
18
+ const TIME_REG = /^(?:[0-2][0-9])(?::[0-5][0-9])?(?::[0-5][0-9])?(?:\.\d{3})?(?:Z|(?:[+-]0[0-9]|-1[0-2]|\+1[0-4]):[0-5][0-9])?$/;
17
19
  const E164_DESCRIPTION = 'A phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.';
18
20
  const NANP_DESCRIPTION = 'A phone number in [NANP](https://en.wikipedia.org/wiki/North_American_Numbering_Plan) format.';
19
21
  class StringSchema extends _TypeSchema.default {
@@ -227,7 +229,9 @@ class StringSchema extends _TypeSchema.default {
227
229
  }
228
230
  locale() {
229
231
  return this.format('locale', str => {
230
- if (!_validator.default.isLocale(str)) {
232
+ // Switch to simple regex while this bug is being fixed:
233
+ // https://github.com/validatorjs/validator.js/issues/2342
234
+ if (!LOCALE_REG.test(str)) {
231
235
  throw new _errors.LocalizedError('Must be a valid locale code.');
232
236
  }
233
237
  });
@@ -404,6 +408,17 @@ class StringSchema extends _TypeSchema.default {
404
408
  }
405
409
  });
406
410
  }
411
+
412
+ /**
413
+ * Validates times in ISO-8601 format.
414
+ */
415
+ time() {
416
+ return this.format('time', str => {
417
+ if (!TIME_REG.test(str)) {
418
+ throw new _errors.LocalizedError('Must be an ISO-8601 time.');
419
+ }
420
+ });
421
+ }
407
422
  format(name, fn) {
408
423
  return this.clone({
409
424
  format: name
@@ -417,13 +432,13 @@ class StringSchema extends _TypeSchema.default {
417
432
 
418
433
  // Private
419
434
 
420
- toJSON(extra) {
435
+ toJsonSchema(extra) {
421
436
  const {
422
437
  min,
423
438
  max
424
439
  } = this.meta;
425
440
  return {
426
- ...super.toJSON(extra),
441
+ ...super.toJsonSchema(extra),
427
442
  ...(min && {
428
443
  minLength: min
429
444
  }),
package/dist/cjs/tuple.js CHANGED
@@ -79,15 +79,15 @@ class TupleSchema extends _Schema.default {
79
79
  toString() {
80
80
  return 'tuple';
81
81
  }
82
- toJSON(extra) {
82
+ toJsonSchema(extra) {
83
83
  const {
84
84
  schemas
85
85
  } = this.meta;
86
86
  return {
87
- ...super.toJSON(extra),
87
+ ...super.toJsonSchema(extra),
88
88
  type: 'array',
89
89
  prefixItems: schemas.map(schema => {
90
- return schema.toJSON();
90
+ return schema.toJsonSchema();
91
91
  })
92
92
  };
93
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/yada",
3
- "version": "1.8.2",
3
+ "version": "1.9.0",
4
4
  "description": "Validation library inspired by Joi.",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -18,7 +18,7 @@
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
20
  "lodash": "^4.17.21",
21
- "validator": "^13.9.0"
21
+ "validator": "^13.15.20"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@babel/cli": "^7.20.7",
package/src/Schema.js CHANGED
@@ -214,7 +214,7 @@ export default class Schema {
214
214
  * custom (code-based) assertions will not be output.
215
215
  * @param {Object} [extra]
216
216
  */
217
- toJSON(extra) {
217
+ toJsonSchema(extra) {
218
218
  const { tags } = this.meta;
219
219
  return {
220
220
  ...tags,
@@ -229,10 +229,17 @@ export default class Schema {
229
229
 
230
230
  /**
231
231
  * Exports the schema in [JSON Schema](https://json-schema.org/) format.
232
- * @alias toJSON.
232
+ * @alias toJsonSchema.
233
233
  */
234
234
  toOpenApi(...extra) {
235
- return this.toJSON(...extra);
235
+ return this.toJsonSchema(...extra);
236
+ }
237
+
238
+ /**
239
+ * Export JSON schema when invoked by JSON serializer.
240
+ */
241
+ toJSON() {
242
+ return this.toJsonSchema();
236
243
  }
237
244
 
238
245
  getAnyType() {
@@ -294,7 +301,7 @@ export default class Schema {
294
301
  const anyOf = [];
295
302
  for (let entry of allowed) {
296
303
  if (isSchema(entry)) {
297
- anyOf.push(entry.toJSON());
304
+ anyOf.push(entry.toJsonSchema());
298
305
  } else if (entry === null) {
299
306
  anyOf.push({
300
307
  type: 'null',
@@ -351,7 +358,7 @@ export default class Schema {
351
358
  }
352
359
 
353
360
  inspect() {
354
- return JSON.stringify(this.toJSON(), null, 2);
361
+ return JSON.stringify(this, null, 2);
355
362
  }
356
363
 
357
364
  get() {
package/src/TypeSchema.js CHANGED
@@ -14,9 +14,9 @@ export default class TypeSchema extends Schema {
14
14
  return this.meta.type;
15
15
  }
16
16
 
17
- toJSON(extra) {
17
+ toJsonSchema(extra) {
18
18
  return {
19
- ...super.toJSON(extra),
19
+ ...super.toJsonSchema(extra),
20
20
  type: this.meta.type,
21
21
  };
22
22
  }
package/src/array.js CHANGED
@@ -125,23 +125,23 @@ class ArraySchema extends TypeSchema {
125
125
  return 'array';
126
126
  }
127
127
 
128
- toJSON(extra) {
128
+ toJsonSchema(extra) {
129
129
  let other;
130
130
  const { schemas } = this.meta;
131
131
  if (schemas.length > 1) {
132
132
  other = {
133
133
  anyOf: schemas.map((schema) => {
134
- return schema.toJSON();
134
+ return schema.toJsonSchema();
135
135
  }),
136
136
  };
137
137
  } else if (schemas.length === 1) {
138
138
  other = {
139
- items: schemas[0].toJSON(),
139
+ items: schemas[0].toJsonSchema(),
140
140
  };
141
141
  }
142
142
 
143
143
  return {
144
- ...super.toJSON(extra),
144
+ ...super.toJsonSchema(extra),
145
145
  ...other,
146
146
  type: 'array',
147
147
  };
package/src/date.js CHANGED
@@ -138,10 +138,10 @@ class DateSchema extends Schema {
138
138
  return 'date';
139
139
  }
140
140
 
141
- toJSON(extra) {
141
+ toJsonSchema(extra) {
142
142
  const { format } = this.meta;
143
143
  return {
144
- ...super.toJSON(extra),
144
+ ...super.toJsonSchema(extra),
145
145
  type: format.includes('timestamp') ? 'number' : 'string',
146
146
  };
147
147
  }
package/src/number.js CHANGED
@@ -71,10 +71,10 @@ class NumberSchema extends TypeSchema {
71
71
 
72
72
  // Private
73
73
 
74
- toJSON(extra) {
74
+ toJsonSchema(extra) {
75
75
  const { min, max, multiple } = this.meta;
76
76
  return {
77
- ...super.toJSON(extra),
77
+ ...super.toJsonSchema(extra),
78
78
  ...(min != null && {
79
79
  minimum: min,
80
80
  }),
package/src/object.js CHANGED
@@ -300,19 +300,19 @@ class ObjectSchema extends TypeSchema {
300
300
 
301
301
  // Private
302
302
 
303
- toJSON(extra) {
303
+ toJsonSchema(extra) {
304
304
  const { stripUnknown = false } = this.meta;
305
305
 
306
306
  const required = [];
307
307
  const properties = {};
308
308
  for (let [key, schema] of Object.entries(this.export())) {
309
- properties[key] = schema.toJSON(extra);
309
+ properties[key] = schema.toJsonSchema(extra);
310
310
  if (schema.meta.required) {
311
311
  required.push(key);
312
312
  }
313
313
  }
314
314
  return {
315
- ...super.toJSON(extra),
315
+ ...super.toJsonSchema(extra),
316
316
  ...(Object.keys(properties).length > 0 && {
317
317
  properties,
318
318
  required,
package/src/string.js CHANGED
@@ -18,6 +18,9 @@ const SLUG_REG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
18
18
  const PHONE_REG = /^\+\d{1,3}\d{3,14}$/;
19
19
  const NANP_REG = /^\+1[2-9]\d{2}[2-9]\d{6}$/;
20
20
  const DATE_REG = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[01])$/;
21
+ const LOCALE_REG = /^[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?$/;
22
+ const TIME_REG =
23
+ /^(?:[0-2][0-9])(?::[0-5][0-9])?(?::[0-5][0-9])?(?:\.\d{3})?(?:Z|(?:[+-]0[0-9]|-1[0-2]|\+1[0-4]):[0-5][0-9])?$/;
21
24
 
22
25
  const E164_DESCRIPTION =
23
26
  'A phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.';
@@ -238,7 +241,9 @@ class StringSchema extends TypeSchema {
238
241
 
239
242
  locale() {
240
243
  return this.format('locale', (str) => {
241
- if (!validator.isLocale(str)) {
244
+ // Switch to simple regex while this bug is being fixed:
245
+ // https://github.com/validatorjs/validator.js/issues/2342
246
+ if (!LOCALE_REG.test(str)) {
242
247
  throw new LocalizedError('Must be a valid locale code.');
243
248
  }
244
249
  });
@@ -427,6 +432,17 @@ class StringSchema extends TypeSchema {
427
432
  });
428
433
  }
429
434
 
435
+ /**
436
+ * Validates times in ISO-8601 format.
437
+ */
438
+ time() {
439
+ return this.format('time', (str) => {
440
+ if (!TIME_REG.test(str)) {
441
+ throw new LocalizedError('Must be an ISO-8601 time.');
442
+ }
443
+ });
444
+ }
445
+
430
446
  format(name, fn) {
431
447
  return this.clone({ format: name }).assert(
432
448
  'format',
@@ -441,10 +457,10 @@ class StringSchema extends TypeSchema {
441
457
 
442
458
  // Private
443
459
 
444
- toJSON(extra) {
460
+ toJsonSchema(extra) {
445
461
  const { min, max } = this.meta;
446
462
  return {
447
- ...super.toJSON(extra),
463
+ ...super.toJsonSchema(extra),
448
464
  ...(min && {
449
465
  minLength: min,
450
466
  }),
package/src/tuple.js CHANGED
@@ -69,13 +69,13 @@ class TupleSchema extends Schema {
69
69
  return 'tuple';
70
70
  }
71
71
 
72
- toJSON(extra) {
72
+ toJsonSchema(extra) {
73
73
  const { schemas } = this.meta;
74
74
  return {
75
- ...super.toJSON(extra),
75
+ ...super.toJsonSchema(extra),
76
76
  type: 'array',
77
77
  prefixItems: schemas.map((schema) => {
78
- return schema.toJSON();
78
+ return schema.toJsonSchema();
79
79
  }),
80
80
  };
81
81
  }
package/types/Schema.d.ts CHANGED
@@ -77,12 +77,16 @@ export default class Schema {
77
77
  * custom (code-based) assertions will not be output.
78
78
  * @param {Object} [extra]
79
79
  */
80
- toJSON(extra?: any): any;
80
+ toJsonSchema(extra?: any): any;
81
81
  /**
82
82
  * Exports the schema in [JSON Schema](https://json-schema.org/) format.
83
- * @alias toJSON.
83
+ * @alias toJsonSchema.
84
84
  */
85
85
  toOpenApi(...extra: any[]): any;
86
+ /**
87
+ * Export JSON schema when invoked by JSON serializer.
88
+ */
89
+ toJSON(): any;
86
90
  getAnyType(): {
87
91
  type: string[];
88
92
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.js"],"names":[],"mappings":"AAgBA,kDAEC;AAED;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,uBAFa,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,iDAwCC;IAED;;OAEG;IACH,kBAFa,IAAI,CAOhB;IAED;;;OAGG;IACH,qBAFa,MAAM,CAMlB;IAED;;;;;OAKG;IACH,yBAWC;IAED;;;OAGG;IACH,gCAEC;IAED;;MAOC;IAED;;MAKC;IAED;;;;MASC;IAED;;MAOC;IAED,eAgDC;IAED;;;;OAIG;IACH,oBAFa,IAAI,CAgBhB;IAED,4BAMC;IAED,kBAEC;IAED,YAGC;IAID;;OAEG;IACH,kCAFa,IAAI,CAsDhB;IAED;;OAEG;IACH,4BAFa,IAAI,CAUhB;IAED,oCAKC;IAED,gEAQC;IAED;;OAEG;IACH,oBAFa,IAAI,CAShB;IAED,gCAGC;IAED,qEAYC;CACF"}
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.js"],"names":[],"mappings":"AAgBA,kDAEC;AAED;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,uBAFa,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,iDAwCC;IAED;;OAEG;IACH,kBAFa,IAAI,CAOhB;IAED;;;OAGG;IACH,qBAFa,MAAM,CAMlB;IAED;;;;;OAKG;IACH,+BAWC;IAED;;;OAGG;IACH,gCAEC;IAED;;OAEG;IACH,cAEC;IAED;;MAOC;IAED;;MAKC;IAED;;;;MASC;IAED;;MAOC;IAED,eAgDC;IAED;;;;OAIG;IACH,oBAFa,IAAI,CAgBhB;IAED,4BAMC;IAED,kBAEC;IAED,YAGC;IAID;;OAEG;IACH,kCAFa,IAAI,CAsDhB;IAED;;OAEG;IACH,4BAFa,IAAI,CAUhB;IAED,oCAKC;IAED,gEAQC;IAED;;OAEG;IACH,oBAFa,IAAI,CAShB;IAED,gCAGC;IAED,qEAYC;CACF"}
package/types/string.d.ts CHANGED
@@ -134,6 +134,10 @@ declare class StringSchema extends TypeSchema {
134
134
  *
135
135
  */
136
136
  calendar(): this;
137
+ /**
138
+ * Validates times in ISO-8601 format.
139
+ */
140
+ time(): this;
137
141
  format(name: any, fn: any): this;
138
142
  }
139
143
  import TypeSchema from './TypeSchema';
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.js"],"names":[],"mappings":"AAycA;;GAEG;AACH,iDAEC;AAnbD;IACE,cAmBC;IAED;;OAEG;IACH,YAFa,IAAI,CAQhB;IAED;;OAEG;IACH,eAFW,MA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AED,cAMC;IAED;;;;;;;;;;;OAWG;IACH,iBAMC;IAED,iCAUC;CAgBF;uBArcsB,cAAc"}
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.js"],"names":[],"mappings":"AAydA;;GAEG;AACH,iDAEC;AAhcD;IACE,cAmBC;IAED;;OAEG;IACH,YAFa,IAAI,CAQhB;IAED;;OAEG;IACH,eAFW,MAAM,QAUhB;IAED;;OAEG;IACH,YAFW,MAAM,QAUhB;IAED;;OAEG;IACH,YAFW,MAAM,QAUhB;IAED,aAIC;IAED;;OAEG;IACH,mBAFW,OAAO,QAYjB;IAED;;OAEG;IACH,mBAFW,OAAO,QAYjB;IAED;;OAEG;IACH,WAFW,MAAM,QAahB;IAED,cAMC;IAED,uBASC;IAED,YAMC;IAED,YAMC;IAED,aAMC;IAED,cAMC;IAED;;;OAGG;IACH,iBAFG;QAA0B,OAAO,GAAzB,OAAO;KAAmB,QAQpC;IAED,mBAMC;IAED,WAMC;IAED,gBAMC;IAED,eAQC;IAED,YAMC;IAED,aAOC;IAED,eAMC;IAED;;OAEG;IACH,oBAFW,MAAM,QAQhB;IAED,gBAMC;IAED;;;;;;;OAOG;IACH,mBANG;QAAyB,SAAS,GAA1B,MAAM;QACW,UAAU,GAA3B,MAAM;QACW,UAAU,GAA3B,MAAM;QACW,YAAY,GAA7B,MAAM;QACW,YAAY,GAA7B,MAAM;KAAwB,QA+BxC;IAED;;;;;;;;;;;OAWG;IACH,cAVG;QAA0B,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;KAAqB,QAQvC;IAED;;;;;;;;OAQG;IACH,iBAPG;QAA0B,WAAW,GAA7B,OAAO;QACW,iBAAiB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