1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.formatValidator = void 0;
|
11 | const core_1 = require("@angular-devkit/core");
|
12 | const operators_1 = require("rxjs/operators");
|
13 | function formatValidator(data, dataSchema, formats) {
|
14 | const registry = new core_1.schema.CoreSchemaRegistry();
|
15 | for (const format of formats) {
|
16 | registry.addFormat(format);
|
17 | }
|
18 | return registry.compile(dataSchema).pipe((0, operators_1.mergeMap)((validator) => validator(data)));
|
19 | }
|
20 | exports.formatValidator = formatValidator;
|