Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const validateAuthority = async (value) => {
const decodedValue = JSON.parse(value);
const warnings = authority(decodedValue, ['authority']);
if (Array.isArray(warnings) && warnings.length > 0) {
throw new Error('Authority is invalid');
}
return true;
};