Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- new travis ci support

  • Loading branch information...
commit 745a21f259c6774c8cb3bd9b1977620447f3aabe 1 parent 9af5493
@ded authored
Showing with 27 additions and 5 deletions.
  1. +10 −0 .travis.yml
  2. +5 −2 package.json
  3. +11 −2 valentine.js
  4. +1 −1  valentine.min.js
View
10 .travis.yml
@@ -0,0 +1,10 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
+branches:
+ only:
+ - master
+notifications:
+ email:
+ - dustin@dustindiaz.com
View
7 package.json
@@ -1,7 +1,7 @@
{
"name": "valentine"
, "description": "JavaScripts Functional Sister. Utilitiy, Iterators, type checking"
- , "version": "1.4.7"
+ , "version": "1.5.0"
, "homepage": "https://github.com/ded/valentine"
, "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"
, "keywords": ["ender", "functional", "iteration", "type checking", "base"]
@@ -12,6 +12,9 @@
, "url": "https://github.com/ded/valentine.git"
}
, "devDependencies": {
- "sink-test": ">= 0.0.9"
+ "sink-test": ">= 1.0.1"
+ }
+ , "scripts": {
+ "test": "make test"
}
}
View
13 valentine.js
@@ -416,8 +416,17 @@
}
, bind: function (scope, fn) {
+ var args = arguments.length > 2 ? slice.call(arguments, 2) : null
return function () {
- fn.apply(scope, arguments)
+ return fn.apply(scope, args ? args.concat(slice.call(arguments)) : arguments)
+ }
+ }
+
+ , curry: function (fn) {
+ if (arguments.length == 1) return fn
+ var args = slice.call(arguments, 1)
+ return function () {
+ return fn.apply(null, args.concat(slice.call(arguments)))
}
}
@@ -534,4 +543,4 @@
}
return v
-})
+})
View
2  valentine.min.js
@@ -4,4 +4,4 @@
* https://github.com/ded/valentine
* License MIT
*/
-!function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"?define(b):this[a]=this.v=b()}("valentine",function(){function n(a){this.values=a,this.index=0}function o(a,b){return new q(a,b)}function p(a,b){for(var c in b)a[c]=b[c]}function q(a,b){this.val=a,this._scope=b||e,this._chained=0}var a=this,b=a.v,c=[],d={},e=null,f=c.slice,g="map"in c,h="reduce"in c,i=/(^\s*|\s*$)/g,j={each:g?function(a,b,d){c.forEach.call(a,b,d)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)d in a&&b.call(c,a[d],d,a)},map:g?function(a,b,d){return c.map.call(a,b,d)}:function(a,b,c){var d=[],e;for(e=0,l=a.length;e<l;e++)e in a&&(d[e]=b.call(c,a[e],e,a));return d},some:g?function(a,b,c){return a.some(b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(d in a&&b.call(c,a[d],d,a))return!0;return!1},every:g?function(a,b,c){return a.every(b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(d in a&&!b.call(c,a[d],d,a))return!1;return!0},filter:g?function(a,b,c){return a.filter(b,c)}:function(a,b,c){for(var d=[],e=0,f=0,g=a.length;e<g;e++)if(e in a){if(!b.call(c,a[e],e,a))continue;d[f++]=a[e]}return d},indexOf:g?function(a,b,c){return a.indexOf(b,isFinite(c)?c:0)}:function(a,b,c){c=c||0;for(var d=0;d<a.length;d++)if(d in a&&a[d]===b)return d;return-1},lastIndexOf:g?function(a,b,c){return a.lastIndexOf(b,isFinite(c)?c:a.length)}:function(a,b,c){c=c||a.length,c=c>=a.length?a.length:c<0?a.length+c:c;for(var d=c;d>=0;--d)if(d in a&&a[d]===b)return d;return-1},reduce:h?function(a,b,d,e){return c.reduce.call(a,b,d,e)}:function(a,b,c,d){a||(a=[]);var e=0,f=a.length;if(arguments.length<3)do{if(e in a){c=a[e++];break}if(++e>=f)throw new TypeError("Empty array")}while(1);for(;e<f;e++)e in a&&(c=b.call(d,c,a[e],e,a));return c},reduceRight:h?function(a,b,d,e){return c.reduceRight.call(a,b,d,e)}:function(a,b,c,d){!a&&(a=[]);var e=a.length,f=e-1;if(arguments.length<3)do{if(f in a){c=a[f--];break}if(--f<0)throw new TypeError("Empty array")}while(1);for(;f>=0;f--)f in a&&(c=b.call(d,c,a[f],f,a));return c},find:function(a,b,c){var d;return j.some(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},reject:function(a,b,c){var d=[];for(var e=0,f=0,g=a.length;e<g;e++)if(e in a){if(b.call(c,a[e],e,a))continue;d[f++]=a[e]}return d},size:function(a){return m.toArray(a).length},compact:function(a){return j.filter(a,function(a){return!!a})},flatten:function(a){return j.reduce(a,function(a,b){return k.arr(b)?a.concat(j.flatten(b)):(a[a.length]=b,a)},[])},uniq:function(a){var b=[],c,d;a:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue a;b[b.length]=a[c]}return b},merge:function(a,b){var c=a.length,d=0,e;if(isFinite(b.length))for(e=b.length;d<e;d++)a[c++]=b[d];else while(b[d]!==undefined)first[c++]=second[d++];return a.length=c,a},inArray:function(a,b){return!!~j.indexOf(a,b)}},k={fun:function(a){return typeof a=="function"},str:function(a){return typeof a=="string"},ele:function(a){!!a&&!!a.nodeType&&a.nodeType==1},arr:function(a){return a instanceof Array},arrLike:function(a){return a&&a.length&&isFinite(a.length)},num:function(a){return typeof a=="number"},bool:function(a){return a===!0||a===!1},args:function(a){return!!a&&!!d.hasOwnProperty.call(a,"callee")},emp:function(a){var b=0;return k.arr(a)?a.length===0:k.obj(a)?function(){for(var c in a){b++;break}return b===0}():a===""},dat:function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},reg:function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},nan:function(a){return a!==a},nil:function(a){return a===e},und:function(a){return typeof a=="undefined"},def:function(a){return typeof a!="undefined"},obj:function(a){return a instanceof Object&&!k.fun(a)&&!k.arr(a)}},m={each:function(a,b,c){k.arrLike(a)?j.each(a,b,c):function(){for(var e in a)d.hasOwnProperty.call(a,e)&&b.call(c,e,a[e],a)}()},map:function(a,b,c){var e=[],f=0;return k.arrLike(a)?j.map(a,b,c):!function(){for(var g in a)d.hasOwnProperty.call(a,g)&&(e[f++]=b.call(c,g,a[g],a))}()&&e},pluck:function(a,b){return k.arrLike(a)?j.map(a,function(a){return a[b]}):m.map(a,function(a,c){return c[b]})},toArray:function(a){return a?k.arr(a)?a:a.toArray?a.toArray():k.args(a)?f.call(a):j.map(a,function(a){return a}):[]},first:function(a){return a[0]},last:function(a){return a[a.length-1]},keys:Object.keys?function(a){return Object.keys(a)}:function(a){var b=[],c;for(c in a)d.hasOwnProperty.call(a,c)&&(b[b.length]=c);return b},values:function(a){return m.map(a,function(a,b){return b})},extend:function(){var a,b,c,d,f,g=arguments[0],h=1,i=arguments.length;for(;h<i;h++)if((a=arguments[h])!==e)for(b in a){c=g[b],d=a[b];if(g===d)continue;d&&k.obj(d)?(f=c&&k.obj(c)?c:{},g[b]=m.extend(f,d)):d!==undefined&&(g[b]=d)}return g},trim:String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(i,"")},bind:function(a,b){return function(){b.apply(a,arguments)}},parallel:function(a,b){var c=m.toArray(arguments),d=0,f=[],g=[];k.arr(a)||(b=c.pop(),a=c),j.each(a,function(c,h){c(function(){var c=m.toArray(arguments),i=c.shift();if(i)return b(i);f[h]=c,a.length==++d&&(f.unshift(e),j.each(f,function(a){g=g.concat(a)}),b.apply(e,g))})})},waterfall:function(a,b){var c=m.toArray(arguments),d=0;k.arr(a)||(b=c.pop(),a=c),function f(){var c=m.toArray(arguments);c.push(f);var d=c.shift();!d&&a.length?a.shift().apply(e,c):(c.pop(),c.unshift(d),b.apply(e,c))}(e)},queue:function(a){return new n(k.arrLike(a)?a:m.toArray(arguments))}};return n.prototype.next=function(){return this.index<this.values.length&&this.values[this.index++](),this},p(o,j),p(o,m),o.is=k,o.v=o,o.each(o.extend({},j,m),function(a,b){q.prototype[a]=function(){var a=o.toArray(arguments);a.unshift(this.val);var c=b.apply(this._scope,a);return this.val=c,this._chained?this:c}}),p(q.prototype,{chain:function(){return this._chained=1,this},value:function(){return this.val}}),o.noConflict=function(){return a.v=b,this},o})
+!function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"?define(b):this[a]=this.v=b()}("valentine",function(){function n(a){this.values=a,this.index=0}function o(a,b){return new q(a,b)}function p(a,b){for(var c in b)a[c]=b[c]}function q(a,b){this.val=a,this._scope=b||e,this._chained=0}var a=this,b=a.v,c=[],d={},e=null,f=c.slice,g="map"in c,h="reduce"in c,i=/(^\s*|\s*$)/g,j={each:g?function(a,b,d){c.forEach.call(a,b,d)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)d in a&&b.call(c,a[d],d,a)},map:g?function(a,b,d){return c.map.call(a,b,d)}:function(a,b,c){var d=[],e;for(e=0,l=a.length;e<l;e++)e in a&&(d[e]=b.call(c,a[e],e,a));return d},some:g?function(a,b,c){return a.some(b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(d in a&&b.call(c,a[d],d,a))return!0;return!1},every:g?function(a,b,c){return a.every(b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(d in a&&!b.call(c,a[d],d,a))return!1;return!0},filter:g?function(a,b,c){return a.filter(b,c)}:function(a,b,c){for(var d=[],e=0,f=0,g=a.length;e<g;e++)if(e in a){if(!b.call(c,a[e],e,a))continue;d[f++]=a[e]}return d},indexOf:g?function(a,b,c){return a.indexOf(b,isFinite(c)?c:0)}:function(a,b,c){c=c||0;for(var d=0;d<a.length;d++)if(d in a&&a[d]===b)return d;return-1},lastIndexOf:g?function(a,b,c){return a.lastIndexOf(b,isFinite(c)?c:a.length)}:function(a,b,c){c=c||a.length,c=c>=a.length?a.length:c<0?a.length+c:c;for(var d=c;d>=0;--d)if(d in a&&a[d]===b)return d;return-1},reduce:h?function(a,b,d,e){return c.reduce.call(a,b,d,e)}:function(a,b,c,d){a||(a=[]);var e=0,f=a.length;if(arguments.length<3)do{if(e in a){c=a[e++];break}if(++e>=f)throw new TypeError("Empty array")}while(1);for(;e<f;e++)e in a&&(c=b.call(d,c,a[e],e,a));return c},reduceRight:h?function(a,b,d,e){return c.reduceRight.call(a,b,d,e)}:function(a,b,c,d){!a&&(a=[]);var e=a.length,f=e-1;if(arguments.length<3)do{if(f in a){c=a[f--];break}if(--f<0)throw new TypeError("Empty array")}while(1);for(;f>=0;f--)f in a&&(c=b.call(d,c,a[f],f,a));return c},find:function(a,b,c){var d;return j.some(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},reject:function(a,b,c){var d=[];for(var e=0,f=0,g=a.length;e<g;e++)if(e in a){if(b.call(c,a[e],e,a))continue;d[f++]=a[e]}return d},size:function(a){return m.toArray(a).length},compact:function(a){return j.filter(a,function(a){return!!a})},flatten:function(a){return j.reduce(a,function(a,b){return k.arr(b)?a.concat(j.flatten(b)):(a[a.length]=b,a)},[])},uniq:function(a){var b=[],c,d;a:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue a;b[b.length]=a[c]}return b},merge:function(a,b){var c=a.length,d=0,e;if(isFinite(b.length))for(e=b.length;d<e;d++)a[c++]=b[d];else while(b[d]!==undefined)first[c++]=second[d++];return a.length=c,a},inArray:function(a,b){return!!~j.indexOf(a,b)}},k={fun:function(a){return typeof a=="function"},str:function(a){return typeof a=="string"},ele:function(a){!!a&&!!a.nodeType&&a.nodeType==1},arr:function(a){return a instanceof Array},arrLike:function(a){return a&&a.length&&isFinite(a.length)},num:function(a){return typeof a=="number"},bool:function(a){return a===!0||a===!1},args:function(a){return!!a&&!!d.hasOwnProperty.call(a,"callee")},emp:function(a){var b=0;return k.arr(a)?a.length===0:k.obj(a)?function(){for(var c in a){b++;break}return b===0}():a===""},dat:function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},reg:function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},nan:function(a){return a!==a},nil:function(a){return a===e},und:function(a){return typeof a=="undefined"},def:function(a){return typeof a!="undefined"},obj:function(a){return a instanceof Object&&!k.fun(a)&&!k.arr(a)}},m={each:function(a,b,c){k.arrLike(a)?j.each(a,b,c):function(){for(var e in a)d.hasOwnProperty.call(a,e)&&b.call(c,e,a[e],a)}()},map:function(a,b,c){var e=[],f=0;return k.arrLike(a)?j.map(a,b,c):!function(){for(var g in a)d.hasOwnProperty.call(a,g)&&(e[f++]=b.call(c,g,a[g],a))}()&&e},pluck:function(a,b){return k.arrLike(a)?j.map(a,function(a){return a[b]}):m.map(a,function(a,c){return c[b]})},toArray:function(a){return a?k.arr(a)?a:a.toArray?a.toArray():k.args(a)?f.call(a):j.map(a,function(a){return a}):[]},first:function(a){return a[0]},last:function(a){return a[a.length-1]},keys:Object.keys?function(a){return Object.keys(a)}:function(a){var b=[],c;for(c in a)d.hasOwnProperty.call(a,c)&&(b[b.length]=c);return b},values:function(a){return m.map(a,function(a,b){return b})},extend:function(){var a,b,c,d,f,g=arguments[0],h=1,i=arguments.length;for(;h<i;h++)if((a=arguments[h])!==e)for(b in a){c=g[b],d=a[b];if(g===d)continue;d&&k.obj(d)?(f=c&&k.obj(c)?c:{},g[b]=m.extend(f,d)):d!==undefined&&(g[b]=d)}return g},trim:String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(i,"")},bind:function(a,b){var c=arguments.length>2?f.call(arguments,2):null;return function(){return b.apply(a,c?c.concat(f.call(arguments)):arguments)}},curry:function(a){if(arguments.length==1)return a;var b=f.call(arguments,1);return function(){return a.apply(null,b.concat(f.call(arguments)))}},parallel:function(a,b){var c=m.toArray(arguments),d=0,f=[],g=[];k.arr(a)||(b=c.pop(),a=c),j.each(a,function(c,h){c(function(){var c=m.toArray(arguments),i=c.shift();if(i)return b(i);f[h]=c,a.length==++d&&(f.unshift(e),j.each(f,function(a){g=g.concat(a)}),b.apply(e,g))})})},waterfall:function(a,b){var c=m.toArray(arguments),d=0;k.arr(a)||(b=c.pop(),a=c),function f(){var c=m.toArray(arguments);c.push(f);var d=c.shift();!d&&a.length?a.shift().apply(e,c):(c.pop(),c.unshift(d),b.apply(e,c))}(e)},queue:function(a){return new n(k.arrLike(a)?a:m.toArray(arguments))}};return n.prototype.next=function(){return this.index<this.values.length&&this.values[this.index++](),this},p(o,j),p(o,m),o.is=k,o.v=o,o.each(o.extend({},j,m),function(a,b){q.prototype[a]=function(){var a=o.toArray(arguments);a.unshift(this.val);var c=b.apply(this._scope,a);return this.val=c,this._chained?this:c}}),p(q.prototype,{chain:function(){return this._chained=1,this},value:function(){return this.val}}),o.noConflict=function(){return a.v=b,this},o})
Please sign in to comment.
Something went wrong with that request. Please try again.