Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot default configuration item to undefined #2871

Open
jsumners-nr opened this issue Jan 13, 2025 · 2 comments
Open

Cannot default configuration item to undefined #2871

jsumners-nr opened this issue Jan 13, 2025 · 2 comments

Comments

@jsumners-nr
Copy link
Contributor

if (!arbitrary && internal[key] === undefined) {
return
}

That block prohibits a default config like:

some_block: {
	nested_item: {
		default: undefined,
		env: 'ENV_VAR_NAME'
	}
}

The following will fail due to the linked code:

test(() => {
	const config = Config.initialize({
		some_block: {
			nested_item: 'find-me'
		}
	})
	assert.deepStrictEqual(config.some_block, { nested_item: 'find-me' })
})
@workato-integration
Copy link

@bizob2828
Copy link
Member

Looking at lib/config/default.js we set defaults to null for these cases

@kmudduluru kmudduluru moved this from Triage Needed: Unprioritized Features to Prioritized in Node.js Engineering Board Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Prioritized
Development

No branches or pull requests

2 participants