GitShow/sindresorhus/node-defaults
sindresorhus

node-defaults

Easily handle defaults for your options

by sindresorhus
Star on GitHubForknpm

JavaScript

76 stars7 forks5 contributorsQuiet · 2y agoSince 2013v3.0.0MIT

Meet the team

See all 5 on GitHub →
sindresorhus
sindresorhus11 contributions
tmpvar
tmpvar7 contributions
dylanarmstrong
dylanarmstrong1 contribution
andineck
andineck1 contribution

Languages

View on GitHub →
JavaScript67.6%
TypeScript32.4%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
dylanarmstrong
fix: better return types to override undefinedMergedPR

When determining return type, use the default object type if it's defined and overriding an undefined type. Fixes https://github.com/sindresorhus/node-defaults/issues/5

dylanarmstrong · 2y ago
pjeby
Undocumented side-effect: the default object is modified if it has sub-optionsClosedIssue

Example: This means that if you have nested defaults that aren't a fresh object literal, you have to explicitly clone them each time.

pjeby · 2y ago
dylanarmstrong
Cannot Convert Partial<T> to Required<T>ClosedIssue

Hi, It's not currently possible to override types like so: This will throw this error: Current workaround is to cast with , but I feel that the typing for this method should support this conversion.

dylanarmstrong · 2y ago
Structured data for AI agents

Repository: sindresorhus/node-defaults. Description: Easily handle defaults for your options Stars: 76, Forks: 7. Primary language: JavaScript. Languages: JavaScript (67.6%), TypeScript (32.4%). License: MIT. Latest release: v3.0.0 (2y ago). Open PRs: 0, open issues: 0. Last activity: 2y ago. Community health: 85%. Top contributors: sindresorhus, tmpvar, dylanarmstrong, andineck.

·@ofershap

Replace github.com with gitshow.dev