Comparing version 0.14.1 to 0.16.1
@@ -27,3 +27,3 @@ /** | ||
if (curryArgs.length >= n) { | ||
return f.apply(null, curryArgs); | ||
return f.apply(null, curryArgs.slice(0, n)); | ||
} else { | ||
@@ -30,0 +30,0 @@ return _curry(f, n, curryArgs); |
/** | ||
* @module 101/is-number | ||
* | ||
*/ | ||
@@ -16,2 +15,2 @@ | ||
return typeof val === 'number' || val instanceof Number; | ||
} | ||
} |
/** | ||
* @module 101/is-string | ||
* | ||
*/ | ||
@@ -16,2 +15,2 @@ | ||
return typeof val === 'string' || val instanceof String; | ||
} | ||
} |
{ | ||
"name": "101", | ||
"version": "0.14.1", | ||
"version": "0.16.1", | ||
"description": "common javascript utils that can be required selectively that assume es5+", | ||
@@ -33,4 +33,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"coveralls": "^2.11.2", | ||
"lab": "^4.6.2" | ||
"code": "^1.4.0", | ||
"lab": "^5.5.1" | ||
}, | ||
@@ -37,0 +37,0 @@ "dependencies": { |
@@ -258,2 +258,24 @@ ![101](http://i.imgur.com/MFrmMt6.png) | ||
## flip | ||
Returns a function with flipped arguments | ||
```js | ||
var flip = require('101/flip'); | ||
var curry = require('101/curry'); | ||
var hasKeypaths = require('101/has-keypaths'); | ||
var hasFooBar = curry(flip(hasKeypaths))(['foo.bar']); | ||
hasFooBar({ foo: { bar : true } }); // true | ||
function prefix(pre, str) { | ||
return pre + str; | ||
} | ||
flip(prefix)('hello', '_'); // "_hello" | ||
``` | ||
## hasKeypaths | ||
@@ -417,2 +439,30 @@ | ||
## lens | ||
Create a lens to access a datastructur. | ||
```js | ||
var fooLens = lens('foo'); | ||
var toUpper = function(str) { return str.toUpperCase(); }; | ||
var obj = { | ||
foo: 'foo', | ||
bar: 'bar' | ||
}; | ||
var arr = ['foo', 'bar']; | ||
fooLens(obj); // => 'foo' | ||
fooLens.set('moo', obj); // => { foo: 'moo', bar: 'bar' } | ||
fooLens.mod(toUpper, obj); // => { foo: 'MOO', bar: 'bar' } | ||
var first = lens( | ||
function(arr) { return arr[0]; }, | ||
function(val, arr) { var clone = arr.slice(); clone[0] = val; return clone; } | ||
); | ||
first(arr); // => 'foo' | ||
first.set('moo')(arr); // => ['moo', 'bar'] | ||
first.mod(toUpper)(arr); // => ['FOO', 'bar'] | ||
``` | ||
## noop | ||
@@ -589,2 +639,17 @@ | ||
## values | ||
Returns Array containing the values of the properties of an object | ||
```js | ||
var values = require('101/values'); | ||
var obj { | ||
foo: 'apple', | ||
bar: 'orange' | ||
}; | ||
var objValues = values(obj); | ||
objValues // ['apple', 'orange'] | ||
``` | ||
## xor | ||
@@ -591,0 +656,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
669
1
47252
44
1005
1