mirror of
https://github.com/strapi/strapi.git
synced 2025-07-22 16:37:13 +00:00
24 lines
579 B
JavaScript
24 lines
579 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
/**
|
||
|
* Module dependencies
|
||
|
*/
|
||
|
|
||
|
// Locale helpers.
|
||
|
const isOneToManyAssociation = require('./isOneToManyAssociation');
|
||
|
const isOneToOneAssociation = require('./isOneToOneAssociation');
|
||
|
|
||
|
/**
|
||
|
* Helper which returns a boolean. True if the type
|
||
|
* of the relation is `oneToOne`.
|
||
|
*
|
||
|
* @param {Object} currentModel
|
||
|
* @param {Object} association
|
||
|
*
|
||
|
* @return {boolean}
|
||
|
*/
|
||
|
|
||
|
module.exports = function isOneWayAssociation(currentModel, association) {
|
||
|
return !(isOneToManyAssociation(currentModel, association) || isOneToOneAssociation(currentModel, association));
|
||
|
};
|