projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Load users instead of permission into group details table
[arvados-workbench2.git]
/
src
/
models
/
vocabulary.ts
diff --git
a/src/models/vocabulary.ts
b/src/models/vocabulary.ts
index 3dbd4756b22d7f801130e7b80af87ca615019d7f..ea23ad2c79ffc05d56f3e0fa42572a37bc6a38ad 100644
(file)
--- a/
src/models/vocabulary.ts
+++ b/
src/models/vocabulary.ts
@@
-2,12
+2,23
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
+import { isObject, has, every } from 'lodash/fp';
+
export interface Vocabulary {
strict: boolean;
export interface Vocabulary {
strict: boolean;
- tags:
Tag[]
;
+ tags:
Record<string, Tag>
;
}
export interface Tag {
}
export interface 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