@bedrockio/yada 1.8.1 → 1.8.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.
- package/CHANGELOG.md +8 -0
- package/README.md +4 -4
- package/dist/cjs/Schema.js +12 -5
- package/dist/cjs/TypeSchema.js +2 -2
- package/dist/cjs/array.js +23 -5
- package/dist/cjs/date.js +2 -2
- package/dist/cjs/number.js +2 -2
- package/dist/cjs/object.js +3 -3
- package/dist/cjs/string.js +2 -2
- package/dist/cjs/tuple.js +3 -3
- package/package.json +1 -1
- package/src/Schema.js +12 -5
- package/src/TypeSchema.js +2 -2
- package/src/array.js +21 -6
- package/src/date.js +2 -2
- package/src/number.js +2 -2
- package/src/object.js +3 -3
- package/src/string.js +2 -2
- package/src/tuple.js +3 -3
- package/types/Schema.d.ts +6 -2
- package/types/Schema.d.ts.map +1 -1
- package/types/array.d.ts +5 -1
- package/types/array.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
## 1.8.2
|
|
2
|
+
|
|
3
|
+
- Fixed array schemas not passing through `requireAllWithin`.
|
|
4
|
+
|
|
1
5
|
## 1.8.1
|
|
2
6
|
|
|
3
7
|
- Fixed bug with tagging in `toOpenApi`.
|
|
4
8
|
|
|
9
|
+
## 1.8.1
|
|
10
|
+
|
|
11
|
+
- Fixed issue with incorrect JSON schema when nested.
|
|
12
|
+
|
|
5
13
|
## 1.8.0
|
|
6
14
|
|
|
7
15
|
- 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').
|
|
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
|
|
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
|
-
}).
|
|
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!').
|
|
943
|
+
yd.string().description('my description!').toJsonSchema();
|
|
944
944
|
// {
|
|
945
945
|
// type: 'string',
|
|
946
946
|
// description: 'my description!',
|
package/dist/cjs/Schema.js
CHANGED
|
@@ -221,7 +221,7 @@ class Schema {
|
|
|
221
221
|
* custom (code-based) assertions will not be output.
|
|
222
222
|
* @param {Object} [extra]
|
|
223
223
|
*/
|
|
224
|
-
|
|
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
|
|
241
|
+
* @alias toJsonSchema.
|
|
242
242
|
*/
|
|
243
243
|
toOpenApi(...extra) {
|
|
244
|
-
return this.
|
|
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.
|
|
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
|
|
385
|
+
return JSON.stringify(this, null, 2);
|
|
379
386
|
}
|
|
380
387
|
get() {
|
|
381
388
|
const {
|
package/dist/cjs/TypeSchema.js
CHANGED
package/dist/cjs/array.js
CHANGED
|
@@ -10,8 +10,9 @@ var _TypeSchema = _interopRequireDefault(require("./TypeSchema"));
|
|
|
10
10
|
var _errors = require("./errors");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
class ArraySchema extends _TypeSchema.default {
|
|
13
|
-
constructor(schemas) {
|
|
13
|
+
constructor(schemas, meta) {
|
|
14
14
|
super(Array, {
|
|
15
|
+
...meta,
|
|
15
16
|
schemas
|
|
16
17
|
});
|
|
17
18
|
this.setup();
|
|
@@ -106,12 +107,29 @@ class ArraySchema extends _TypeSchema.default {
|
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Augments the array schema to make all nested fields required.
|
|
112
|
+
* @returns {this}
|
|
113
|
+
*/
|
|
114
|
+
requireAllWithin() {
|
|
115
|
+
const {
|
|
116
|
+
schemas,
|
|
117
|
+
...rest
|
|
118
|
+
} = this.meta;
|
|
119
|
+
const newSchemas = schemas.map(schema => {
|
|
120
|
+
return schema.requireAllWithin();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
return new ArraySchema(newSchemas, rest).required();
|
|
125
|
+
}
|
|
126
|
+
|
|
109
127
|
// Private
|
|
110
128
|
|
|
111
129
|
toString() {
|
|
112
130
|
return 'array';
|
|
113
131
|
}
|
|
114
|
-
|
|
132
|
+
toJsonSchema(extra) {
|
|
115
133
|
let other;
|
|
116
134
|
const {
|
|
117
135
|
schemas
|
|
@@ -119,16 +137,16 @@ class ArraySchema extends _TypeSchema.default {
|
|
|
119
137
|
if (schemas.length > 1) {
|
|
120
138
|
other = {
|
|
121
139
|
anyOf: schemas.map(schema => {
|
|
122
|
-
return schema.
|
|
140
|
+
return schema.toJsonSchema();
|
|
123
141
|
})
|
|
124
142
|
};
|
|
125
143
|
} else if (schemas.length === 1) {
|
|
126
144
|
other = {
|
|
127
|
-
items: schemas[0].
|
|
145
|
+
items: schemas[0].toJsonSchema()
|
|
128
146
|
};
|
|
129
147
|
}
|
|
130
148
|
return {
|
|
131
|
-
...super.
|
|
149
|
+
...super.toJsonSchema(extra),
|
|
132
150
|
...other,
|
|
133
151
|
type: 'array'
|
|
134
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
|
-
|
|
145
|
+
toJsonSchema(extra) {
|
|
146
146
|
const {
|
|
147
147
|
format
|
|
148
148
|
} = this.meta;
|
|
149
149
|
return {
|
|
150
|
-
...super.
|
|
150
|
+
...super.toJsonSchema(extra),
|
|
151
151
|
type: format.includes('timestamp') ? 'number' : 'string'
|
|
152
152
|
};
|
|
153
153
|
}
|
package/dist/cjs/number.js
CHANGED
|
@@ -79,14 +79,14 @@ class NumberSchema extends _TypeSchema.default {
|
|
|
79
79
|
|
|
80
80
|
// Private
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
toJsonSchema(extra) {
|
|
83
83
|
const {
|
|
84
84
|
min,
|
|
85
85
|
max,
|
|
86
86
|
multiple
|
|
87
87
|
} = this.meta;
|
|
88
88
|
return {
|
|
89
|
-
...super.
|
|
89
|
+
...super.toJsonSchema(extra),
|
|
90
90
|
...(min != null && {
|
|
91
91
|
minimum: min
|
|
92
92
|
}),
|
package/dist/cjs/object.js
CHANGED
|
@@ -300,20 +300,20 @@ class ObjectSchema extends _TypeSchema.default {
|
|
|
300
300
|
|
|
301
301
|
// Private
|
|
302
302
|
|
|
303
|
-
|
|
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.
|
|
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.
|
|
316
|
+
...super.toJsonSchema(extra),
|
|
317
317
|
...(Object.keys(properties).length > 0 && {
|
|
318
318
|
properties,
|
|
319
319
|
required,
|
package/dist/cjs/string.js
CHANGED
|
@@ -417,13 +417,13 @@ class StringSchema extends _TypeSchema.default {
|
|
|
417
417
|
|
|
418
418
|
// Private
|
|
419
419
|
|
|
420
|
-
|
|
420
|
+
toJsonSchema(extra) {
|
|
421
421
|
const {
|
|
422
422
|
min,
|
|
423
423
|
max
|
|
424
424
|
} = this.meta;
|
|
425
425
|
return {
|
|
426
|
-
...super.
|
|
426
|
+
...super.toJsonSchema(extra),
|
|
427
427
|
...(min && {
|
|
428
428
|
minLength: min
|
|
429
429
|
}),
|
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
|
-
|
|
82
|
+
toJsonSchema(extra) {
|
|
83
83
|
const {
|
|
84
84
|
schemas
|
|
85
85
|
} = this.meta;
|
|
86
86
|
return {
|
|
87
|
-
...super.
|
|
87
|
+
...super.toJsonSchema(extra),
|
|
88
88
|
type: 'array',
|
|
89
89
|
prefixItems: schemas.map(schema => {
|
|
90
|
-
return schema.
|
|
90
|
+
return schema.toJsonSchema();
|
|
91
91
|
})
|
|
92
92
|
};
|
|
93
93
|
}
|
package/package.json
CHANGED
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
|
-
|
|
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
|
|
232
|
+
* @alias toJsonSchema.
|
|
233
233
|
*/
|
|
234
234
|
toOpenApi(...extra) {
|
|
235
|
-
return this.
|
|
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.
|
|
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
|
|
361
|
+
return JSON.stringify(this, null, 2);
|
|
355
362
|
}
|
|
356
363
|
|
|
357
364
|
get() {
|
package/src/TypeSchema.js
CHANGED
package/src/array.js
CHANGED
|
@@ -5,8 +5,8 @@ import TypeSchema from './TypeSchema';
|
|
|
5
5
|
import { ArrayError, ElementError, LocalizedError } from './errors';
|
|
6
6
|
|
|
7
7
|
class ArraySchema extends TypeSchema {
|
|
8
|
-
constructor(schemas) {
|
|
9
|
-
super(Array, { schemas });
|
|
8
|
+
constructor(schemas, meta) {
|
|
9
|
+
super(Array, { ...meta, schemas });
|
|
10
10
|
this.setup();
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -104,29 +104,44 @@ class ArraySchema extends TypeSchema {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Augments the array schema to make all nested fields required.
|
|
109
|
+
* @returns {this}
|
|
110
|
+
*/
|
|
111
|
+
requireAllWithin() {
|
|
112
|
+
const { schemas, ...rest } = this.meta;
|
|
113
|
+
|
|
114
|
+
const newSchemas = schemas.map((schema) => {
|
|
115
|
+
return schema.requireAllWithin();
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
return new ArraySchema(newSchemas, rest).required();
|
|
120
|
+
}
|
|
121
|
+
|
|
107
122
|
// Private
|
|
108
123
|
|
|
109
124
|
toString() {
|
|
110
125
|
return 'array';
|
|
111
126
|
}
|
|
112
127
|
|
|
113
|
-
|
|
128
|
+
toJsonSchema(extra) {
|
|
114
129
|
let other;
|
|
115
130
|
const { schemas } = this.meta;
|
|
116
131
|
if (schemas.length > 1) {
|
|
117
132
|
other = {
|
|
118
133
|
anyOf: schemas.map((schema) => {
|
|
119
|
-
return schema.
|
|
134
|
+
return schema.toJsonSchema();
|
|
120
135
|
}),
|
|
121
136
|
};
|
|
122
137
|
} else if (schemas.length === 1) {
|
|
123
138
|
other = {
|
|
124
|
-
items: schemas[0].
|
|
139
|
+
items: schemas[0].toJsonSchema(),
|
|
125
140
|
};
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
return {
|
|
129
|
-
...super.
|
|
144
|
+
...super.toJsonSchema(extra),
|
|
130
145
|
...other,
|
|
131
146
|
type: 'array',
|
|
132
147
|
};
|
package/src/date.js
CHANGED
|
@@ -138,10 +138,10 @@ class DateSchema extends Schema {
|
|
|
138
138
|
return 'date';
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
toJsonSchema(extra) {
|
|
142
142
|
const { format } = this.meta;
|
|
143
143
|
return {
|
|
144
|
-
...super.
|
|
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
|
-
|
|
74
|
+
toJsonSchema(extra) {
|
|
75
75
|
const { min, max, multiple } = this.meta;
|
|
76
76
|
return {
|
|
77
|
-
...super.
|
|
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
|
-
|
|
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.
|
|
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.
|
|
315
|
+
...super.toJsonSchema(extra),
|
|
316
316
|
...(Object.keys(properties).length > 0 && {
|
|
317
317
|
properties,
|
|
318
318
|
required,
|
package/src/string.js
CHANGED
|
@@ -441,10 +441,10 @@ class StringSchema extends TypeSchema {
|
|
|
441
441
|
|
|
442
442
|
// Private
|
|
443
443
|
|
|
444
|
-
|
|
444
|
+
toJsonSchema(extra) {
|
|
445
445
|
const { min, max } = this.meta;
|
|
446
446
|
return {
|
|
447
|
-
...super.
|
|
447
|
+
...super.toJsonSchema(extra),
|
|
448
448
|
...(min && {
|
|
449
449
|
minLength: min,
|
|
450
450
|
}),
|
package/src/tuple.js
CHANGED
|
@@ -69,13 +69,13 @@ class TupleSchema extends Schema {
|
|
|
69
69
|
return 'tuple';
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
toJsonSchema(extra) {
|
|
73
73
|
const { schemas } = this.meta;
|
|
74
74
|
return {
|
|
75
|
-
...super.
|
|
75
|
+
...super.toJsonSchema(extra),
|
|
76
76
|
type: 'array',
|
|
77
77
|
prefixItems: schemas.map((schema) => {
|
|
78
|
-
return schema.
|
|
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
|
-
|
|
80
|
+
toJsonSchema(extra?: any): any;
|
|
81
81
|
/**
|
|
82
82
|
* Exports the schema in [JSON Schema](https://json-schema.org/) format.
|
|
83
|
-
* @alias
|
|
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
|
};
|
package/types/Schema.d.ts.map
CHANGED
|
@@ -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
|
|
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/array.d.ts
CHANGED
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
export default function _default(...schemas?: Schema[]): ArraySchema;
|
|
10
10
|
import Schema from './Schema';
|
|
11
11
|
declare class ArraySchema extends TypeSchema {
|
|
12
|
-
constructor(schemas: any);
|
|
13
12
|
setup(): void;
|
|
14
13
|
length(length: any): this;
|
|
15
14
|
min(length: any): this;
|
|
16
15
|
max(length: any): this;
|
|
17
16
|
latlng(): this;
|
|
17
|
+
/**
|
|
18
|
+
* Augments the array schema to make all nested fields required.
|
|
19
|
+
* @returns {this}
|
|
20
|
+
*/
|
|
21
|
+
requireAllWithin(): this;
|
|
18
22
|
toString(): string;
|
|
19
23
|
}
|
|
20
24
|
import TypeSchema from './TypeSchema';
|
package/types/array.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../src/array.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../src/array.js"],"names":[],"mappings":"AAsJA;;;;;;;GAOG;AACH,8CALc,MAAM,EAAA,eAUnB;mBAjKkB,UAAU;AAI7B;IAME,cAsCC;IAED,0BAUC;IAED,uBAUC;IAED,uBAaC;IAED,eAaC;IAED;;;OAGG;IACH,oBAFa,IAAI,CAWhB;IAID,mBAEC;CAuBF;uBAjJsB,cAAc"}
|