fix(utils): More resilient object from string path (#5929)

**What**
More resilient util in case an undefined, nu,, '' value is passed as part of the relations
This commit is contained in:
Adrien de Peretti
2023-12-21 09:28:13 +00:00
committed by GitHub
parent 29bb2e4f6e
commit c41f3002f3
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---
Fix/utils object from string path
@@ -49,6 +49,9 @@ export function objectFromStringPath(
const output: Record<string, any> = {}
for (const relation of collection) {
if (!relation) {
continue
}
if (relation.indexOf(".") > -1) {
const nestedRelations = relation.split(".")