Comparing version 0.11.2 to 0.11.3
# Changelog | ||
## v0.11.3 | ||
### New | ||
- Added `sum` function which takes an array of numbers and adds them together | ||
- TS type added | ||
- Added `product` function which takes an array of numbers and multiplies them together | ||
- TS type added | ||
- Switched over to [Circleci](https://circleci.com/) and [Codecov](https://codecov.io/) | ||
### Fixed | ||
- TS types | ||
- Added `addIndex` type | ||
- Added `memoizeWith` type | ||
- `addIndex` Documentation | ||
- `slice` Documentation | ||
## v0.11.2 | ||
@@ -4,0 +22,0 @@ |
@@ -955,5 +955,5 @@ (function (global, factory) { | ||
var val = x < 0 ? negate(x) : x; | ||
return x ? _toConsumableArray(compose$1(filter$1(function (i) { | ||
return x ? [].concat(_toConsumableArray(compose$1(filter$1(function (i) { | ||
return rem$1(i, val) === 0; | ||
}), range$1(0), val)).concat([val]) : []; | ||
}), range$1(0), val)), [val]) : []; | ||
}; | ||
@@ -1014,2 +1014,4 @@ | ||
var product = reduce$1(multiply$1, 1); | ||
var round = function round(precision, num) { | ||
@@ -1025,2 +1027,4 @@ return Number("".concat(Math.round("".concat(num, "e").concat(precision)), "e-").concat(precision)); | ||
var sum = reduce$1(add$1, 0); | ||
var within = function within(min, max, n) { | ||
@@ -1287,2 +1291,3 @@ return min < n && max > n; | ||
exports.pow = pow$1; | ||
exports.product = product; | ||
exports.range = range$1; | ||
@@ -1292,2 +1297,3 @@ exports.rem = rem$1; | ||
exports.subtract = subtract$1; | ||
exports.sum = sum; | ||
exports.within = within$1; | ||
@@ -1294,0 +1300,0 @@ exports.amend = amend$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=r(function(n,r){return r.concat(n)});function e(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 u=function(n){return{"@@transducer/result":function(n){return n},"@@transducer/step":n}},c=e(function(n,r,t){var e=u(n),c=!0,o=!1,i=void 0;try{for(var a,f=t[Symbol.iterator]();!(c=(a=f.next()).done);c=!0){var s=a.value;if((r=e["@@transducer/step"](s,r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}}}catch(n){o=!0,i=n}finally{try{c||null==f.return||f.return()}finally{if(o)throw i}}return e["@@transducer/result"](r)}),o=r(function(n,r){return c(function(r,e){return t(n(r),e)},[],r)}),i=e(function(n,r,t){return n[r]=t,n}),a=r(function(n,r){return c(function(r,t){var e=n(r),u=i(t,e);return t.hasOwnProperty(e)?u(t[e]+1):u(1)},{},r)}),f=function(n,r){return n.push(r),n},s=r(function(n,r){return c(function(r,t){var e=n(r),u=i(t,e);return t.hasOwnProperty(e)?u(f(t[e],r)):u([r])},{},r)}),l=function(n){return n},p=r(function(n,r){return Object.values(r.reduce(function(r,t){var e=n(t);return r.hasOwnProperty(e)?r:i(r,e,t)},{}))}),y=p(l),d=r(function(n,r){return c(function(r,t){return n(r)?f(t,r):t},[],r)}),h=r(function(n,r){return r.slice(n,1/0)}),v=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?[]:r.slice(t)}),g=function(n){return null==n},m=function(n){return n&&n["@@transducer/reduced"]?n:{"@@transducer/value":n,"@@transducer/reduced":!0}},b=r(function(n,r){return c(function(r,t){return n(r)?t:m(!1)},!0,r)}),w=r(function(n,r){return c(function(r,t){return n(r)?m(r):t},null,r)}),A=r(function(n,r){return r.findIndex(n)}),O=e(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}),j=function(n){return Object.prototype.toString.call(n).slice(8,-1)},S=r(function(n,r){var t=j(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))}}),k=r(function(n,r){var t=s(l,r);return y(n.filter(function(n){return S(n,t)}))});function x(n){return(x="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 N(n,r){return q(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)||B()}function P(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)||z(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function q(n){if(Array.isArray(n))return n}function z(n){if(Symbol.iterator in Object(n)||"[object Arguments]"===Object.prototype.toString.call(n))return Array.from(n)}function B(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var E=r(function(n,r){for(var t=r.length,e=Array(t),u=0;u<t;u++)i(e,u,n(r[u]));return e}),M=r(function(n,r){return E(function(n){return n.apply(void 0,P(r))},n)}),I=c(function(n,r){return n>=r?n:r},""),U=r(function(n,r){return r.reduce(function(r,t){return n(r)>=n(t)?r:t})}),C=r(function(n,r){return r.reduce(function(r,t){return n(r)<=n(t)?r:t})}),T=r(function(n,r){return c(function(r,t){var e=N(t,2),u=e[0],c=e[1];return n(r)?[f(u,r),c]:[u,f(c,r)]},[[],[]],r)}),W=r(function(n,r){return[].concat(n,r)}),R=e(function(n,r,t){for(var e=u(n),c=t.length-1;c>=0;c--)if((r=e["@@transducer/step"](t[c],r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}return e["@@transducer/result"](r)}),D=function(n){return!n},F=r(function(n,r){return D(n(r))}),L=r(function(n,r){return d(F(n),r)}),_=r(function(n,r){return o(l,[r.slice(0,n),r.slice(n+1)])}),Z=r(function(n,r){return c(function(r,t){return n(r)?m(!0):t},!1,r)}),G=r(function(n,r){return r.slice().sort(n)}),H=r(function(n,r){return n<r?-1:n>r?1:0});function J(n){return function t(u,c,o,i){switch(arguments.length){case 0:return t;case 1:return e(function(r,t,e){return n(u,r,t,e)});case 2:return r(function(r,t){return n(u,c,r,t)});case 3:return function(r){return n(u,c,o,r)};default:return n(u,c,o,i)}}}var K=J(function(n,r,t,e){return n(r(t),r(e))}),Q=r(function(n,r){return G(K(H,n),r)}),V=r(function(n,r){return P(r).sort(function(r,t){return n.reduce(function(n,e){return 0===n?e(r,t):n},0)})}),X=r(function(n,r){return r.slice(0,n)}),Y=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?r:r.slice(0,t)}),$=r(function(n,r){return y(n.concat(r))}),nn=e(function(n,r,t){return o(l,[t.slice(0,n),r,t.slice(n+1)])}),rn=r(function(n,r){return(n.length<r.length?n:r).reduce(function(t,e,u){return i(t,n[u],r[u])},{})}),tn=r(function(n,r){return n}),en=r(function(n,r){return n&&r}),un=e(function(n,r,t){return n(t)(r(t))}),cn=r(function(n,r){return n.apply(void 0,P(r))}),on=e(function(n,r,t){return H(n(r),n(t))}),an=e(function(n,r,t){return n(t)&&r(t)}),fn=J(function(n,r,t,e){return n(e)?r(e):t(e)}),sn=e(function(n,r,t){return n(r(t))}),ln=e(function(n,r,t){return r(t).then(n)}),pn=function(n){return n.length},yn=sn(pn,Object.values),dn=function(n){var r=j(n);switch(r){case"Array":case"String":return n.length;case"Object":return yn(n);case"Map":case"Set":return n.size;default:throw new TypeError("Unsupported type: ".concat(r))}},hn=r(function(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}),vn=function(n,r,t){for(var e=0,u=t.length;e<u;e++)if(n(r,t[e]))return!0;return!1},gn=function(n){for(var r=[],t=null;!(t=n.next()).done;)r.push(t.value);return r},mn=function(n,r,t,e){var u=gn(n),c=gn(r);function o(n,r){return bn(n,r,t.slice(),e.slice())}return!vn(function(n,r){return!vn(o,r,n)},c,u)},bn=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(hn(r,t))return!0;var c,o,i=j(r);if(i!==j(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(x(r)!==x(t)||!hn(r.valueOf(),t.valueOf()))return!1;break;case"Date":if(!hn(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&&mn(r.entries(),t.entries(),e.concat([r]),u.concat([t]));case"Set":return r.size===t.size&&mn(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},wn=r(bn),An=r(function(n,r){return g(r)||hn(NaN,r)?n:r}),On=r(function(n,r){return n>r?-1:n<r?1:0}),jn=e(function(n,r,t){return On(n(r),n(t))}),Sn=e(function(n,r,t){return n(t)||r(t)}),kn=r(function(n,r){try{return n(r)}catch(n){return}}),xn=e(function(n,r,t){return hn(n(r),n(t))}),Nn=e(function(n,r,t){return n(t,r)}),Pn=r(function(n,r){return r>n}),qn=r(function(n,r){return r>=n}),zn=r(function(n,r){return r<n}),Bn=r(function(n,r){return r<=n}),En=r(function(n,r){var t={};return function(e){var u=n(e);return S(u,t)||(t[u]=r(e)),t[u]}}),Mn=r(function(n,r){return n||r}),In=r(function(n,r){return n.reduce(function(n,r){return r(n)},r)}),Un=r(function(n,r){return n.reduce(function(n,r){return n.then(r)},Promise.resolve(r))}),Cn=e(function(n,r,t){return n(t)?t:r(t)}),Tn=e(function(n,r,t){return n(t)?r(t):t}),Wn=e(function(n,r,t){return t.slice(n,r)}),Rn=r(function(n,r){return sn(wn(n),Wn(-n.length,1/0),r)}),Dn=r(function(n,r){return-1!==r.indexOf(n)}),Fn=r(function(n,r){return r[n<0?r.length+n:n]}),Ln=r(function(n,r){return n+r}),_n=e(function(n,r,t){return n<=t&&r>=t}),Zn=e(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}),Gn=r(function(n,r){return r/n}),Hn=function(n){return-n},Jn=r(function(n,r){for(var t=[],e=Number(n),u=Number(r);e<u;e++)t.push(e);return t}),Kn=r(function(n,r){return r%n}),Qn=r(function n(r,t){return t?n(t,r%t):r}),Vn=hn(0),Xn=r(function(n,r){return Math.abs(Math.floor(n/Qn(n,r)*r))}),Yn=r(function(n,r){return n*r}),$n=r(function(n,r){return Math.pow(r,n)}),nr=r(function(n,r){return Number("".concat(Math.round("".concat(r,"e").concat(n)),"e-").concat(n))}),rr=r(function(n,r){return r-n}),tr=e(function(n,r,t){return n<t&&r>t}),er=r(function(n,r){return Object.assign({},n,r)}),ur=r(function(n,r){return Object.keys(n).some(function(t){return n[t](r[t])})}),cr=r(function(n,r){return c(function(t,e){return i(e,t,n(r[t]))},{},Object.keys(r))}),or=r(function(n,r){return c(function(t,e){return D(Dn(t,n))?i(e,t,r[t]):e},{},Object.keys(r))}),ir=e(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])))}),ar=r(function n(r,t){var e,u=q(e=r)||z(e)||B(),c=u[0],o=u.slice(1);return o.length?g(t[c])?void 0:n(o,t[c]):t[c]}),fr=e(function(n,r,t){var e=ar(r,t);return g(e)?n:e}),sr=r(function(n,r){return Object.assign({},r,c(function(t,e){return r.hasOwnProperty(t)?i(e,t,n[t](r[t])):e},{},Object.keys(n)))}),lr=r(function(n,r){return r[n]}),pr=r(function(n,r){return E(function(n){return r[n]},n)}),yr=r(function(n,r){return c(function(t,e){return n(r[t])?i(e,t,r[t]):e},{},Object.keys(r))}),dr=r(function(n,r){return Object.keys(n).every(function(t){return n[t](r[t])})}),hr=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}),vr=r(function(n,r){return r.join(n)}),gr=r(function(n,r){return r.match(n)}),mr=e(function(n,r,t){return t.replace(n,r)}),br=r(function(n,r){return r.split(n)}),wr=r(function(n,r){return n.test(r)});n.concatMap=o,n.countBy=a,n.difference=function(n){var r=o(y,n),t=s(l,r);return d(function(n){return 1===t[n].length},r)},n.drop=h,n.dropWhile=v,n.ensureArray=function(n){return Array.isArray(n)?n:g(n)?[]:[n]},n.every=b,n.filter=d,n.find=w,n.findIndex=A,n.groupBy=s,n.insert=O,n.intersection=k,n.juxt=M,n.map=E,n.max=I,n.maxBy=U,n.min=function(n){return n.reduce(function(n,r){return n<=r?n:r})},n.minBy=C,n.partition=T,n.prepend=W,n.reduceRight=R,n.reject=L,n.remove=_,n.some=Z,n.sort=G,n.sortBy=Q,n.sortWith=V,n.take=X,n.takeWhile=Y,n.union=$,n.uniq=y,n.uniqBy=p,n.update=nn,n.zip=rn,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],i=e[e.length-1],a=e.slice();return a[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,P(o(l,[t,[r,i]])));return r+=1,u},n.apply(void 0,P(a))}},n.always=tn,n.and=en,n.ap=un,n.apply=cn,n.ascend=H,n.ascendBy=on,n.both=an,n.branch=fn,n.complement=F,n.compose=sn,n.composeP=ln,n.count=dn,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.deepEq=wn,n.defaultTo=An,n.descend=On,n.descendBy=jn,n.either=Sn,n.encase=kn,n.eq=hn,n.eqBy=xn,n.flip=Nn,n.gt=Pn,n.gte=qn,n.has=S,n.identity=l,n.isEmpty=function(n){return g(n)||!dn(n)},n.isNil=g,n.lt=zn,n.lte=Bn,n.memoizeWith=En,n.not=D,n.on=K,n.or=Mn,n.pipe=In,n.pipeP=Un,n.reduce=c,n.reduced=m,n.size=function(n){return n.size},n.type=j,n.unless=Cn,n.when=Tn,n.concat=t,n.endsWith=Rn,n.first=function(n){return n[0]},n.includes=Dn,n.last=function(n){return n[n.length-1]},n.length=pn,n.nth=Fn,n.reverse=function(n){return Array.isArray(n)?n.slice().reverse():n.split("").reverse().join("")},n.slice=Wn,n.add=Ln,n.between=_n,n.clamp=Zn,n.dec=function(n){return n-1},n.divide=Gn,n.factors=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=n<0?Hn(n):n;return n?P(sn(d(function(n){return 0===Kn(n,r)}),Jn(0),r)).concat([r]):[]},n.gcd=Qn,n.inc=function(n){return n+1},n.isEven=function(n){return en(!hn(n,NaN),hn(n%2,0))},n.isOdd=function(n){if(!hn(n,NaN)){var r=hn(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(!Kn(t,n))return!1;return n&&1!==n},n.isZero=Vn,n.lcm=Xn,n.mean=function(n){return Gn(pn(n),c(Ln,0,n))},n.multiply=Yn,n.negate=Hn,n.pow=$n,n.range=Jn,n.rem=Kn,n.round=nr,n.subtract=rr,n.within=tr,n.amend=er,n.any=ur,n.draft=cr,n.height=yn,n.omit=or,n.over=ir,n.path=ar,n.pathOr=fr,n.plan=sr,n.prop=lr,n.props=pr,n.sift=yr,n.whole=dr,n.capitalize=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},n.fuzzySearch=hr,n.join=vr,n.match=gr,n.replace=mr,n.split=br,n.test=wr,n.toLower=function(n){return n.toLowerCase()},n.toUpper=function(n){return n.toUpperCase()},n.trim=function(n){return n.trim()},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=r(function(n,r){return r.concat(n)});function e(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 u=function(n){return{"@@transducer/result":function(n){return n},"@@transducer/step":n}},c=e(function(n,r,t){var e=u(n),c=!0,o=!1,i=void 0;try{for(var a,f=t[Symbol.iterator]();!(c=(a=f.next()).done);c=!0){var s=a.value;if((r=e["@@transducer/step"](s,r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}}}catch(n){o=!0,i=n}finally{try{c||null==f.return||f.return()}finally{if(o)throw i}}return e["@@transducer/result"](r)}),o=r(function(n,r){return c(function(r,e){return t(n(r),e)},[],r)}),i=e(function(n,r,t){return n[r]=t,n}),a=r(function(n,r){return c(function(r,t){var e=n(r),u=i(t,e);return t.hasOwnProperty(e)?u(t[e]+1):u(1)},{},r)}),f=function(n,r){return n.push(r),n},s=r(function(n,r){return c(function(r,t){var e=n(r),u=i(t,e);return t.hasOwnProperty(e)?u(f(t[e],r)):u([r])},{},r)}),l=function(n){return n},p=r(function(n,r){return Object.values(r.reduce(function(r,t){var e=n(t);return r.hasOwnProperty(e)?r:i(r,e,t)},{}))}),y=p(l),d=r(function(n,r){return c(function(r,t){return n(r)?f(t,r):t},[],r)}),h=r(function(n,r){return r.slice(n,1/0)}),v=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?[]:r.slice(t)}),g=function(n){return null==n},m=function(n){return n&&n["@@transducer/reduced"]?n:{"@@transducer/value":n,"@@transducer/reduced":!0}},b=r(function(n,r){return c(function(r,t){return n(r)?t:m(!1)},!0,r)}),w=r(function(n,r){return c(function(r,t){return n(r)?m(r):t},null,r)}),A=r(function(n,r){return r.findIndex(n)}),O=e(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}),j=function(n){return Object.prototype.toString.call(n).slice(8,-1)},S=r(function(n,r){var t=j(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))}}),k=r(function(n,r){var t=s(l,r);return y(n.filter(function(n){return S(n,t)}))});function x(n){return(x="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 N(n,r){return q(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)||B()}function P(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)||z(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function q(n){if(Array.isArray(n))return n}function z(n){if(Symbol.iterator in Object(n)||"[object Arguments]"===Object.prototype.toString.call(n))return Array.from(n)}function B(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var E=r(function(n,r){for(var t=r.length,e=Array(t),u=0;u<t;u++)i(e,u,n(r[u]));return e}),M=r(function(n,r){return E(function(n){return n.apply(void 0,P(r))},n)}),I=c(function(n,r){return n>=r?n:r},""),U=r(function(n,r){return r.reduce(function(r,t){return n(r)>=n(t)?r:t})}),C=r(function(n,r){return r.reduce(function(r,t){return n(r)<=n(t)?r:t})}),T=r(function(n,r){return c(function(r,t){var e=N(t,2),u=e[0],c=e[1];return n(r)?[f(u,r),c]:[u,f(c,r)]},[[],[]],r)}),W=r(function(n,r){return[].concat(n,r)}),R=e(function(n,r,t){for(var e=u(n),c=t.length-1;c>=0;c--)if((r=e["@@transducer/step"](t[c],r))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}return e["@@transducer/result"](r)}),D=function(n){return!n},F=r(function(n,r){return D(n(r))}),L=r(function(n,r){return d(F(n),r)}),_=r(function(n,r){return o(l,[r.slice(0,n),r.slice(n+1)])}),Z=r(function(n,r){return c(function(r,t){return n(r)?m(!0):t},!1,r)}),G=r(function(n,r){return r.slice().sort(n)}),H=r(function(n,r){return n<r?-1:n>r?1:0});function J(n){return function t(u,c,o,i){switch(arguments.length){case 0:return t;case 1:return e(function(r,t,e){return n(u,r,t,e)});case 2:return r(function(r,t){return n(u,c,r,t)});case 3:return function(r){return n(u,c,o,r)};default:return n(u,c,o,i)}}}var K=J(function(n,r,t,e){return n(r(t),r(e))}),Q=r(function(n,r){return G(K(H,n),r)}),V=r(function(n,r){return P(r).sort(function(r,t){return n.reduce(function(n,e){return 0===n?e(r,t):n},0)})}),X=r(function(n,r){return r.slice(0,n)}),Y=r(function(n,r){var t=r.findIndex(function(r){return!n(r)});return t<0?r:r.slice(0,t)}),$=r(function(n,r){return y(n.concat(r))}),nn=e(function(n,r,t){return o(l,[t.slice(0,n),r,t.slice(n+1)])}),rn=r(function(n,r){return(n.length<r.length?n:r).reduce(function(t,e,u){return i(t,n[u],r[u])},{})}),tn=r(function(n,r){return n}),en=r(function(n,r){return n&&r}),un=e(function(n,r,t){return n(t)(r(t))}),cn=r(function(n,r){return n.apply(void 0,P(r))}),on=e(function(n,r,t){return H(n(r),n(t))}),an=e(function(n,r,t){return n(t)&&r(t)}),fn=J(function(n,r,t,e){return n(e)?r(e):t(e)}),sn=e(function(n,r,t){return n(r(t))}),ln=e(function(n,r,t){return r(t).then(n)}),pn=function(n){return n.length},yn=sn(pn,Object.values),dn=function(n){var r=j(n);switch(r){case"Array":case"String":return n.length;case"Object":return yn(n);case"Map":case"Set":return n.size;default:throw new TypeError("Unsupported type: ".concat(r))}},hn=r(function(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}),vn=function(n,r,t){for(var e=0,u=t.length;e<u;e++)if(n(r,t[e]))return!0;return!1},gn=function(n){for(var r=[],t=null;!(t=n.next()).done;)r.push(t.value);return r},mn=function(n,r,t,e){var u=gn(n),c=gn(r);function o(n,r){return bn(n,r,t.slice(),e.slice())}return!vn(function(n,r){return!vn(o,r,n)},c,u)},bn=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(hn(r,t))return!0;var c,o,i=j(r);if(i!==j(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(x(r)!==x(t)||!hn(r.valueOf(),t.valueOf()))return!1;break;case"Date":if(!hn(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&&mn(r.entries(),t.entries(),e.concat([r]),u.concat([t]));case"Set":return r.size===t.size&&mn(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},wn=r(bn),An=r(function(n,r){return g(r)||hn(NaN,r)?n:r}),On=r(function(n,r){return n>r?-1:n<r?1:0}),jn=e(function(n,r,t){return On(n(r),n(t))}),Sn=e(function(n,r,t){return n(t)||r(t)}),kn=r(function(n,r){try{return n(r)}catch(n){return}}),xn=e(function(n,r,t){return hn(n(r),n(t))}),Nn=e(function(n,r,t){return n(t,r)}),Pn=r(function(n,r){return r>n}),qn=r(function(n,r){return r>=n}),zn=r(function(n,r){return r<n}),Bn=r(function(n,r){return r<=n}),En=r(function(n,r){var t={};return function(e){var u=n(e);return S(u,t)||(t[u]=r(e)),t[u]}}),Mn=r(function(n,r){return n||r}),In=r(function(n,r){return n.reduce(function(n,r){return r(n)},r)}),Un=r(function(n,r){return n.reduce(function(n,r){return n.then(r)},Promise.resolve(r))}),Cn=e(function(n,r,t){return n(t)?t:r(t)}),Tn=e(function(n,r,t){return n(t)?r(t):t}),Wn=e(function(n,r,t){return t.slice(n,r)}),Rn=r(function(n,r){return sn(wn(n),Wn(-n.length,1/0),r)}),Dn=r(function(n,r){return-1!==r.indexOf(n)}),Fn=r(function(n,r){return r[n<0?r.length+n:n]}),Ln=r(function(n,r){return n+r}),_n=e(function(n,r,t){return n<=t&&r>=t}),Zn=e(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}),Gn=r(function(n,r){return r/n}),Hn=function(n){return-n},Jn=r(function(n,r){for(var t=[],e=Number(n),u=Number(r);e<u;e++)t.push(e);return t}),Kn=r(function(n,r){return r%n}),Qn=r(function n(r,t){return t?n(t,r%t):r}),Vn=hn(0),Xn=r(function(n,r){return Math.abs(Math.floor(n/Qn(n,r)*r))}),Yn=r(function(n,r){return n*r}),$n=r(function(n,r){return Math.pow(r,n)}),nr=c(Yn,1),rr=r(function(n,r){return Number("".concat(Math.round("".concat(r,"e").concat(n)),"e-").concat(n))}),tr=r(function(n,r){return r-n}),er=c(Ln,0),ur=e(function(n,r,t){return n<t&&r>t}),cr=r(function(n,r){return Object.assign({},n,r)}),or=r(function(n,r){return Object.keys(n).some(function(t){return n[t](r[t])})}),ir=r(function(n,r){return c(function(t,e){return i(e,t,n(r[t]))},{},Object.keys(r))}),ar=r(function(n,r){return c(function(t,e){return D(Dn(t,n))?i(e,t,r[t]):e},{},Object.keys(r))}),fr=e(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])))}),sr=r(function n(r,t){var e,u=q(e=r)||z(e)||B(),c=u[0],o=u.slice(1);return o.length?g(t[c])?void 0:n(o,t[c]):t[c]}),lr=e(function(n,r,t){var e=sr(r,t);return g(e)?n:e}),pr=r(function(n,r){return Object.assign({},r,c(function(t,e){return r.hasOwnProperty(t)?i(e,t,n[t](r[t])):e},{},Object.keys(n)))}),yr=r(function(n,r){return r[n]}),dr=r(function(n,r){return E(function(n){return r[n]},n)}),hr=r(function(n,r){return c(function(t,e){return n(r[t])?i(e,t,r[t]):e},{},Object.keys(r))}),vr=r(function(n,r){return Object.keys(n).every(function(t){return n[t](r[t])})}),gr=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}),mr=r(function(n,r){return r.join(n)}),br=r(function(n,r){return r.match(n)}),wr=e(function(n,r,t){return t.replace(n,r)}),Ar=r(function(n,r){return r.split(n)}),Or=r(function(n,r){return n.test(r)});n.concatMap=o,n.countBy=a,n.difference=function(n){var r=o(y,n),t=s(l,r);return d(function(n){return 1===t[n].length},r)},n.drop=h,n.dropWhile=v,n.ensureArray=function(n){return Array.isArray(n)?n:g(n)?[]:[n]},n.every=b,n.filter=d,n.find=w,n.findIndex=A,n.groupBy=s,n.insert=O,n.intersection=k,n.juxt=M,n.map=E,n.max=I,n.maxBy=U,n.min=function(n){return n.reduce(function(n,r){return n<=r?n:r})},n.minBy=C,n.partition=T,n.prepend=W,n.reduceRight=R,n.reject=L,n.remove=_,n.some=Z,n.sort=G,n.sortBy=Q,n.sortWith=V,n.take=X,n.takeWhile=Y,n.union=$,n.uniq=y,n.uniqBy=p,n.update=nn,n.zip=rn,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],i=e[e.length-1],a=e.slice();return a[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,P(o(l,[t,[r,i]])));return r+=1,u},n.apply(void 0,P(a))}},n.always=tn,n.and=en,n.ap=un,n.apply=cn,n.ascend=H,n.ascendBy=on,n.both=an,n.branch=fn,n.complement=F,n.compose=sn,n.composeP=ln,n.count=dn,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.deepEq=wn,n.defaultTo=An,n.descend=On,n.descendBy=jn,n.either=Sn,n.encase=kn,n.eq=hn,n.eqBy=xn,n.flip=Nn,n.gt=Pn,n.gte=qn,n.has=S,n.identity=l,n.isEmpty=function(n){return g(n)||!dn(n)},n.isNil=g,n.lt=zn,n.lte=Bn,n.memoizeWith=En,n.not=D,n.on=K,n.or=Mn,n.pipe=In,n.pipeP=Un,n.reduce=c,n.reduced=m,n.size=function(n){return n.size},n.type=j,n.unless=Cn,n.when=Tn,n.concat=t,n.endsWith=Rn,n.first=function(n){return n[0]},n.includes=Dn,n.last=function(n){return n[n.length-1]},n.length=pn,n.nth=Fn,n.reverse=function(n){return Array.isArray(n)?n.slice().reverse():n.split("").reverse().join("")},n.slice=Wn,n.add=Ln,n.between=_n,n.clamp=Zn,n.dec=function(n){return n-1},n.divide=Gn,n.factors=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=n<0?Hn(n):n;return n?[].concat(P(sn(d(function(n){return 0===Kn(n,r)}),Jn(0),r)),[r]):[]},n.gcd=Qn,n.inc=function(n){return n+1},n.isEven=function(n){return en(!hn(n,NaN),hn(n%2,0))},n.isOdd=function(n){if(!hn(n,NaN)){var r=hn(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(!Kn(t,n))return!1;return n&&1!==n},n.isZero=Vn,n.lcm=Xn,n.mean=function(n){return Gn(pn(n),c(Ln,0,n))},n.multiply=Yn,n.negate=Hn,n.pow=$n,n.product=nr,n.range=Jn,n.rem=Kn,n.round=rr,n.subtract=tr,n.sum=er,n.within=ur,n.amend=cr,n.any=or,n.draft=ir,n.height=yn,n.omit=ar,n.over=fr,n.path=sr,n.pathOr=lr,n.plan=pr,n.prop=yr,n.props=dr,n.sift=hr,n.whole=vr,n.capitalize=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},n.fuzzySearch=gr,n.join=mr,n.match=br,n.replace=wr,n.split=Ar,n.test=Or,n.toLower=function(n){return n.toLowerCase()},n.toUpper=function(n){return n.toUpperCase()},n.trim=function(n){return n.trim()},Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "kyanite", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"description": "A small library of pure functional utilities to make life easier and data better", | ||
@@ -15,19 +15,18 @@ "main": "dist/kyanite.min.js", | ||
"devDependencies": { | ||
"@babel/core": "7.1.6", | ||
"@babel/preset-env": "7.1.6", | ||
"@babel/core": "7.3.3", | ||
"@babel/preset-env": "7.3.1", | ||
"@killparadise/docdash": "github:dhershman1/docdash", | ||
"coveralls": "^3.0.2", | ||
"esm": "3.1.1", | ||
"esm": "3.2.5", | ||
"globby": "9.0.0", | ||
"jsdoc": "3.5.5", | ||
"npm-run-all": "4.1.5", | ||
"nyc": "13.1.0", | ||
"rollup": "1.1.2", | ||
"nyc": "13.3.0", | ||
"rollup": "1.2.1", | ||
"rollup-plugin-babel": "4.3.2", | ||
"rollup-plugin-cleanup": "3.1.1", | ||
"rollup-plugin-filesize": "6.0.0", | ||
"rollup-plugin-terser": "4.0.2", | ||
"rollup-plugin-filesize": "6.0.1", | ||
"rollup-plugin-terser": "4.0.4", | ||
"standard": "12.0.1", | ||
"tap-spec": "5.0.0", | ||
"tape": "4.9.2" | ||
"tape": "4.10.1" | ||
}, | ||
@@ -43,3 +42,3 @@ "scripts": { | ||
"check-cov": "nyc check-coverage --lines 95 --functions 100 --branches 95", | ||
"report": "nyc report --reporter=text-lcov | coveralls", | ||
"report": "nyc report --reporter=text-lcov > coverage.lcov", | ||
"cov": "nyc --reporter=html npm test", | ||
@@ -46,0 +45,0 @@ "ts": "tsc -p types/tsconfig.json", |
@@ -26,11 +26,10 @@ <p align=center> | ||
</a> | ||
<a href="https://travis-ci.org/dhershman1/kyanite"> | ||
<img alt="Build Status" src="https://img.shields.io/travis/dhershman1/kyanite.svg?style=flat-square"> | ||
<a href="https://circleci.com/gh/dhershman1/kyanite/tree/master"> | ||
<img alt="Build Status" src="https://circleci.com/gh/dhershman1/kyanite/tree/master.svg?style=svg"> | ||
</a> | ||
<a href="https://coveralls.io/github/dhershman1/kyanite?branch=master"> | ||
<img alt="Coverage" src="https://img.shields.io/coveralls/github/dhershman1/kyanite.svg?style=flat-square"> | ||
<a href="https://codecov.io/gh/dhershman1/kyanite"> | ||
<img alt="Coverage" src="https://codecov.io/gh/dhershman1/kyanite/branch/master/graph/badge.svg"> | ||
</a> | ||
</p> | ||
<br /> | ||
<p align=center> | ||
@@ -37,0 +36,0 @@ <a href="https://github.com/standard/standard"> |
@@ -15,3 +15,3 @@ import concatMap from '../array/concatMap' | ||
* @example | ||
* import { addIndex, map, filter } from 'kyanite' | ||
* import { addIndex, map, filter, reduce } from 'kyanite' | ||
* const m = addIndex(map) | ||
@@ -18,0 +18,0 @@ * const f = addIndex(filter) |
@@ -106,2 +106,3 @@ export { default as concatMap } from './array/concatMap.js' | ||
export { default as pow } from './number/pow.js' | ||
export { default as product } from './number/product.js' | ||
export { default as range } from './number/range.js' | ||
@@ -111,2 +112,3 @@ export { default as rem } from './number/rem.js' | ||
export { default as subtract } from './number/subtract.js' | ||
export { default as sum } from './number/sum.js' | ||
export { default as within } from './number/within.js' | ||
@@ -113,0 +115,0 @@ export { default as amend } from './object/amend.js' |
@@ -14,3 +14,3 @@ import _curry3 from '../_internals/_curry3' | ||
* @param {Number} a The index at which to begin extraction | ||
* @param {Number} b The index for what the extraction goes to. However does not extract | ||
* @param {Number} b The index for what the extraction goes to. | ||
* @param {Array|String} list The list of items or characters to slice | ||
@@ -17,0 +17,0 @@ * @return {Array|String} The newly created list |
@@ -42,2 +42,7 @@ // Type definitions for Kyanite v0.10.2 | ||
/** | ||
* Creates a new list iteration function from an existing one by adding two new parameters to its callback function: the current index, and the entire list. This will only work for functions in which the iteration callback function is the first parameter, and where the list is the last parameter. (This latter might be unimportant if the list parameter is not used.) | ||
*/ | ||
addIndex(fn: Function): Function | ||
/** | ||
* Always returns the first param sent to it, and ignores the 2nd also known as the K combinator | ||
@@ -492,2 +497,8 @@ */ | ||
/** | ||
* Creates a new function that, when invoked, caches the result of calling fn for a given argument set and returns the result. Subsequent calls to the memoized fn with the same argument set will not result in an additional call to fn; instead, the cached result for that set of arguments will be returned. | ||
*/ | ||
memoizeWith(mFn: Function, fn: Function): Function; | ||
memoizeWith(mFn: Function): (fn: Function) => Function; | ||
/** | ||
* Goes through an array of values and grabs the min value of the array | ||
@@ -612,2 +623,7 @@ */ | ||
/** | ||
* Takes an array of numbers and multiplies them together | ||
*/ | ||
product(arr: ReadonlyArray<number>): number | ||
/** | ||
* Brings back the indicated property of an object if it exists | ||
@@ -756,2 +772,7 @@ */ | ||
/** | ||
* Takes an array of numbers and adds them together | ||
*/ | ||
sum(arr: ReadonlyArray<number>): number | ||
/** | ||
* Takes the values from an array up until the point specified | ||
@@ -758,0 +779,0 @@ */ |
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
237222
16
150
6153
116