Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
746 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 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 | 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(operators_1.mergeMap((validator) => validator(data)));
|
---|
| 19 | }
|
---|
| 20 | exports.formatValidator = formatValidator;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.