@panosoft/ramda-utils
Advanced tools
Comparing version 0.1.8 to 0.1.9
var R = require('ramda'); | ||
var Ru = R.mapObj(R.curry, { | ||
applyTo: (o, f) => f(o), | ||
rmap: (o, fs) => R.map(Ru.applyTo(o), fs), | ||
zipApply: (fs, os) => R.zipWith(R.call, fs, os), | ||
filterObj: (p, o) => R.pick(R.filter(k => p(o[k]), R.keys(o)), o), | ||
pickValues: (ks, o) => R.compose(R.values, R.pick(ks))(o), | ||
applyTo: (obj, fn) => fn(obj), | ||
rmap: (obj, fns) => R.map(Ru.applyTo(obj), fns), | ||
zipApply: (fns, objs) => R.zipWith(R.call, fns, objs), | ||
filterObj: (pred, obj) => R.pick(R.filter(key => pred(obj[key]), R.keys(obj)), obj), | ||
pickValues: (keys, obj) => R.compose(R.values, R.pick(keys))(obj), | ||
trace: (msg, x) => { console.log(msg, x); return x; }, | ||
sumProps: (props, obj) => R.sum(R.map(Ru.applyTo(obj), R.map(R.prop, props))), | ||
sumColumn: (prop, objs) => R.sum(R.map(R.prop(prop), objs)), | ||
subsetOf: (s, sub) => R.reduce(R.and, true, R.map(R.contains(R.__, s), sub)), | ||
complementC: f => { | ||
return R.curry(R.nAry(f.length, function() { | ||
return !f.apply(this, arguments); | ||
sumProps: (keys, obj) => R.sum(Ru.pickValues(keys, obj)), | ||
sumColumn: (key, objs) => R.sum(R.map(R.prop(key), objs)), | ||
subsetOf: (set, sub) => R.reduce(R.and, true, R.map(R.contains(R.__, set), sub)), | ||
complementC: fn => { | ||
return R.curry(R.nAry(fn.length, function() { | ||
return !fn.apply(this, arguments); | ||
})); | ||
}, | ||
isEmptyC: f => { | ||
return R.curry(R.nAry(f.length, function() { | ||
return R.isEmpty(f.apply(this, arguments)); | ||
isEmptyC: fn => { | ||
return R.curry(R.nAry(fn.length, function() { | ||
return R.isEmpty(fn.apply(this, arguments)); | ||
})); | ||
}, | ||
isNotEmptyC: f => { | ||
return R.curry(R.nAry(f.length, function() { | ||
return !R.isEmpty(f.apply(this, arguments)); | ||
isNotEmptyC: fn => { | ||
return R.curry(R.nAry(fn.length, function() { | ||
return !R.isEmpty(fn.apply(this, arguments)); | ||
})); | ||
@@ -43,6 +43,11 @@ }, | ||
}, | ||
matchGroups: (r, s) => { | ||
matchGroups: (reg, str) => { | ||
var m, g = []; | ||
while (m = r.exec(s)) | ||
g.push(m.slice(1)); | ||
// avoid infinite loop | ||
if (!reg.global) { | ||
g.push(reg.exec(str).slice(1)); | ||
} | ||
else { | ||
while (m = reg.exec(str)) g.push(m.slice(1)); | ||
} | ||
return g; | ||
@@ -49,0 +54,0 @@ }, |
{ | ||
"name": "@panosoft/ramda-utils", | ||
"version": "0.1.8", | ||
"description": "Utilities built on top of Ramda", | ||
"version": "0.1.9", | ||
"description": "Utilities built on top of Ramda.", | ||
"repository": "panosoft/ramda-utils", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "node --harmony_arrow_functions test/test.js", | ||
"test": "mocha", | ||
"patch": "npm version patch && git push --follow-tags && npm publish", | ||
@@ -12,6 +13,12 @@ "minor": "npm version minor && git push --follow-tags && npm publish" | ||
"author": "Charles Scalfani", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"dependencies": { | ||
"ramda": "^0.17.1" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.2.0", | ||
"mocha": "^2.3.2", | ||
"sinon": "^1.16.1", | ||
"sinon-chai": "^2.8.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
216
0
397
15769
4
6
1