chore: v0.5.11 — cross-platform fix, utility hoists, git-cliff - #101
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new substituteEnvVars utility to deep-walk config objects and resolve environment variables, adds a platform check to reject Windows drive-letter paths on non-Windows platforms, updates the changelog generation tool from auto-changelog to git-cliff, and adds documentation for Slack file downloads. Feedback on the changes suggests improving the object prototype check in substituteEnvVars to also support objects created with Object.create(null) by allowing a null prototype.
| if ( | ||
| value !== null && | ||
| typeof value === 'object' && | ||
| Object.getPrototypeOf(value) === Object.prototype | ||
| ) { |
There was a problem hiding this comment.
The current check for plain objects (Object.getPrototypeOf(value) === Object.prototype) will skip objects created with Object.create(null), which have a null prototype. In JavaScript/TypeScript, Object.create(null) is a common pattern for creating clean dictionary/map objects.
To ensure environment variables are also substituted in these objects, we should allow a null prototype as well.
| if ( | |
| value !== null && | |
| typeof value === 'object' && | |
| Object.getPrototypeOf(value) === Object.prototype | |
| ) { | |
| if ( | |
| value !== null && | |
| typeof value === 'object' && | |
| (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null) | |
| ) { |
v0.5.11
Changes
Quality
Downstream
Closes #95, closes #100, closes #90, closes #93