UNPKG
nopt-defaults
Version:
latest (0.0.1)
0.0.1
Default options for nopt
github.com/btmills/nopt-defaults
btmills/nopt-defaults
nopt-defaults
/
index.js
9 lines
(8 loc)
•
219 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
module
.
exports
=
function
(
options, defaults
) {
Object
.
keys
(defaults).
forEach
(
function
(
opt
) {
if
(!
Object
.
prototype
.
hasOwnProperty
.
call
(options, opt)) { options[opt] = defaults[opt]; } });
return
options; };