Skip to content

Commit

Permalink
fix(utils): More resilient object from string path (#5929)
Browse files Browse the repository at this point in the history
**What**
More resilient util in case an undefined, nu,, '' value is passed as part of the relations
  • Loading branch information
adrien2p authored Dec 21, 2023
1 parent 29bb2e4 commit c41f300
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/mighty-jokes-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---

Fix/utils object from string path
3 changes: 3 additions & 0 deletions packages/utils/src/common/object-from-string-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(".")

Expand Down

0 comments on commit c41f300

Please sign in to comment.