UNPKG

options-defaults

Version:

Options-defaults design pattern implementation for reliable configuration. It merges objects deeply, overrides arrays and classes (different than Object) and the result remains strongly typed.

5 lines (4 loc) 293 B
- **Beats alternatives** - better alternative to `{...defaults, ...options}` destructing and lodash `_.defaults` or `_.merge` - **Secure** - immune to prototype pollution attack - **Simple** - just 40 lines of clean TypeScript code - **Strongly typed** - result remains strongly typed