Feature #14393
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
+import { isObject, has, every } from 'lodash/fp';
+
export interface Vocabulary {
strict: boolean;
tags: Tag[];
export interface Vocabulary {
strict: boolean;
tags: Tag[];
strict: boolean;
values: string[];
}
strict: boolean;
values: string[];
}
+
+const VOCABULARY_VALIDATORS = [
+ isObject,
+ has('strict'),
+ has('tags'),
+];
+
+export const isVocabulary = (value: any) =>
+ every(validator => validator(value), VOCABULARY_VALIDATORS);
\ No newline at end of file