Skip to content

Commit

Permalink
fix: ignore prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Jan 15, 2024
1 parent e0e56dd commit 8cc7a4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fast-rings-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zazuko/env": patch
---

`Dataset#serialize` would fail with some parsers when unrecognized prefix was used
6 changes: 5 additions & 1 deletion packages/env/lib/Dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ export function createConstructor(env: Environment<FormatsFactory>): DatasetCtor
return { ...map, [prefix[0]]: prefix[1] }
}

return { ...map, [prefix]: knownPrefixes[prefix] }
if (prefix in knownPrefixes) {
return { ...map, [prefix]: knownPrefixes[prefix] }
}

return map
}, {}),
}))
}
Expand Down

0 comments on commit 8cc7a4e

Please sign in to comment.