cmd.js
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "cmd.js", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A chainable utility toolkit for JavaScript.", | ||
@@ -31,3 +31,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "https://github.com/NateFerrero/cmd.js.git" | ||
"url": "https://github.com/SnappLab/cmd.js.git" | ||
}, | ||
@@ -48,5 +48,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/NateFerrero/cmd.js/issues" | ||
"url": "https://github.com/SnappLab/cmd.js/issues" | ||
}, | ||
"homepage": "https://github.com/NateFerrero/cmd.js" | ||
"homepage": "https://github.com/SnappLab/cmd.js" | ||
} |
@@ -6,3 +6,2 @@ # cmd.js | ||
[![cmd.js on npm](https://nodei.co/npm/cmd.js.png?downloads=true&stars=true)](https://nodei.co/npm/cmd.js/) | ||
[![cmd.js on npm](https://nodei.co/npm-dl/cmd.js.png?months=6&height=2)](https://nodei.co/npm/cmd.js/) | ||
@@ -206,5 +205,5 @@ [![Github Stars](https://img.shields.io/github/stars/NateFerrero/cmd.js.svg)](https://github.com/NateFerrero/cmd.js) | ||
```js | ||
cmd.exists(...values); | ||
cmd.exists.with(...values); | ||
cmd.exists(0, null); // [true, false] | ||
cmd.exists.with(0, null); // [true, false] | ||
``` | ||
@@ -219,3 +218,3 @@ | ||
return typeof x !== 'string' | ||
}).and.exists("1", 2, null, "3"); // [true, false] | ||
}).exists.with("1", 2, null, "3"); // [true, false] | ||
``` | ||
@@ -244,3 +243,3 @@ | ||
```js | ||
cmd.add(1).map([1, 2, 3], [10, 20, 30], [100, 200, 300]); | ||
cmd.add(1).map.with([1, 2, 3], [10, 20, 30], [100, 200, 300]); | ||
// [[2, 3, 4], [11, 21, 31], [101, 201, 301]] | ||
@@ -254,5 +253,5 @@ ``` | ||
```js | ||
cmd.sum(...values); | ||
cmd.sum.with(...values); | ||
cmd.sum(1, 2, 3); // 6 | ||
cmd.sum.with(1, 2, 3); // 6 | ||
``` | ||
@@ -265,5 +264,5 @@ | ||
```js | ||
cmd.sum([1, 2, 3], [4, 5, 6], [7, 8, 9]); // 45 - not what we want | ||
cmd.sum.with([1, 2, 3], [4, 5, 6], [7, 8, 9]); // 45 - not what we want | ||
cmd.sum.map([1, 2, 3], [4, 5, 6], [7, 8, 9]) // [6, 15, 24] - perfect! | ||
cmd.sum.map.with([1, 2, 3], [4, 5, 6], [7, 8, 9]); // [6, 15, 24] - perfect! | ||
``` | ||
@@ -282,11 +281,11 @@ | ||
cmd.max(1, 2, 3, 4, 5); // 5 | ||
cmd.max.with(1, 2, 3, 4, 5); // 5 | ||
cmd.max([1, 2, 3, 4, 5]); // 5 | ||
cmd.max.with([1, 2, 3, 4, 5]); // 5 | ||
cmd.max(1, [2, 3], 4, 5); // 5 | ||
cmd.max.with(1, [2, 3], 4, 5); // 5 | ||
cmd.max([1], 2, [3, 4, 5]); // 5 | ||
cmd.max.with([1], 2, [3, 4, 5]); // 5 | ||
cmd.max([1], [2], [3], [4], [5]); // 5 | ||
cmd.max.with([1], [2], [3], [4], [5]); // 5 | ||
``` | ||
@@ -320,2 +319,3 @@ | ||
// 5 | ||
``` | ||
@@ -322,0 +322,0 @@ How many fruits are there? Use `.filter` and `.sum` together: |
@@ -12,4 +12,4 @@ ### cmd.case.* | ||
```js | ||
cmd.case.lower('Hello World!', 'Will Smith here.'); | ||
cmd.case.lower.with('Hello World!', 'Will Smith here.'); | ||
// ["hello world!", "will smith here."] | ||
``` |
@@ -10,4 +10,4 @@ ### cmd.count | ||
```js | ||
cmd.count(1, [2, 3, 4], 5, [6]); | ||
cmd.count.with(1, [2, 3, 4], 5, [6]); | ||
// 6 | ||
``` |
@@ -10,4 +10,4 @@ ### cmd.exists | ||
```js | ||
cmd.exists(null, undefined, false, '', 0, true); | ||
cmd.exists.with(null, undefined, false, '', 0, true); | ||
// [false, false, true, true, true, true] | ||
``` |
@@ -10,3 +10,3 @@ ### cmd.log | ||
```js | ||
cmd.log(1, 2, 3); | ||
cmd.log.with(1, 2, 3); | ||
// 1 | ||
@@ -13,0 +13,0 @@ // 2 |
@@ -19,3 +19,3 @@ ### cmd.match | ||
msgMatch(0, 1, 2, 3, 4, 5, 6, 'x'); | ||
msgMatch.with(0, 1, 2, 3, 4, 5, 6, 'x'); | ||
// ["You have no messages", | ||
@@ -22,0 +22,0 @@ // "You have a message", |
@@ -10,4 +10,4 @@ ### cmd.max | ||
```js | ||
cmd.max(1, 2, 3, 4, 5); | ||
cmd.max.with(1, 2, 3, 4, 5); | ||
// 5 | ||
``` |
@@ -10,4 +10,4 @@ ### cmd.min | ||
```js | ||
cmd.min(1, 2, 3, 4, 5); | ||
cmd.min.with(1, 2, 3, 4, 5); | ||
// 1 | ||
``` |
@@ -10,4 +10,4 @@ ### cmd.not | ||
```js | ||
cmd.not(null, undefined, false, '', 0, true); | ||
cmd.not.with(null, undefined, false, '', 0, true); | ||
// [true, true, true, false, false, false] | ||
``` |
@@ -10,4 +10,4 @@ ### cmd.product | ||
```js | ||
cmd.product(1, 2, 3, 4, 5); | ||
cmd.product.with(1, 2, 3, 4, 5); | ||
// 120 | ||
``` |
@@ -13,7 +13,7 @@ ### cmd.push.to | ||
add({ | ||
add.with({ | ||
name: 'Adam' | ||
}); | ||
add({ | ||
add.with({ | ||
name: 'Blake' | ||
@@ -20,0 +20,0 @@ }); |
@@ -12,6 +12,6 @@ ### cmd.sort | ||
```js | ||
cmd.sort.asc('c', 'a', 'b', 3, 1, 2); | ||
cmd.sort.asc.with('c', 'a', 'b', 3, 1, 2); | ||
// [1, 2, 3, "a", "b", "c"] | ||
cmd.sort.desc('c', 'a', 'b', 3, 1, 2); | ||
cmd.sort.desc.with('c', 'a', 'b', 3, 1, 2); | ||
// ["c", "b", "a", 3, 2, 1] | ||
@@ -18,0 +18,0 @@ |
@@ -10,4 +10,4 @@ ### cmd.sum | ||
```js | ||
cmd.sum(1, 2, 3, 4, 5); | ||
cmd.sum.with(1, 2, 3, 4, 5); | ||
// 15 | ||
``` |
@@ -14,4 +14,4 @@ ### cmd.tap | ||
doublePlus1(1, 2, 3, 4, 5); | ||
doublePlus1.with(1, 2, 3, 4, 5); | ||
// [3, 5, 7, 9, 11] | ||
``` |
@@ -236,3 +236,2 @@ /** | ||
}); | ||
return cmd[name]; | ||
@@ -239,0 +238,0 @@ }; |
110241