2021-03-17 23:27:21 +00:00
|
|
|
import { readJsonFile } from "../generic/json";
|
2021-03-22 10:33:21 +00:00
|
|
|
import { TagValues } from "../tags-config";
|
2021-03-17 23:27:21 +00:00
|
|
|
|
|
|
|
export function isValidTagValue(value: string): boolean {
|
|
|
|
//console.log(`isValidTagValue ${value}`);
|
|
|
|
if (!value) {
|
|
|
|
return false;
|
|
|
|
}
|
2021-03-22 10:33:21 +00:00
|
|
|
const tag = TagValues.find(t => t.id === value);
|
|
|
|
if (!tag) {
|
2021-03-17 23:27:21 +00:00
|
|
|
return false;
|
|
|
|
}
|
2021-03-22 10:33:21 +00:00
|
|
|
//console.log(`TAG ${tag.name}`);
|
2021-03-17 23:27:21 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function isValidTagValues(values: string[]): boolean {
|
|
|
|
return values.reduce((accum: boolean, value: string) => accum && isValidTagValue(value), true);
|
|
|
|
}
|