Comparing version 0.3.1 to 0.4.0
@@ -20,3 +20,5 @@ "use strict"; | ||
function unpartialDuo(base, partial) { | ||
if (partial === undefined || partial === null) | ||
if (partial === undefined) | ||
return base; | ||
if (base === null || base === undefined) | ||
return partial; | ||
@@ -23,0 +25,0 @@ return Object.assign({}, base, partial); |
@@ -28,3 +28,5 @@ "use strict"; | ||
function unpartialDuo(base, partial) { | ||
if (partial === undefined || partial === null) | ||
if (partial === undefined) | ||
return base; | ||
if (base === null || base === undefined) | ||
return partial; | ||
@@ -31,0 +33,0 @@ return __assign({}, base, partial); |
{ | ||
"name": "unpartial", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "Unpartial a partialed object", | ||
@@ -17,14 +17,14 @@ "main": "dist-es5/index.js", | ||
"clean": "rimraf dist-es5 dist-es2015", | ||
"coverage": "nyc npm test", | ||
"coveralls": "nyc report --reporter=text-lcov | coveralls", | ||
"dc": "npm run dependency-check", | ||
"debug": "node scripts/debug.js", | ||
"dependency-check": "dependency-check . --unused --no-dev && dependency-check . --missing --no-dev", | ||
"lint": "tslint -p tsconfig.json --type-check \"src/**/*.ts\"", | ||
"prepare": "npm run build", | ||
"lint": "tslint -p tsconfig.json 'src/**/*.ts'", | ||
"postpublish": "git push", | ||
"prepublish": "npm run build", | ||
"preversion": "git pull && npm run verify", | ||
"verify": "npm run lint && npm run coverage && npm run dependency-check", | ||
"coverage": "nyc npm test", | ||
"coveralls": "nyc report --reporter=text-lcov | coveralls", | ||
"test": "npm run clean && tsc && ava", | ||
"watch": "npm run clean && node scripts/watch.js", | ||
"debug": "node scripts/debug.js" | ||
"watch": "npm run clean && node scripts/watch.js" | ||
}, | ||
@@ -73,10 +73,10 @@ "repository": { | ||
"@types/lodash.merge": "^4.6.3", | ||
"ava": "^0.22.0", | ||
"ava": "^0.23.0", | ||
"dependency-check": "^2.9.1", | ||
"nyc": "^11.2.1", | ||
"nyc": "^11.3.0", | ||
"rimraf": "^2.6.2", | ||
"tslint": "^5.7.0", | ||
"tslint": "^5.8.0", | ||
"tslint-config-unional": "^0.8.0", | ||
"typescript": "^2.5.3" | ||
"typescript": "^2.6.1" | ||
} | ||
} |
@@ -10,3 +10,3 @@ # Unpartial | ||
Unpartial an interface | ||
Unpartial an interface. | ||
@@ -25,3 +25,3 @@ It is very common to define a config interface and `Partial<>` it in a function argument. | ||
function foo(givenConfig: Partial<Config>) { | ||
function foo(givenConfig?: Partial<Config>) { | ||
const config = unpartial(defaultConfig, givenConfig); | ||
@@ -50,3 +50,3 @@ // use config with type safety | ||
function foo(givenOption: Partial<MyOption>) { | ||
function foo(givenOption?: Partial<MyOption>) { | ||
const option = unpartial(defaultOption, myDefaultOption, givenOption) | ||
@@ -73,5 +73,5 @@ } | ||
[downloads-url]: https://npmjs.org/package/unpartial | ||
[travis-image]: https://img.shields.io/travis/unional/unpartial.svg?style=flat | ||
[travis-url]: https://travis-ci.org/unional/unpartial | ||
[travis-image]: https://img.shields.io/travis/unional/unpartial/master.svg?style=flat | ||
[travis-url]: https://travis-ci.org/unional/unpartial?branch=master | ||
[coveralls-image]: https://coveralls.io/repos/github/unional/unpartial/badge.svg | ||
[coveralls-url]: https://coveralls.io/github/unional/unpartial |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18948
132