diff --git a/API.md b/API.md index c65715c..053f77b 100644 --- a/API.md +++ b/API.md @@ -8,6 +8,7 @@ Cure for being paranoia about parameters which are coming in every single wrong * [.includes(param, contain, [condition])](#module_Paramoia.includes) ⇒ Boolean * [.equals(param, types)](#module_Paramoia.equals) ⇒ Boolean * [.valid(param, whitelist)](#module_Paramoia.valid) ⇒ Boolean + * [.invalid(param, blacklist)](#module_Paramoia.invalid) ⇒ Boolean * [.has(param, key)](#module_Paramoia.has) ⇒ Boolean * [.values(param, types)](#module_Paramoia.values) ⇒ Boolean * [.empty(param)](#module_Paramoia.empty) ⇒ Boolean @@ -28,7 +29,7 @@ It checks if **param** includes **contain** or not. | --- | --- | --- | --- | | param | Array.<String> \| Object.<String, \*> | | Parameter which will be checked. | | contain | Array.<String> \| Object.<String, \*> | | Parameter which will be checked against. | -| [condition] | Number | Paramoia.Include.Must | Parameter which indicates check condition: `Only`: **param** *can include less* than **contain** but different. `Must`: **param** *must include* **contain**. `MustOnly`: **param** *must only include* **contain**. You should use [Paramoia.Include.*](#module_Paramoia.Include) | +| [condition] | Number | Paramoia.Include.Must | Parameter which indicates check condition: `Only`: **param** *can include less* than **contain** but different. `Must`: **param** *must include* **contain**. `MustOnly`: **param** *must only include* **contain**. You should use one of [Paramoia.Include.*](#module_Paramoia.Include) | @@ -53,8 +54,21 @@ It checks if **param** is one of **whitelist** or not. | Param | Type | Description | | --- | --- | --- | -| param | Number \| String | Parameter which will be checked. | -| whitelist | Array.<(Number\|String)> | Parameter which will be checked against. | +| param | \* | Parameter which will be checked. | +| whitelist | Array.<\*> | Parameter which will be checked against. | + + + +### Paramoia.invalid(param, blacklist) ⇒ Boolean +It checks if **param** is not one of **blacklist** or it is. + +**Kind**: static method of [Paramoia](#module_Paramoia) +**Returns**: Boolean - Result of check. - `TRUE`: **param** IS NOT one of **blacklist**. - `FALSE`: **param** IS one of **blacklist**. + +| Param | Type | Description | +| --- | --- | --- | +| param | \* | Parameter which will be checked. | +| blacklist | Array.<\*> | Parameter which will be checked against. | diff --git a/CHANGELOG.md b/CHANGELOG.md index 26b45c1..06d82b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.3.1 (2019-01-30) + +- docs: fix typo in api documentation ([d2acfc5](https://github.com/b8kkyn/paramoia/commit/d2acfc5)) +- feat: add invalid function ([711c8dd](https://github.com/b8kkyn/paramoia/commit/711c8dd)) +- docs: fix documentation of valid function ([4070a88](https://github.com/b8kkyn/paramoia/commit/4070a88)) +- fix: add missing default value for condition parameter of includes function ([d6abe68](https://github.com/b8kkyn/paramoia/commit/d6abe68)) + # 0.2.1 (2019-01-27) - fix: add default return value to includes, has and empty functions ([f00e56d](https://github.com/b8kkyn/paramoia/commit/f00e56d)) diff --git a/package-lock.json b/package-lock.json index 5e7fbc2..4bc009f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "paramoia", - "version": "0.2.1", + "version": "0.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e92ca42..9d9517b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "paramoia", - "version": "0.2.1", + "version": "0.3.1", "description": "Cure for being paranoia about parameters which are coming in every single wrong way to our functions.", "main": "index.js", "scripts": {