made with requirebin
Created
March 24, 2015 19:57
-
-
Save efleming969/b7e7806e05b817cd335d 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 assert = require("chai").assert | |
var R = require("ramda") | |
var UrlPattern = require("url-pattern") | |
var patterns = [ "#/foos/new" , "#/foos/:id" , "#/" ] | |
var path = routes( patterns , "#/foos/new" ) | |
assert.equal( path.pattern , "#/foos/1" ) | |
function routes( patterns , hash ) | |
{ | |
return { pattern: "#/foos/1" } | |
} |
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}({1:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var kMaxLength=1073741823;var rootParent={};Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}if(length>0&&length<=Buffer.poolSize)buf.parent=rootParent;return buf}function SlowBuffer(subject,encoding,noZero){if(!(this instanceof SlowBuffer))return new SlowBuffer(subject,encoding,noZero);var buf=new Buffer(subject,encoding,noZero);delete buf.parent;return buf}Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.byteLength=function(str,encoding){var ret;str=str+"";switch(encoding||"utf8"){case"ascii":case"binary":case"raw":ret=str.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;case"hex":ret=str.length>>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length,2);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;if(length<0||offset<0||offset>this.length)throw new RangeError("attempt to write outside buffer bounds");var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i]&127)}return ret}function binarySlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT){newBuf=Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}}if(newBuf.length)newBuf.parent=this.parent||this;return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;return val};Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256))val+=this[offset+--byteLength]*mul;return val};Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256))val+=this[offset+--i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range")}Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=0;var mul=1;var sub=value<0?1:0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=byteLength-1;var mul=1;var sub=value<0?1:0;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4; | |
};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range");if(offset<0)throw new RangeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(target_start>=target.length)target_start=target.length;if(!target_start)target_start=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||source.length===0)return 0;if(target_start<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=source.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}return len};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;if(end<start)throw new RangeError("end < start");if(end===start)return;if(this.length===0)return;if(start<0||start>=this.length)throw new RangeError("start out of bounds");if(end<0||end>this.length)throw new RangeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(Buffer.TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr.constructor=Buffer;arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUIntLE=BP.readUIntLE;arr.readUIntBE=BP.readUIntBE;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readIntLE=BP.readIntLE;arr.readIntBE=BP.readIntBE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUIntLE=BP.writeUIntLE;arr.writeUIntBE=BP.writeUIntBE;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeIntLE=BP.writeIntLE;arr.writeIntBE=BP.writeIntBE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z\-]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){var codePoint,length=string.length;var leadSurrogate=null;units=units||Infinity;var bytes=[];var i=0;for(;i<length;i++){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(leadSurrogate){if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}else{codePoint=leadSurrogate-55296<<10|codePoint-56320|65536;leadSurrogate=null}}else{if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}else{leadSurrogate=codePoint;continue}}}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=null}if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<2097152){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length,unitSize){if(unitSize)length-=length%unitSize;for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":2,ieee754:3,"is-array":4}],2:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);var PLUS_URL_SAFE="-".charCodeAt(0);var SLASH_URL_SAFE="_".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS||code===PLUS_URL_SAFE)return 62;if(code===SLASH||code===SLASH_URL_SAFE)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],3:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],4:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],5:[function(require,module,exports){var used=[],exports=module.exports={};exports.version="2.1.2";exports.AssertionError=require("assertion-error");var util=require("./chai/utils");exports.use=function(fn){if(!~used.indexOf(fn)){fn(this,util);used.push(fn)}return this};exports.util=util;var config=require("./chai/config");exports.config=config;var assertion=require("./chai/assertion");exports.use(assertion);var core=require("./chai/core/assertions");exports.use(core);var expect=require("./chai/interface/expect");exports.use(expect);var should=require("./chai/interface/should");exports.use(should);var assert=require("./chai/interface/assert");exports.use(assert)},{"./chai/assertion":6,"./chai/config":7,"./chai/core/assertions":8,"./chai/interface/assert":9,"./chai/interface/expect":10,"./chai/interface/should":11,"./chai/utils":24,"assertion-error":33}],6:[function(require,module,exports){var config=require("./config");module.exports=function(_chai,util){var AssertionError=_chai.AssertionError,flag=util.flag;_chai.Assertion=Assertion;function Assertion(obj,msg,stack){flag(this,"ssfi",stack||arguments.callee);flag(this,"object",obj);flag(this,"message",msg)}Object.defineProperty(Assertion,"includeStack",{get:function(){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");return config.includeStack},set:function(value){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");config.includeStack=value}});Object.defineProperty(Assertion,"showDiff",{get:function(){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");return config.showDiff},set:function(value){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");config.showDiff=value}});Assertion.addProperty=function(name,fn){util.addProperty(this.prototype,name,fn)};Assertion.addMethod=function(name,fn){util.addMethod(this.prototype,name,fn)};Assertion.addChainableMethod=function(name,fn,chainingBehavior){util.addChainableMethod(this.prototype,name,fn,chainingBehavior)};Assertion.overwriteProperty=function(name,fn){util.overwriteProperty(this.prototype,name,fn)};Assertion.overwriteMethod=function(name,fn){util.overwriteMethod(this.prototype,name,fn)};Assertion.overwriteChainableMethod=function(name,fn,chainingBehavior){util.overwriteChainableMethod(this.prototype,name,fn,chainingBehavior)};Assertion.prototype.assert=function(expr,msg,negateMsg,expected,_actual,showDiff){var ok=util.test(this,arguments);if(true!==showDiff)showDiff=false;if(true!==config.showDiff)showDiff=false;if(!ok){var msg=util.getMessage(this,arguments),actual=util.getActual(this,arguments);throw new AssertionError(msg,{actual:actual,expected:expected,showDiff:showDiff},config.includeStack?this.assert:flag(this,"ssfi"))}};Object.defineProperty(Assertion.prototype,"_obj",{get:function(){return flag(this,"object")},set:function(val){flag(this,"object",val)}})}},{"./config":7}],7:[function(require,module,exports){module.exports={includeStack:false,showDiff:true,truncateThreshold:40}},{}],8:[function(require,module,exports){module.exports=function(chai,_){var Assertion=chai.Assertion,toString=Object.prototype.toString,flag=_.flag;["to","be","been","is","and","has","have","with","that","which","at","of","same"].forEach(function(chain){Assertion.addProperty(chain,function(){return this})});Assertion.addProperty("not",function(){flag(this,"negate",true)});Assertion.addProperty("deep",function(){flag(this,"deep",true)});Assertion.addProperty("any",function(){flag(this,"any",true);flag(this,"all",false)});Assertion.addProperty("all",function(){flag(this,"all",true);flag(this,"any",false)});function an(type,msg){if(msg)flag(this,"message",msg);type=type.toLowerCase();var obj=flag(this,"object"),article=~["a","e","i","o","u"].indexOf(type.charAt(0))?"an ":"a ";this.assert(type===_.type(obj),"expected #{this} to be "+article+type,"expected #{this} not to be "+article+type)}Assertion.addChainableMethod("an",an);Assertion.addChainableMethod("a",an);function includeChainingBehavior(){flag(this,"contains",true)}function include(val,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");var expected=false;if(_.type(obj)==="array"&&_.type(val)==="object"){for(var i in obj){if(_.eql(obj[i],val)){expected=true;break}}}else if(_.type(val)==="object"){if(!flag(this,"negate")){for(var k in val)new Assertion(obj).property(k,val[k]);return}var subset={};for(var k in val)subset[k]=obj[k];expected=_.eql(subset,val)}else{expected=obj&&~obj.indexOf(val)}this.assert(expected,"expected #{this} to include "+_.inspect(val),"expected #{this} to not include "+_.inspect(val))}Assertion.addChainableMethod("include",include,includeChainingBehavior);Assertion.addChainableMethod("contain",include,includeChainingBehavior);Assertion.addChainableMethod("contains",include,includeChainingBehavior);Assertion.addChainableMethod("includes",include,includeChainingBehavior);Assertion.addProperty("ok",function(){this.assert(flag(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});Assertion.addProperty("true",function(){this.assert(true===flag(this,"object"),"expected #{this} to be true","expected #{this} to be false",this.negate?false:true)});Assertion.addProperty("false",function(){this.assert(false===flag(this,"object"),"expected #{this} to be false","expected #{this} to be true",this.negate?true:false)});Assertion.addProperty("null",function(){this.assert(null===flag(this,"object"),"expected #{this} to be null","expected #{this} not to be null")});Assertion.addProperty("undefined",function(){this.assert(undefined===flag(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")});Assertion.addProperty("exist",function(){this.assert(null!=flag(this,"object"),"expected #{this} to exist","expected #{this} to not exist")});Assertion.addProperty("empty",function(){var obj=flag(this,"object"),expected=obj;if(Array.isArray(obj)||"string"===typeof object){expected=obj.length}else if(typeof obj==="object"){expected=Object.keys(obj).length}this.assert(!expected,"expected #{this} to be empty","expected #{this} not to be empty")});function checkArguments(){var obj=flag(this,"object"),type=Object.prototype.toString.call(obj);this.assert("[object Arguments]"===type,"expected #{this} to be arguments but got "+type,"expected #{this} to not be arguments")}Assertion.addProperty("arguments",checkArguments);Assertion.addProperty("Arguments",checkArguments);function assertEqual(val,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"deep")){return this.eql(val)}else{this.assert(val===obj,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",val,this._obj,true)}}Assertion.addMethod("equal",assertEqual);Assertion.addMethod("equals",assertEqual);Assertion.addMethod("eq",assertEqual);function assertEql(obj,msg){if(msg)flag(this,"message",msg);this.assert(_.eql(obj,flag(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",obj,this._obj,true)}Assertion.addMethod("eql",assertEql);Assertion.addMethod("eqls",assertEql);function assertAbove(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len>n,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",n,len)}else{this.assert(obj>n,"expected #{this} to be above "+n,"expected #{this} to be at most "+n)}}Assertion.addMethod("above",assertAbove);Assertion.addMethod("gt",assertAbove);Assertion.addMethod("greaterThan",assertAbove);function assertLeast(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len>=n,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",n,len)}else{this.assert(obj>=n,"expected #{this} to be at least "+n,"expected #{this} to be below "+n)}}Assertion.addMethod("least",assertLeast);Assertion.addMethod("gte",assertLeast);function assertBelow(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len<n,"expected #{this} to have a length below #{exp} but got #{act}","expected #{this} to not have a length below #{exp}",n,len)}else{this.assert(obj<n,"expected #{this} to be below "+n,"expected #{this} to be at least "+n)}}Assertion.addMethod("below",assertBelow);Assertion.addMethod("lt",assertBelow);Assertion.addMethod("lessThan",assertBelow);function assertMost(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len<=n,"expected #{this} to have a length at most #{exp} but got #{act}","expected #{this} to have a length above #{exp}",n,len)}else{this.assert(obj<=n,"expected #{this} to be at most "+n,"expected #{this} to be above "+n)}}Assertion.addMethod("most",assertMost);Assertion.addMethod("lte",assertMost);Assertion.addMethod("within",function(start,finish,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object"),range=start+".."+finish;if(flag(this,"doLength")){new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len>=start&&len<=finish,"expected #{this} to have a length within "+range,"expected #{this} to not have a length within "+range)}else{this.assert(obj>=start&&obj<=finish,"expected #{this} to be within "+range,"expected #{this} to not be within "+range)}});function assertInstanceOf(constructor,msg){if(msg)flag(this,"message",msg);var name=_.getName(constructor);this.assert(flag(this,"object")instanceof constructor,"expected #{this} to be an instance of "+name,"expected #{this} to not be an instance of "+name)}Assertion.addMethod("instanceof",assertInstanceOf);Assertion.addMethod("instanceOf",assertInstanceOf);Assertion.addMethod("property",function(name,val,msg){if(msg)flag(this,"message",msg);var isDeep=!!flag(this,"deep"),descriptor=isDeep?"deep property ":"property ",negate=flag(this,"negate"),obj=flag(this,"object"),pathInfo=isDeep?_.getPathInfo(name,obj):null,hasProperty=isDeep?pathInfo.exists:_.hasProperty(name,obj),value=isDeep?pathInfo.value:obj[name];if(negate&&undefined!==val){if(undefined===value){msg=msg!=null?msg+": ":"";throw new Error(msg+_.inspect(obj)+" has no "+descriptor+_.inspect(name))}}else{this.assert(hasProperty,"expected #{this} to have a "+descriptor+_.inspect(name),"expected #{this} to not have "+descriptor+_.inspect(name))}if(undefined!==val){this.assert(val===value,"expected #{this} to have a "+descriptor+_.inspect(name)+" of #{exp}, but got #{act}","expected #{this} to not have a "+descriptor+_.inspect(name)+" of #{act}",val,value)}flag(this,"object",value)});function assertOwnProperty(name,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");this.assert(obj.hasOwnProperty(name),"expected #{this} to have own property "+_.inspect(name),"expected #{this} to not have own property "+_.inspect(name))}Assertion.addMethod("ownProperty",assertOwnProperty);Assertion.addMethod("haveOwnProperty",assertOwnProperty);function assertLengthChain(){flag(this,"doLength",true)}function assertLength(n,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).to.have.property("length");var len=obj.length;this.assert(len==n,"expected #{this} to have a length of #{exp} but got #{act}","expected #{this} to not have a length of #{act}",n,len)}Assertion.addChainableMethod("length",assertLength,assertLengthChain);Assertion.addMethod("lengthOf",assertLength);Assertion.addMethod("match",function(re,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");this.assert(re.exec(obj),"expected #{this} to match "+re,"expected #{this} not to match "+re)});Assertion.addMethod("string",function(str,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).is.a("string");this.assert(~obj.indexOf(str),"expected #{this} to contain "+_.inspect(str),"expected #{this} to not contain "+_.inspect(str))});function assertKeys(keys){var obj=flag(this,"object"),str,ok=true,mixedArgsMsg="keys must be given single argument of Array|Object|String, or multiple String arguments";switch(_.type(keys)){case"array":if(arguments.length>1)throw new Error(mixedArgsMsg);break;case"object":if(arguments.length>1)throw new Error(mixedArgsMsg);keys=Object.keys(keys);break;default:keys=Array.prototype.slice.call(arguments)}if(!keys.length)throw new Error("keys required");var actual=Object.keys(obj),expected=keys,len=keys.length,any=flag(this,"any"),all=flag(this,"all");if(!any&&!all){all=true}if(any){var intersection=expected.filter(function(key){return~actual.indexOf(key)});ok=intersection.length>0}if(all){ok=keys.every(function(key){return~actual.indexOf(key)});if(!flag(this,"negate")&&!flag(this,"contains")){ok=ok&&keys.length==actual.length}}if(len>1){keys=keys.map(function(key){return _.inspect(key)});var last=keys.pop();if(all){str=keys.join(", ")+", and "+last}if(any){str=keys.join(", ")+", or "+last}}else{str=_.inspect(keys[0])}str=(len>1?"keys ":"key ")+str;str=(flag(this,"contains")?"contain ":"have ")+str;this.assert(ok,"expected #{this} to "+str,"expected #{this} to not "+str,expected.slice(0).sort(),actual.sort(),true)}Assertion.addMethod("keys",assertKeys);Assertion.addMethod("key",assertKeys);function assertThrows(constructor,errMsg,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).is.a("function");var thrown=false,desiredError=null,name=null,thrownError=null;if(arguments.length===0){errMsg=null;constructor=null}else if(constructor&&(constructor instanceof RegExp||"string"===typeof constructor)){errMsg=constructor;constructor=null}else if(constructor&&constructor instanceof Error){desiredError=constructor;constructor=null;errMsg=null}else if(typeof constructor==="function"){name=constructor.prototype.name||constructor.name;if(name==="Error"&&constructor!==Error){name=(new constructor).name}}else{constructor=null}try{obj()}catch(err){if(desiredError){this.assert(err===desiredError,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",desiredError instanceof Error?desiredError.toString():desiredError,err instanceof Error?err.toString():err);flag(this,"object",err);return this}if(constructor){this.assert(err instanceof constructor,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",name,err instanceof Error?err.toString():err);if(!errMsg){flag(this,"object",err);return this}}var message="object"===_.type(err)&&"message"in err?err.message:""+err;if(message!=null&&errMsg&&errMsg instanceof RegExp){this.assert(errMsg.exec(message),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",errMsg,message);flag(this,"object",err);return this}else if(message!=null&&errMsg&&"string"===typeof errMsg){this.assert(~message.indexOf(errMsg),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",errMsg,message);flag(this,"object",err);return this}else{thrown=true;thrownError=err}}var actuallyGot="",expectedThrown=name!==null?name:desiredError?"#{exp}":"an error";if(thrown){actuallyGot=" but #{act} was thrown"}this.assert(thrown===true,"expected #{this} to throw "+expectedThrown+actuallyGot,"expected #{this} to not throw "+expectedThrown+actuallyGot,desiredError instanceof Error?desiredError.toString():desiredError,thrownError instanceof Error?thrownError.toString():thrownError);flag(this,"object",thrownError)}Assertion.addMethod("throw",assertThrows);Assertion.addMethod("throws",assertThrows);Assertion.addMethod("Throw",assertThrows);Assertion.addMethod("respondTo",function(method,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object"),itself=flag(this,"itself"),context="function"===_.type(obj)&&!itself?obj.prototype[method]:obj[method];this.assert("function"===typeof context,"expected #{this} to respond to "+_.inspect(method),"expected #{this} to not respond to "+_.inspect(method))});Assertion.addProperty("itself",function(){flag(this,"itself",true)});Assertion.addMethod("satisfy",function(matcher,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");var result=matcher(obj);this.assert(result,"expected #{this} to satisfy "+_.objDisplay(matcher),"expected #{this} to not satisfy"+_.objDisplay(matcher),this.negate?false:true,result)});Assertion.addMethod("closeTo",function(expected,delta,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj,msg).is.a("number");if(_.type(expected)!=="number"||_.type(delta)!=="number"){throw new Error("the arguments to closeTo must be numbers")}this.assert(Math.abs(obj-expected)<=delta,"expected #{this} to be close to "+expected+" +/- "+delta,"expected #{this} not to be close to "+expected+" +/- "+delta)});function isSubsetOf(subset,superset,cmp){return subset.every(function(elem){if(!cmp)return superset.indexOf(elem)!==-1;return superset.some(function(elem2){return cmp(elem,elem2)})})}Assertion.addMethod("members",function(subset,msg){if(msg)flag(this,"message",msg);var obj=flag(this,"object");new Assertion(obj).to.be.an("array");new Assertion(subset).to.be.an("array");var cmp=flag(this,"deep")?_.eql:undefined;if(flag(this,"contains")){return this.assert(isSubsetOf(subset,obj,cmp),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",obj,subset)}this.assert(isSubsetOf(obj,subset,cmp)&&isSubsetOf(subset,obj,cmp),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",obj,subset)});function assertChanges(object,prop,msg){if(msg)flag(this,"message",msg);var fn=flag(this,"object");new Assertion(object,msg).to.have.property(prop);new Assertion(fn).is.a("function");var initial=object[prop];fn();this.assert(initial!==object[prop],"expected ."+prop+" to change","expected ."+prop+" to not change")}Assertion.addChainableMethod("change",assertChanges);Assertion.addChainableMethod("changes",assertChanges);function assertIncreases(object,prop,msg){if(msg)flag(this,"message",msg);var fn=flag(this,"object");new Assertion(object,msg).to.have.property(prop);new Assertion(fn).is.a("function");var initial=object[prop];fn();this.assert(object[prop]-initial>0,"expected ."+prop+" to increase","expected ."+prop+" to not increase")}Assertion.addChainableMethod("increase",assertIncreases);Assertion.addChainableMethod("increases",assertIncreases);function assertDecreases(object,prop,msg){if(msg)flag(this,"message",msg);var fn=flag(this,"object");new Assertion(object,msg).to.have.property(prop);new Assertion(fn).is.a("function");var initial=object[prop];fn();this.assert(object[prop]-initial<0,"expected ."+prop+" to decrease","expected ."+prop+" to not decrease")}Assertion.addChainableMethod("decrease",assertDecreases);Assertion.addChainableMethod("decreases",assertDecreases)}},{}],9:[function(require,module,exports){module.exports=function(chai,util){var Assertion=chai.Assertion,flag=util.flag;var assert=chai.assert=function(express,errmsg){var test=new Assertion(null,null,chai.assert);test.assert(express,errmsg,"[ negation message unavailable ]")};assert.fail=function(actual,expected,message,operator){message=message||"assert.fail()";throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},assert.fail)};assert.ok=function(val,msg){new Assertion(val,msg).is.ok};assert.notOk=function(val,msg){new Assertion(val,msg).is.not.ok};assert.equal=function(act,exp,msg){var test=new Assertion(act,msg,assert.equal);test.assert(exp==flag(test,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",exp,act)};assert.notEqual=function(act,exp,msg){var test=new Assertion(act,msg,assert.notEqual);test.assert(exp!=flag(test,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",exp,act)};assert.strictEqual=function(act,exp,msg){new Assertion(act,msg).to.equal(exp)};assert.notStrictEqual=function(act,exp,msg){new Assertion(act,msg).to.not.equal(exp)};assert.deepEqual=function(act,exp,msg){new Assertion(act,msg).to.eql(exp)};assert.notDeepEqual=function(act,exp,msg){new Assertion(act,msg).to.not.eql(exp)};assert.isAbove=function(val,abv,msg){new Assertion(val,msg).to.be.above(abv)};assert.isBelow=function(val,blw,msg){new Assertion(val,msg).to.be.below(blw)};assert.isTrue=function(val,msg){new Assertion(val,msg).is["true"]};assert.isFalse=function(val,msg){new Assertion(val,msg).is["false"]};assert.isNull=function(val,msg){ | |
new Assertion(val,msg).to.equal(null)};assert.isNotNull=function(val,msg){new Assertion(val,msg).to.not.equal(null)};assert.isUndefined=function(val,msg){new Assertion(val,msg).to.equal(undefined)};assert.isDefined=function(val,msg){new Assertion(val,msg).to.not.equal(undefined)};assert.isFunction=function(val,msg){new Assertion(val,msg).to.be.a("function")};assert.isNotFunction=function(val,msg){new Assertion(val,msg).to.not.be.a("function")};assert.isObject=function(val,msg){new Assertion(val,msg).to.be.a("object")};assert.isNotObject=function(val,msg){new Assertion(val,msg).to.not.be.a("object")};assert.isArray=function(val,msg){new Assertion(val,msg).to.be.an("array")};assert.isNotArray=function(val,msg){new Assertion(val,msg).to.not.be.an("array")};assert.isString=function(val,msg){new Assertion(val,msg).to.be.a("string")};assert.isNotString=function(val,msg){new Assertion(val,msg).to.not.be.a("string")};assert.isNumber=function(val,msg){new Assertion(val,msg).to.be.a("number")};assert.isNotNumber=function(val,msg){new Assertion(val,msg).to.not.be.a("number")};assert.isBoolean=function(val,msg){new Assertion(val,msg).to.be.a("boolean")};assert.isNotBoolean=function(val,msg){new Assertion(val,msg).to.not.be.a("boolean")};assert.typeOf=function(val,type,msg){new Assertion(val,msg).to.be.a(type)};assert.notTypeOf=function(val,type,msg){new Assertion(val,msg).to.not.be.a(type)};assert.instanceOf=function(val,type,msg){new Assertion(val,msg).to.be.instanceOf(type)};assert.notInstanceOf=function(val,type,msg){new Assertion(val,msg).to.not.be.instanceOf(type)};assert.include=function(exp,inc,msg){new Assertion(exp,msg,assert.include).include(inc)};assert.notInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notInclude).not.include(inc)};assert.match=function(exp,re,msg){new Assertion(exp,msg).to.match(re)};assert.notMatch=function(exp,re,msg){new Assertion(exp,msg).to.not.match(re)};assert.property=function(obj,prop,msg){new Assertion(obj,msg).to.have.property(prop)};assert.notProperty=function(obj,prop,msg){new Assertion(obj,msg).to.not.have.property(prop)};assert.deepProperty=function(obj,prop,msg){new Assertion(obj,msg).to.have.deep.property(prop)};assert.notDeepProperty=function(obj,prop,msg){new Assertion(obj,msg).to.not.have.deep.property(prop)};assert.propertyVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.have.property(prop,val)};assert.propertyNotVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.not.have.property(prop,val)};assert.deepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.have.deep.property(prop,val)};assert.deepPropertyNotVal=function(obj,prop,val,msg){new Assertion(obj,msg).to.not.have.deep.property(prop,val)};assert.lengthOf=function(exp,len,msg){new Assertion(exp,msg).to.have.length(len)};assert.Throw=function(fn,errt,errs,msg){if("string"===typeof errt||errt instanceof RegExp){errs=errt;errt=null}var assertErr=new Assertion(fn,msg).to.Throw(errt,errs);return flag(assertErr,"object")};assert.doesNotThrow=function(fn,type,msg){if("string"===typeof type){msg=type;type=null}new Assertion(fn,msg).to.not.Throw(type)};assert.operator=function(val,operator,val2,msg){var ok;switch(operator){case"==":ok=val==val2;break;case"===":ok=val===val2;break;case">":ok=val>val2;break;case">=":ok=val>=val2;break;case"<":ok=val<val2;break;case"<=":ok=val<=val2;break;case"!=":ok=val!=val2;break;case"!==":ok=val!==val2;break;default:throw new Error('Invalid operator "'+operator+'"')}var test=new Assertion(ok,msg);test.assert(true===flag(test,"object"),"expected "+util.inspect(val)+" to be "+operator+" "+util.inspect(val2),"expected "+util.inspect(val)+" to not be "+operator+" "+util.inspect(val2))};assert.closeTo=function(act,exp,delta,msg){new Assertion(act,msg).to.be.closeTo(exp,delta)};assert.sameMembers=function(set1,set2,msg){new Assertion(set1,msg).to.have.same.members(set2)};assert.sameDeepMembers=function(set1,set2,msg){new Assertion(set1,msg).to.have.same.deep.members(set2)};assert.includeMembers=function(superset,subset,msg){new Assertion(superset,msg).to.include.members(subset)};assert.changes=function(fn,obj,prop){new Assertion(fn).to.change(obj,prop)};assert.doesNotChange=function(fn,obj,prop){new Assertion(fn).to.not.change(obj,prop)};assert.increases=function(fn,obj,prop){new Assertion(fn).to.increase(obj,prop)};assert.doesNotIncrease=function(fn,obj,prop){new Assertion(fn).to.not.increase(obj,prop)};assert.decreases=function(fn,obj,prop){new Assertion(fn).to.decrease(obj,prop)};assert.doesNotDecrease=function(fn,obj,prop){new Assertion(fn).to.not.decrease(obj,prop)};assert.ifError=function(val,msg){new Assertion(val,msg).to.not.be.ok};(function alias(name,as){assert[as]=assert[name];return alias})("Throw","throw")("Throw","throws")}},{}],10:[function(require,module,exports){module.exports=function(chai,util){chai.expect=function(val,message){return new chai.Assertion(val,message)};chai.expect.fail=function(actual,expected,message,operator){message=message||"expect.fail()";throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},chai.expect.fail)}}},{}],11:[function(require,module,exports){module.exports=function(chai,util){var Assertion=chai.Assertion;function loadShould(){function shouldGetter(){if(this instanceof String||this instanceof Number||this instanceof Boolean){return new Assertion(this.valueOf(),null,shouldGetter)}return new Assertion(this,null,shouldGetter)}function shouldSetter(value){Object.defineProperty(this,"should",{value:value,enumerable:true,configurable:true,writable:true})}Object.defineProperty(Object.prototype,"should",{set:shouldSetter,get:shouldGetter,configurable:true});var should={};should.fail=function(actual,expected,message,operator){message=message||"should.fail()";throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},should.fail)};should.equal=function(val1,val2,msg){new Assertion(val1,msg).to.equal(val2)};should.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.Throw(errt,errs)};should.exist=function(val,msg){new Assertion(val,msg).to.exist};should.not={};should.not.equal=function(val1,val2,msg){new Assertion(val1,msg).to.not.equal(val2)};should.not.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.not.Throw(errt,errs)};should.not.exist=function(val,msg){new Assertion(val,msg).to.not.exist};should["throw"]=should["Throw"];should.not["throw"]=should.not["Throw"];return should}chai.should=loadShould;chai.Should=loadShould}},{}],12:[function(require,module,exports){var transferFlags=require("./transferFlags");var flag=require("./flag");var config=require("../config");var hasProtoSupport="__proto__"in Object;var excludeNames=/^(?:length|name|arguments|caller)$/;var call=Function.prototype.call,apply=Function.prototype.apply;module.exports=function(ctx,name,method,chainingBehavior){if(typeof chainingBehavior!=="function"){chainingBehavior=function(){}}var chainableBehavior={method:method,chainingBehavior:chainingBehavior};if(!ctx.__methods){ctx.__methods={}}ctx.__methods[name]=chainableBehavior;Object.defineProperty(ctx,name,{get:function(){chainableBehavior.chainingBehavior.call(this);var assert=function assert(){var old_ssfi=flag(this,"ssfi");if(old_ssfi&&config.includeStack===false)flag(this,"ssfi",assert);var result=chainableBehavior.method.apply(this,arguments);return result===undefined?this:result};if(hasProtoSupport){var prototype=assert.__proto__=Object.create(this);prototype.call=call;prototype.apply=apply}else{var asserterNames=Object.getOwnPropertyNames(ctx);asserterNames.forEach(function(asserterName){if(!excludeNames.test(asserterName)){var pd=Object.getOwnPropertyDescriptor(ctx,asserterName);Object.defineProperty(assert,asserterName,pd)}})}transferFlags(this,assert);return assert},configurable:true})}},{"../config":7,"./flag":15,"./transferFlags":31}],13:[function(require,module,exports){var config=require("../config");var flag=require("./flag");module.exports=function(ctx,name,method){ctx[name]=function(){var old_ssfi=flag(this,"ssfi");if(old_ssfi&&config.includeStack===false)flag(this,"ssfi",ctx[name]);var result=method.apply(this,arguments);return result===undefined?this:result}}},{"../config":7,"./flag":15}],14:[function(require,module,exports){module.exports=function(ctx,name,getter){Object.defineProperty(ctx,name,{get:function(){var result=getter.call(this);return result===undefined?this:result},configurable:true})}},{}],15:[function(require,module,exports){module.exports=function(obj,key,value){var flags=obj.__flags||(obj.__flags=Object.create(null));if(arguments.length===3){flags[key]=value}else{return flags[key]}}},{}],16:[function(require,module,exports){module.exports=function(obj,args){return args.length>4?args[4]:obj._obj}},{}],17:[function(require,module,exports){module.exports=function getEnumerableProperties(object){var result=[];for(var name in object){result.push(name)}return result}},{}],18:[function(require,module,exports){var flag=require("./flag"),getActual=require("./getActual"),inspect=require("./inspect"),objDisplay=require("./objDisplay");module.exports=function(obj,args){var negate=flag(obj,"negate"),val=flag(obj,"object"),expected=args[3],actual=getActual(obj,args),msg=negate?args[2]:args[1],flagMsg=flag(obj,"message");if(typeof msg==="function")msg=msg();msg=msg||"";msg=msg.replace(/#{this}/g,objDisplay(val)).replace(/#{act}/g,objDisplay(actual)).replace(/#{exp}/g,objDisplay(expected));return flagMsg?flagMsg+": "+msg:msg}},{"./flag":15,"./getActual":16,"./inspect":25,"./objDisplay":26}],19:[function(require,module,exports){module.exports=function(func){if(func.name)return func.name;var match=/^\s?function ([^(]*)\(/.exec(func);return match&&match[1]?match[1]:""}},{}],20:[function(require,module,exports){var hasProperty=require("./hasProperty");module.exports=function getPathInfo(path,obj){var parsed=parsePath(path),last=parsed[parsed.length-1];var info={parent:parsed.length>1?_getPathValue(parsed,obj,parsed.length-1):obj,name:last.p||last.i,value:_getPathValue(parsed,obj)};info.exists=hasProperty(info.name,info.parent);return info};function parsePath(path){var str=path.replace(/\[/g,".["),parts=str.match(/(\\\.|[^.]+?)+/g);return parts.map(function(value){var re=/\[(\d+)\]$/,mArr=re.exec(value);if(mArr)return{i:parseFloat(mArr[1])};else return{p:value}})}function _getPathValue(parsed,obj,index){var tmp=obj,res;index=index===undefined?parsed.length:index;for(var i=0,l=index;i<l;i++){var part=parsed[i];if(tmp){if("undefined"!==typeof part.p)tmp=tmp[part.p];else if("undefined"!==typeof part.i)tmp=tmp[part.i];if(i==l-1)res=tmp}else{res=undefined}}return res}},{"./hasProperty":23}],21:[function(require,module,exports){var getPathInfo=require("./getPathInfo");module.exports=function(path,obj){var info=getPathInfo(path,obj);return info.value}},{"./getPathInfo":20}],22:[function(require,module,exports){module.exports=function getProperties(object){var result=Object.getOwnPropertyNames(subject);function addProperty(property){if(result.indexOf(property)===-1){result.push(property)}}var proto=Object.getPrototypeOf(subject);while(proto!==null){Object.getOwnPropertyNames(proto).forEach(addProperty);proto=Object.getPrototypeOf(proto)}return result}},{}],23:[function(require,module,exports){var type=require("./type");var literals={number:Number,string:String};module.exports=function hasProperty(name,obj){var ot=type(obj);if(ot==="null"||ot==="undefined")return false;if(literals[ot]&&typeof obj!=="object")obj=new literals[ot](obj);return name in obj}},{"./type":32}],24:[function(require,module,exports){var exports=module.exports={};exports.test=require("./test");exports.type=require("./type");exports.getMessage=require("./getMessage");exports.getActual=require("./getActual");exports.inspect=require("./inspect");exports.objDisplay=require("./objDisplay");exports.flag=require("./flag");exports.transferFlags=require("./transferFlags");exports.eql=require("deep-eql");exports.getPathValue=require("./getPathValue");exports.getPathInfo=require("./getPathInfo");exports.hasProperty=require("./hasProperty");exports.getName=require("./getName");exports.addProperty=require("./addProperty");exports.addMethod=require("./addMethod");exports.overwriteProperty=require("./overwriteProperty");exports.overwriteMethod=require("./overwriteMethod");exports.addChainableMethod=require("./addChainableMethod");exports.overwriteChainableMethod=require("./overwriteChainableMethod")},{"./addChainableMethod":12,"./addMethod":13,"./addProperty":14,"./flag":15,"./getActual":16,"./getMessage":18,"./getName":19,"./getPathInfo":20,"./getPathValue":21,"./hasProperty":23,"./inspect":25,"./objDisplay":26,"./overwriteChainableMethod":27,"./overwriteMethod":28,"./overwriteProperty":29,"./test":30,"./transferFlags":31,"./type":32,"deep-eql":34}],25:[function(require,module,exports){var getName=require("./getName");var getProperties=require("./getProperties");var getEnumerableProperties=require("./getEnumerableProperties");module.exports=inspect;function inspect(obj,showHidden,depth,colors){var ctx={showHidden:showHidden,seen:[],stylize:function(str){return str}};return formatValue(ctx,obj,typeof depth==="undefined"?2:depth)}var isDOMElement=function(object){if(typeof HTMLElement==="object"){return object instanceof HTMLElement}else{return object&&typeof object==="object"&&object.nodeType===1&&typeof object.nodeName==="string"}};function formatValue(ctx,value,recurseTimes){if(value&&typeof value.inspect==="function"&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes);if(typeof ret!=="string"){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}if(isDOMElement(value)){if("outerHTML"in value){return value.outerHTML}else{try{if(document.xmlVersion){var xmlSerializer=new XMLSerializer;return xmlSerializer.serializeToString(value)}else{var ns="http://www.w3.org/1999/xhtml";var container=document.createElementNS(ns,"_");container.appendChild(value.cloneNode(false));html=container.innerHTML.replace("><",">"+value.innerHTML+"<");container.innerHTML="";return html}}catch(err){}}}var visibleKeys=getEnumerableProperties(value);var keys=ctx.showHidden?getProperties(value):visibleKeys;if(keys.length===0||isError(value)&&(keys.length===1&&keys[0]==="stack"||keys.length===2&&keys[0]==="description"&&keys[1]==="stack")){if(typeof value==="function"){var name=getName(value);var nameSuffix=name?": "+name:"";return ctx.stylize("[Function"+nameSuffix+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toUTCString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(typeof value==="function"){var name=getName(value);var nameSuffix=name?": "+name:"";base=" [Function"+nameSuffix+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){return formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){switch(typeof value){case"undefined":return ctx.stylize("undefined","undefined");case"string":var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string");case"number":if(value===0&&1/value===-Infinity){return ctx.stylize("-0","number")}return ctx.stylize(""+value,"number");case"boolean":return ctx.stylize(""+value,"boolean")}if(value===null){return ctx.stylize("null","null")}}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(Object.prototype.hasOwnProperty.call(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str;if(value.__lookupGetter__){if(value.__lookupGetter__(key)){if(value.__lookupSetter__(key)){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(value.__lookupSetter__(key)){str=ctx.stylize("[Setter]","special")}}}if(visibleKeys.indexOf(key)<0){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(value[key])<0){if(recurseTimes===null){str=formatValue(ctx,value[key],null)}else{str=formatValue(ctx,value[key],recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(typeof name==="undefined"){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)||typeof ar==="object"&&objectToString(ar)==="[object Array]"}function isRegExp(re){return typeof re==="object"&&objectToString(re)==="[object RegExp]"}function isDate(d){return typeof d==="object"&&objectToString(d)==="[object Date]"}function isError(e){return typeof e==="object"&&objectToString(e)==="[object Error]"}function objectToString(o){return Object.prototype.toString.call(o)}},{"./getEnumerableProperties":17,"./getName":19,"./getProperties":22}],26:[function(require,module,exports){var inspect=require("./inspect");var config=require("../config");module.exports=function(obj){var str=inspect(obj),type=Object.prototype.toString.call(obj);if(config.truncateThreshold&&str.length>=config.truncateThreshold){if(type==="[object Function]"){return!obj.name||obj.name===""?"[Function]":"[Function: "+obj.name+"]"}else if(type==="[object Array]"){return"[ Array("+obj.length+") ]"}else if(type==="[object Object]"){var keys=Object.keys(obj),kstr=keys.length>2?keys.splice(0,2).join(", ")+", ...":keys.join(", ");return"{ Object ("+kstr+") }"}else{return str}}else{return str}}},{"../config":7,"./inspect":25}],27:[function(require,module,exports){module.exports=function(ctx,name,method,chainingBehavior){var chainableBehavior=ctx.__methods[name];var _chainingBehavior=chainableBehavior.chainingBehavior;chainableBehavior.chainingBehavior=function(){var result=chainingBehavior(_chainingBehavior).call(this);return result===undefined?this:result};var _method=chainableBehavior.method;chainableBehavior.method=function(){var result=method(_method).apply(this,arguments);return result===undefined?this:result}}},{}],28:[function(require,module,exports){module.exports=function(ctx,name,method){var _method=ctx[name],_super=function(){return this};if(_method&&"function"===typeof _method)_super=_method;ctx[name]=function(){var result=method(_super).apply(this,arguments);return result===undefined?this:result}}},{}],29:[function(require,module,exports){module.exports=function(ctx,name,getter){var _get=Object.getOwnPropertyDescriptor(ctx,name),_super=function(){};if(_get&&"function"===typeof _get.get)_super=_get.get;Object.defineProperty(ctx,name,{get:function(){var result=getter(_super).call(this);return result===undefined?this:result},configurable:true})}},{}],30:[function(require,module,exports){var flag=require("./flag");module.exports=function(obj,args){var negate=flag(obj,"negate"),expr=args[0];return negate?!expr:expr}},{"./flag":15}],31:[function(require,module,exports){module.exports=function(assertion,object,includeAll){var flags=assertion.__flags||(assertion.__flags=Object.create(null));if(!object.__flags){object.__flags=Object.create(null)}includeAll=arguments.length===3?includeAll:true;for(var flag in flags){if(includeAll||flag!=="object"&&flag!=="ssfi"&&flag!="message"){object.__flags[flag]=flags[flag]}}}},{}],32:[function(require,module,exports){var natives={"[object Arguments]":"arguments","[object Array]":"array","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object RegExp]":"regexp","[object String]":"string"};module.exports=function(obj){var str=Object.prototype.toString.call(obj);if(natives[str])return natives[str];if(obj===null)return"null";if(obj===undefined)return"undefined";if(obj===Object(obj))return"object";return typeof obj}},{}],33:[function(require,module,exports){function exclude(){var excludes=[].slice.call(arguments);function excludeProps(res,obj){Object.keys(obj).forEach(function(key){if(!~excludes.indexOf(key))res[key]=obj[key]})}return function extendExclude(){var args=[].slice.call(arguments),i=0,res={};for(;i<args.length;i++){excludeProps(res,args[i])}return res}}module.exports=AssertionError;function AssertionError(message,_props,ssf){var extend=exclude("name","message","stack","constructor","toJSON"),props=extend(_props||{});this.message=message||"Unspecified AssertionError";this.showDiff=false;for(var key in props){this[key]=props[key]}ssf=ssf||arguments.callee;if(ssf&&Error.captureStackTrace){Error.captureStackTrace(this,ssf)}}AssertionError.prototype=Object.create(Error.prototype);AssertionError.prototype.name="AssertionError";AssertionError.prototype.constructor=AssertionError;AssertionError.prototype.toJSON=function(stack){var extend=exclude("constructor","toJSON","stack"),props=extend({name:this.name},this);if(false!==stack&&this.stack){props.stack=this.stack}return props}},{}],34:[function(require,module,exports){module.exports=require("./lib/eql")},{"./lib/eql":35}],35:[function(require,module,exports){var type=require("type-detect");var Buffer;try{Buffer=require("buffer").Buffer}catch(ex){Buffer={};Buffer.isBuffer=function(){return false}}module.exports=deepEqual;function deepEqual(a,b,m){if(sameValue(a,b)){return true}else if("date"===type(a)){return dateEqual(a,b)}else if("regexp"===type(a)){return regexpEqual(a,b)}else if(Buffer.isBuffer(a)){return bufferEqual(a,b)}else if("arguments"===type(a)){return argumentsEqual(a,b,m)}else if(!typeEqual(a,b)){return false}else if("object"!==type(a)&&"object"!==type(b)&&("array"!==type(a)&&"array"!==type(b))){return sameValue(a,b)}else{return objectEqual(a,b,m)}}function sameValue(a,b){if(a===b)return a!==0||1/a===1/b;return a!==a&&b!==b}function typeEqual(a,b){return type(a)===type(b)}function dateEqual(a,b){if("date"!==type(b))return false;return sameValue(a.getTime(),b.getTime())}function regexpEqual(a,b){if("regexp"!==type(b))return false;return sameValue(a.toString(),b.toString())}function argumentsEqual(a,b,m){if("arguments"!==type(b))return false;a=[].slice.call(a);b=[].slice.call(b);return deepEqual(a,b,m)}function enumerable(a){var res=[];for(var key in a)res.push(key);return res}function iterableEqual(a,b){if(a.length!==b.length)return false;var i=0;var match=true;for(;i<a.length;i++){if(a[i]!==b[i]){match=false;break}}return match}function bufferEqual(a,b){if(!Buffer.isBuffer(b))return false;return iterableEqual(a,b)}function isValue(a){return a!==null&&a!==undefined}function objectEqual(a,b,m){if(!isValue(a)||!isValue(b)){return false}if(a.prototype!==b.prototype){return false}var i;if(m){for(i=0;i<m.length;i++){if(m[i][0]===a&&m[i][1]===b||m[i][0]===b&&m[i][1]===a){return true}}}else{m=[]}try{var ka=enumerable(a);var kb=enumerable(b)}catch(ex){return false}ka.sort();kb.sort();if(!iterableEqual(ka,kb)){return false}m.push([a,b]);var key;for(i=ka.length-1;i>=0;i--){key=ka[i];if(!deepEqual(a[key],b[key],m)){return false}}return true}},{buffer:1,"type-detect":36}],36:[function(require,module,exports){module.exports=require("./lib/type")},{"./lib/type":37}],37:[function(require,module,exports){var exports=module.exports=getType;var natives={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};function getType(obj){var str=Object.prototype.toString.call(obj);if(natives[str])return natives[str];if(obj===null)return"null";if(obj===undefined)return"undefined";if(obj===Object(obj))return"object";return typeof obj}exports.Library=Library;function Library(){this.tests={}}Library.prototype.of=getType;Library.prototype.define=function(type,test){if(arguments.length===1)return this.tests[type];this.tests[type]=test;return this};Library.prototype.test=function(obj,type){if(type===getType(obj))return true;var test=this.tests[type];if(test&&"regexp"===getType(test)){return test.test(obj)}else if(test&&"function"===getType(test)){return test(obj)}else{throw new ReferenceError('Type test "'+type+'" not defined or invalid.')}}},{}],chai:[function(require,module,exports){module.exports=require("./lib/chai")},{"./lib/chai":5}]},{},[]);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}({"url-pattern":[function(require,module,exports){var indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++){if(i in this&&this[i]===item)return i}return-1};(function(root,factory){if("function"===typeof define&&define.amd!=null){return define([],factory)}else if(typeof exports!=="undefined"&&exports!==null){return module.exports=factory()}else{return root.UrlPattern=factory()}})(this,function(){var UrlPattern;UrlPattern=function(arg,separator){if(arg instanceof UrlPattern){this.isRegex=arg.isRegex;this.regex=arg.regex;this.names=arg.names;return this}this.isRegex=arg instanceof RegExp;if(!("string"===typeof arg||this.isRegex)){throw new TypeError("argument must be a regex or a string")}[":","*"].forEach(function(forbidden){if(separator===forbidden){throw new Error("separator can't be "+forbidden)}});if(this.isRegex){this.regex=arg}else{this.regex=new RegExp(this.toRegexString(arg,separator));this.names=this.getNames(arg,separator)}return this};UrlPattern.prototype.match=function(url){var bound,captured,i,j,len,match,name,value;match=this.regex.exec(url);if(match==null){return null}captured=match.slice(1);if(this.isRegex){return captured}bound={};for(i=j=0,len=captured.length;j<len;i=++j){value=captured[i];name=this.names[i];if(value==null){continue}if(name==="_"){if(bound._==null){bound._=[]}bound._.push(value)}else{bound[name]=value}}return bound};UrlPattern.prototype.escapeForRegex=function(string){return string.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};UrlPattern.prototype.getNames=function(arg,separator){var escapedSeparator,name,names,regex,results;if(separator==null){separator="/"}if(arg instanceof RegExp){return[]}escapedSeparator=this.escapeForRegex(separator);regex=new RegExp("((:?:[^"+escapedSeparator+"()]+)|(?:[*]))","g");names=[];results=regex.exec(arg);while(results!=null){name=results[1].slice(1);if(name==="_"){throw new TypeError(":_ can't be used as a pattern name in pattern "+arg)}if(indexOf.call(names,name)>=0){throw new TypeError("duplicate pattern name :"+name+" in pattern "+arg)}names.push(name||"_");results=regex.exec(arg)}return names};UrlPattern.prototype.escapeSeparators=function(string,separator){var escapedSeparator,regex;if(separator==null){separator="/"}escapedSeparator=UrlPattern.prototype.escapeForRegex(separator);regex=new RegExp(escapedSeparator,"g");return string.replace(regex,escapedSeparator)};UrlPattern.prototype.toRegexString=function(string,separator){var escapedSeparator,stringWithEscapedSeparators;if(separator==null){separator="/"}stringWithEscapedSeparators=UrlPattern.prototype.escapeSeparators(string,separator);stringWithEscapedSeparators=stringWithEscapedSeparators.replace(/\((.*?)\)/g,"(?:$1)?").replace(/\*/g,"(.*?)");escapedSeparator=UrlPattern.prototype.escapeForRegex(separator);UrlPattern.prototype.getNames(string,separator).forEach(function(name){return stringWithEscapedSeparators=stringWithEscapedSeparators.replace(":"+name,"([^\\"+separator+"]+)")});return"^"+stringWithEscapedSeparators+"$"};return UrlPattern})},{}]},{},[]);var assert=require("chai").assert;var R=require("ramda");var UrlPattern=require("url-pattern");var patterns=["#/foos/new","#/foos/:id","#/"];var path=routes(patterns,"#/foos/new");assert.equal(path.pattern,"#/foos/1");function routes(patterns,hash){return{pattern:"#/foos/1"}} |
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", | |
"chai": "2.1.2", | |
"url-pattern": "0.7.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment