assert-options
Advanced tools
Comparing version 0.6.2 to 0.7.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.assertOptions = void 0; | ||
function assertOptions(options, defaults) { | ||
@@ -4,0 +5,0 @@ if (options !== null && options !== undefined && typeof options !== 'object') { |
{ | ||
"name": "assert-options", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"description": "Generic options parameter handling.", | ||
@@ -9,3 +9,3 @@ "main": "dist/src/index.js", | ||
"all": "tsc && npm test && npm run lint", | ||
"lint": "./node_modules/.bin/tslint --fix ./src/**/*.ts ./test/**/*.ts", | ||
"lint": "tslint --fix ./src/**/*.ts ./test/**/*.ts", | ||
"test": "nyc mocha -r ts-node/register test/**/*.spec.ts", | ||
@@ -40,14 +40,14 @@ "travis": "nyc npm test && nyc report --reporter=text-lcov | coveralls" | ||
"devDependencies": { | ||
"@types/chai": "4.2.11", | ||
"@types/mocha": "7.0.2", | ||
"@types/node": "13.13.4", | ||
"@types/chai": "4.2.14", | ||
"@types/mocha": "8.2.0", | ||
"@types/node": "14.14.14", | ||
"chai": "4.2.0", | ||
"coveralls": "3.0.14", | ||
"mocha": "7.1.2", | ||
"coveralls": "3.1.0", | ||
"mocha": "8.2.1", | ||
"mocha-lcov-reporter": "1.3.0", | ||
"nyc": "15.0.1", | ||
"ts-node": "8.9.1", | ||
"tslint": "6.1.2", | ||
"typescript": "3.8.3" | ||
"nyc": "15.1.0", | ||
"ts-node": "9.1.1", | ||
"tslint": "6.1.3", | ||
"typescript": "4.1.3" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # assert-options | ||
Strongly-typed, built with TypeScript 3.x `strict` mode, for JavaScript clients. | ||
Strongly-typed, built with TypeScript 4.x `strict` mode, for JavaScript clients. | ||
@@ -16,8 +16,8 @@ [](https://travis-ci.org/vitaly-t/assert-options) | ||
* Passing in invalid or misspelled option names is one of the most common errors. | ||
* Passing in invalid or misspelled option names is one of the most common errors in JavaScript. | ||
* Assigning defaults is the most common operation for methods that take options. | ||
This module automates proper options parsing and setting defaults where needed. | ||
This module automates proper options handling - parsing and setting defaults where needed. | ||
Although this library is implemented in TypeScript, its objective is to help JavaScript clients, | ||
Although this library is implemented in TypeScript, its objective is mainly to help JavaScript clients, | ||
because TypeScript itself can handle invalid options and defaults natively. | ||
@@ -28,3 +28,3 @@ | ||
``` | ||
$ npm install assert-options | ||
$ npm i assert-options | ||
``` | ||
@@ -44,3 +44,3 @@ | ||
And when default values are not needed, you can just use an array of strings: | ||
When default values are not needed, you can just use an array of strings: | ||
@@ -47,0 +47,0 @@ ```js |
6730
71