util-array-object-or-both
Advanced tools
Comparing version 2.7.64 to 2.7.65
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 2.7.64 | ||
* Version: 2.7.65 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -6,0 +6,0 @@ * License: MIT |
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 2.7.64 | ||
* Version: 2.7.65 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -6,0 +6,0 @@ * License: MIT |
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 2.7.64 | ||
* Version: 2.7.65 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -6,0 +6,0 @@ * License: MIT |
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 2.7.64 | ||
* Version: 2.7.65 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -6,0 +6,0 @@ * License: MIT |
{ | ||
"name": "util-array-object-or-both", | ||
"version": "2.7.64", | ||
"version": "2.7.65", | ||
"description": "Validate and normalise user choice: array, object or both?", | ||
"license": "MIT", | ||
"repository": "https://gitlab.com/codsen/codsen/", | ||
"homepage": "https://codsen.com/os/util-array-object-or-both/", | ||
"author": { | ||
"email": "roy@codsen.com", | ||
"name": "Roy Revelt", | ||
"url": "codsen.com" | ||
}, | ||
"keywords": [ | ||
@@ -24,2 +16,10 @@ "array", | ||
], | ||
"homepage": "https://codsen.com/os/util-array-object-or-both/", | ||
"repository": "https://gitlab.com/codsen/codsen/", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Roy Revelt", | ||
"email": "roy@codsen.com", | ||
"url": "codsen.com" | ||
}, | ||
"main": "dist/util-array-object-or-both.cjs.js", | ||
@@ -43,3 +43,4 @@ "module": "dist/util-array-object-or-both.esm.js", | ||
"pretest": "npm run build", | ||
"test": "npm run lint && npm run unittest && npm run clean_cov && npm run format", | ||
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format", | ||
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier", | ||
"tsd": "tsd", | ||
@@ -54,2 +55,13 @@ "unittest": "./node_modules/.bin/tap --no-only --output-file=testStats.md && npm run clean_cov && npm run perf", | ||
}, | ||
"tap": { | ||
"coverage-report": [ | ||
"json-summary", | ||
"text" | ||
], | ||
"nyc-arg": [ | ||
"--exclude=**/*.cjs.js", | ||
"--exclude=**/*.umd.js" | ||
], | ||
"timeout": 0 | ||
}, | ||
"lect": { | ||
@@ -84,3 +96,2 @@ "defaultExported": true, | ||
"req": "arrObjOrBoth", | ||
"typeSriptDefinitions": false, | ||
"various": { | ||
@@ -90,13 +101,2 @@ "devDependencies": [] | ||
}, | ||
"tap": { | ||
"coverage-report": [ | ||
"json-summary", | ||
"text" | ||
], | ||
"nyc-arg": [ | ||
"--exclude=**/*.cjs.js", | ||
"--exclude=**/*.umd.js" | ||
], | ||
"timeout": 0 | ||
}, | ||
"dependencies": { | ||
@@ -113,10 +113,10 @@ "lodash.includes": "^4.3.0", | ||
"@babel/preset-env": "^7.11.5", | ||
"@rollup/plugin-babel": "^5.2.0", | ||
"@rollup/plugin-commonjs": "^15.0.0", | ||
"@rollup/plugin-babel": "^5.2.1", | ||
"@rollup/plugin-commonjs": "^15.1.0", | ||
"@rollup/plugin-node-resolve": "^9.0.0", | ||
"@rollup/plugin-strip": "^2.0.0", | ||
"benchmark": "^2.1.4", | ||
"eslint": "^7.8.1", | ||
"lect": "^0.13.11", | ||
"rollup": "^2.26.10", | ||
"eslint": "^7.9.0", | ||
"lect": "^0.14.1", | ||
"rollup": "^2.28.1", | ||
"rollup-plugin-ascii": "^0.0.3", | ||
@@ -123,0 +123,0 @@ "rollup-plugin-banner": "^0.2.1", |
@@ -5,3 +5,20 @@ # util-array-object-or-both | ||
<img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> | ||
<div class="package-badges"> | ||
<a href="https://www.npmjs.com/package/util-array-object-or-both" rel="nofollow noreferrer noopener"> | ||
<img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm"> | ||
</a> | ||
<a href="https://codsen.com/os/util-array-object-or-both" rel="nofollow noreferrer noopener"> | ||
<img src="https://img.shields.io/badge/-Codsen-blue?style=flat-square" alt="page on npm"> | ||
</a> | ||
<a href="https://gitlab.com/codsen/codsen/tree/master/packages/util-array-object-or-both" rel="nofollow noreferrer noopener"> | ||
<img src="https://img.shields.io/badge/-GitLab-blue?style=flat-square" alt="page on GitLab"> | ||
</a> | ||
<a href="https://npmcharts.com/compare/util-array-object-or-both?interval=30" rel="nofollow noreferrer noopener" target="_blank"> | ||
<img src="https://img.shields.io/npm/dm/util-array-object-or-both.svg?style=flat-square" alt="Downloads per month"> | ||
</a> | ||
<a href="https://prettier.io" rel="nofollow noreferrer noopener" target="_blank"> | ||
<img src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg?style=flat-square" alt="Code style: prettier"> | ||
</a> | ||
<img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT License"> | ||
</div> | ||
@@ -14,10 +31,32 @@ ## Install | ||
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> | ||
## Quick Take | ||
```js | ||
import { strict as assert } from "assert"; | ||
import arrObjOrBoth from "util-array-object-or-both"; | ||
// normalises string, a user preference: | ||
assert.equal(arrObjOrBoth("arrays"), "array"); | ||
assert.equal(arrObjOrBoth("array"), "array"); | ||
assert.equal(arrObjOrBoth("arr"), "array"); | ||
assert.equal(arrObjOrBoth("a"), "array"); | ||
assert.equal(arrObjOrBoth("objects"), "object"); | ||
assert.equal(arrObjOrBoth("object"), "object"); | ||
assert.equal(arrObjOrBoth("obj"), "object"); | ||
assert.equal(arrObjOrBoth("o"), "object"); | ||
assert.equal(arrObjOrBoth("whatever"), "any"); | ||
assert.equal(arrObjOrBoth("either"), "any"); | ||
assert.equal(arrObjOrBoth("both"), "any"); | ||
assert.equal(arrObjOrBoth("any"), "any"); | ||
assert.equal(arrObjOrBoth("all"), "any"); | ||
assert.equal(arrObjOrBoth("e"), "any"); | ||
``` | ||
## Documentation | ||
Please [visit our documentation](https://codsen.com/os/util-array-object-or-both/) for a full description of the API and examples. | ||
Please [visit codsen.com](https://codsen.com/os/util-array-object-or-both/) for a full description of the API and examples. | ||
<img src="https://codsen.com/images/png-codsen-star.png" width="42" alt="star" align="center"> | ||
## Licence | ||
@@ -29,2 +68,2 @@ | ||
<img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"> | ||
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"> |
51907
10
1148
67