made with requirebin
Created
March 24, 2015 20:09
-
-
Save efleming969/b14adb96be59de88db0e to your computer and use it in GitHub Desktop.
requirebin sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var R = require("ramda") | |
| var _ = require("underscore") | |
| var tasks = [ | |
| { username: 'Scott' | |
| , title: 'remember milk' | |
| , dueDate: '2015-04-01' | |
| , complete: false | |
| , priority: 'medium' | |
| } | |
| , { username: 'Michael' | |
| , title: 'finish painting' | |
| , dueDate: '2015-04-02' | |
| , complete: true | |
| , priority: 'high' | |
| } | |
| ] | |
| var incompleteTasks0 = tasks.filter( function(task) { | |
| return !task.complete | |
| } ) | |
| var incompleteTasks1 = _.filter( tasks , { complete: false } ) | |
| var incomplete = R.filter( R.where( {complete: false} ) ) | |
| console.log( incompleteTasks0 ) | |
| console.log( incompleteTasks1 ) | |
| console.log( incomplete( tasks ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({ramda:[function(require,module,exports){(function(){"use strict";var __={ramda:"placeholder"};var _add=function _add(a,b){return a+b};var _all=function _all(fn,list){var idx=-1;while(++idx<list.length){if(!fn(list[idx])){return false}}return true};var _any=function _any(fn,list){var idx=-1;while(++idx<list.length){if(fn(list[idx])){return true}}return false};var _assoc=function _assoc(prop,val,obj){var result={};for(var p in obj){result[p]=obj[p]}result[prop]=val;return result};var _cloneRegExp=function _cloneRegExp(pattern){return new RegExp(pattern.source,(pattern.global?"g":"")+(pattern.ignoreCase?"i":"")+(pattern.multiline?"m":"")+(pattern.sticky?"y":"")+(pattern.unicode?"u":""))};var _complement=function _complement(f){return function(){return!f.apply(this,arguments)}};var _compose=function _compose(f,g){return function(){return f.call(this,g.apply(this,arguments))}};var _concat=function _concat(set1,set2){set1=set1||[];set2=set2||[];var idx;var len1=set1.length;var len2=set2.length;var result=[];idx=-1;while(++idx<len1){result[result.length]=set1[idx]}idx=-1;while(++idx<len2){result[result.length]=set2[idx]}return result};var _containsWith=function _containsWith(pred,x,list){var idx=-1,len=list.length;while(++idx<len){if(pred(x,list[idx])){return true}}return false};var _createMapEntry=function _createMapEntry(key,val){var obj={};obj[key]=val;return obj};var _createMaxMinBy=function _createMaxMinBy(comparator){return function(valueComputer,list){if(!(list&&list.length>0)){return}var idx=0;var winner=list[idx];var computedWinner=valueComputer(winner);var computedCurrent;while(++idx<list.length){computedCurrent=valueComputer(list[idx]);if(comparator(computedCurrent,computedWinner)){computedWinner=computedCurrent;winner=list[idx]}}return winner}};var _curry1=function _curry1(fn){return function f1(a){if(arguments.length===0){return f1}else if(a===__){return f1}else{return fn(a)}}};var _curry2=function _curry2(fn){return function f2(a,b){var n=arguments.length;if(n===0){return f2}else if(n===1&&a===__){return f2}else if(n===1){return _curry1(function(b){return fn(a,b)})}else if(n===2&&a===__&&b===__){return f2}else if(n===2&&a===__){return _curry1(function(a){return fn(a,b)})}else if(n===2&&b===__){return _curry1(function(b){return fn(a,b)})}else{return fn(a,b)}}};var _curry3=function _curry3(fn){return function f3(a,b,c){var n=arguments.length;if(n===0){return f3}else if(n===1&&a===__){return f3}else if(n===1){return _curry2(function(b,c){return fn(a,b,c)})}else if(n===2&&a===__&&b===__){return f3}else if(n===2&&a===__){return _curry2(function(a,c){return fn(a,b,c)})}else if(n===2&&b===__){return _curry2(function(b,c){return fn(a,b,c)})}else if(n===2){return _curry1(function(c){return fn(a,b,c)})}else if(n===3&&a===__&&b===__&&c===__){return f3}else if(n===3&&a===__&&b===__){return _curry2(function(a,b){return fn(a,b,c)})}else if(n===3&&a===__&&c===__){return _curry2(function(a,c){return fn(a,b,c)})}else if(n===3&&b===__&&c===__){return _curry2(function(b,c){return fn(a,b,c)})}else if(n===3&&a===__){return _curry1(function(a){return fn(a,b,c)})}else if(n===3&&b===__){return _curry1(function(b){return fn(a,b,c)})}else if(n===3&&c===__){return _curry1(function(c){return fn(a,b,c)})}else{return fn(a,b,c)}}};var _dissoc=function _dissoc(prop,obj){var result={};for(var p in obj){if(p!==prop){result[p]=obj[p]}}return result};var _filter=function _filter(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){if(fn(list[idx])){result[result.length]=list[idx]}}return result};var _filterIndexed=function _filterIndexed(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){if(fn(list[idx],idx,list)){result[result.length]=list[idx]}}return result};var _forEach=function _forEach(fn,list){var idx=-1,len=list.length;while(++idx<len){fn(list[idx])}return list};var _functionsWith=function _functionsWith(fn){return function(obj){return _filter(function(key){return typeof obj[key]==="function"},fn(obj))}};var _gt=function _gt(a,b){return a>b};var _has=function _has(prop,obj){return Object.prototype.hasOwnProperty.call(obj,prop)};var _identity=function _identity(x){return x};var _indexOf=function _indexOf(list,item,from){var idx=0,len=list.length;if(typeof from=="number"){idx=from<0?Math.max(0,len+from):from}while(idx<len){if(list[idx]===item){return idx}++idx}return-1};var _isArray=Array.isArray||function _isArray(val){return val!=null&&val.length>=0&&Object.prototype.toString.call(val)==="[object Array]"};var _isInteger=Number.isInteger||function _isInteger(n){return n<<0===n};var _isThenable=function _isThenable(value){return value!=null&&value===Object(value)&&typeof value.then==="function"};var _isTransformer=function _isTransformer(obj){return typeof obj.step==="function"&&typeof obj.result==="function"};var _lastIndexOf=function _lastIndexOf(list,item,from){var idx=list.length;if(typeof from=="number"){idx=from<0?idx+from+1:Math.min(idx,from+1)}while(--idx>=0){if(list[idx]===item){return idx}}return-1};var _lt=function _lt(a,b){return a<b};var _map=function _map(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){result[idx]=fn(list[idx])}return result};var _multiply=function _multiply(a,b){return a*b};var _nth=function _nth(n,list){return n<0?list[list.length+n]:list[n]};var _path=function _path(paths,obj){if(obj==null||paths.length===0){return}else{var val=obj;for(var idx=0,len=paths.length;idx<len&&val!=null;idx+=1){val=val[paths[idx]]}return val}};var _prepend=function _prepend(el,list){return _concat([el],list)};var _reduced=function(x){return x&&x.__transducers_reduced__?x:{value:x,__transducers_reduced__:true}};var _satisfiesSpec=function _satisfiesSpec(spec,parsedSpec,testObj){if(spec===testObj){return true}if(testObj==null){return false}parsedSpec.fn=parsedSpec.fn||[];parsedSpec.obj=parsedSpec.obj||[];var key,val,idx=-1,fnLen=parsedSpec.fn.length,j=-1,objLen=parsedSpec.obj.length;while(++idx<fnLen){key=parsedSpec.fn[idx];val=spec[key];if(!(key in testObj)){return false}if(!val(testObj[key],testObj)){return false}}while(++j<objLen){key=parsedSpec.obj[j];if(spec[key]!==testObj[key]){return false}}return true};var _slice=function _slice(args,from,to){switch(arguments.length){case 1:return _slice(args,0,args.length);case 2:return _slice(args,from,args.length);default:var length=Math.max(0,to-from),list=[],idx=-1;while(++idx<length){list[idx]=args[from+idx]}return list}};var _xall=function(){function XAll(f,xf){this.xf=xf;this.f=f;this.all=true}XAll.prototype.init=function(){return this.xf.init()};XAll.prototype.result=function(result){if(this.all){result=this.xf.step(result,true)}return this.xf.result(result)};XAll.prototype.step=function(result,input){if(!this.f(input)){this.all=false;result=_reduced(this.xf.step(result,false))}return result};return _curry2(function _xall(f,xf){return new XAll(f,xf)})}();var _xany=function(){function XAny(f,xf){this.xf=xf;this.f=f;this.any=false}XAny.prototype.init=function(){return this.xf.init()};XAny.prototype.result=function(result){if(!this.any){result=this.xf.step(result,false)}return this.xf.result(result)};XAny.prototype.step=function(result,input){if(this.f(input)){this.any=true;result=_reduced(this.xf.step(result,true))}return result};return _curry2(function _xany(f,xf){return new XAny(f,xf)})}();var _xdrop=function(){function XDrop(n,xf){this.xf=xf;this.n=n}XDrop.prototype.init=function(){return this.xf.init()};XDrop.prototype.result=function(result){return this.xf.result(result)};XDrop.prototype.step=function(result,input){if(this.n>0){this.n-=1;return result}return this.xf.step(result,input)};return _curry2(function _xdrop(n,xf){return new XDrop(n,xf)})}();var _xdropWhile=function(){function XDropWhile(f,xf){this.xf=xf;this.f=f}XDropWhile.prototype.init=function(){return this.xf.init()};XDropWhile.prototype.result=function(result){return this.xf.result(result)};XDropWhile.prototype.step=function(result,input){if(this.f){if(this.f(input)){return result}this.f=null}return this.xf.step(result,input)};return _curry2(function _xdropWhile(f,xf){return new XDropWhile(f,xf)})}();var _xfilter=function(){function XFilter(f,xf){this.xf=xf;this.f=f}XFilter.prototype.init=function(){return this.xf.init()};XFilter.prototype.result=function(result){return this.xf.result(result)};XFilter.prototype.step=function(result,input){return this.f(input)?this.xf.step(result,input):result};return _curry2(function _xfilter(f,xf){return new XFilter(f,xf)})}();var _xfind=function(){function XFind(f,xf){this.xf=xf;this.f=f;this.found=false}XFind.prototype.init=function(){return this.xf.init()};XFind.prototype.result=function(result){if(!this.found){result=this.xf.step(result,void 0)}return this.xf.result(result)};XFind.prototype.step=function(result,input){if(this.f(input)){this.found=true;result=_reduced(this.xf.step(result,input))}return result};return _curry2(function _xfind(f,xf){return new XFind(f,xf)})}();var _xfindIndex=function(){function XFindIndex(f,xf){this.xf=xf;this.f=f;this.idx=-1;this.found=false}XFindIndex.prototype.init=function(){return this.xf.init()};XFindIndex.prototype.result=function(result){if(!this.found){result=this.xf.step(result,-1)}return this.xf.result(result)};XFindIndex.prototype.step=function(result,input){this.idx+=1;if(this.f(input)){this.found=true;result=_reduced(this.xf.step(result,this.idx))}return result};return _curry2(function _xfindIndex(f,xf){return new XFindIndex(f,xf)})}();var _xfindLast=function(){function XFindLast(f,xf){this.xf=xf;this.f=f}XFindLast.prototype.init=function(){return this.xf.init()};XFindLast.prototype.result=function(result){return this.xf.result(this.xf.step(result,this.last))};XFindLast.prototype.step=function(result,input){if(this.f(input)){this.last=input}return result};return _curry2(function _xfindLast(f,xf){return new XFindLast(f,xf)})}();var _xfindLastIndex=function(){function XFindLastIndex(f,xf){this.xf=xf;this.f=f;this.idx=-1;this.lastIdx=-1}XFindLastIndex.prototype.init=function(){return this.xf.init()};XFindLastIndex.prototype.result=function(result){return this.xf.result(this.xf.step(result,this.lastIdx))};XFindLastIndex.prototype.step=function(result,input){this.idx+=1;if(this.f(input)){this.lastIdx=this.idx}return result};return _curry2(function _xfindLastIndex(f,xf){return new XFindLastIndex(f,xf)})}();var _xmap=function(){function XMap(f,xf){this.xf=xf;this.f=f}XMap.prototype.init=function(){return this.xf.init()};XMap.prototype.result=function(result){return this.xf.result(result)};XMap.prototype.step=function(result,input){return this.xf.step(result,this.f(input))};return _curry2(function _xmap(f,xf){return new XMap(f,xf)})}();var _xtake=function(){function XTake(n,xf){this.xf=xf;this.n=n}XTake.prototype.init=function(){return this.xf.init()};XTake.prototype.result=function(result){return this.xf.result(result)};XTake.prototype.step=function(result,input){this.n-=1;return this.n===0?_reduced(this.xf.step(result,input)):this.xf.step(result,input)};return _curry2(function _xtake(n,xf){return new XTake(n,xf)})}();var _xtakeWhile=function(){function XTakeWhile(f,xf){this.xf=xf;this.f=f}XTakeWhile.prototype.init=function(){return this.xf.init()};XTakeWhile.prototype.result=function(result){return this.xf.result(result)};XTakeWhile.prototype.step=function(result,input){return this.f(input)?this.xf.step(result,input):_reduced(result)};return _curry2(function _xtakeWhile(f,xf){return new XTakeWhile(f,xf)})}();var _xwrap=function(){function XWrap(fn){this.f=fn}XWrap.prototype.init=function(){throw new Error("init not implemented on XWrap")};XWrap.prototype.result=function(acc){return acc};XWrap.prototype.step=function(acc,x){return this.f(acc,x)};return function _xwrap(fn){return new XWrap(fn)}}();var add=_curry2(_add);var always=_curry1(function always(val){return function(){return val}});var and=_curry2(function and(a,b){return a&&b});var aperture=_curry2(function aperture(n,list){var idx=-1;var limit=list.length-(n-1);var acc=new Array(limit>=0?limit:0);while(++idx<limit){acc[idx]=_slice(list,idx,idx+n)}return acc});var apply=_curry2(function apply(fn,args){return fn.apply(this,args)});var arity=_curry2(function(n,fn){switch(n){case 0:return function(){return fn.apply(this,arguments)};case 1:return function(a0){void a0;return fn.apply(this,arguments)};case 2:return function(a0,a1){void a1;return fn.apply(this,arguments)};case 3:return function(a0,a1,a2){void a2;return fn.apply(this,arguments)};case 4:return function(a0,a1,a2,a3){void a3;return fn.apply(this,arguments)};case 5:return function(a0,a1,a2,a3,a4){void a4;return fn.apply(this,arguments)};case 6:return function(a0,a1,a2,a3,a4,a5){void a5;return fn.apply(this,arguments)};case 7:return function(a0,a1,a2,a3,a4,a5,a6){void a6;return fn.apply(this,arguments)};case 8:return function(a0,a1,a2,a3,a4,a5,a6,a7){void a7;return fn.apply(this,arguments)};case 9:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8){void a8;return fn.apply(this,arguments)};case 10:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9){void a9;return fn.apply(this,arguments)};default:throw new Error("First argument to arity must be a non-negative integer no greater than ten")}});var assoc=_curry3(_assoc);var bind=_curry2(function bind(fn,thisObj){return arity(fn.length,function(){return fn.apply(thisObj,arguments)})});var both=_curry2(function both(f,g){return function _both(){return f.apply(this,arguments)&&g.apply(this,arguments)}});var comparator=_curry1(function comparator(pred){return function(a,b){return pred(a,b)?-1:pred(b,a)?1:0}});var complement=_curry1(_complement);var cond=function cond(){var pairs=arguments;return function(){var idx=-1;while(++idx<pairs.length){if(pairs[idx][0].apply(this,arguments)){return pairs[idx][1].apply(this,arguments)}}}};var containsWith=_curry3(_containsWith);var countBy=_curry2(function countBy(fn,list){var counts={};var len=list.length;var idx=-1;while(++idx<len){var key=fn(list[idx]);counts[key]=(_has(key,counts)?counts[key]:0)+1}return counts});var createMapEntry=_curry2(_createMapEntry);var curryN=_curry2(function curryN(length,fn){return arity(length,function(){var n=arguments.length;var shortfall=length-n;var idx=n;while(--idx>=0){if(arguments[idx]===__){shortfall+=1}}if(shortfall<=0){return fn.apply(this,arguments)}else{var initialArgs=_slice(arguments);return curryN(shortfall,function(){var currentArgs=_slice(arguments);var combinedArgs=[];var idx=-1;while(++idx<n){var val=initialArgs[idx];combinedArgs[idx]=val===__?currentArgs.shift():val}return fn.apply(this,combinedArgs.concat(currentArgs))})}})});var dec=add(-1);var defaultTo=_curry2(function defaultTo(d,v){return v==null?d:v});var differenceWith=_curry3(function differenceWith(pred,first,second){var out=[];var idx=-1;var firstLen=first.length;var containsPred=containsWith(pred);while(++idx<firstLen){if(!containsPred(first[idx],second)&&!containsPred(first[idx],out)){out[idx]=first[idx]}}return out});var dissoc=_curry2(_dissoc);var divide=_curry2(function divide(a,b){return a/b});var either=_curry2(function either(f,g){return function _either(){return f.apply(this,arguments)||g.apply(this,arguments)}});var eq=_curry2(function eq(a,b){if(a===0){return 1/a===1/b}else{return a===b||a!==a&&b!==b}});var eqProps=_curry3(function eqProps(prop,obj1,obj2){return obj1[prop]===obj2[prop]});var filterIndexed=_curry2(_filterIndexed);var forEach=_curry2(_forEach);var forEachIndexed=_curry2(function forEachIndexed(fn,list){var idx=-1,len=list.length;while(++idx<len){fn(list[idx],idx,list)}return list});var fromPairs=_curry1(function fromPairs(pairs){var idx=-1,len=pairs.length,out={};while(++idx<len){if(_isArray(pairs[idx])&&pairs[idx].length){out[pairs[idx][0]]=pairs[idx][1]}}return out});var gt=_curry2(_gt);var gte=_curry2(function gte(a,b){return a>=b});var has=_curry2(_has);var hasIn=_curry2(function(prop,obj){return prop in obj});var identity=_curry1(_identity);var ifElse=_curry3(function ifElse(condition,onTrue,onFalse){return curryN(Math.max(condition.length,onTrue.length,onFalse.length),function _ifElse(){return condition.apply(this,arguments)?onTrue.apply(this,arguments):onFalse.apply(this,arguments)})});var inc=add(1);var indexOf=_curry2(function indexOf(target,list){return _indexOf(list,target)});var insertAll=_curry3(function insertAll(idx,elts,list){idx=idx<list.length&&idx>=0?idx:list.length;return _concat(_concat(_slice(list,0,idx),elts),_slice(list,idx))});var is=_curry2(function is(Ctor,val){return val!=null&&val.constructor===Ctor||val instanceof Ctor});var isArrayLike=_curry1(function isArrayLike(x){if(_isArray(x)){return true}if(!x){return false}if(typeof x!=="object"){return false}if(x instanceof String){return false}if(x.nodeType===1){return!!x.length}if(x.length===0){return true}if(x.length>0){return x.hasOwnProperty(0)&&x.hasOwnProperty(x.length-1)}return false});var isEmpty=_curry1(function isEmpty(list){return Object(list).length===0});var isNaN=_curry1(function isNaN(x){return typeof x==="number"&&x!==x});var isNil=_curry1(function isNil(x){return x==null});var isSet=_curry1(function isSet(list){var len=list.length;var idx=-1;while(++idx<len){if(_indexOf(list,list[idx],idx+1)>=0){return false}}return true});var keysIn=_curry1(function keysIn(obj){var prop,ks=[];for(prop in obj){ks[ks.length]=prop}return ks});var lastIndexOf=_curry2(function lastIndexOf(target,list){return _lastIndexOf(list,target)});var length=_curry1(function length(list){return list!=null&&is(Number,list.length)?list.length:NaN});var lens=_curry2(function lens(get,set){var lns=function(a){return get(a)};lns.set=_curry2(set);lns.map=_curry2(function(fn,a){return set(fn(get(a)),a)});return lns});var lensOn=_curry3(function lensOn(get,set,obj){var lns=function(){return get(obj)};lns.set=set;lns.map=function(fn){return set(fn(get(obj)))};return lns});var lt=_curry2(_lt);var lte=_curry2(function lte(a,b){return a<=b});var mapAccum=_curry3(function mapAccum(fn,acc,list){var idx=-1,len=list.length,result=[],tuple=[acc];while(++idx<len){tuple=fn(tuple[0],list[idx]);result[idx]=tuple[1]}return[tuple[0],result]});var mapAccumRight=_curry3(function mapAccumRight(fn,acc,list){var idx=list.length,result=[],tuple=[acc];while(--idx>=0){tuple=fn(tuple[0],list[idx]);result[idx]=tuple[1]}return[tuple[0],result]});var mapIndexed=_curry2(function mapIndexed(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){result[idx]=fn(list[idx],idx,list)}return result});var mathMod=_curry2(function mathMod(m,p){if(!_isInteger(m)){return NaN}if(!_isInteger(p)||p<1){return NaN}return(m%p+p)%p});var maxBy=_curry2(_createMaxMinBy(_gt));var memoize=function(){var repr=function(x){return x+"::"+Object.prototype.toString.call(x)};var serialize=function(args){return args.length+":{"+_map(repr,args).join(",")+"}"};return _curry1(function memoize(fn){var cache={};return function(){var key=serialize(arguments);if(!_has(key,cache)){cache[key]=fn.apply(this,arguments)}return cache[key]}})}();var minBy=_curry2(_createMaxMinBy(_lt));var modulo=_curry2(function modulo(a,b){return a%b});var multiply=_curry2(_multiply);var nAry=_curry2(function(n,fn){switch(n){case 0:return function(){return fn.call(this)};case 1:return function(a0){return fn.call(this,a0)};case 2:return function(a0,a1){return fn.call(this,a0,a1)};case 3:return function(a0,a1,a2){return fn.call(this,a0,a1,a2)};case 4:return function(a0,a1,a2,a3){return fn.call(this,a0,a1,a2,a3)};case 5:return function(a0,a1,a2,a3,a4){return fn.call(this,a0,a1,a2,a3,a4)};case 6:return function(a0,a1,a2,a3,a4,a5){return fn.call(this,a0,a1,a2,a3,a4,a5)};case 7:return function(a0,a1,a2,a3,a4,a5,a6){return fn.call(this,a0,a1,a2,a3,a4,a5,a6)};case 8:return function(a0,a1,a2,a3,a4,a5,a6,a7){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7)};case 9:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7,a8)};case 10:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}});var negate=_curry1(function negate(n){return-n});var not=_curry1(function not(a){return!a});var nth=_curry2(_nth);var nthArg=_curry1(function nthArg(n){return function(){return _nth(n,arguments)}});var nthChar=_curry2(function nthChar(n,str){return str.charAt(n<0?str.length+n:n)});var nthCharCode=_curry2(function nthCharCode(n,str){return str.charCodeAt(n<0?str.length+n:n)});var of=_curry1(function of(x){return[x]});var omit=_curry2(function omit(names,obj){var result={};for(var prop in obj){if(_indexOf(names,prop)<0){result[prop]=obj[prop]}}return result});var once=_curry1(function once(fn){var called=false,result;return function(){if(called){return result}called=true;result=fn.apply(this,arguments);return result}});var or=_curry2(function or(a,b){return a||b});var path=_curry2(_path);var pathEq=_curry3(function pathEq(path,val,obj){return _path(path,obj)===val});var pick=_curry2(function pick(names,obj){var result={};for(var prop in obj){if(_indexOf(names,prop)>=0){result[prop]=obj[prop]}}return result});var pickAll=_curry2(function pickAll(names,obj){var result={};var idx=-1;var len=names.length;while(++idx<len){var name=names[idx];result[name]=obj[name]}return result});var pickBy=_curry2(function pickBy(test,obj){var result={};for(var prop in obj){if(test(obj[prop],prop,obj)){result[prop]=obj[prop]}}return result});var prepend=_curry2(_prepend);var prop=_curry2(function prop(p,obj){return obj[p]});var propEq=_curry3(function propEq(name,val,obj){return obj[name]===val});var propOr=_curry3(function propOr(val,p,obj){return _has(p,obj)?obj[p]:val});var props=_curry2(function props(ps,obj){var len=ps.length;var out=[];var idx=-1;while(++idx<len){out[idx]=obj[ps[idx]]}return out});var range=_curry2(function range(from,to){var result=[];var n=from;while(n<to){result[result.length]=n;n+=1}return result});var reduceIndexed=_curry3(function reduceIndexed(fn,acc,list){var idx=-1,len=list.length;while(++idx<len){acc=fn(acc,list[idx],idx,list)}return acc});var reduceRight=_curry3(function reduceRight(fn,acc,list){var idx=list.length;while(--idx>=0){acc=fn(acc,list[idx])}return acc});var reduceRightIndexed=_curry3(function reduceRightIndexed(fn,acc,list){var idx=list.length;while(--idx>=0){acc=fn(acc,list[idx],idx,list)}return acc});var rejectIndexed=_curry2(function rejectIndexed(fn,list){return _filterIndexed(_complement(fn),list)});var remove=_curry3(function remove(start,count,list){return _concat(_slice(list,0,Math.min(start,list.length)),_slice(list,Math.min(list.length,start+count)))});var replace=_curry3(function replace(regex,replacement,str){return str.replace(regex,replacement)});var reverse=_curry1(function reverse(list){return _slice(list).reverse()});var scan=_curry3(function scan(fn,acc,list){var idx=0,len=list.length+1,result=[acc];while(++idx<len){acc=fn(acc,list[idx-1]);result[idx]=acc}return result});var sortBy=_curry2(function sortBy(fn,list){return _slice(list).sort(function(a,b){var aa=fn(a);var bb=fn(b);return aa<bb?-1:aa>bb?1:0})});var strIndexOf=_curry2(function strIndexOf(c,str){return str.indexOf(c)});var strLastIndexOf=_curry2(function(c,str){return str.lastIndexOf(c)});var subtract=_curry2(function subtract(a,b){return a-b});var tap=_curry2(function tap(fn,x){fn(x);return x});var test=_curry2(function test(pattern,str){return _cloneRegExp(pattern).test(str)});var times=_curry2(function times(fn,n){var len=Number(n);var list=new Array(len);var idx=0;while(idx<len){list[idx]=fn(idx);idx+=1}return list});var toPairs=_curry1(function toPairs(obj){var pairs=[];for(var prop in obj){if(_has(prop,obj)){pairs[pairs.length]=[prop,obj[prop]]}}return pairs});var toPairsIn=_curry1(function toPairsIn(obj){var pairs=[];for(var prop in obj){pairs[pairs.length]=[prop,obj[prop]]}return pairs});var trim=function(){var ws=" \n\f\r "+" \u2028"+"\u2029\ufeff";var zeroWidth="";var hasProtoTrim=typeof String.prototype.trim==="function";if(!hasProtoTrim||(ws.trim()||!zeroWidth.trim())){return _curry1(function trim(str){var beginRx=new RegExp("^["+ws+"]["+ws+"]*");var endRx=new RegExp("["+ws+"]["+ws+"]*$");return str.replace(beginRx,"").replace(endRx,"")})}else{return _curry1(function trim(str){return str.trim()})}}();var type=_curry1(function type(val){return val===null?"Null":val===undefined?"Undefined":Object.prototype.toString.call(val).slice(8,-1)});var unapply=_curry1(function unapply(fn){return function(){return fn(_slice(arguments))}});var unary=_curry1(function unary(fn){return nAry(1,fn)});var unfold=_curry2(function unfold(fn,seed){var pair=fn(seed);var result=[];while(pair&&pair.length){result[result.length]=pair[0];pair=fn(pair[1])}return result});var uniqWith=_curry2(function uniqWith(pred,list){var idx=-1,len=list.length;var result=[],item;while(++idx<len){item=list[idx];if(!_containsWith(pred,item,result)){result[result.length]=item}}return result});var valuesIn=_curry1(function valuesIn(obj){var prop,vs=[];for(prop in obj){vs[vs.length]=obj[prop]}return vs});var wrap=_curry2(function wrap(fn,wrapper){return curryN(fn.length,function(){return wrapper.apply(this,_concat([fn],arguments))})});var xprod=_curry2(function xprod(a,b){var idx=-1;var ilen=a.length;var j;var jlen=b.length;var result=[];while(++idx<ilen){j=-1;while(++j<jlen){result[result.length]=[a[idx],b[j]]}}return result});var zip=_curry2(function zip(a,b){var rv=[];var idx=-1;var len=Math.min(a.length,b.length);while(++idx<len){rv[idx]=[a[idx],b[idx]]}return rv});var zipObj=_curry2(function zipObj(keys,values){var idx=-1,len=keys.length,out={};while(++idx<len){out[keys[idx]]=values[idx]}return out});var zipWith=_curry3(function zipWith(fn,a,b){var rv=[],idx=-1,len=Math.min(a.length,b.length);while(++idx<len){rv[idx]=fn(a[idx],b[idx])}return rv});var F=always(false);var T=always(true);var _append=function _append(el,list){return _concat(list,[el])};var _assocPath=function _assocPath(path,val,obj){switch(path.length){case 0:return obj;case 1:return _assoc(path[0],val,obj);default:return _assoc(path[0],_assocPath(_slice(path,1),val,Object(obj[path[0]])),obj)}};var _baseCopy=function _baseCopy(value,refFrom,refTo){var copy=function copy(copiedValue){var len=refFrom.length;var idx=-1;while(++idx<len){if(value===refFrom[idx]){return refTo[idx]}}refFrom[idx+1]=value;refTo[idx+1]=copiedValue;for(var key in value){copiedValue[key]=_baseCopy(value[key],refFrom,refTo)}return copiedValue};switch(type(value)){case"Object":return copy({});case"Array":return copy([]);case"Date":return new Date(value);case"RegExp":return _cloneRegExp(value);default:return value}};var _checkForMethod=function _checkForMethod(methodname,fn){return function(){var length=arguments.length;if(length===0){return fn()}var obj=arguments[length-1];return _isArray(obj)||typeof obj[methodname]!=="function"?fn.apply(this,arguments):obj[methodname].apply(obj,_slice(arguments,0,length-1))}};var _composeP=function _composeP(f,g){return function(){var context=this;var value=g.apply(this,arguments);if(_isThenable(value)){return value.then(function(result){return f.call(context,result)})}else{return f.call(this,value)}}};var _contains=function _contains(a,list){return _indexOf(list,a)>=0};var _createComposer=function _createComposer(composeFunction){return function(){var idx=arguments.length-1;var fn=arguments[idx];var length=fn.length;while(--idx>=0){fn=composeFunction(arguments[idx],fn)}return arity(length,fn)}};var _createMaxMin=function _createMaxMin(comparator,initialVal){return _curry1(function(list){var idx=-1,winner=initialVal,computed;while(++idx<list.length){computed=+list[idx];if(comparator(computed,winner)){winner=computed}}return winner})};var _createPartialApplicator=function _createPartialApplicator(concat){return function(fn){var args=_slice(arguments,1);return arity(Math.max(0,fn.length-args.length),function(){return fn.apply(this,concat(args,arguments))})}};var _dispatchable=function _dispatchable(methodname,xf,fn){return function(){var length=arguments.length;if(length===0){return fn()}var obj=arguments[length-1];if(!_isArray(obj)){var args=_slice(arguments,0,length-1);if(typeof obj[methodname]==="function"){return obj[methodname].apply(obj,args)}if(_isTransformer(obj)){var transducer=xf.apply(null,args);return transducer(obj)}}return fn.apply(this,arguments)}};var _dissocPath=function _dissocPath(path,obj){switch(path.length){case 0:return obj;case 1:return _dissoc(path[0],obj);default:var head=path[0];var tail=_slice(path,1);return obj[head]==null?obj:_assoc(head,_dissocPath(tail,obj[head]),obj)}};var _hasMethod=function _hasMethod(methodName,obj){return obj!=null&&!_isArray(obj)&&typeof obj[methodName]==="function"};var _makeFlat=function _makeFlat(recursive){return function flatt(list){var value,result=[],idx=-1,j,ilen=list.length,jlen;while(++idx<ilen){if(isArrayLike(list[idx])){value=recursive?flatt(list[idx]):list[idx];j=-1;jlen=value.length;while(++j<jlen){result[result.length]=value[j]}}else{result[result.length]=list[idx]}}return result}};var _pluck=function _pluck(p,list){return _map(prop(p),list)};var _reduce=function(){function _arrayReduce(xf,acc,list){var idx=-1,len=list.length;while(++idx<len){acc=xf.step(acc,list[idx]);if(acc&&acc.__transducers_reduced__){acc=acc.value;break}}return xf.result(acc)}function _iterableReduce(xf,acc,iter){var step=iter.next();while(!step.done){acc=xf.step(acc,step.value);if(acc&&acc.__transducers_reduced__){acc=acc.value;break}step=iter.next()}return xf.result(acc)}function _methodReduce(xf,acc,obj){return xf.result(obj.reduce(bind(xf.step,xf),acc))}var symIterator=typeof Symbol!=="undefined"?Symbol.iterator:"@@iterator";return function _reduce(fn,acc,list){if(typeof fn==="function"){fn=_xwrap(fn)}if(isArrayLike(list)){return _arrayReduce(fn,acc,list)}if(typeof list.reduce==="function"){return _methodReduce(fn,acc,list)}if(list[symIterator]!=null){return _iterableReduce(fn,acc,list[symIterator]())}if(typeof list.next==="function"){return _iterableReduce(fn,acc,list)}throw new TypeError("reduce: list must be array or iterable")}}();var _xgroupBy=function(){function XGroupBy(f,xf){this.xf=xf;this.f=f;this.inputs={}}XGroupBy.prototype.init=function(){return this.xf.init()};XGroupBy.prototype.result=function(result){var key;for(key in this.inputs){if(_has(key,this.inputs)){result=this.xf.step(result,this.inputs[key]);if(result.__transducers_reduced__){result=result.value;break}}}return this.xf.result(result)};XGroupBy.prototype.step=function(result,input){var key=this.f(input);this.inputs[key]=this.inputs[key]||[key,[]];this.inputs[key][1]=_append(input,this.inputs[key][1]);return result};return _curry2(function _xgroupBy(f,xf){return new XGroupBy(f,xf)})}();var all=_curry2(_dispatchable("all",_xall,_all));var any=_curry2(_dispatchable("any",_xany,_any));var append=_curry2(_append);var assocPath=_curry3(_assocPath);var binary=_curry1(function binary(fn){return nAry(2,fn)});var clone=_curry1(function clone(value){return _baseCopy(value,[],[])});var compose=_createComposer(_compose);var composeP=_createComposer(_composeP);var concat=_curry2(function(set1,set2){if(_isArray(set2)){return _concat(set1,set2)}else if(_hasMethod("concat",set1)){return set1.concat(set2)}else{throw new TypeError("can't concat "+typeof set1)}});var contains=_curry2(_contains);var converge=curryN(3,function(after){var fns=_slice(arguments,1);return function(){var args=arguments;return after.apply(this,_map(function(fn){return fn.apply(this,args)},fns))}});var curry=_curry1(function curry(fn){return curryN(fn.length,fn); | |
| });var difference=_curry2(function difference(first,second){var out=[];var idx=-1;var firstLen=first.length;while(++idx<firstLen){if(!_contains(first[idx],second)&&!_contains(first[idx],out)){out[out.length]=first[idx]}}return out});var dissocPath=_curry2(_dissocPath);var drop=_curry2(_dispatchable("drop",_xdrop,function drop(n,list){return n<list.length?_slice(list,n):[]}));var dropWhile=_curry2(_dispatchable("dropWhile",_xdropWhile,function dropWhile(pred,list){var idx=-1,len=list.length;while(++idx<len&&pred(list[idx])){}return _slice(list,idx)}));var empty=_curry1(function empty(x){return _hasMethod("empty",x)?x.empty():[]});var filter=_curry2(_dispatchable("filter",_xfilter,_filter));var find=_curry2(_dispatchable("find",_xfind,function find(fn,list){var idx=-1;var len=list.length;while(++idx<len){if(fn(list[idx])){return list[idx]}}}));var findIndex=_curry2(_dispatchable("findIndex",_xfindIndex,function findIndex(fn,list){var idx=-1;var len=list.length;while(++idx<len){if(fn(list[idx])){return idx}}return-1}));var findLast=_curry2(_dispatchable("findLast",_xfindLast,function findLast(fn,list){var idx=list.length;while(--idx>=0){if(fn(list[idx])){return list[idx]}}}));var findLastIndex=_curry2(_dispatchable("findLastIndex",_xfindLastIndex,function findLastIndex(fn,list){var idx=list.length;while(--idx>=0){if(fn(list[idx])){return idx}}return-1}));var flatten=_curry1(_makeFlat(true));var flip=_curry1(function flip(fn){return curry(function(a,b){var args=_slice(arguments);args[0]=b;args[1]=a;return fn.apply(this,args)})});var func=curry(function func(funcName,obj){return obj[funcName].apply(obj,_slice(arguments,2))});var functionsIn=_curry1(_functionsWith(keysIn));var groupBy=_curry2(_dispatchable("groupBy",_xgroupBy,function groupBy(fn,list){return _reduce(function(acc,elt){var key=fn(elt);acc[key]=_append(elt,acc[key]||(acc[key]=[]));return acc},{},list)}));var head=nth(0);var insert=_curry3(function insert(idx,elt,list){idx=idx<list.length&&idx>=0?idx:list.length;return _concat(_append(elt,_slice(list,0,idx)),_slice(list,idx))});var intersectionWith=_curry3(function intersectionWith(pred,list1,list2){var results=[],idx=-1;while(++idx<list1.length){if(_containsWith(pred,list1[idx],list2)){results[results.length]=list1[idx]}}return uniqWith(pred,results)});var invoke=curry(function invoke(methodName,args,obj){return obj[methodName].apply(obj,args)});var invoker=curry(function invoker(arity,method){var initialArgs=_slice(arguments,2);var len=arity-initialArgs.length;return curryN(len+1,function(){var target=arguments[len];var args=initialArgs.concat(_slice(arguments,0,len));return target[method].apply(target,args)})});var join=invoker(1,"join");var keys=function(){var hasEnumBug=!{toString:null}.propertyIsEnumerable("toString");var nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];return _curry1(function keys(obj){if(Object(obj)!==obj){return[]}if(Object.keys){return Object.keys(obj)}var prop,ks=[],nIdx;for(prop in obj){if(_has(prop,obj)){ks[ks.length]=prop}}if(hasEnumBug){nIdx=nonEnumerableProps.length;while(--nIdx>=0){prop=nonEnumerableProps[nIdx];if(_has(prop,obj)&&!_contains(prop,ks)){ks[ks.length]=prop}}}return ks})}();var last=nth(-1);var map=_curry2(_dispatchable("map",_xmap,_map));var mapObj=_curry2(function mapObject(fn,obj){return _reduce(function(acc,key){acc[key]=fn(obj[key]);return acc},{},keys(obj))});var mapObjIndexed=_curry2(function mapObjectIndexed(fn,obj){return _reduce(function(acc,key){acc[key]=fn(obj[key],key,obj);return acc},{},keys(obj))});var match=invoker(1,"match");var max=_createMaxMin(_gt,-Infinity);var min=_createMaxMin(_lt,Infinity);var none=_curry2(_complement(_dispatchable("any",_xany,_any)));var partial=curry(_createPartialApplicator(_concat));var partialRight=curry(_createPartialApplicator(flip(_concat)));var partition=_curry2(function partition(pred,list){return _reduce(function(acc,elt){var xs=acc[pred(elt)?0:1];xs[xs.length]=elt;return acc},[[],[]],list)});var pipe=function pipe(){return compose.apply(this,reverse(arguments))};var pipeP=function pipeP(){return composeP.apply(this,reverse(arguments))};var pluck=_curry2(_pluck);var reduce=_curry3(_reduce);var reject=_curry2(function reject(fn,list){return filter(_complement(fn),list)});var repeat=_curry2(function repeat(value,n){return times(always(value),n)});var slice=_curry3(_checkForMethod("slice",function slice(fromIndex,toIndex,xs){return Array.prototype.slice.call(xs,fromIndex,toIndex)}));var sort=_curry2(function sort(comparator,list){return clone(list).sort(comparator)});var split=invoker(1,"split");var substring=slice;var substringFrom=substring(__,Infinity);var substringTo=substring(0);var sum=reduce(_add,0);var tail=_checkForMethod("tail",function(list){return _slice(list,1)});var take=_curry2(_dispatchable("take",_xtake,function take(n,list){return _slice(list,0,Math.min(n,list.length))}));var takeWhile=_curry2(_dispatchable("takeWhile",_xtakeWhile,function takeWhile(fn,list){var idx=-1,len=list.length;while(++idx<len&&fn(list[idx])){}return _slice(list,0,idx)}));var toLower=invoker(0,"toLowerCase");var toUpper=invoker(0,"toUpperCase");var transduce=curryN(4,function(xf,fn,acc,list){return _reduce(xf(typeof fn==="function"?_xwrap(fn):fn),acc,list)});var unionWith=_curry3(function unionWith(pred,list1,list2){return uniqWith(pred,_concat(list1,list2))});var uniq=_curry1(function uniq(list){var idx=-1,len=list.length;var result=[],item;while(++idx<len){item=list[idx];if(!_contains(item,result)){result[result.length]=item}}return result});var unnest=_curry1(_makeFlat(false));var useWith=curry(function useWith(fn){var transformers=_slice(arguments,1);var tlen=transformers.length;return curry(arity(tlen,function(){var args=[],idx=-1;while(++idx<tlen){args[idx]=transformers[idx](arguments[idx])}return fn.apply(this,args.concat(_slice(arguments,tlen)))}))});var values=_curry1(function values(obj){var props=keys(obj);var len=props.length;var vals=[];var idx=-1;while(++idx<len){vals[idx]=obj[props[idx]]}return vals});var where=_curry2(function where(spec,testObj){var parsedSpec=groupBy(function(key){return typeof spec[key]==="function"?"fn":"obj"},keys(spec));return _satisfiesSpec(spec,parsedSpec,testObj)});var _eqDeep=function _eqDeep(a,b,stackA,stackB){var typeA=type(a);if(typeA!==type(b)){return false}if(eq(a,b)){return true}if(typeA=="RegExp"){return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline&&a.sticky===b.sticky&&a.unicode===b.unicode}if(Object(a)===a){if(typeA==="Date"&&a.getTime()!=b.getTime()){return false}var keysA=keys(a);if(keysA.length!==keys(b).length){return false}var idx=stackA.length;while(--idx>=0){if(stackA[idx]===a){return stackB[idx]===b}}stackA[stackA.length]=a;stackB[stackB.length]=b;idx=keysA.length;while(--idx>=0){var key=keysA[idx];if(!_has(key,b)||!_eqDeep(b[key],a[key],stackA,stackB)){return false}}stackA.pop();stackB.pop();return true}return false};var _extend=function _extend(destination,other){var props=keys(other);var idx=-1,length=props.length;while(++idx<length){destination[props[idx]]=other[props[idx]]}return destination};var _predicateWrap=function _predicateWrap(predPicker){return function(preds){var predIterator=function(){var args=arguments;return predPicker(function(predicate){return predicate.apply(null,args)},preds)};return arguments.length>1?predIterator.apply(null,_slice(arguments,1)):arity(max(_pluck("length",preds)),predIterator)}};var allPass=curry(_predicateWrap(_all));var anyPass=curry(_predicateWrap(_any));var ap=_curry2(function ap(fns,vs){return _hasMethod("ap",fns)?fns.ap(vs):_reduce(function(acc,fn){return _concat(acc,map(fn,vs))},[],fns)});var call=curry(function call(fn){return fn.apply(this,_slice(arguments,1))});var chain=_curry2(_checkForMethod("chain",function chain(f,list){return unnest(_map(f,list))}));var charAt=invoker(1,"charAt");var charCodeAt=invoker(1,"charCodeAt");var commuteMap=_curry3(function commuteMap(fn,of,list){function consF(acc,ftor){return ap(map(append,fn(ftor)),acc)}return _reduce(consF,of([]),list)});var constructN=_curry2(function constructN(n,Fn){if(n>10){throw new Error("Constructor with greater than ten arguments")}if(n===0){return function(){return new Fn}}return curry(nAry(n,function($0,$1,$2,$3,$4,$5,$6,$7,$8,$9){switch(arguments.length){case 1:return new Fn($0);case 2:return new Fn($0,$1);case 3:return new Fn($0,$1,$2);case 4:return new Fn($0,$1,$2,$3);case 5:return new Fn($0,$1,$2,$3,$4);case 6:return new Fn($0,$1,$2,$3,$4,$5);case 7:return new Fn($0,$1,$2,$3,$4,$5,$6);case 8:return new Fn($0,$1,$2,$3,$4,$5,$6,$7);case 9:return new Fn($0,$1,$2,$3,$4,$5,$6,$7,$8);case 10:return new Fn($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)}}))});var eqDeep=_curry2(function eqDeep(a,b){return _eqDeep(a,b,[],[])});var evolve=_curry2(function evolve(transformations,object){return _extend(_extend({},object),mapObjIndexed(function(fn,key){return fn(object[key])},transformations))});var functions=_curry1(_functionsWith(keys));var init=slice(0,-1);var intersection=_curry2(function intersection(list1,list2){return uniq(_filter(flip(_contains)(list1),list2))});var invert=_curry1(function invert(obj){var props=keys(obj);var len=props.length;var idx=-1;var out={};while(++idx<len){var key=props[idx];var val=obj[key];var list=_has(val,out)?out[val]:out[val]=[];list[list.length]=key}return out});var invertObj=_curry1(function invertObj(obj){var props=keys(obj);var len=props.length;var idx=-1;var out={};while(++idx<len){var key=props[idx];out[obj[key]]=key}return out});var liftN=_curry2(function liftN(arity,fn){var lifted=curryN(arity,fn);return curryN(arity,function(){return _reduce(ap,map(lifted,arguments[0]),_slice(arguments,1))})});var merge=_curry2(function merge(a,b){return _extend(_extend({},a),b)});var mergeAll=_curry1(function mergeAll(list){return reduce(merge,{},list)});var product=reduce(_multiply,1);var project=useWith(_map,pickAll,identity);var union=_curry2(compose(uniq,_concat));var _stepCat=function(){var _stepCatArray={init:Array,step:function(xs,x){return _concat(xs,[x])},result:_identity};var _stepCatString={init:String,step:_add,result:_identity};var _stepCatObject={init:Object,step:function(result,input){return merge(result,isArrayLike(input)?_createMapEntry(input[0],input[1]):input)},result:_identity};return function _stepCat(obj){if(_isTransformer(obj)){return obj}if(isArrayLike(obj)){return _stepCatArray}if(typeof obj==="string"){return _stepCatString}if(typeof obj==="object"){return _stepCatObject}throw new Error("Cannot create transformer for "+obj)}}();var commute=commuteMap(map(identity));var construct=_curry1(function construct(Fn){return constructN(Fn.length,Fn)});var into=_curry3(function into(acc,xf,list){return _isTransformer(acc)?_reduce(xf(acc),acc.init(),list):_reduce(xf(_stepCat(acc)),acc,list)});var lift=_curry1(function lift(fn){return liftN(fn.length,fn)});var R={F:F,T:T,__:__,add:add,all:all,allPass:allPass,always:always,and:and,any:any,anyPass:anyPass,ap:ap,aperture:aperture,append:append,apply:apply,arity:arity,assoc:assoc,assocPath:assocPath,binary:binary,bind:bind,both:both,call:call,chain:chain,charAt:charAt,charCodeAt:charCodeAt,clone:clone,commute:commute,commuteMap:commuteMap,comparator:comparator,complement:complement,compose:compose,composeP:composeP,concat:concat,cond:cond,construct:construct,constructN:constructN,contains:contains,containsWith:containsWith,converge:converge,countBy:countBy,createMapEntry:createMapEntry,curry:curry,curryN:curryN,dec:dec,defaultTo:defaultTo,difference:difference,differenceWith:differenceWith,dissoc:dissoc,dissocPath:dissocPath,divide:divide,drop:drop,dropWhile:dropWhile,either:either,empty:empty,eq:eq,eqDeep:eqDeep,eqProps:eqProps,evolve:evolve,filter:filter,filterIndexed:filterIndexed,find:find,findIndex:findIndex,findLast:findLast,findLastIndex:findLastIndex,flatten:flatten,flip:flip,forEach:forEach,forEachIndexed:forEachIndexed,fromPairs:fromPairs,func:func,functions:functions,functionsIn:functionsIn,groupBy:groupBy,gt:gt,gte:gte,has:has,hasIn:hasIn,head:head,identity:identity,ifElse:ifElse,inc:inc,indexOf:indexOf,init:init,insert:insert,insertAll:insertAll,intersection:intersection,intersectionWith:intersectionWith,into:into,invert:invert,invertObj:invertObj,invoke:invoke,invoker:invoker,is:is,isArrayLike:isArrayLike,isEmpty:isEmpty,isNaN:isNaN,isNil:isNil,isSet:isSet,join:join,keys:keys,keysIn:keysIn,last:last,lastIndexOf:lastIndexOf,length:length,lens:lens,lensOn:lensOn,lift:lift,liftN:liftN,lt:lt,lte:lte,map:map,mapAccum:mapAccum,mapAccumRight:mapAccumRight,mapIndexed:mapIndexed,mapObj:mapObj,mapObjIndexed:mapObjIndexed,match:match,mathMod:mathMod,max:max,maxBy:maxBy,memoize:memoize,merge:merge,mergeAll:mergeAll,min:min,minBy:minBy,modulo:modulo,multiply:multiply,nAry:nAry,negate:negate,none:none,not:not,nth:nth,nthArg:nthArg,nthChar:nthChar,nthCharCode:nthCharCode,of:of,omit:omit,once:once,or:or,partial:partial,partialRight:partialRight,partition:partition,path:path,pathEq:pathEq,pick:pick,pickAll:pickAll,pickBy:pickBy,pipe:pipe,pipeP:pipeP,pluck:pluck,prepend:prepend,product:product,project:project,prop:prop,propEq:propEq,propOr:propOr,props:props,range:range,reduce:reduce,reduceIndexed:reduceIndexed,reduceRight:reduceRight,reduceRightIndexed:reduceRightIndexed,reject:reject,rejectIndexed:rejectIndexed,remove:remove,repeat:repeat,replace:replace,reverse:reverse,scan:scan,slice:slice,sort:sort,sortBy:sortBy,split:split,strIndexOf:strIndexOf,strLastIndexOf:strLastIndexOf,substring:substring,substringFrom:substringFrom,substringTo:substringTo,subtract:subtract,sum:sum,tail:tail,take:take,takeWhile:takeWhile,tap:tap,test:test,times:times,toLower:toLower,toPairs:toPairs,toPairsIn:toPairsIn,toUpper:toUpper,transduce:transduce,trim:trim,type:type,unapply:unapply,unary:unary,unfold:unfold,union:union,unionWith:unionWith,uniq:uniq,uniqWith:uniqWith,unnest:unnest,useWith:useWith,values:values,valuesIn:valuesIn,where:where,wrap:wrap,xprod:xprod,zip:zip,zipObj:zipObj,zipWith:zipWith};if(typeof exports==="object"){module.exports=R}else if(typeof define==="function"&&define.amd){define(function(){return R})}else{this.R=R}}).call(this)},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({underscore:[function(require,module,exports){(function(){var root=this;var previousUnderscore=root._;var ArrayProto=Array.prototype,ObjProto=Object.prototype,FuncProto=Function.prototype;var push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty;var nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeBind=FuncProto.bind,nativeCreate=Object.create;var Ctor=function(){};var _=function(obj){if(obj instanceof _)return obj;if(!(this instanceof _))return new _(obj);this._wrapped=obj};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=_}exports._=_}else{root._=_}_.VERSION="1.8.2";var optimizeCb=function(func,context,argCount){if(context===void 0)return func;switch(argCount==null?3:argCount){case 1:return function(value){return func.call(context,value)};case 2:return function(value,other){return func.call(context,value,other)};case 3:return function(value,index,collection){return func.call(context,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection)}}return function(){return func.apply(context,arguments)}};var cb=function(value,context,argCount){if(value==null)return _.identity;if(_.isFunction(value))return optimizeCb(value,context,argCount);if(_.isObject(value))return _.matcher(value);return _.property(value)};_.iteratee=function(value,context){return cb(value,context,Infinity)};var createAssigner=function(keysFunc,undefinedOnly){return function(obj){var length=arguments.length;if(length<2||obj==null)return obj;for(var index=1;index<length;index++){var source=arguments[index],keys=keysFunc(source),l=keys.length;for(var i=0;i<l;i++){var key=keys[i];if(!undefinedOnly||obj[key]===void 0)obj[key]=source[key]}}return obj}};var baseCreate=function(prototype){if(!_.isObject(prototype))return{};if(nativeCreate)return nativeCreate(prototype);Ctor.prototype=prototype;var result=new Ctor;Ctor.prototype=null;return result};var MAX_ARRAY_INDEX=Math.pow(2,53)-1;var isArrayLike=function(collection){var length=collection&&collection.length;return typeof length=="number"&&length>=0&&length<=MAX_ARRAY_INDEX};_.each=_.forEach=function(obj,iteratee,context){iteratee=optimizeCb(iteratee,context);var i,length;if(isArrayLike(obj)){for(i=0,length=obj.length;i<length;i++){iteratee(obj[i],i,obj)}}else{var keys=_.keys(obj);for(i=0,length=keys.length;i<length;i++){iteratee(obj[keys[i]],keys[i],obj)}}return obj};_.map=_.collect=function(obj,iteratee,context){iteratee=cb(iteratee,context);var keys=!isArrayLike(obj)&&_.keys(obj),length=(keys||obj).length,results=Array(length);for(var index=0;index<length;index++){var currentKey=keys?keys[index]:index;results[index]=iteratee(obj[currentKey],currentKey,obj)}return results};function createReduce(dir){function iterator(obj,iteratee,memo,keys,index,length){for(;index>=0&&index<length;index+=dir){var currentKey=keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo}return function(obj,iteratee,memo,context){iteratee=optimizeCb(iteratee,context,4);var keys=!isArrayLike(obj)&&_.keys(obj),length=(keys||obj).length,index=dir>0?0:length-1;if(arguments.length<3){memo=obj[keys?keys[index]:index];index+=dir}return iterator(obj,iteratee,memo,keys,index,length)}}_.reduce=_.foldl=_.inject=createReduce(1);_.reduceRight=_.foldr=createReduce(-1);_.find=_.detect=function(obj,predicate,context){var key;if(isArrayLike(obj)){key=_.findIndex(obj,predicate,context)}else{key=_.findKey(obj,predicate,context)}if(key!==void 0&&key!==-1)return obj[key]};_.filter=_.select=function(obj,predicate,context){var results=[];predicate=cb(predicate,context);_.each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value)});return results};_.reject=function(obj,predicate,context){return _.filter(obj,_.negate(cb(predicate)),context)};_.every=_.all=function(obj,predicate,context){predicate=cb(predicate,context);var keys=!isArrayLike(obj)&&_.keys(obj),length=(keys||obj).length;for(var index=0;index<length;index++){var currentKey=keys?keys[index]:index;if(!predicate(obj[currentKey],currentKey,obj))return false}return true};_.some=_.any=function(obj,predicate,context){predicate=cb(predicate,context);var keys=!isArrayLike(obj)&&_.keys(obj),length=(keys||obj).length;for(var index=0;index<length;index++){var currentKey=keys?keys[index]:index;if(predicate(obj[currentKey],currentKey,obj))return true}return false};_.contains=_.includes=_.include=function(obj,target,fromIndex){if(!isArrayLike(obj))obj=_.values(obj);return _.indexOf(obj,target,typeof fromIndex=="number"&&fromIndex)>=0};_.invoke=function(obj,method){var args=slice.call(arguments,2);var isFunc=_.isFunction(method);return _.map(obj,function(value){var func=isFunc?method:value[method];return func==null?func:func.apply(value,args)})};_.pluck=function(obj,key){return _.map(obj,_.property(key))};_.where=function(obj,attrs){return _.filter(obj,_.matcher(attrs))};_.findWhere=function(obj,attrs){return _.find(obj,_.matcher(attrs))};_.max=function(obj,iteratee,context){var result=-Infinity,lastComputed=-Infinity,value,computed;if(iteratee==null&&obj!=null){obj=isArrayLike(obj)?obj:_.values(obj);for(var i=0,length=obj.length;i<length;i++){value=obj[i];if(value>result){result=value}}}else{iteratee=cb(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=value;lastComputed=computed}})}return result};_.min=function(obj,iteratee,context){var result=Infinity,lastComputed=Infinity,value,computed;if(iteratee==null&&obj!=null){obj=isArrayLike(obj)?obj:_.values(obj);for(var i=0,length=obj.length;i<length;i++){value=obj[i];if(value<result){result=value}}}else{iteratee=cb(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed<lastComputed||computed===Infinity&&result===Infinity){result=value;lastComputed=computed}})}return result};_.shuffle=function(obj){var set=isArrayLike(obj)?obj:_.values(obj);var length=set.length;var shuffled=Array(length);for(var index=0,rand;index<length;index++){rand=_.random(0,index);if(rand!==index)shuffled[index]=shuffled[rand];shuffled[rand]=set[index]}return shuffled};_.sample=function(obj,n,guard){if(n==null||guard){if(!isArrayLike(obj))obj=_.values(obj);return obj[_.random(obj.length-1)]}return _.shuffle(obj).slice(0,Math.max(0,n))};_.sortBy=function(obj,iteratee,context){iteratee=cb(iteratee,context);return _.pluck(_.map(obj,function(value,index,list){return{value:value,index:index,criteria:iteratee(value,index,list)}}).sort(function(left,right){var a=left.criteria;var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)return-1}return left.index-right.index}),"value")};var group=function(behavior){return function(obj,iteratee,context){var result={};iteratee=cb(iteratee,context);_.each(obj,function(value,index){var key=iteratee(value,index,obj);behavior(result,value,key)});return result}};_.groupBy=group(function(result,value,key){if(_.has(result,key))result[key].push(value);else result[key]=[value]});_.indexBy=group(function(result,value,key){result[key]=value});_.countBy=group(function(result,value,key){if(_.has(result,key))result[key]++;else result[key]=1});_.toArray=function(obj){if(!obj)return[];if(_.isArray(obj))return slice.call(obj);if(isArrayLike(obj))return _.map(obj,_.identity);return _.values(obj)};_.size=function(obj){if(obj==null)return 0;return isArrayLike(obj)?obj.length:_.keys(obj).length};_.partition=function(obj,predicate,context){predicate=cb(predicate,context);var pass=[],fail=[];_.each(obj,function(value,key,obj){(predicate(value,key,obj)?pass:fail).push(value)});return[pass,fail]};_.first=_.head=_.take=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[0];return _.initial(array,array.length-n)};_.initial=function(array,n,guard){return slice.call(array,0,Math.max(0,array.length-(n==null||guard?1:n)))};_.last=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[array.length-1];return _.rest(array,Math.max(0,array.length-n))};_.rest=_.tail=_.drop=function(array,n,guard){return slice.call(array,n==null||guard?1:n)};_.compact=function(array){return _.filter(array,_.identity)};var flatten=function(input,shallow,strict,startIndex){var output=[],idx=0;for(var i=startIndex||0,length=input&&input.length;i<length;i++){var value=input[i];if(isArrayLike(value)&&(_.isArray(value)||_.isArguments(value))){if(!shallow)value=flatten(value,shallow,strict);var j=0,len=value.length;output.length+=len;while(j<len){output[idx++]=value[j++]}}else if(!strict){output[idx++]=value}}return output};_.flatten=function(array,shallow){return flatten(array,shallow,false)};_.without=function(array){return _.difference(array,slice.call(arguments,1))};_.uniq=_.unique=function(array,isSorted,iteratee,context){if(array==null)return[];if(!_.isBoolean(isSorted)){context=iteratee;iteratee=isSorted;isSorted=false}if(iteratee!=null)iteratee=cb(iteratee,context);var result=[];var seen=[];for(var i=0,length=array.length;i<length;i++){var value=array[i],computed=iteratee?iteratee(value,i,array):value;if(isSorted){if(!i||seen!==computed)result.push(value);seen=computed}else if(iteratee){if(!_.contains(seen,computed)){seen.push(computed);result.push(value)}}else if(!_.contains(result,value)){result.push(value)}}return result};_.union=function(){return _.uniq(flatten(arguments,true,true))};_.intersection=function(array){if(array==null)return[];var result=[];var argsLength=arguments.length;for(var i=0,length=array.length;i<length;i++){var item=array[i];if(_.contains(result,item))continue;for(var j=1;j<argsLength;j++){if(!_.contains(arguments[j],item))break}if(j===argsLength)result.push(item)}return result};_.difference=function(array){var rest=flatten(arguments,true,true,1);return _.filter(array,function(value){return!_.contains(rest,value)})};_.zip=function(){return _.unzip(arguments)};_.unzip=function(array){var length=array&&_.max(array,"length").length||0;var result=Array(length);for(var index=0;index<length;index++){result[index]=_.pluck(array,index)}return result};_.object=function(list,values){var result={};for(var i=0,length=list&&list.length;i<length;i++){if(values){result[list[i]]=values[i]}else{result[list[i][0]]=list[i][1]}}return result};_.indexOf=function(array,item,isSorted){var i=0,length=array&&array.length;if(typeof isSorted=="number"){i=isSorted<0?Math.max(0,length+isSorted):isSorted}else if(isSorted&&length){i=_.sortedIndex(array,item);return array[i]===item?i:-1}if(item!==item){return _.findIndex(slice.call(array,i),_.isNaN)}for(;i<length;i++)if(array[i]===item)return i;return-1};_.lastIndexOf=function(array,item,from){var idx=array?array.length:0;if(typeof from=="number"){idx=from<0?idx+from+1:Math.min(idx,from+1)}if(item!==item){return _.findLastIndex(slice.call(array,0,idx),_.isNaN)}while(--idx>=0)if(array[idx]===item)return idx;return-1};function createIndexFinder(dir){return function(array,predicate,context){predicate=cb(predicate,context);var length=array!=null&&array.length;var index=dir>0?0:length-1;for(;index>=0&&index<length;index+=dir){if(predicate(array[index],index,array))return index}return-1}}_.findIndex=createIndexFinder(1);_.findLastIndex=createIndexFinder(-1);_.sortedIndex=function(array,obj,iteratee,context){iteratee=cb(iteratee,context,1);var value=iteratee(obj);var low=0,high=array.length;while(low<high){var mid=Math.floor((low+high)/2);if(iteratee(array[mid])<value)low=mid+1;else high=mid}return low};_.range=function(start,stop,step){if(arguments.length<=1){stop=start||0;start=0}step=step||1;var length=Math.max(Math.ceil((stop-start)/step),0);var range=Array(length);for(var idx=0;idx<length;idx++,start+=step){range[idx]=start}return range};var executeBound=function(sourceFunc,boundFunc,context,callingContext,args){if(!(callingContext instanceof boundFunc))return sourceFunc.apply(context,args);var self=baseCreate(sourceFunc.prototype);var result=sourceFunc.apply(self,args);if(_.isObject(result))return result;return self};_.bind=function(func,context){if(nativeBind&&func.bind===nativeBind)return nativeBind.apply(func,slice.call(arguments,1));if(!_.isFunction(func))throw new TypeError("Bind must be called on a function");var args=slice.call(arguments,2);var bound=function(){return executeBound(func,bound,context,this,args.concat(slice.call(arguments)))};return bound};_.partial=function(func){var boundArgs=slice.call(arguments,1);var bound=function(){var position=0,length=boundArgs.length;var args=Array(length);for(var i=0;i<length;i++){args[i]=boundArgs[i]===_?arguments[position++]:boundArgs[i]}while(position<arguments.length)args.push(arguments[position++]);return executeBound(func,bound,this,this,args)};return bound};_.bindAll=function(obj){var i,length=arguments.length,key;if(length<=1)throw new Error("bindAll must be passed function names");for(i=1;i<length;i++){key=arguments[i];obj[key]=_.bind(obj[key],obj)}return obj};_.memoize=function(func,hasher){var memoize=function(key){var cache=memoize.cache;var address=""+(hasher?hasher.apply(this,arguments):key);if(!_.has(cache,address))cache[address]=func.apply(this,arguments);return cache[address]};memoize.cache={};return memoize};_.delay=function(func,wait){var args=slice.call(arguments,2);return setTimeout(function(){return func.apply(null,args)},wait)};_.defer=_.partial(_.delay,_,1);_.throttle=function(func,wait,options){var context,args,result;var timeout=null;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:_.now();timeout=null;result=func.apply(context,args);if(!timeout)context=args=null};return function(){var now=_.now();if(!previous&&options.leading===false)previous=now;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){if(timeout){clearTimeout(timeout);timeout=null}previous=now;result=func.apply(context,args);if(!timeout)context=args=null}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining)}return result}};_.debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result;var later=function(){var last=_.now()-timestamp;if(last<wait&&last>=0){timeout=setTimeout(later,wait-last)}else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null}}};return function(){context=this;args=arguments;timestamp=_.now();var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null}return result}};_.wrap=function(func,wrapper){return _.partial(wrapper,func)};_.negate=function(predicate){return function(){return!predicate.apply(this,arguments)}};_.compose=function(){var args=arguments;var start=args.length-1;return function(){var i=start;var result=args[start].apply(this,arguments);while(i--)result=args[i].call(this,result);return result}};_.after=function(times,func){return function(){if(--times<1){return func.apply(this,arguments)}}};_.before=function(times,func){var memo;return function(){if(--times>0){memo=func.apply(this,arguments)}if(times<=1)func=null;return memo}};_.once=_.partial(_.before,2);var hasEnumBug=!{toString:null}.propertyIsEnumerable("toString");var nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function collectNonEnumProps(obj,keys){var nonEnumIdx=nonEnumerableProps.length;var constructor=obj.constructor;var proto=_.isFunction(constructor)&&constructor.prototype||ObjProto;var prop="constructor";if(_.has(obj,prop)&&!_.contains(keys,prop))keys.push(prop);while(nonEnumIdx--){prop=nonEnumerableProps[nonEnumIdx];if(prop in obj&&obj[prop]!==proto[prop]&&!_.contains(keys,prop)){keys.push(prop)}}}_.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)if(_.has(obj,key))keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys};_.allKeys=function(obj){if(!_.isObject(obj))return[];var keys=[];for(var key in obj)keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys};_.values=function(obj){var keys=_.keys(obj);var length=keys.length;var values=Array(length);for(var i=0;i<length;i++){values[i]=obj[keys[i]]}return values};_.mapObject=function(obj,iteratee,context){iteratee=cb(iteratee,context);var keys=_.keys(obj),length=keys.length,results={},currentKey;for(var index=0;index<length;index++){currentKey=keys[index];results[currentKey]=iteratee(obj[currentKey],currentKey,obj)}return results};_.pairs=function(obj){var keys=_.keys(obj);var length=keys.length;var pairs=Array(length);for(var i=0;i<length;i++){pairs[i]=[keys[i],obj[keys[i]]]}return pairs};_.invert=function(obj){var result={};var keys=_.keys(obj);for(var i=0,length=keys.length;i<length;i++){result[obj[keys[i]]]=keys[i]}return result};_.functions=_.methods=function(obj){var names=[];for(var key in obj){if(_.isFunction(obj[key]))names.push(key)}return names.sort()};_.extend=createAssigner(_.allKeys);_.extendOwn=_.assign=createAssigner(_.keys);_.findKey=function(obj,predicate,context){predicate=cb(predicate,context); | |
| var keys=_.keys(obj),key;for(var i=0,length=keys.length;i<length;i++){key=keys[i];if(predicate(obj[key],key,obj))return key}};_.pick=function(object,oiteratee,context){var result={},obj=object,iteratee,keys;if(obj==null)return result;if(_.isFunction(oiteratee)){keys=_.allKeys(obj);iteratee=optimizeCb(oiteratee,context)}else{keys=flatten(arguments,false,false,1);iteratee=function(value,key,obj){return key in obj};obj=Object(obj)}for(var i=0,length=keys.length;i<length;i++){var key=keys[i];var value=obj[key];if(iteratee(value,key,obj))result[key]=value}return result};_.omit=function(obj,iteratee,context){if(_.isFunction(iteratee)){iteratee=_.negate(iteratee)}else{var keys=_.map(flatten(arguments,false,false,1),String);iteratee=function(value,key){return!_.contains(keys,key)}}return _.pick(obj,iteratee,context)};_.defaults=createAssigner(_.allKeys,true);_.clone=function(obj){if(!_.isObject(obj))return obj;return _.isArray(obj)?obj.slice():_.extend({},obj)};_.tap=function(obj,interceptor){interceptor(obj);return obj};_.isMatch=function(object,attrs){var keys=_.keys(attrs),length=keys.length;if(object==null)return!length;var obj=Object(object);for(var i=0;i<length;i++){var key=keys[i];if(attrs[key]!==obj[key]||!(key in obj))return false}return true};var eq=function(a,b,aStack,bStack){if(a===b)return a!==0||1/a===1/b;if(a==null||b==null)return a===b;if(a instanceof _)a=a._wrapped;if(b instanceof _)b=b._wrapped;var className=toString.call(a);if(className!==toString.call(b))return false;switch(className){case"[object RegExp]":case"[object String]":return""+a===""+b;case"[object Number]":if(+a!==+a)return+b!==+b;return+a===0?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var areArrays=className==="[object Array]";if(!areArrays){if(typeof a!="object"||typeof b!="object")return false;var aCtor=a.constructor,bCtor=b.constructor;if(aCtor!==bCtor&&!(_.isFunction(aCtor)&&aCtor instanceof aCtor&&_.isFunction(bCtor)&&bCtor instanceof bCtor)&&("constructor"in a&&"constructor"in b)){return false}}aStack=aStack||[];bStack=bStack||[];var length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b}aStack.push(a);bStack.push(b);if(areArrays){length=a.length;if(length!==b.length)return false;while(length--){if(!eq(a[length],b[length],aStack,bStack))return false}}else{var keys=_.keys(a),key;length=keys.length;if(_.keys(b).length!==length)return false;while(length--){key=keys[length];if(!(_.has(b,key)&&eq(a[key],b[key],aStack,bStack)))return false}}aStack.pop();bStack.pop();return true};_.isEqual=function(a,b){return eq(a,b)};_.isEmpty=function(obj){if(obj==null)return true;if(isArrayLike(obj)&&(_.isArray(obj)||_.isString(obj)||_.isArguments(obj)))return obj.length===0;return _.keys(obj).length===0};_.isElement=function(obj){return!!(obj&&obj.nodeType===1)};_.isArray=nativeIsArray||function(obj){return toString.call(obj)==="[object Array]"};_.isObject=function(obj){var type=typeof obj;return type==="function"||type==="object"&&!!obj};_.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(name){_["is"+name]=function(obj){return toString.call(obj)==="[object "+name+"]"}});if(!_.isArguments(arguments)){_.isArguments=function(obj){return _.has(obj,"callee")}}if(typeof/./!="function"&&typeof Int8Array!="object"){_.isFunction=function(obj){return typeof obj=="function"||false}}_.isFinite=function(obj){return isFinite(obj)&&!isNaN(parseFloat(obj))};_.isNaN=function(obj){return _.isNumber(obj)&&obj!==+obj};_.isBoolean=function(obj){return obj===true||obj===false||toString.call(obj)==="[object Boolean]"};_.isNull=function(obj){return obj===null};_.isUndefined=function(obj){return obj===void 0};_.has=function(obj,key){return obj!=null&&hasOwnProperty.call(obj,key)};_.noConflict=function(){root._=previousUnderscore;return this};_.identity=function(value){return value};_.constant=function(value){return function(){return value}};_.noop=function(){};_.property=function(key){return function(obj){return obj==null?void 0:obj[key]}};_.propertyOf=function(obj){return obj==null?function(){}:function(key){return obj[key]}};_.matcher=_.matches=function(attrs){attrs=_.extendOwn({},attrs);return function(obj){return _.isMatch(obj,attrs)}};_.times=function(n,iteratee,context){var accum=Array(Math.max(0,n));iteratee=optimizeCb(iteratee,context,1);for(var i=0;i<n;i++)accum[i]=iteratee(i);return accum};_.random=function(min,max){if(max==null){max=min;min=0}return min+Math.floor(Math.random()*(max-min+1))};_.now=Date.now||function(){return(new Date).getTime()};var escapeMap={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};var unescapeMap=_.invert(escapeMap);var createEscaper=function(map){var escaper=function(match){return map[match]};var source="(?:"+_.keys(map).join("|")+")";var testRegexp=RegExp(source);var replaceRegexp=RegExp(source,"g");return function(string){string=string==null?"":""+string;return testRegexp.test(string)?string.replace(replaceRegexp,escaper):string}};_.escape=createEscaper(escapeMap);_.unescape=createEscaper(unescapeMap);_.result=function(object,property,fallback){var value=object==null?void 0:object[property];if(value===void 0){value=fallback}return _.isFunction(value)?value.call(object):value};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id};_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"};var escaper=/\\|'|\r|\n|\u2028|\u2029/g;var escapeChar=function(match){return"\\"+escapes[match]};_.template=function(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=_.defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g");var index=0;var source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escaper,escapeChar);index=offset+match.length;if(escape){source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'"}else if(interpolate){source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'"}else if(evaluate){source+="';\n"+evaluate+"\n__p+='"}return match});source+="';\n";if(!settings.variable)source="with(obj||{}){\n"+source+"}\n";source="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{var render=new Function(settings.variable||"obj","_",source)}catch(e){e.source=source;throw e}var template=function(data){return render.call(this,data,_)};var argument=settings.variable||"obj";template.source="function("+argument+"){\n"+source+"}";return template};_.chain=function(obj){var instance=_(obj);instance._chain=true;return instance};var result=function(instance,obj){return instance._chain?_(obj).chain():obj};_.mixin=function(obj){_.each(_.functions(obj),function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];push.apply(args,arguments);return result(this,func.apply(_,args))}})};_.mixin(_);_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;method.apply(obj,arguments);if((name==="shift"||name==="splice")&&obj.length===0)delete obj[0];return result(this,obj)}});_.each(["concat","join","slice"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){return result(this,method.apply(this._wrapped,arguments))}});_.prototype.value=function(){return this._wrapped};_.prototype.valueOf=_.prototype.toJSON=_.prototype.value;_.prototype.toString=function(){return""+this._wrapped};if(typeof define==="function"&&define.amd){define("underscore",[],function(){return _})}}).call(this)},{}]},{},[]);var R=require("ramda");var _=require("underscore");var tasks=[{username:"Scott",title:"remember milk",dueDate:"2015-04-01",complete:false,priority:"medium"},{username:"Michael",title:"finish painting",dueDate:"2015-04-02",complete:true,priority:"high"}];var incompleteTasks0=tasks.filter(function(task){return!task.complete});var incompleteTasks1=_.filter(tasks,{complete:false});var incomplete=R.filter(R.where({complete:false}));console.log(incompleteTasks0);console.log(incompleteTasks1);console.log(incomplete(tasks)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "requirebin-sketch", | |
| "version": "1.0.0", | |
| "dependencies": { | |
| "ramda": "0.13.0", | |
| "underscore": "1.8.2" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment