1 | ;
|
2 | /**
|
3 | * @license
|
4 | * Copyright Google LLC All Rights Reserved.
|
5 | *
|
6 | * Use of this source code is governed by an MIT-style license that can be
|
7 | * found in the LICENSE file at https://angular.io/license
|
8 | */
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.formatValidator = void 0;
|
11 | const core_1 = require("@angular-devkit/core");
|
12 | async function formatValidator(data, dataSchema, formats) {
|
13 | const registry = new core_1.schema.CoreSchemaRegistry();
|
14 | for (const format of formats) {
|
15 | registry.addFormat(format);
|
16 | }
|
17 | const validator = await registry.compile(dataSchema);
|
18 | return validator(data);
|
19 | }
|
20 | exports.formatValidator = formatValidator;
|