Comparing version 0.12.2 to 0.13.0
# Changelog | ||
## v0.13.0 | ||
### BREAKING CHANGES | ||
- `find` has gone back to returning `undefined` instead of `null` for not found values | ||
### New | ||
- Added `fold` function which runs a `reduce` without an initial accumulator | ||
- Added the `propOr` Function which returns the value of a property from an object or the provided default value | ||
- CircleCI will now handle publishing the documentation to the `gh-pages` branch | ||
### Fixed | ||
- Documentation for functions showing up `deprecated` when they were actually not | ||
- Documentation for `join` moved it to the `Array` Category, and fixed a typo in it's example | ||
- Documentation for `apply` showed incorrect curry examples | ||
### Improved | ||
- `min` is now using the `fold` function | ||
- Finally improved the documentation process so now documentation changes won't flood the PRs! | ||
## v0.12.2 | ||
@@ -4,0 +27,0 @@ |
@@ -214,3 +214,3 @@ (function (global, factory) { | ||
return fn(val) ? reduced(val) : acc; | ||
}, null, arr); | ||
}, undefined, arr); | ||
}; | ||
@@ -224,2 +224,12 @@ var find$1 = _curry2(find); | ||
var flip = function flip(fn, a, b) { | ||
return fn(b, a); | ||
}; | ||
var flip$1 = _curry3(flip); | ||
var fold = function fold(fn, arr) { | ||
return arr.reduce(flip$1(fn)); | ||
}; | ||
var fold$1 = _curry2(fold); | ||
var insert = function insert(i, d, arr) { | ||
@@ -263,2 +273,7 @@ var idx = i < arr.length && i >= 0 ? i : arr.length; | ||
var join = function join(str, list) { | ||
return list.join(str); | ||
}; | ||
var join$1 = _curry2(join); | ||
function _typeof(obj) { | ||
@@ -383,7 +398,5 @@ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { | ||
var min = function min(list) { | ||
return list.reduce(function (a, b) { | ||
return a <= b ? a : b; | ||
}); | ||
}; | ||
var min = fold$1(function (a, b) { | ||
return a <= b ? a : b; | ||
}); | ||
@@ -825,7 +838,2 @@ var minBy = function minBy(fn, list) { | ||
var flip = function flip(fn, a, b) { | ||
return fn(b, a); | ||
}; | ||
var flip$1 = _curry3(flip); | ||
var gt = function gt(a, b) { | ||
@@ -1150,2 +1158,11 @@ return b > a; | ||
var propOr = function propOr(def, key, obj) { | ||
var val = prop$1(key, obj); | ||
if (isNil(val)) { | ||
return def; | ||
} | ||
return val; | ||
}; | ||
var propOr$1 = _curry3(propOr); | ||
var props = function props(keys, obj) { | ||
@@ -1199,7 +1216,2 @@ return map$1(function (k) { | ||
var join = function join(str, list) { | ||
return list.join(str); | ||
}; | ||
var join$1 = _curry2(join); | ||
var match = function match(reg, str) { | ||
@@ -1286,2 +1298,3 @@ return str.match(reg); | ||
exports.flip = flip$1; | ||
exports.fold = fold$1; | ||
exports.fuzzySearch = fuzzySearch$1; | ||
@@ -1342,2 +1355,3 @@ exports.gcd = gcd$1; | ||
exports.propEq = propEq$1; | ||
exports.propOr = propOr$1; | ||
exports.props = props$1; | ||
@@ -1344,0 +1358,0 @@ exports.range = range$1; |
@@ -1,1 +0,1 @@ | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).kyanite={})}(this,function(n){"use strict";function r(n){return function r(t,e){return arguments.length?1===arguments.length?function(r){return n(t,r)}:n(t,e):r}}var t=function(n,r){return n.push(r),n},e=r(function(n,r){return r%n}),u=r(function(n,r){return r.reduce(function(u,c,o){return e(n,o)?u:t(u,r.slice(o,o+n))},[])}),c=r(function(n,r){return r.concat(n)});function o(n){return function t(e,u,c){switch(arguments.length){case 0:return t;case 1:return r(function(r,t){return n(e,r,t)});case 2:return function(r){return n(e,u,r)};default:return n(e,u,c)}}}var i=function(n){return{"@@transducer/result":function(n){return n},"@@transducer/step":n}},a=o(function(n,r,t){var e=i(n),u=!0,c=!1,o=void 0;try{for(var a,f=t[Symbol.iterator]();!(u=(a=f.next()).done);u=!0){var s=a.value;if((r=e["@@transducer/step"](s,r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}}}catch(n){c=!0,o=n}finally{try{u||null==f.return||f.return()}finally{if(c)throw o}}return e["@@transducer/result"](r)}),f=r(function(n,r){return a(function(r,t){return c(n(r),t)},[],r)}),s=o(function(n,r,t){return n[r]=t,n}),l=r(function(n,r){return a(function(r,t){var e=n(r),u=s(t,e);return t.hasOwnProperty(e)?u(t[e]+1):u(1)},{},r)}),p=r(function(n,r){return a(function(r,e){var u=n(r),c=s(e,u);return e.hasOwnProperty(u)?c(t(e[u],r)):c([r])},{},r)}),y=function(n){return n},d=r(function(n,r){return Object.values(r.reduce(function(r,t){var e=n(t);return r.hasOwnProperty(e)?r:s(r,e,t)},{}))}),h=d(y),v=r(function(n,r){return a(function(r,e){return n(r)?t(e,r):e},[],r)}),g=r(function(n,r){return r.slice(n,1/0)}),m=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?[]:r.slice(t)}),b=function(n){return null==n},w=function(n){return n&&n["@@transducer/reduced"]?n:{"@@transducer/value":n,"@@transducer/reduced":!0}},A=r(function(n,r){return a(function(r,t){return n(r)?t:w(!1)},!0,r)}),O=r(function(n,r){return a(function(n,t){return n(r)?t:w(!1)},!0,n)}),j=r(function(n,r){return a(function(r,t){return n(r)?w(r):t},null,r)}),N=r(function(n,r){return r.findIndex(n)}),k=o(function(n,r,t){var e=n<t.length&&n>=0?n:t.length,u=t.slice(0);return u.splice(e,0,r),u}),S=function(n){return Object.prototype.toString.call(n).slice(8,-1)},x=r(function(n,r){var t=S(r);switch(t){case"Array":case"String":return r.includes(n);case"Object":case"Arguments":return r.hasOwnProperty(n);case"Map":case"Set":return r.has(n);default:throw new TypeError("Unsupported type: ".concat(t))}}),P=r(function(n,r){var t=p(y,r);return h(n.filter(function(n){return x(n,t)}))});function q(n){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function E(n,r){return B(n)||function(n,r){var t=[],e=!0,u=!1,c=void 0;try{for(var o,i=n[Symbol.iterator]();!(e=(o=i.next()).done)&&(t.push(o.value),!r||t.length!==r);e=!0);}catch(n){u=!0,c=n}finally{try{e||null==i.return||i.return()}finally{if(u)throw c}}return t}(n,r)||M()}function z(n){return function(n){if(Array.isArray(n)){for(var r=0,t=new Array(n.length);r<n.length;r++)t[r]=n[r];return t}}(n)||I(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function B(n){if(Array.isArray(n))return n}function I(n){if(Symbol.iterator in Object(n)||"[object Arguments]"===Object.prototype.toString.call(n))return Array.from(n)}function M(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var U=r(function(n,r){for(var t=r.length,e=Array(t),u=0;u<t;u++)s(e,u,n(r[u]));return e}),C=r(function(n,r){return U(function(n){return n.apply(void 0,z(r))},n)}),T=a(function(n,r){return n>=r?n:r},""),W=r(function(n,r){return r.reduce(function(r,t){return n(r)>=n(t)?r:t})}),R=r(function(n,r){return r.reduce(function(r,t){return n(r)<=n(t)?r:t})}),D=r(function(n,r){return a(function(r,e){var u=E(e,2),c=u[0],o=u[1];return n(r)?[t(c,r),o]:[c,t(o,r)]},[[],[]],r)}),F=r(function(n,r){return[].concat(n,r)}),L=o(function(n,r,t){for(var e=i(n),u=t.length-1;u>=0;u--)if((r=e["@@transducer/step"](t[u],r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}return e["@@transducer/result"](r)}),_=function(n){return!n},Z=r(function(n,r){return _(n(r))}),G=r(function(n,r){return v(Z(n),r)}),H=r(function(n,r){return f(y,[r.slice(0,n),r.slice(n+1)])}),J=r(function(n,r){return a(function(r,t){return n(r)?w(!0):t},!1,r)}),K=r(function(n,r){return a(function(n,t){return n(r)?w(!0):t},!1,n)}),Q=r(function(n,r){return r.slice().sort(n)}),V=function(n,r){return n<r?-1:n>r?1:0};function X(n){return function t(e,u,c,i){switch(arguments.length){case 0:return t;case 1:return o(function(r,t,u){return n(e,r,t,u)});case 2:return r(function(r,t){return n(e,u,r,t)});case 3:return function(r){return n(e,u,c,r)};default:return n(e,u,c,i)}}}var Y=X(function(n,r,t,e){return n(r(t),r(e))}),$=r(function(n,r){return Q(Y(V,n),r)}),nn=r(function(n,r){return z(r).sort(function(r,t){return n.reduce(function(n,e){return 0===n?e(r,t):n},0)})}),rn=r(function(n,r){return r.slice(0,n)}),tn=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?r:r.slice(0,t)}),en=r(function(n,r){return h(n.concat(r))}),un=o(function(n,r,t){return f(y,[t.slice(0,n),r,t.slice(n+1)])}),cn=r(function(n,r){return(n.length<r.length?n:r).reduce(function(t,e,u){return s(t,n[u],r[u])},{})}),on=r(function(n,r){return n}),an=r(function(n,r){return n&&r}),fn=o(function(n,r,t){return n(t)(r(t))}),sn=r(function(n,r){return n.apply(void 0,z(r))}),ln=o(function(n,r,t){return V(n(r),n(t))}),pn=o(function(n,r,t){return n(t)&&r(t)}),yn=X(function(n,r,t,e){return n(e)?r(e):t(e)}),dn=o(function(n,r,t){return n(r(t))}),hn=o(function(n,r,t){return r(t).then(n)}),vn=function(n){return n.length},gn=dn(vn,Object.values),mn=function(n){var r=S(n);switch(r){case"Array":case"String":return n.length;case"Object":return gn(n);case"Map":case"Set":return n.size;default:throw new TypeError("Unsupported type: ".concat(r))}},bn=r(function(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}),wn=function(n,r,t){for(var e=0,u=t.length;e<u;e++)if(n(r,t[e]))return!0;return!1},An=function(n){for(var r=[],t=null;!(t=n.next()).done;)r.push(t.value);return r},On=function(n,r,t,e){var u=An(n),c=An(r);function o(n,r){return jn(n,r,t.slice(),e.slice())}return!wn(function(n,r){return!wn(o,r,n)},c,u)},jn=function n(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(bn(r,t))return!0;var c,o,i=S(r);if(i!==S(t)||null==r||null==t)return!1;if("function"==typeof r.equals||"function"==typeof t.equals)return"function"==typeof r.equals&&r.equals(t)&&"function"==typeof t.equals&&t.equals(r);switch(i){case"Arguments":case"Array":case"Object":if("function"==typeof r.constructor&&"Promise"===(c=r.constructor,null==(o=String(c).match(/^function (\w*)/))?"":o[1]))return r===t;break;case"Boolean":case"Number":case"String":if(q(r)!==q(t)||!bn(r.valueOf(),t.valueOf()))return!1;break;case"Date":if(!bn(r.valueOf(),t.valueOf()))return!1;break;case"Error":return r.name===t.name&&r.message===t.message;case"RegExp":if(r.source!==t.source||r.global!==t.global||r.ignoreCase!==t.ignoreCase||r.multiline!==t.multiline||r.sticky!==t.sticky||r.unicode!==t.unicode)return!1}for(var a=e.length-1;a>=0;a--)if(e[a]===r)return u[a]===t;switch(i){case"Map":return r.size===t.size&&On(r.entries(),t.entries(),e.concat([r]),u.concat([t]));case"Set":return r.size===t.size&&On(r.values(),t.values(),e.concat([r]),u.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=Object.keys(r);if(f.length!==Object.values(t).length)return!1;for(var s=e.concat([r]),l=u.concat([t]),p=f.length-1;p>=0;p--){var y=f[p];if(!Object.prototype.hasOwnProperty.call(t,y)||!n(t[y],r[y],s,l))return!1}return!0},Nn=r(jn),kn=r(function(n,r){return b(r)||bn(NaN,r)?n:r}),Sn=function(n,r){return n>r?-1:n<r?1:0},xn=o(function(n,r,t){return Sn(n(r),n(t))}),Pn=o(function(n,r,t){return n(t)||r(t)}),qn=r(function(n,r){try{return n(r)}catch(n){return}}),En=o(function(n,r,t){return bn(n(r),n(t))}),zn=o(function(n,r,t){return n(t,r)}),Bn=r(function(n,r){return r>n}),In=r(function(n,r){return r>=n}),Mn=r(function(n,r){return r<n}),Un=r(function(n,r){return r<=n}),Cn=r(function(n,r){var t={};return function(e){var u=n(e);return x(u,t)||(t[u]=r(e)),t[u]}}),Tn=r(function(n,r){return Z(bn(n),r)}),Wn=r(function(n,r){return n||r}),Rn=r(function(n,r){return a(function(n,r){return n(r)},r,n)}),Dn=r(function(n,r){return a(function(n,r){return r.then(n)},Promise.resolve(r),n)}),Fn=o(function(n,r,t){return n(t)?t:r(t)}),Ln=o(function(n,r,t){return n(t)?r(t):t}),_n=o(function(n,r,t){return t.slice(n,r)}),Zn=r(function(n,r){return dn(Nn(n),_n(-n.length,1/0),r)}),Gn=r(function(n,r){return-1!==r.indexOf(n)}),Hn=r(function(n,r){return r[n<0?r.length+n:n]}),Jn=r(function(n,r){return n+r}),Kn=o(function(n,r,t){return n<=t&&r>=t}),Qn=o(function(n,r,t){if(n>r)throw new Error("Min cannot be greater than max in clamp");return t>n&&t<r?t:t<=n?n:r}),Vn=r(function(n,r){return r/n}),Xn=function(n){return-n},Yn=r(function(n,r){for(var t=[],e=Number(n),u=Number(r);e<u;e++)t.push(e);return t}),$n=r(function n(r,t){return t?n(t,r%t):r}),nr=bn(0),rr=r(function(n,r){return Math.abs(Math.floor(n/$n(n,r)*r))}),tr=function(n){return Vn(vn(n),a(Jn,0,n))},er=r(function(n,r){return J(y,[!Number.isInteger(n),!Number.isInteger(r),r<1])?NaN:(n%r+r)%r}),ur=r(function(n,r){return n*r}),cr=r(function(n,r){return Math.pow(r,n)}),or=a(ur,1),ir=r(function(n,r){return Number("".concat(Math.round("".concat(r,"e").concat(n)),"e-").concat(n))}),ar=r(function(n,r){return r-n}),fr=a(Jn,0),sr=o(function(n,r,t){return n<t&&r>t}),lr=r(function(n,r){return Object.assign({},n,r)}),pr=r(function(n,r){return Object.keys(n).some(function(t){return n[t](r[t])})}),yr=r(function(n,r){return a(function(t,e){return s(e,t,n(r[t]))},{},Object.keys(r))}),dr=r(function(n,r){return a(function(t,e){return _(Gn(t,n))?s(e,t,r[t]):e},{},Object.keys(r))}),hr=o(function(n,r,t){return Object.assign({},t,function(n,r,t){return r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n}({},n,r(t[n])))}),vr=r(function n(r,t){var e,u=B(e=r)||I(e)||M(),c=u[0],o=u.slice(1);if(!b(t)&&!b(t[c]))return o.length?n(o,t[c]):t[c]}),gr=o(function(n,r,t){var e=vr(r,t);return b(e)?n:e}),mr=r(function(n,r){return Object.assign({},r,a(function(t,e){return r.hasOwnProperty(t)?s(e,t,n[t](r[t])):e},{},Object.keys(n)))}),br=r(function(n,r){return r[n]}),wr=o(function(n,r,t){return dn(bn(r),br(n),t)}),Ar=r(function(n,r){return U(function(n){return r[n]},n)}),Or=r(function(n,r){return a(function(t,e){return n(r[t])?s(e,t,r[t]):e},{},Object.keys(r))}),jr=r(function(n,r){return Object.keys(n).every(function(t){return n[t](r[t])})}),Nr=r(function(n,r){var t=r.length,e=n.length,u=0;if(e>t)return!1;if(e===t)return n===r;n:for(var c=0;c<e;c++){for(var o=n.charCodeAt(c);u<t;u++)if(r.charCodeAt(u)===o)continue n;return!1}return!0}),kr=r(function(n,r){return r.join(n)}),Sr=r(function(n,r){return r.match(n)}),xr=o(function(n,r,t){return t.replace(n,r)}),Pr=r(function(n,r){return r.split(n)}),qr=r(function(n,r){return n.test(r)});n.add=Jn,n.addIndex=function(n){return function(){for(var r=0,t=arguments.length,e=new Array(t),u=0;u<t;u++)e[u]=arguments[u];var c=e[0],o=e[e.length-1],i=e.slice();return i[0]=function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var u=c.apply(void 0,z(f(y,[t,[r,o]])));return r+=1,u},n.apply(void 0,z(i))}},n.always=on,n.amend=lr,n.and=an,n.any=pr,n.ap=fn,n.apply=sn,n.ascend=V,n.ascendBy=ln,n.between=Kn,n.both=pn,n.branch=yn,n.capitalize=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},n.chunk=u,n.clamp=Qn,n.complement=Z,n.compose=dn,n.composeP=hn,n.concat=c,n.concatMap=f,n.count=mn,n.countBy=l,n.curry=function n(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),u=1;u<t;u++)e[u-1]=arguments[u];return r.length<=e.length?r.apply(void 0,e):function(){for(var t=arguments.length,u=new Array(t),c=0;c<t;c++)u[c]=arguments[c];return n.apply(void 0,[r].concat(e,u))}},n.curryN=function n(r,t){for(var e=arguments.length,u=new Array(e>2?e-2:0),c=2;c<e;c++)u[c-2]=arguments[c];return r<=0?t.apply(void 0,u):function(){for(var e=arguments.length,c=new Array(e),o=0;o<e;o++)c[o]=arguments[o];return n.apply(void 0,[r-c.length,t].concat(u,c))}},n.dec=function(n){return n-1},n.deepEq=Nn,n.defaultTo=kn,n.descend=Sn,n.descendBy=xn,n.difference=function(n){var r=f(h,n),t=p(y,r);return v(function(n){return 1===t[n].length},r)},n.divide=Vn,n.draft=yr,n.drop=g,n.dropWhile=m,n.either=Pn,n.encase=qn,n.endsWith=Zn,n.ensureArray=function(n){return Array.isArray(n)?n:b(n)?[]:[n]},n.eq=bn,n.eqBy=En,n.every=A,n.everyPass=O,n.factors=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=n<0?Xn(n):n;return n?[].concat(z(dn(v(function(n){return 0===e(n,r)}),Yn(0),r)),[r]):[]},n.filter=v,n.find=j,n.findIndex=N,n.first=function(n){return n[0]},n.flip=zn,n.fuzzySearch=Nr,n.gcd=$n,n.groupBy=p,n.gt=Bn,n.gte=In,n.has=x,n.height=gn,n.identity=y,n.inc=function(n){return n+1},n.includes=Gn,n.insert=k,n.intersection=P,n.isEmpty=function(n){return b(n)||!mn(n)},n.isEven=function(n){return an(!bn(n,NaN),bn(n%2,0))},n.isNil=b,n.isOdd=function(n){if(!bn(n,NaN)){var r=bn(n%2);return!r(NaN)&&!r(0)}return!1},n.isPrime=function(n){for(var r=Math.sqrt(n),t=2;t<=r;t++)if(!e(t,n))return!1;return n&&1!==n},n.isZero=nr,n.join=kr,n.juxt=C,n.last=function(n){return n[n.length-1]},n.lcm=rr,n.length=vn,n.lt=Mn,n.lte=Un,n.map=U,n.match=Sr,n.max=T,n.maxBy=W,n.mean=tr,n.median=function(n){var r=n.length;if(0===r)return NaN;var t=2-r%2,e=(r-t)/2;return Rn([Q(V),_n(e,e+t),tr],n)},n.memoizeWith=Cn,n.min=function(n){return n.reduce(function(n,r){return n<=r?n:r})},n.minBy=R,n.mod=er,n.multiply=ur,n.negate=Xn,n.not=_,n.notEq=Tn,n.nth=Hn,n.omit=dr,n.on=Y,n.or=Wn,n.over=hr,n.partition=D,n.path=vr,n.pathOr=gr,n.pipe=Rn,n.pipeP=Dn,n.plan=mr,n.pow=cr,n.prepend=F,n.product=or,n.prop=br,n.propEq=wr,n.props=Ar,n.range=Yn,n.reduce=a,n.reduceRight=L,n.reduced=w,n.reject=G,n.rem=e,n.remove=H,n.replace=xr,n.reverse=function(n){return Array.isArray(n)?n.slice().reverse():n.split("").reverse().join("")},n.round=ir,n.sift=Or,n.size=function(n){return n.size},n.slice=_n,n.some=J,n.somePass=K,n.sort=Q,n.sortBy=$,n.sortWith=nn,n.split=Pr,n.subtract=ar,n.sum=fr,n.take=rn,n.takeWhile=tn,n.test=qr,n.toLower=function(n){return n.toLowerCase()},n.toUpper=function(n){return n.toUpperCase()},n.trim=function(n){return n.trim()},n.type=S,n.union=en,n.uniq=h,n.uniqBy=d,n.unless=Fn,n.update=un,n.when=Ln,n.whole=jr,n.within=sr,n.zip=cn,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).kyanite={})}(this,function(n){"use strict";function r(n){return function r(t,e){return arguments.length?1===arguments.length?function(r){return n(t,r)}:n(t,e):r}}var t=function(n,r){return n.push(r),n},e=r(function(n,r){return r%n}),u=r(function(n,r){return r.reduce(function(u,c,o){return e(n,o)?u:t(u,r.slice(o,o+n))},[])}),c=r(function(n,r){return r.concat(n)});function o(n){return function t(e,u,c){switch(arguments.length){case 0:return t;case 1:return r(function(r,t){return n(e,r,t)});case 2:return function(r){return n(e,u,r)};default:return n(e,u,c)}}}var i=function(n){return{"@@transducer/result":function(n){return n},"@@transducer/step":n}},a=o(function(n,r,t){var e=i(n),u=!0,c=!1,o=void 0;try{for(var a,f=t[Symbol.iterator]();!(u=(a=f.next()).done);u=!0){var s=a.value;if((r=e["@@transducer/step"](s,r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}}}catch(n){c=!0,o=n}finally{try{u||null==f.return||f.return()}finally{if(c)throw o}}return e["@@transducer/result"](r)}),f=r(function(n,r){return a(function(r,t){return c(n(r),t)},[],r)}),s=o(function(n,r,t){return n[r]=t,n}),l=r(function(n,r){return a(function(r,t){var e=n(r),u=s(t,e);return t.hasOwnProperty(e)?u(t[e]+1):u(1)},{},r)}),p=r(function(n,r){return a(function(r,e){var u=n(r),c=s(e,u);return e.hasOwnProperty(u)?c(t(e[u],r)):c([r])},{},r)}),d=function(n){return n},y=r(function(n,r){return Object.values(r.reduce(function(r,t){var e=n(t);return r.hasOwnProperty(e)?r:s(r,e,t)},{}))}),h=y(d),v=r(function(n,r){return a(function(r,e){return n(r)?t(e,r):e},[],r)}),g=r(function(n,r){return r.slice(n,1/0)}),m=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?[]:r.slice(t)}),b=function(n){return null==n},w=function(n){return n&&n["@@transducer/reduced"]?n:{"@@transducer/value":n,"@@transducer/reduced":!0}},A=r(function(n,r){return a(function(r,t){return n(r)?t:w(!1)},!0,r)}),O=r(function(n,r){return a(function(n,t){return n(r)?t:w(!1)},!0,n)}),j=r(function(n,r){return a(function(r,t){return n(r)?w(r):t},void 0,r)}),N=r(function(n,r){return r.findIndex(n)}),k=o(function(n,r,t){return n(t,r)}),S=r(function(n,r){return r.reduce(k(n))}),x=o(function(n,r,t){var e=n<t.length&&n>=0?n:t.length,u=t.slice(0);return u.splice(e,0,r),u}),P=function(n){return Object.prototype.toString.call(n).slice(8,-1)},q=r(function(n,r){var t=P(r);switch(t){case"Array":case"String":return r.includes(n);case"Object":case"Arguments":return r.hasOwnProperty(n);case"Map":case"Set":return r.has(n);default:throw new TypeError("Unsupported type: ".concat(t))}}),E=r(function(n,r){var t=p(d,r);return h(n.filter(function(n){return q(n,t)}))}),z=r(function(n,r){return r.join(n)});function B(n){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function I(n,r){return U(n)||function(n,r){var t=[],e=!0,u=!1,c=void 0;try{for(var o,i=n[Symbol.iterator]();!(e=(o=i.next()).done)&&(t.push(o.value),!r||t.length!==r);e=!0);}catch(n){u=!0,c=n}finally{try{e||null==i.return||i.return()}finally{if(u)throw c}}return t}(n,r)||T()}function M(n){return function(n){if(Array.isArray(n)){for(var r=0,t=new Array(n.length);r<n.length;r++)t[r]=n[r];return t}}(n)||C(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function U(n){if(Array.isArray(n))return n}function C(n){if(Symbol.iterator in Object(n)||"[object Arguments]"===Object.prototype.toString.call(n))return Array.from(n)}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var W=r(function(n,r){for(var t=r.length,e=Array(t),u=0;u<t;u++)s(e,u,n(r[u]));return e}),R=r(function(n,r){return W(function(n){return n.apply(void 0,M(r))},n)}),D=a(function(n,r){return n>=r?n:r},""),F=r(function(n,r){return r.reduce(function(r,t){return n(r)>=n(t)?r:t})}),L=S(function(n,r){return n<=r?n:r}),_=r(function(n,r){return r.reduce(function(r,t){return n(r)<=n(t)?r:t})}),Z=r(function(n,r){return a(function(r,e){var u=I(e,2),c=u[0],o=u[1];return n(r)?[t(c,r),o]:[c,t(o,r)]},[[],[]],r)}),G=r(function(n,r){return[].concat(n,r)}),H=o(function(n,r,t){for(var e=i(n),u=t.length-1;u>=0;u--)if((r=e["@@transducer/step"](t[u],r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}return e["@@transducer/result"](r)}),J=function(n){return!n},K=r(function(n,r){return J(n(r))}),Q=r(function(n,r){return v(K(n),r)}),V=r(function(n,r){return f(d,[r.slice(0,n),r.slice(n+1)])}),X=r(function(n,r){return a(function(r,t){return n(r)?w(!0):t},!1,r)}),Y=r(function(n,r){return a(function(n,t){return n(r)?w(!0):t},!1,n)}),$=r(function(n,r){return r.slice().sort(n)}),nn=function(n,r){return n<r?-1:n>r?1:0};function rn(n){return function t(e,u,c,i){switch(arguments.length){case 0:return t;case 1:return o(function(r,t,u){return n(e,r,t,u)});case 2:return r(function(r,t){return n(e,u,r,t)});case 3:return function(r){return n(e,u,c,r)};default:return n(e,u,c,i)}}}var tn=rn(function(n,r,t,e){return n(r(t),r(e))}),en=r(function(n,r){return $(tn(nn,n),r)}),un=r(function(n,r){return M(r).sort(function(r,t){return n.reduce(function(n,e){return 0===n?e(r,t):n},0)})}),cn=r(function(n,r){return r.slice(0,n)}),on=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?r:r.slice(0,t)}),an=r(function(n,r){return h(n.concat(r))}),fn=o(function(n,r,t){return f(d,[t.slice(0,n),r,t.slice(n+1)])}),sn=r(function(n,r){return(n.length<r.length?n:r).reduce(function(t,e,u){return s(t,n[u],r[u])},{})}),ln=r(function(n,r){return n}),pn=r(function(n,r){return n&&r}),dn=o(function(n,r,t){return n(t)(r(t))}),yn=r(function(n,r){return n.apply(void 0,M(r))}),hn=o(function(n,r,t){return nn(n(r),n(t))}),vn=o(function(n,r,t){return n(t)&&r(t)}),gn=rn(function(n,r,t,e){return n(e)?r(e):t(e)}),mn=o(function(n,r,t){return n(r(t))}),bn=o(function(n,r,t){return r(t).then(n)}),wn=function(n){return n.length},An=mn(wn,Object.values),On=function(n){var r=P(n);switch(r){case"Array":case"String":return n.length;case"Object":return An(n);case"Map":case"Set":return n.size;default:throw new TypeError("Unsupported type: ".concat(r))}},jn=r(function(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}),Nn=function(n,r,t){for(var e=0,u=t.length;e<u;e++)if(n(r,t[e]))return!0;return!1},kn=function(n){for(var r=[],t=null;!(t=n.next()).done;)r.push(t.value);return r},Sn=function(n,r,t,e){var u=kn(n),c=kn(r);function o(n,r){return xn(n,r,t.slice(),e.slice())}return!Nn(function(n,r){return!Nn(o,r,n)},c,u)},xn=function n(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(jn(r,t))return!0;var c,o,i=P(r);if(i!==P(t)||null==r||null==t)return!1;if("function"==typeof r.equals||"function"==typeof t.equals)return"function"==typeof r.equals&&r.equals(t)&&"function"==typeof t.equals&&t.equals(r);switch(i){case"Arguments":case"Array":case"Object":if("function"==typeof r.constructor&&"Promise"===(c=r.constructor,null==(o=String(c).match(/^function (\w*)/))?"":o[1]))return r===t;break;case"Boolean":case"Number":case"String":if(B(r)!==B(t)||!jn(r.valueOf(),t.valueOf()))return!1;break;case"Date":if(!jn(r.valueOf(),t.valueOf()))return!1;break;case"Error":return r.name===t.name&&r.message===t.message;case"RegExp":if(r.source!==t.source||r.global!==t.global||r.ignoreCase!==t.ignoreCase||r.multiline!==t.multiline||r.sticky!==t.sticky||r.unicode!==t.unicode)return!1}for(var a=e.length-1;a>=0;a--)if(e[a]===r)return u[a]===t;switch(i){case"Map":return r.size===t.size&&Sn(r.entries(),t.entries(),e.concat([r]),u.concat([t]));case"Set":return r.size===t.size&&Sn(r.values(),t.values(),e.concat([r]),u.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=Object.keys(r);if(f.length!==Object.values(t).length)return!1;for(var s=e.concat([r]),l=u.concat([t]),p=f.length-1;p>=0;p--){var d=f[p];if(!Object.prototype.hasOwnProperty.call(t,d)||!n(t[d],r[d],s,l))return!1}return!0},Pn=r(xn),qn=r(function(n,r){return b(r)||jn(NaN,r)?n:r}),En=function(n,r){return n>r?-1:n<r?1:0},zn=o(function(n,r,t){return En(n(r),n(t))}),Bn=o(function(n,r,t){return n(t)||r(t)}),In=r(function(n,r){try{return n(r)}catch(n){return}}),Mn=o(function(n,r,t){return jn(n(r),n(t))}),Un=r(function(n,r){return r>n}),Cn=r(function(n,r){return r>=n}),Tn=r(function(n,r){return r<n}),Wn=r(function(n,r){return r<=n}),Rn=r(function(n,r){var t={};return function(e){var u=n(e);return q(u,t)||(t[u]=r(e)),t[u]}}),Dn=r(function(n,r){return K(jn(n),r)}),Fn=r(function(n,r){return n||r}),Ln=r(function(n,r){return a(function(n,r){return n(r)},r,n)}),_n=r(function(n,r){return a(function(n,r){return r.then(n)},Promise.resolve(r),n)}),Zn=o(function(n,r,t){return n(t)?t:r(t)}),Gn=o(function(n,r,t){return n(t)?r(t):t}),Hn=o(function(n,r,t){return t.slice(n,r)}),Jn=r(function(n,r){return mn(Pn(n),Hn(-n.length,1/0),r)}),Kn=r(function(n,r){return-1!==r.indexOf(n)}),Qn=r(function(n,r){return r[n<0?r.length+n:n]}),Vn=r(function(n,r){return n+r}),Xn=o(function(n,r,t){return n<=t&&r>=t}),Yn=o(function(n,r,t){if(n>r)throw new Error("Min cannot be greater than max in clamp");return t>n&&t<r?t:t<=n?n:r}),$n=r(function(n,r){return r/n}),nr=function(n){return-n},rr=r(function(n,r){for(var t=[],e=Number(n),u=Number(r);e<u;e++)t.push(e);return t}),tr=r(function n(r,t){return t?n(t,r%t):r}),er=jn(0),ur=r(function(n,r){return Math.abs(Math.floor(n/tr(n,r)*r))}),cr=function(n){return $n(wn(n),a(Vn,0,n))},or=r(function(n,r){return X(d,[!Number.isInteger(n),!Number.isInteger(r),r<1])?NaN:(n%r+r)%r}),ir=r(function(n,r){return n*r}),ar=r(function(n,r){return Math.pow(r,n)}),fr=a(ir,1),sr=r(function(n,r){return Number("".concat(Math.round("".concat(r,"e").concat(n)),"e-").concat(n))}),lr=r(function(n,r){return r-n}),pr=a(Vn,0),dr=o(function(n,r,t){return n<t&&r>t}),yr=r(function(n,r){return Object.assign({},n,r)}),hr=r(function(n,r){return Object.keys(n).some(function(t){return n[t](r[t])})}),vr=r(function(n,r){return a(function(t,e){return s(e,t,n(r[t]))},{},Object.keys(r))}),gr=r(function(n,r){return a(function(t,e){return J(Kn(t,n))?s(e,t,r[t]):e},{},Object.keys(r))}),mr=o(function(n,r,t){return Object.assign({},t,function(n,r,t){return r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n}({},n,r(t[n])))}),br=r(function n(r,t){var e,u=U(e=r)||C(e)||T(),c=u[0],o=u.slice(1);if(!b(t)&&!b(t[c]))return o.length?n(o,t[c]):t[c]}),wr=o(function(n,r,t){var e=br(r,t);return b(e)?n:e}),Ar=r(function(n,r){return Object.assign({},r,a(function(t,e){return r.hasOwnProperty(t)?s(e,t,n[t](r[t])):e},{},Object.keys(n)))}),Or=r(function(n,r){return r[n]}),jr=o(function(n,r,t){return mn(jn(r),Or(n),t)}),Nr=o(function(n,r,t){var e=Or(r,t);return b(e)?n:e}),kr=r(function(n,r){return W(function(n){return r[n]},n)}),Sr=r(function(n,r){return a(function(t,e){return n(r[t])?s(e,t,r[t]):e},{},Object.keys(r))}),xr=r(function(n,r){return Object.keys(n).every(function(t){return n[t](r[t])})}),Pr=r(function(n,r){var t=r.length,e=n.length,u=0;if(e>t)return!1;if(e===t)return n===r;n:for(var c=0;c<e;c++){for(var o=n.charCodeAt(c);u<t;u++)if(r.charCodeAt(u)===o)continue n;return!1}return!0}),qr=r(function(n,r){return r.match(n)}),Er=o(function(n,r,t){return t.replace(n,r)}),zr=r(function(n,r){return r.split(n)}),Br=r(function(n,r){return n.test(r)});n.add=Vn,n.addIndex=function(n){return function(){for(var r=0,t=arguments.length,e=new Array(t),u=0;u<t;u++)e[u]=arguments[u];var c=e[0],o=e[e.length-1],i=e.slice();return i[0]=function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var u=c.apply(void 0,M(f(d,[t,[r,o]])));return r+=1,u},n.apply(void 0,M(i))}},n.always=ln,n.amend=yr,n.and=pn,n.any=hr,n.ap=dn,n.apply=yn,n.ascend=nn,n.ascendBy=hn,n.between=Xn,n.both=vn,n.branch=gn,n.capitalize=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},n.chunk=u,n.clamp=Yn,n.complement=K,n.compose=mn,n.composeP=bn,n.concat=c,n.concatMap=f,n.count=On,n.countBy=l,n.curry=function n(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),u=1;u<t;u++)e[u-1]=arguments[u];return r.length<=e.length?r.apply(void 0,e):function(){for(var t=arguments.length,u=new Array(t),c=0;c<t;c++)u[c]=arguments[c];return n.apply(void 0,[r].concat(e,u))}},n.curryN=function n(r,t){for(var e=arguments.length,u=new Array(e>2?e-2:0),c=2;c<e;c++)u[c-2]=arguments[c];return r<=0?t.apply(void 0,u):function(){for(var e=arguments.length,c=new Array(e),o=0;o<e;o++)c[o]=arguments[o];return n.apply(void 0,[r-c.length,t].concat(u,c))}},n.dec=function(n){return n-1},n.deepEq=Pn,n.defaultTo=qn,n.descend=En,n.descendBy=zn,n.difference=function(n){var r=f(h,n),t=p(d,r);return v(function(n){return 1===t[n].length},r)},n.divide=$n,n.draft=vr,n.drop=g,n.dropWhile=m,n.either=Bn,n.encase=In,n.endsWith=Jn,n.ensureArray=function(n){return Array.isArray(n)?n:b(n)?[]:[n]},n.eq=jn,n.eqBy=Mn,n.every=A,n.everyPass=O,n.factors=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=n<0?nr(n):n;return n?[].concat(M(mn(v(function(n){return 0===e(n,r)}),rr(0),r)),[r]):[]},n.filter=v,n.find=j,n.findIndex=N,n.first=function(n){return n[0]},n.flip=k,n.fold=S,n.fuzzySearch=Pr,n.gcd=tr,n.groupBy=p,n.gt=Un,n.gte=Cn,n.has=q,n.height=An,n.identity=d,n.inc=function(n){return n+1},n.includes=Kn,n.insert=x,n.intersection=E,n.isEmpty=function(n){return b(n)||!On(n)},n.isEven=function(n){return pn(!jn(n,NaN),jn(n%2,0))},n.isNil=b,n.isOdd=function(n){if(!jn(n,NaN)){var r=jn(n%2);return!r(NaN)&&!r(0)}return!1},n.isPrime=function(n){for(var r=Math.sqrt(n),t=2;t<=r;t++)if(!e(t,n))return!1;return n&&1!==n},n.isZero=er,n.join=z,n.juxt=R,n.last=function(n){return n[n.length-1]},n.lcm=ur,n.length=wn,n.lt=Tn,n.lte=Wn,n.map=W,n.match=qr,n.max=D,n.maxBy=F,n.mean=cr,n.median=function(n){var r=n.length;if(0===r)return NaN;var t=2-r%2,e=(r-t)/2;return Ln([$(nn),Hn(e,e+t),cr],n)},n.memoizeWith=Rn,n.min=L,n.minBy=_,n.mod=or,n.multiply=ir,n.negate=nr,n.not=J,n.notEq=Dn,n.nth=Qn,n.omit=gr,n.on=tn,n.or=Fn,n.over=mr,n.partition=Z,n.path=br,n.pathOr=wr,n.pipe=Ln,n.pipeP=_n,n.plan=Ar,n.pow=ar,n.prepend=G,n.product=fr,n.prop=Or,n.propEq=jr,n.propOr=Nr,n.props=kr,n.range=rr,n.reduce=a,n.reduceRight=H,n.reduced=w,n.reject=Q,n.rem=e,n.remove=V,n.replace=Er,n.reverse=function(n){return Array.isArray(n)?n.slice().reverse():n.split("").reverse().join("")},n.round=sr,n.sift=Sr,n.size=function(n){return n.size},n.slice=Hn,n.some=X,n.somePass=Y,n.sort=$,n.sortBy=en,n.sortWith=un,n.split=zr,n.subtract=lr,n.sum=pr,n.take=cn,n.takeWhile=on,n.test=Br,n.toLower=function(n){return n.toLowerCase()},n.toUpper=function(n){return n.toUpperCase()},n.trim=function(n){return n.trim()},n.type=P,n.union=an,n.uniq=h,n.uniqBy=y,n.unless=Zn,n.update=fn,n.when=Gn,n.whole=xr,n.within=dr,n.zip=sn,Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "kyanite", | ||
"version": "0.12.2", | ||
"version": "0.13.0", | ||
"description": "A small library of pure functional utilities to make life easier and data better", | ||
@@ -15,11 +15,12 @@ "main": "dist/kyanite.min.js", | ||
"devDependencies": { | ||
"@babel/core": "7.4.3", | ||
"@babel/preset-env": "7.4.3", | ||
"@babel/core": "7.4.4", | ||
"@babel/preset-env": "7.4.4", | ||
"@killparadise/docdash": "github:dhershman1/docdash", | ||
"esm": "3.2.22", | ||
"esm": "3.2.25", | ||
"gh-pages": "2.0.1", | ||
"globby": "9.2.0", | ||
"jsdoc": "3.5.5", | ||
"jsdoc": "3.6.2", | ||
"npm-run-all": "4.1.5", | ||
"nyc": "14.0.0", | ||
"rollup": "1.10.0", | ||
"nyc": "14.1.1", | ||
"rollup": "1.12.2", | ||
"rollup-plugin-babel": "4.3.2", | ||
@@ -39,3 +40,4 @@ "rollup-plugin-cleanup": "3.1.1", | ||
"docs": "node_modules/.bin/jsdoc -c jsdoc.json", | ||
"scripts": "npm-run-all create docs build", | ||
"docs:deploy": "gh-pages --dist docs", | ||
"scripts": "npm-run-all create build", | ||
"test:cov": "nyc npm test", | ||
@@ -46,3 +48,3 @@ "check-cov": "nyc check-coverage --lines 95 --functions 100 --branches 95", | ||
"ts": "tsc -p types/tsconfig.json", | ||
"prepack": "npm-run-all --parallel create docs lint test --serial build" | ||
"prepack": "npm-run-all --parallel create lint test --serial build" | ||
}, | ||
@@ -49,0 +51,0 @@ "nyc": { |
@@ -8,3 +8,3 @@ <p align=center> | ||
<p align=center> | ||
A light weight pure functional library with single type utility functions and it only depends on itself. | ||
A light weight functional JavaScript library that only depends on itself. | ||
</p> | ||
@@ -127,3 +127,3 @@ <p align=center> | ||
- [foreword](https://github.com/abstract-tools/foreword) by [Abstract Tools](https://github.com/abstract-tools) which is a very nice and easy to use library developed by a close friend. This is where a lot of functionality, AND the idea of a pure single data type system came from I can't recommend it enough. | ||
- [foreword](https://github.com/abstract-tools/foreword) by [Abstract Tools](https://github.com/abstract-tools) which is a very nice and easy to use library developed by a close friend and mentor. This is where a lot of functionality ideas came from I can't recommend it enough. | ||
- [Ramdajs](http://ramdajs.com/) by [Ramda](https://github.com/ramda) a large and fairly handy library where the original idea sparked |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import _curry3 from './_curry3' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import _curry2 from './_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from './_curry2' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -14,3 +14,3 @@ import _curry2 from '../_internals/_curry2' | ||
* @param {Array} arr The list we want to search through | ||
* @return {Any} Returns either the found item, or undefined if no item is found | ||
* @return {Maybe} Returns either the found item, or undefined if no item is found | ||
* | ||
@@ -31,4 +31,4 @@ * @example | ||
reduce((val, acc) => | ||
fn(val) ? reduced(val) : acc, null, arr) | ||
fn(val) ? reduced(val) : acc, undefined, arr) | ||
export default _curry2(find) |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,1 +1,3 @@ | ||
import fold from './fold' | ||
/** | ||
@@ -17,4 +19,5 @@ * @name min | ||
*/ | ||
const min = list => list.reduce((a, b) => a <= b ? a : b) | ||
// const min = list => list.reduce((a, b) => a <= b ? a : b) | ||
const min = fold((a, b) => a <= b ? a : b) | ||
export default min |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import ascend from '../function/ascend' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import concatMap from '../array/concatMap' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -23,4 +23,4 @@ import _curry2 from '../_internals/_curry2' | ||
* | ||
* fn(2) // => 4 | ||
* fn(100) // => 200 | ||
* fn([2]) // => 4 | ||
* fn([100]) // => 200 | ||
*/ | ||
@@ -27,0 +27,0 @@ const apply = (fn, a) => fn(...a) |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry4 from '../_internals/_curry4' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import height from '../object/height' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -6,4 +6,2 @@ import isNil from './isNil' | ||
* @name isEmpty | ||
* @deprecated since v0.11.0 use empty | ||
* @see empty | ||
* @function | ||
@@ -10,0 +8,0 @@ * @since v0.1.0 |
/** | ||
* @name isNil | ||
* @deprecated since v0.11.0 use nil | ||
* @see nil | ||
* @function | ||
@@ -6,0 +4,0 @@ * @since v0.1.0 |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry4 from '../_internals/_curry4' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -14,3 +14,3 @@ /** | ||
* @example | ||
* import { reduce, reduced } from 'kyanite' | ||
* import { compose, inc, dec, pipe, reduce, reduced, when } from 'kyanite' | ||
* | ||
@@ -21,2 +21,12 @@ * reduce((item, acc) => | ||
* acc.length === 3 ? reduced(acc) : acc.concat(item * 2), [], [1, 2, 3, 4, 5]) // => [2, 4, 6] | ||
* | ||
* // Using it with pipe is also do able | ||
* const fn = pipe([ | ||
* when(lt(10), compose(reduced, inc)), | ||
* when(gt(10), compose(reduced, dec)) | ||
* ]) | ||
* | ||
* fn(1) // => 2 | ||
* fn(20) // => 19 | ||
* fn(10) // => 10 | ||
*/ | ||
@@ -23,0 +33,0 @@ const reduced = x => |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -13,5 +13,7 @@ export { default as chunk } from './array/chunk.js' | ||
export { default as findIndex } from './array/findIndex.js' | ||
export { default as fold } from './array/fold.js' | ||
export { default as groupBy } from './array/groupBy.js' | ||
export { default as insert } from './array/insert.js' | ||
export { default as intersection } from './array/intersection.js' | ||
export { default as join } from './array/join.js' | ||
export { default as juxt } from './array/juxt.js' | ||
@@ -131,2 +133,3 @@ export { default as map } from './array/map.js' | ||
export { default as propEq } from './object/propEq.js' | ||
export { default as propOr } from './object/propOr.js' | ||
export { default as props } from './object/props.js' | ||
@@ -137,3 +140,2 @@ export { default as sift } from './object/sift.js' | ||
export { default as fuzzySearch } from './string/fuzzySearch.js' | ||
export { default as join } from './string/join.js' | ||
export { default as match } from './string/match.js' | ||
@@ -140,0 +142,0 @@ export { default as replace } from './string/replace.js' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import compose from '../function/compose' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import compose from '../function/compose' |
@@ -0,0 +0,0 @@ /** |
@@ -6,4 +6,2 @@ import and from '../function/and' | ||
* @name isEven | ||
* @deprecated since v0.11.0 use even | ||
* @see even | ||
* @function | ||
@@ -10,0 +8,0 @@ * @since v0.7.0 |
@@ -5,4 +5,2 @@ import eq from '../function/eq' | ||
* @name isOdd | ||
* @deprecated since v0.11.0 use odd | ||
* @see odd | ||
* @function | ||
@@ -9,0 +7,0 @@ * @since v0.7.0 |
@@ -5,4 +5,2 @@ import rem from './rem' | ||
* @name isPrime | ||
* @deprecated since v0.11.0 use prime | ||
* @see prime | ||
* @function | ||
@@ -9,0 +7,0 @@ * @since v0.8.3 |
@@ -0,0 +0,0 @@ import eq from '../function/eq' |
@@ -0,0 +0,0 @@ import sort from '../array/sort' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import reduce from '../function/reduce' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import reduce from '../function/reduce' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import compose from '../function/compose' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry3 from '../_internals/_curry3' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ import _curry2 from '../_internals/_curry2' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -338,2 +338,8 @@ // Type definitions for Kyanite v0.12.x | ||
/** | ||
* Takes an array and folds it using a function, basically a reduce without the need to send an initial accumulator value | ||
*/ | ||
fold<T, U, TResult>(fn: (a: T, acc: TResult) => TResult, arr: ReadonlyArray<T>): U; | ||
fold<T, U, TResult>(fn: (a: T, acc: TResult) => TResult): (arr: ReadonlyArray<T>) => U; | ||
/** | ||
* Takes a needle and searches the haystack for the matching string | ||
@@ -670,2 +676,9 @@ */ | ||
/** | ||
* If the provided object contains it's own property with the specified name, that value is returned. Otherwise it will return the provided default value | ||
*/ | ||
propOr<P extends string, U, T>(def: T, key: P, obj: Record<P, U>): U | T | ||
propOr<P extends string, T>(def: T, key: P): <U>(obj: Record<P, U>) => U | T | ||
propOr<T>(def: T): <P extends string>(key: P) => <U>(obj: Record<P, U>) => U | T | ||
/** | ||
* Pulls a list of values from an object and returns them as an array | ||
@@ -672,0 +685,0 @@ */ |
@@ -0,0 +0,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
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
6572
259187
17
159