Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function validateHasMany(value) {
if (value) {
if (isPromise(value)) {
return value.then(models => models ? models.map(m => m.get('validations')) : true);
}
return value.map(m => m.get('validations'));
}
return true;
}
export default function validateBelongsTo(value) {
if (value) {
if (isPromise(value)) {
return value.then(model => model ? get(model, 'validations') : true);
}
return get(value, 'validations');
}
return true;
}