mirror of
https://github.com/koloml/furbooru-tagging-assistant.git
synced 2025-12-24 07:12:57 +00:00
Added validation logic for the group entity
This commit is contained in:
@@ -48,7 +48,22 @@ const entitiesValidators: EntitiesValidationMap = {
|
||||
) {
|
||||
throw new Error('Invalid profile format detected!');
|
||||
}
|
||||
}
|
||||
},
|
||||
groups: importedObject => {
|
||||
if (!importedObject.v || importedObject.v > 2) {
|
||||
throw new Error('Unsupported group version!');
|
||||
}
|
||||
|
||||
if (
|
||||
!validateRequiredString(importedObject?.id)
|
||||
|| !validateRequiredString(importedObject?.name)
|
||||
|| !validateOptionalArray(importedObject?.tags)
|
||||
|| !validateOptionalArray(importedObject?.prefixes)
|
||||
|| !validateOptionalArray(importedObject?.suffixes)
|
||||
) {
|
||||
throw new Error('Invalid group format detected!');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user