{"version":3,"file":"getRelationType.mjs","sources":["../../../admin/src/utils/getRelationType.ts"],"sourcesContent":["import type { Schema } from '@strapi/types';\n\n/**\n *\n * Retrieves the relation type\n */\nexport const getRelationType = (\n relation: Schema.Attribute.RelationKind.Any,\n targetAttribute?: string | null\n) => {\n const hasNotTargetAttribute = targetAttribute === undefined || targetAttribute === null;\n\n if (relation === 'oneToOne' && hasNotTargetAttribute) {\n return 'oneWay';\n }\n\n if (relation === 'oneToMany' && hasNotTargetAttribute) {\n return 'manyWay';\n }\n\n return relation;\n};\n"],"names":["getRelationType","relation","targetAttribute","hasNotTargetAttribute","undefined"],"mappings":"AAEA;;;AAGC,IACM,MAAMA,eAAkB,GAAA,CAC7BC,QACAC,EAAAA,eAAAA,GAAAA;IAEA,MAAMC,qBAAAA,GAAwBD,eAAoBE,KAAAA,SAAAA,IAAaF,eAAoB,KAAA,IAAA;IAEnF,IAAID,QAAAA,KAAa,cAAcE,qBAAuB,EAAA;QACpD,OAAO,QAAA;AACT;IAEA,IAAIF,QAAAA,KAAa,eAAeE,qBAAuB,EAAA;QACrD,OAAO,SAAA;AACT;IAEA,OAAOF,QAAAA;AACT;;;;"}