Skip to content

Instantly share code, notes, and snippets.

@donnut
Last active August 29, 2015 14:07
Show Gist options
  • Save donnut/1d73c10d2837b455e649 to your computer and use it in GitHub Desktop.
Save donnut/1d73c10d2837b455e649 to your computer and use it in GitHub Desktop.
requirebin sketch
var domify = require('domify')
var R = require('ramda');
var assert = require('assert');
var obj = {person: {name: 'Joe'}};
var clone = R.cloneObj(obj);
clone.person.name = 'Doe';
document.body.appendChild(domify(obj.person.name + ": should be Joe"));
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}({domify:[function(require,module,exports){module.exports=parse;var map={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};map.td=map.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];map.option=map.optgroup=[1,'<select multiple="multiple">',"</select>"];map.thead=map.tbody=map.colgroup=map.caption=map.tfoot=[1,"<table>","</table>"];map.text=map.circle=map.ellipse=map.line=map.path=map.polygon=map.polyline=map.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function parse(html,doc){if("string"!=typeof html)throw new TypeError("String expected");if(!doc)doc=document;var m=/<([\w:]+)/.exec(html);if(!m)return doc.createTextNode(html);html=html.replace(/^\s+|\s+$/g,"");var tag=m[1];if(tag=="body"){var el=doc.createElement("html");el.innerHTML=html;return el.removeChild(el.lastChild)}var wrap=map[tag]||map._default;var depth=wrap[0];var prefix=wrap[1];var suffix=wrap[2];var el=doc.createElement("div");el.innerHTML=prefix+html+suffix;while(depth--)el=el.lastChild;if(el.firstChild==el.lastChild){return el.removeChild(el.firstChild)}var fragment=doc.createDocumentFragment();while(el.firstChild){fragment.appendChild(el.removeChild(el.firstChild))}return fragment}},{}]},{},[]);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(factory){if(typeof exports==="object"){module.exports=factory(this)}else if(typeof define==="function"&&define.amd){define(factory)}else{this.R=this.ramda=factory(this)}})(function(){"use strict";var R={version:"0.5.0"};function _slice(args,from,to){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return _slice(args,0,args.length);case 2:return _slice(args,from,args.length);default:var length=to-from,list=new Array(length),idx=-1;while(++idx<length){list[idx]=args[from+idx]}return list}}var concat=function _concat(set1,set2){set1=set1||[];set2=set2||[];var length1=set1.length,length2=set2.length,result=new Array(length1+length2);for(var idx=0;idx<length1;idx++){result[idx]=set1[idx]}for(idx=0;idx<length2;idx++){result[idx+length1]=set2[idx]}return result};var toString=Object.prototype.toString;var isArray=Array.isArray||function _isArray(val){return val&&val.length>=0&&toString.call(val)==="[object Array]"};R.isArrayLike=function isArrayLike(x){return isArray(x)||!!x&&typeof x==="object"&&!(x instanceof String)&&(!!(x.nodeType===1&&x.length)||x.length>=0)};var NO_ARGS_EXCEPTION=new TypeError("Function called with no arguments");function curry2(fn){return function(a,b){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(b){return fn(a,b)};default:return fn(a,b)}}}function curry3(fn){return function(a,b,c){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return curry2(function(b,c){return fn(a,b,c)});case 2:return function(c){return fn(a,b,c)};default:return fn(a,b,c)}}}if(typeof Object.defineProperty==="function"){try{Object.defineProperty(R,"_",{writable:false,value:void 0})}catch(e){}}var _=R._;void _;var op=R.op=function op(fn){var length=fn.length;if(length<2){throw new Error("Expected binary function.")}var left=curry(fn),right=curry(R.flip(fn));return function(a,b){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return right(a);case 2:return b===R._?left(a):left.apply(null,arguments);default:return left.apply(null,arguments)}}};var curryN=R.curryN=function curryN(length,fn){return function recurry(args){return arity(Math.max(length-(args&&args.length||0),0),function(){if(arguments.length===0){throw NO_ARGS_EXCEPTION}var newArgs=concat(args,arguments);if(newArgs.length>=length){return fn.apply(this,newArgs)}else{return recurry(newArgs)}})}([])};var curry=R.curry=function curry(fn){return curryN(fn.length,fn)};var hasMethod=function _hasMethod(methodName,obj){return obj&&!isArray(obj)&&typeof obj[methodName]==="function"};function checkForMethod(methodname,fn){return function(a,b,c){var length=arguments.length;var obj=arguments[length-1],callBound=obj&&!isArray(obj)&&typeof obj[methodname]==="function";switch(arguments.length){case 0:return fn();case 1:return callBound?obj[methodname]():fn(a);case 2:return callBound?obj[methodname](a):fn(a,b);case 3:return callBound?obj[methodname](a,b):fn(a,b,c)}}}var nAry=R.nAry=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:return fn}};R.unary=function _unary(fn){return nAry(1,fn)};var binary=R.binary=function _binary(fn){return nAry(2,fn)};var arity=R.arity=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:return fn}};var invoker=R.invoker=function _invoker(name,obj,len){var method=obj[name];var length=len===void 0?method.length:len;return method&&curryN(length+1,function(){if(arguments.length){var target=Array.prototype.pop.call(arguments);var targetMethod=target[name];if(targetMethod==method){return targetMethod.apply(target,arguments)}}})};var useWith=R.useWith=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.push(transformers[idx](arguments[idx]))}return fn.apply(this,args.concat(_slice(arguments,tlen)))}))};function forEach(fn,list){var idx=-1,len=list.length;while(++idx<len){fn(list[idx])}return list}R.forEach=curry2(forEach);R.forEach.idx=curry2(function forEachIdx(fn,list){var idx=-1,len=list.length;while(++idx<len){fn(list[idx],idx,list)}return list});var clone=R.clone=function _clone(list){return _slice(list)};function isEmpty(list){return!list||!list.length}R.isEmpty=isEmpty;R.prepend=curry2(function prepend(el,list){return concat([el],list)});R.cons=R.prepend;R.head=function head(list){list=list||[];return list[0]};R.car=R.head;R.last=function _last(list){list=list||[];return list[list.length-1]};R.tail=checkForMethod("tail",function(list){list=list||[];return list.length>1?_slice(list,1):[]});R.cdr=R.tail;var append=R.append=curry2(function _append(el,list){return concat(list,[el])});R.push=R.append;R.concat=curry2(function(set1,set2){if(isArray(set2)){return concat(set1,set2)}else if(R.is(String,set1)){return set1.concat(set2)}else if(hasMethod("concat",set2)){return set2.concat(set1)}else{throw new TypeError("can't concat "+typeof set2)}});var identity=R.identity=function _I(x){return x};R.I=R.identity;R.times=curry2(function _times(fn,n){var list=new Array(n);var idx=-1;while(++idx<n){list[idx]=fn(idx)}return list});R.repeatN=curry2(function _repeatN(value,n){return R.times(R.always(value),n)});function internalCompose(f,g){return function(){return f.call(this,g.apply(this,arguments))}}var compose=R.compose=function _compose(){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return arguments[0];default:var idx=arguments.length-1,fn=arguments[idx],length=fn.length;while(idx--){fn=internalCompose(arguments[idx],fn)}return arity(length,fn)}};R.pipe=function _pipe(){return compose.apply(this,_slice(arguments).reverse())};var flip=R.flip=function _flip(fn){return function(a,b){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(b){return fn.apply(this,[b,a].concat(_slice(arguments,1)))};default:return fn.apply(this,concat([b,a],_slice(arguments,2)))}}};R.lPartial=function _lPartial(fn){var args=_slice(arguments,1);return arity(Math.max(fn.length-args.length,0),function(){return fn.apply(this,concat(args,arguments))})};R.rPartial=function _rPartial(fn){var args=_slice(arguments,1);return arity(Math.max(fn.length-args.length,0),function(){return fn.apply(this,concat(arguments,args))})};R.memoize=function _memoize(fn){if(!fn.length){return once(fn)}var cache={};return function(){if(!arguments.length){return}var position=foldl(function(cache,arg){return cache[arg]||(cache[arg]={})},cache,_slice(arguments,0,arguments.length-1));var arg=arguments[arguments.length-1];return position[arg]||(position[arg]=fn.apply(this,arguments))}};var once=R.once=function _once(fn){var called=false,result;return function(){if(called){return result}called=true;result=fn.apply(this,arguments);return result}};R.wrap=function _wrap(fn,wrapper){return function(){return wrapper.apply(this,concat([fn],arguments))}};var constructN=R.constructN=curry2(function _constructN(n,Fn){var f=function(){var Temp=function(){},inst,ret;Temp.prototype=Fn.prototype;inst=new Temp;ret=Fn.apply(inst,arguments);return Object(ret)===ret?ret:inst};return n>1?curry(nAry(n,f)):f});R.construct=function _construct(Fn){return constructN(Fn.length,Fn)};R.converge=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))}};R.reduce=curry3(function _reduce(fn,acc,list){var idx=-1,len=list.length;while(++idx<len){acc=fn(acc,list[idx])}return acc});var foldl=R.foldl=R.reduce;R.reduce.idx=curry3(function _reduceIdx(fn,acc,list){var idx=-1,len=list.length;while(++idx<len){acc=fn(acc,list[idx],idx,list)}return acc});R.foldl.idx=R.reduce.idx;R.reduceRight=curry3(checkForMethod("reduceRight",function _reduceRight(fn,acc,list){var idx=list.length;while(idx--){acc=fn(acc,list[idx])}return acc}));R.foldr=R.reduceRight;R.reduceRight.idx=curry3(function _reduceRightIdx(fn,acc,list){var idx=list.length;while(idx--){acc=fn(acc,list[idx],idx,list)}return acc});R.foldr.idx=R.reduceRight.idx;R.unfoldr=curry2(function _unfoldr(fn,seed){var pair=fn(seed);var result=[];while(pair&&pair.length){result.push(pair[0]);pair=fn(pair[1])}return result});function map(fn,list){var idx=-1,len=list.length,result=new Array(len);while(++idx<len){result[idx]=fn(list[idx])}return result}R.map=curry2(checkForMethod("map",map));R.map.idx=curry2(function _mapIdx(fn,list){var idx=-1,len=list.length,result=new Array(len);while(++idx<len){result[idx]=fn(list[idx],idx,list)}return result});R.mapObj=curry2(function _mapObject(fn,obj){return foldl(function(acc,key){acc[key]=fn(obj[key]);return acc},{},keys(obj))});R.mapObj.idx=curry2(function mapObjectIdx(fn,obj){return foldl(function(acc,key){acc[key]=fn(obj[key],key,obj);return acc},{},keys(obj))});R.ap=curry2(function _ap(fns,vs){return hasMethod("ap",fns)?fns.ap(vs):foldl(function(acc,fn){return concat(acc,map(fn,vs))},[],fns)});R.of=function _of(x,container){return hasMethod("of",container)?container.of(x):[x]};R.empty=function _empty(x){return hasMethod("empty",x)?x.empty():[]};R.chain=curry2(checkForMethod("chain",function _chain(f,list){return unnest(map(f,list))}));R.size=function _size(list){return list.length};R.length=R.size;var filter=function _filter(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){if(fn(list[idx])){result.push(list[idx])}}return result};R.filter=curry2(checkForMethod("filter",filter));function filterIdx(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){if(fn(list[idx],idx,list)){result.push(list[idx])}}return result}R.filter.idx=curry2(filterIdx);var reject=function _reject(fn,list){return filter(not(fn),list)};R.reject=curry2(reject);R.reject.idx=curry2(function _rejectIdx(fn,list){return filterIdx(not(fn),list)});R.takeWhile=curry2(checkForMethod("takeWhile",function(fn,list){var idx=-1,len=list.length;while(++idx<len&&fn(list[idx])){}return _slice(list,0,idx)}));R.take=curry2(checkForMethod("take",function(n,list){return _slice(list,0,Math.min(n,list.length))}));R.skipUntil=curry2(function _skipUntil(fn,list){var idx=-1,len=list.length;while(++idx<len&&!fn(list[idx])){}return _slice(list,idx)});R.skip=curry2(checkForMethod("skip",function _skip(n,list){if(n<list.length){return _slice(list,n)}else{return[]}}));R.find=curry2(function find(fn,list){var idx=-1;var len=list.length;while(++idx<len){if(fn(list[idx])){return list[idx]}}});R.findIndex=curry2(function _findIndex(fn,list){var idx=-1;var len=list.length;while(++idx<len){if(fn(list[idx])){return idx}}return-1});R.findLast=curry2(function _findLast(fn,list){var idx=list.length;while(idx--){if(fn(list[idx])){return list[idx]}}});R.findLastIndex=curry2(function _findLastIndex(fn,list){var idx=list.length;while(idx--){if(fn(list[idx])){return idx}}return-1});function every(fn,list){var idx=-1;while(++idx<list.length){if(!fn(list[idx])){return false}}return true}R.every=curry2(every);function some(fn,list){var idx=-1;while(++idx<list.length){if(fn(list[idx])){return true}}return false}R.some=curry2(some);var indexOf=function _indexOf(list,item,from){var idx=0,length=list.length;if(typeof from=="number"){idx=from<0?Math.max(0,length+from):from}for(;idx<length;idx++){if(list[idx]===item){return idx}}return-1};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};R.indexOf=curry2(function _indexOf(target,list){return indexOf(list,target)});R.indexOf.from=curry3(function indexOfFrom(target,fromIdx,list){return indexOf(list,target,fromIdx)});R.lastIndexOf=curry2(function _lastIndexOf(target,list){return lastIndexOf(list,target)});R.lastIndexOf.from=curry3(function lastIndexOfFrom(target,fromIdx,list){return lastIndexOf(list,target,fromIdx)});function contains(a,list){return indexOf(list,a)>-1}R.contains=curry2(contains);function containsWith(pred,x,list){var idx=-1,len=list.length;while(++idx<len){if(pred(x,list[idx])){return true}}return false}R.containsWith=curry3(containsWith);var uniq=R.uniq=function uniq(list){var idx=-1,len=list.length;var result=[],item;while(++idx<len){item=list[idx];if(!contains(item,result)){result.push(item)}}return result};R.isSet=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 uniqWith=R.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.push(item)}}return result});var pluck=R.pluck=curry2(function _pluck(p,list){return map(prop(p),list)});var makeFlat=function _makeFlat(recursive){return function __flatt(list){var value,result=[],idx=-1,j,ilen=list.length,jlen;while(++idx<ilen){if(R.isArrayLike(list[idx])){value=recursive?__flatt(list[idx]):list[idx];j=-1;jlen=value.length;while(++j<jlen){result.push(value[j])}}else{result.push(list[idx])}}return result}};R.flatten=makeFlat(true);var unnest=R.unnest=makeFlat(false);R.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});R.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});R.zipObj=curry2(function _zipObj(keys,values){var idx=-1,len=keys.length,out={};while(++idx<len){out[keys[idx]]=values[idx]}return out});R.fromPairs=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};R.xprodWith=curry3(function _xprodWith(fn,a,b){if(isEmpty(a)||isEmpty(b)){return[]}var idx=-1,ilen=a.length,j,jlen=b.length,result=[];while(++idx<ilen){j=-1;while(++j<jlen){result.push(fn(a[idx],b[j]))}}return result});R.xprod=curry2(function _xprod(a,b){if(isEmpty(a)||isEmpty(b)){return[]}var idx=-1;var ilen=a.length;var j;var jlen=b.length;var result=[];while(++idx<ilen){j=-1;while(++j<jlen){result.push([a[idx],b[j]])}}return result});R.reverse=function _reverse(list){return clone(list||[]).reverse()};R.range=curry2(function _range(from,to){if(from>=to){return[]}var idx=0,result=new Array(Math.floor(to)-Math.ceil(from));for(;from<to;idx++,from++){result[idx]=from}return result});R.join=invoker("join",Array.prototype);R.slice=invoker("slice",Array.prototype);R.slice.from=curry2(function(a,xs){return xs.slice(a,xs.length)});R.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)))});R.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))});R.insert.all=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 comparator=R.comparator=function _comparator(pred){return function(a,b){return pred(a,b)?-1:pred(b,a)?1:0}};R.sort=curry2(function sort(comparator,list){return clone(list).sort(comparator)});R.groupBy=curry2(function _groupBy(fn,list){return foldl(function(acc,elt){var key=fn(elt);acc[key]=append(elt,acc[key]||(acc[key]=[]));return acc},{},list)});R.partition=curry2(function _partition(pred,list){return foldl(function(acc,elt){acc[pred(elt)?0:1].push(elt);return acc},[[],[]],list)});R.tap=curry2(function _tap(x,fn){if(typeof fn==="function"){fn(x)}return x});R.eq=curry2(function _eq(a,b){return a===b});var prop=R.prop=function prop(p,obj){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function _prop(obj){return obj[p]}}return obj[p]};R.get=R.prop;R.props=flip(R.prop);var hasOwnProperty=Object.prototype.hasOwnProperty;R.propOrDefault=curry3(function _propOrDefault(p,val,obj){return hasOwnProperty.call(obj,p)?obj[p]:val});R.func=function _func(funcName,obj){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(obj){return obj[funcName].apply(obj,_slice(arguments,1))};default:return obj[funcName].apply(obj,_slice(arguments,2))}};var always=R.always=function _always(val){return function(){return val}};var nativeKeys=Object.keys;var keys=R.keys=function(){var hasEnumBug=!{toString:null}.propertyIsEnumerable("toString");var nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];return function _keys(obj){if(!R.is(Object,obj)){return[]}if(nativeKeys){return nativeKeys(Object(obj))}var prop,ks=[],nIdx;for(prop in obj){if(hasOwnProperty.call(obj,prop)){ks.push(prop)}}if(hasEnumBug){nIdx=nonEnumerableProps.length;while(nIdx--){prop=nonEnumerableProps[nIdx];if(hasOwnProperty.call(obj,prop)&&!R.contains(prop,ks)){ks.push(prop)}}}return ks}}();R.keysIn=function _keysIn(obj){var prop,ks=[];for(prop in obj){ks.push(prop)}return ks};var pairWith=function(fn){return function(obj){return R.map(function(key){return[key,obj[key]]},fn(obj))}};R.toPairs=pairWith(R.keys);R.toPairsIn=pairWith(R.keysIn);R.values=function _values(obj){var props=keys(obj),length=props.length,vals=new Array(length);for(var idx=0;idx<length;idx++){vals[idx]=obj[props[idx]]}return vals};R.valuesIn=function _valuesIn(obj){var prop,vs=[];for(prop in obj){vs.push(obj[prop])}return vs};function pickWith(test,obj){var copy={},props=keys(obj),prop,val;for(var idx=0,len=props.length;idx<len;idx++){prop=props[idx];val=obj[prop];if(test(val,prop,obj)){copy[prop]=val}}return copy}R.pick=curry2(function pick(names,obj){return pickWith(function(val,key){return contains(key,names)},obj)});R.omit=curry2(function omit(names,obj){return pickWith(function(val,key){return!contains(key,names)},obj)});R.pickWith=curry2(pickWith);var pickAll=function _pickAll(names,obj){var copy={};forEach(function(name){copy[name]=obj[name]},names);return copy};R.pickAll=curry2(pickAll);function extend(destination,other){var props=keys(other),idx=-1,length=props.length;while(++idx<length){destination[props[idx]]=other[props[idx]]}return destination}R.mixin=curry2(function _mixin(a,b){return extend(extend({},a),b)});R.cloneObj=function(obj){return extend({},obj)};R.eqProps=curry3(function eqProps(prop,obj1,obj2){return obj1[prop]===obj2[prop]});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}R.where=function where(spec,testObj){var parsedSpec=R.groupBy(function(key){return typeof spec[key]==="function"?"fn":"obj"},keys(spec));switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(testObj){return satisfiesSpec(spec,parsedSpec,testObj)}}return satisfiesSpec(spec,parsedSpec,testObj)};R.installTo=function(obj){return extend(obj,R)};R.is=curry2(function is(ctor,val){return val!=null&&val.constructor===ctor||val instanceof ctor});R.alwaysZero=always(0);R.alwaysFalse=always(false);R.alwaysTrue=always(true);R.and=curry2(function and(f,g){return function _and(){return!!(f.apply(this,arguments)&&g.apply(this,arguments))}});R.or=curry2(function or(f,g){return function _or(){return!!(f.apply(this,arguments)||g.apply(this,arguments))}});var not=R.not=function _not(f){return function(){return!f.apply(this,arguments)}};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)}};R.allPredicates=predicateWrap(every);R.anyPredicates=predicateWrap(some);var add=R.add=curry2(function _add(a,b){return a+b});var multiply=R.multiply=curry2(function _multiply(a,b){return a*b});R.subtract=op(function _subtract(a,b){return a-b});R.divide=op(function _divide(a,b){return a/b});R.modulo=op(function _modulo(a,b){return a%b});var isInteger=Number.isInteger||function isInteger(n){return n<<0===n};R.mathMod=op(function _mathMod(m,p){if(!isInteger(m)){return NaN}if(!isInteger(p)||p<1){return NaN}return(m%p+p)%p});R.sum=foldl(add,0);R.product=foldl(multiply,1);R.lt=op(function _lt(a,b){return a<b});R.lte=op(function _lte(a,b){return a<=b});R.gt=op(function _gt(a,b){return a>b});R.gte=op(function _gte(a,b){return a>=b});var max=R.max=function _max(list){return foldl(binary(Math.max),-Infinity,list)};R.maxWith=curry2(function _maxWith(keyFn,list){if(!(list&&list.length>0)){return}var idx=0,winner=list[idx],max=keyFn(winner),testKey;while(++idx<list.length){testKey=keyFn(list[idx]);if(testKey>max){max=testKey;winner=list[idx]}}return winner});R.min=function _min(list){return foldl(binary(Math.min),Infinity,list)};R.minWith=curry2(function _minWith(keyFn,list){if(!(list&&list.length>0)){return}var idx=0,winner=list[idx],min=keyFn(list[idx]),testKey;while(++idx<list.length){testKey=keyFn(list[idx]);if(testKey<min){min=testKey;winner=list[idx]}}return winner});var substring=R.substring=invoker("substring",String.prototype);R.substringFrom=flip(substring)(void 0);R.substringTo=substring(0);R.charAt=invoker("charAt",String.prototype);R.charCodeAt=invoker("charCodeAt",String.prototype);R.match=invoker("match",String.prototype);R.strIndexOf=curry2(function _strIndexOf(c,str){return str.indexOf(c)});R.strLastIndexOf=curry2(function(c,str){return str.lastIndexOf(c)});R.toUpperCase=invoker("toUpperCase",String.prototype);R.toLowerCase=invoker("toLowerCase",String.prototype);R.split=invoker("split",String.prototype,1);function path(paths,obj){var idx=-1,length=paths.length,val;if(obj==null){return}val=obj;while(val!=null&&++idx<length){val=val[paths[idx]]}return val}R.pathOn=curry3(function pathOn(sep,str,obj){return path(str.split(sep),obj)});R.path=R.pathOn(".");R.project=useWith(map,R.pickAll,identity);R.propEq=curry3(function propEq(name,val,obj){return obj[name]===val});R.union=compose(uniq,R.concat);R.unionWith=curry3(function _unionWith(pred,list1,list2){return uniqWith(pred,concat(list1,list2))});R.difference=curry2(function _difference(first,second){return uniq(reject(flip(contains)(second),first))});R.differenceWith=curry3(function differenceWith(pred,first,second){return uniqWith(pred)(reject(flip(R.containsWith(pred))(second),first))});R.intersection=curry2(function intersection(list1,list2){return uniq(filter(flip(contains)(list1),list2))});R.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)});function keyValue(fn,list){return map(function(item){return{key:fn(item),val:item}},list)}R.sortBy=curry2(function sortBy(fn,list){return pluck("val",keyValue(fn,list).sort(comparator(function(a,b){return a.key<b.key})))});R.countBy=curry2(function countBy(fn,list){return foldl(function(counts,obj){counts[obj.key]=(counts[obj.key]||0)+1;return counts},{},keyValue(fn,list))});var functionsWith=function(fn){return function(obj){return R.filter(function(key){return typeof obj[key]==="function"},fn(obj))}};R.functions=functionsWith(R.keys);R.functionsIn=functionsWith(R.keysIn);return R})},{}]},{},[]);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){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],2:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)
}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+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){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))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(hasOwnProperty(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,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,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(isUndefined(name)){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.replace(/\u001b\[\d\d?m/g,"").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)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":1,_process:4,inherits:3}],3:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],4:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}if(canPost){var queue=[];window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],assert:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&(isNaN(value)||!isFinite(value))){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(isArguments(a)){if(!isArguments(b)){return false}a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}try{var ka=objectKeys(a),kb=objectKeys(b),key,i}catch(e){return false}if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":2}]},{},[]);var domify=require("domify");var R=require("ramda");var assert=require("assert");var obj={person:{name:"Joe"}};var clone=R.cloneObj(obj);clone.person.name="Doe";document.body.appendChild(domify(obj.person.name+": should be Joe"));
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"domify": "1.3.0",
"ramda": "0.5.0"
}
}
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment