mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 00:37:38 +00:00
15 lines
324 B
JavaScript
15 lines
324 B
JavaScript
'use strict';
|
|
|
|
const isPolymorphic = ({ assoc }) => {
|
|
return assoc.nature.toLowerCase().indexOf('morph') !== -1;
|
|
};
|
|
|
|
const getManyRelations = definition => {
|
|
return definition.associations.filter(({ nature }) => ['manyToMany', 'manyWay'].includes(nature));
|
|
};
|
|
|
|
module.exports = {
|
|
isPolymorphic,
|
|
getManyRelations,
|
|
};
|