Compare commits

..

No commits in common. '14f88f5b62f4220429a9b33009415f1a86e82d08' and '47bec9e5ac6f68ac53de0e82e970cacbcd4b65d9' have entirely different histories.

@ -1,6 +1,6 @@
{
"name": "default-value",
"version": "0.0.3",
"version": "0.0.2",
"description": "Lets you easily define a default value for undefined options, with optional support for Promises",
"main": "index.js",
"scripts": {

@ -7,13 +7,13 @@ function promiseThatReturns(value) {
return Promise.resolve(value);
}
console.log(defaultValue(null, () => 4, {evaluate: true}));
console.log(defaultValue(null, () => 4));
console.log(defaultValue("foo", "bar"));
promiseTry(() => {
return Promise.all([
defaultValue.async(promiseThatReturns(undefined), promiseThatReturns(Infinity)),
defaultValue.async(() => promiseThatReturns("baz"), promiseThatReturns("qux"), {evaluate: true})
defaultValue.async(() => promiseThatReturns("baz"), promiseThatReturns("qux"))
]);
}).then((results) => {
console.log(results[0]);

Loading…
Cancel
Save