functional-lite
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -5,3 +5,3 @@ | ||
/* | ||
* @version 0.0.8 | ||
* @version 0.0.9 | ||
* @author Lauri Rooden - https://github.com/litejs/fn-lite | ||
@@ -84,3 +84,3 @@ * @license MIT License - http://lauri.rooden.ee/mit-license.txt | ||
f.extend = function() { | ||
return self.extend.apply(self, arguments).cache(instance, keyFn, c) | ||
return self.extend.apply(self, arguments).cache(instance, keyFn) | ||
} | ||
@@ -87,0 +87,0 @@ f[P] = self[P] // prototype for better access on extending |
function Nop(){}function True(){return!0}function False(){return!1}function This(){return this}function Init(){return this.init&&this.init.apply(this,arguments)||this} | ||
!function(n){function g(a){if(g[a])return g[a];for(var b="_",c=a,d=a.split("->");1<d.length;)c=d.pop(),b=d.pop().match(/\w+/g)||"",d.length&&d.push("(function("+b+"){return("+c+")})");return g[a]=new Function(b,"return("+c+")")}var f=Array.prototype,e=Function.prototype,l=String.prototype,k=Object,j=e.call.bind(f.slice),m=[];e.construct=function(a){var b=a.length;return b?(m[b]||(m[b]=g("t a->new t(a["+Object.keys(j(a)).join("],a[")+"])")))(this,a):new this};e.partial=function(){var a=this,b=j(arguments); | ||
return function(){return a.apply(this,f.concat.apply(b,arguments))}};e.byWords=function(a){var b=this;a|=0;return function(){var c=this,d=c,h=arguments;(h[a]||"").replace(/[-\w]+/g,function(f){h[a]=f;d=b.apply(c,h)});return d}};e.byKeyVal=function(){var a=this;return function(b){var c,d=j(arguments);if("object"==typeof b)for(c in b)d[0]=c,d[1]=b[c],c=a.apply(this,d);else c=a.apply(this,d);return c}};e.cache=function(a,b,c){var d=this,h=c||{},e=function(){var c=arguments,g=!!a||this instanceof e,j= | ||
b?b(c,d):g+":"+c.length+":"+f.join.call(c);return j in h?h[j]:h[j]=g?d.construct(c):d.apply(this,c)};e.origin=d;e.cached=h;e.extend=function(){return d.extend.apply(d,arguments).cache(a,b,h)};e.prototype=d.prototype;return e};e.extend=function(){var a,b=this,c=0,d=function(){return b.apply(this,arguments)};d.prototype=Object.create(b.prototype);for(d.prototype.constructor=d;a=arguments[c++];)Object.merge(d.prototype,a);return d};e.ttl=function(a,b){var c=this,d=setTimeout(function(){a=0;b&&b()},a); | ||
!function(n){function g(a){if(g[a])return g[a];for(var b="_",c=a,d=a.split("->");1<d.length;)c=d.pop(),b=d.pop().match(/\w+/g)||"",d.length&&d.push("(function("+b+"){return("+c+")})");return g[a]=new Function(b,"return("+c+")")}var f=Array.prototype,e=Function.prototype,l=String.prototype,k=Object,h=e.call.bind(f.slice),m=[];e.construct=function(a){var b=a.length;return b?(m[b]||(m[b]=g("t a->new t(a["+Object.keys(h(a)).join("],a[")+"])")))(this,a):new this};e.partial=function(){var a=this,b=h(arguments); | ||
return function(){return a.apply(this,f.concat.apply(b,arguments))}};e.byWords=function(a){var b=this;a|=0;return function(){var c=this,d=c,f=arguments;(f[a]||"").replace(/[-\w]+/g,function(e){f[a]=e;d=b.apply(c,f)});return d}};e.byKeyVal=function(){var a=this;return function(b){var c,d=h(arguments);if("object"==typeof b)for(c in b)d[0]=c,d[1]=b[c],c=a.apply(this,d);else c=a.apply(this,d);return c}};e.cache=function(a,b,c){var d=this,e=c||{},j=function(){var c=arguments,g=!!a||this instanceof j,h= | ||
b?b(c,d):g+":"+c.length+":"+f.join.call(c);return h in e?e[h]:e[h]=g?d.construct(c):d.apply(this,c)};j.origin=d;j.cached=e;j.extend=function(){return d.extend.apply(d,arguments).cache(a,b)};j.prototype=d.prototype;return j};e.extend=function(){var a,b=this,c=0,d=function(){return b.apply(this,arguments)};d.prototype=Object.create(b.prototype);for(d.prototype.constructor=d;a=arguments[c++];)Object.merge(d.prototype,a);return d};e.ttl=function(a,b){var c=this,d=setTimeout(function(){a=0;b&&b()},a); | ||
return function(){clearTimeout(d);a&&c.apply(null,arguments)}};e.once=function(a){var b,c,d=this;return function(){clearTimeout(b);c=arguments;b=setTimeout(function(){d.apply(null,c)},a)}};e.rate=function(a,b){var c,d,e=this,f=0;return function(){var g=+new Date;clearTimeout(c);g>f?(f=g+a,e.apply(null,arguments)):b&&(d=arguments,c=setTimeout(function(){e.apply(null,d)},f-g))}};k.each=function(a,b,c,d){if(a)for(d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a)};k.merge=function(a){for(var b,c,d=1;c=arguments[d++];)for(b in c)c.hasOwnProperty(b)&& | ||
(a[b]=c[b]);return a};k.zip=function(a,b){return a.fold(function(a,d,e){a[d]=b[e];return a},{})};f.remove=function(){for(var a=this.length,b=j(arguments),c=-1;a--;)~b.indexOf(this[a])&&this.splice(c=a,1);return c};f.each=f.forEach;f.fold=f.reduce;f.foldr=f.reduceRight;f.unique=f.filter.partial(function(a,b,c){return b==c.lastIndexOf(a)});!function(a){e[a]=l[a]=function(){var b=arguments,c=b[0];b[0]=this.fn();return f[a].apply(c,b)}}.byWords()("every filter each map fold foldr some");e.fn=This;l.fn= | ||
(a[b]=c[b]);return a};k.zip=function(a,b){return a.fold(function(a,d,e){a[d]=b[e];return a},{})};f.remove=function(){for(var a=this.length,b=h(arguments),c=-1;a--;)~b.indexOf(this[a])&&this.splice(c=a,1);return c};f.each=f.forEach;f.fold=f.reduce;f.foldr=f.reduceRight;f.unique=f.filter.partial(function(a,b,c){return b==c.lastIndexOf(a)});!function(a){e[a]=l[a]=function(){var b=arguments,c=b[0];b[0]=this.fn();return f[a].apply(c,b)}}.byWords()("every filter each map fold foldr some");e.fn=This;l.fn= | ||
function(){return g(this)};n.Fn=g}(this); |
{ | ||
"name": "functional-lite", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Functional Javascript", |
@@ -11,3 +11,3 @@ | ||
Download [compressed][1] | ||
(2781 bytes, 1193 bytes gzipped) | ||
(2779 bytes, 1196 bytes gzipped) | ||
or [uncompressed][2] source. | ||
@@ -14,0 +14,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
19511