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:
1 parent
29bb2e4f6e
commit
c41f3002f3
2 files changed
+8
No files matched your search
@@ -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> = {}
|
const output: Record<string, any> = {}
|
||||||
|
|
||||||
for (const relation of collection) {
|
for (const relation of collection) {
|
||||||
|
if (!relation) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if (relation.indexOf(".") > -1) {
|
if (relation.indexOf(".") > -1) {
|
||||||
const nestedRelations = relation.split(".")
|
const nestedRelations = relation.split(".")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user