From a53d2521b00901170398ed2cf610851a40a3b86c Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 15:54:49 -0600 Subject: [PATCH 01/19] comitting and pushing new patch version --- .gitignore | 1 + build/index.js | 1410 +++----------------------------- build/index.js.map | 1 + fuse.js | 77 ++ package.json | 34 +- src/batch.js | 6 +- src/index.js | 30 +- src/mixin.js | 11 +- src/vdom.js | 7 +- webpack.config.js | 33 - yarn.lock | 1896 +++++++++++++++++++++----------------------- 11 files changed, 1146 insertions(+), 2360 deletions(-) create mode 100644 build/index.js.map create mode 100644 fuse.js delete mode 100644 webpack.config.js diff --git a/.gitignore b/.gitignore index 7e7aa32..e6e54c7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ coverage .lock-wscript build/*.json node_modules +.fusebox diff --git a/build/index.js b/build/index.js index 2ceff71..6a8f653 100644 --- a/build/index.js +++ b/build/index.js @@ -1,706 +1,121 @@ -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; +(function(FuseBox){ +FuseBox.pkg("clan-fp", {}, function(___scope___){ +___scope___.file("batch.js", function(exports, require, module, __filename, __dirname){ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.l = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // identity function for calling harmory imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; - -/******/ // define getter function for harmory exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ }; - -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; - -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/"; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./src/batch.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -// batched requests +'use strict';Object.defineProperty(exports,'__esModule',{value:!0});function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}// batched requests // The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or // back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another // to that URL is "in-flight", the Promise returned by both of those calls will be resolved by a single network request. - // f :: (url -> options) -> Promise -const batch = f => { - let inflight = {}; - - return (url, options = {}) => { - let { method } = options, - key = `${ url }:${ JSON.stringify(options) }`; - - if ((method || '').toLowerCase() === 'post') return f(url, _extends({}, options, { compress: false })); - - return inflight[key] || (inflight[key] = new Promise((res, rej) => { - f(url, _extends({}, options, { compress: false })).then(d => res(d)).catch(e => rej(e)); - }).then(data => { - inflight = _extends({}, inflight, { [key]: undefined }); - return data; - }).catch(e => console.error(e, url))); - }; -}; - -/* harmony default export */ exports["a"] = batch; - -/***/ }, - -/***/ "./src/fp.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -const log = (...a) => console.log(...a); -/* harmony export (immutable) */ exports["a"] = log; - - -// rAF -const rAF = typeof document !== 'undefined' && (requestAnimationFrame || webkitRequestAnimationFrame || mozRequestAnimationFrame) || process && process.nextTick || (cb => setTimeout(cb, 16.6)); -/* harmony export (immutable) */ exports["b"] = rAF; - - -// composition +var batch=function batch(a){var b={};return function(c){var g=1 U) -> (U -> V) -> (T -> V) -const c = (f, g) => x => f(g(x)); -/* harmony export (immutable) */ exports["c"] = c; - - -// cof :: [(an -> bn)] -> a0 -> bn +var c=exports.c=function c(b,d){return function(e){return b(d(e))}};// cof :: [(an -> bn)] -> a0 -> bn // compose forward -const cof = (...fns) => fns.reduce((acc, fn) => c(acc, fn)); -/* harmony export (immutable) */ exports["d"] = cof; - - -// cob :: [(an -> bn)] -> b0 -> an +var cof=exports.cof=function cof(){for(var _len=arguments.length,b=Array(_len),_key=0;_key<_len;_key++)b[_key]=arguments[_key];return b.reduce(function(d,e){return c(d,e)})};// cob :: [(an -> bn)] -> b0 -> an // compose backwards -const cob = (...fns) => cof(...fns.reverse()); -/* harmony export (immutable) */ exports["e"] = cob; - - -// functional utilities +var cob=exports.cob=function cob(){for(var _len2=arguments.length,b=Array(_len2),_key2=0;_key2<_len2;_key2++)b[_key2]=arguments[_key2];return cof.apply(void 0,_toConsumableArray(b.reverse()))};// functional utilities // pointfree -const pf = fn => (...args) => x => fn.apply(x, args); -/* harmony export (immutable) */ exports["f"] = pf; - - -// curry +var pf=exports.pf=function pf(b){return function(){for(var _len3=arguments.length,d=Array(_len3),_key3=0;_key3<_len3;_key3++)d[_key3]=arguments[_key3];return function(e){return b.apply(e,d)}}};// curry // curry :: (T -> U) -> [args] -> ( -> U) -const curry = (fn, ...args) => fn.bind(undefined, ...args); -/* harmony export (immutable) */ exports["g"] = curry; - - -// Transducers -const mapping = mapper => // mapper: x -> y -reducer => // reducer: (state, value) -> new state -(result, value) => reducer(result, mapper(value)); -/* harmony export (immutable) */ exports["h"] = mapping; - - -const filtering = predicate => // predicate: x -> true/false -reducer => // reducer: (state, value) -> new state -(result, value) => predicate(value) ? reducer(result, value) : result; -/* harmony export (immutable) */ exports["i"] = filtering; - - -const concatter = (thing, value) => thing.concat([value]); -/* harmony export (immutable) */ exports["j"] = concatter; - - -/***/ }, - -/***/ "./src/hamt.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -// compute the hamming weight -const hamming = x => { - x -= x >> 1 & 0x55555555; - x = (x & 0x33333333) + (x >> 2 & 0x33333333); - x = x + (x >> 4) & 0x0f0f0f0f; - x += x >> 8; - x += x >> 16; - return x & 0x7f; -}; -/* harmony export (immutable) */ exports["hamming"] = hamming; - - -const popcount = root => { - if (root.key) return 1; - - let c = root.children; - if (c) { - var sum = 0; - for (var i in c) sum += popcount(c[i]); - return sum; - } -}; -/* harmony export (immutable) */ exports["popcount"] = popcount; - - -// hash fn -const hash = (v = '') => { - v = JSON.stringify(v); - var hash = 5381; - for (let i = 0; i < v.length; i++) hash = (hash << 5) + hash + v.charCodeAt(i); - return hash; -}; -/* harmony export (immutable) */ exports["hash"] = hash; - - -// compare two hashes -const comp = (a, b) => hash(a) === hash(b); -/* harmony export (immutable) */ exports["comp"] = comp; - - -// get a bit vector -const HMAP_SIZE = 8; -/* harmony export (immutable) */ exports["HMAP_SIZE"] = HMAP_SIZE; - -const MAX_DEPTH = 32 / HMAP_SIZE - 1; -/* harmony export (immutable) */ exports["MAX_DEPTH"] = MAX_DEPTH; - -const vec = (h = 0, i = 0, range = HMAP_SIZE) => h >>> range * i & (1 << range) - 1; -/* harmony export (immutable) */ exports["vec"] = vec; - - -const shallowClone = x => { - let y = Object.create(null); - for (let i in x) y[i] = x[i]; - return y; -}; -/* harmony export (immutable) */ exports["shallowClone"] = shallowClone; - - -const cloneNode = x => { - let y = node(); - if (!x) return y; - - if (x.children) { - y.children = shallowClone(x.children); - } else if (x.key !== undefined) { - y.key = x.key; - y.val = x.val; - y.hash = x.hash; - } - - return y; -}; -/* harmony export (immutable) */ exports["cloneNode"] = cloneNode; - - -const numChildren = x => { - let c = 0; - for (var i in x) ++c; - return c; -}; -/* harmony export (immutable) */ exports["numChildren"] = numChildren; - - -const set = (root, key, val) => { - if (root.key === undefined && !root.children) return node(key, val); - - const newroot = cloneNode(root), - h = hash(key); - - // walk the tree - for (var i = 3, r = root, n = newroot; i >= 0; --i) { - let bits = vec(h, i); - - if (r.key !== undefined) { - // if we have a collision - if (r.key === key || i === 0) { - // if keys match or is leaf, just overwrite n's val - n.val = val; - } else if (i !== 0) { - // else if r is not at max depth and keys don't match - // add levels to both trees, new tree must be able - // to access old data - - // 0. create makeshift value node for r - // and new value node for n - let cp = node(r.key, r.val, r.hash); - let cn = node(key, val, h); - let rh = r.hash; - - // 1. delete value props from nodes - delete r.key; - delete r.val; - delete r.hash; - delete n.key; - delete n.val; - delete n.hash; - - // 2. create layers until bit-vectors don't collide - for (let j = i, __r = r, __n = n; j >= 0; j--) { - let vecr = vec(rh, j), - vecn = vec(h, j); - - // create new layer for c and r - let c = __r.children = Object.create(null); - let d = __n.children = shallowClone(c); - - if (vecr !== vecn) { - c[vecr] = cp; - d[vecr] = cp; - d[vecn] = cn; - break; - } else { - __r = c[vecr] = node(); - __n = d[vecn] = cloneNode(__r); - } - } - } - break; - } else if (r.children) { - let _r = r.children[bits]; - if (!_r) { - n = n.children[bits] = node(key, val); - break; - } else { - r = _r; - n = n.children[bits] = cloneNode(r); - } - } - } - - return newroot; -}; -/* harmony export (immutable) */ exports["set"] = set; - - -const get = (root, key) => { - if (root.key === key) return root.val; - const h = hash(key); - for (let i = 3, r = root; i >= 0; --i) { - if (!r.children) return undefined; - r = r.children[vec(h, i)]; - if (!r) return undefined; - if (r.key !== undefined) return r.val; - } - - return undefined; -}; -/* harmony export (immutable) */ exports["get"] = get; - - -const first = root => { - let c = root.children; - for (let i in c) return c[i]; -}; -/* harmony export (immutable) */ exports["first"] = first; - - -const unset = (root, key) => { - const n = cloneNode(root), - h = hash(key); - - for (var i = 3, _n = n, p = n; i >= -1; --i) { - if (_n.key) { - delete _n.key; - delete _n.val; - delete _n.hash; - return n; - - // let c = numChildren(p) - - // if(c === 1) { - // // if only child, delete child and parent? - // delete p.children - // } else if(c===2){ - // // if 2 children, promote sibling as parent value nod - // delete p.children[bits] - // let sibling = first(p) - // delete p.children - // if(sibling.children){ - // p.children = sibling.children - // } else if(p.key) { - // p.val = sibling.val - // p.hash = sibling.hash - // p.key = sibling.key - // } - // } else { - // // if more than 2 children, just delete the one - // delete p.children[bits] - // } - // return n - } - - const bits = vec(h, i); - _n = _n && _n.children && _n.children[bits]; - if (!_n) return n; - p = _n; - } - return n; -}; -/* harmony export (immutable) */ exports["unset"] = unset; - - -const node = (key, val, h = key !== undefined && hash(key)) => { - /* +var curry=exports.curry=function curry(b){for(var _len4=arguments.length,d=Array(1<_len4?_len4-1:0),_key4=1;_key4<_len4;_key4++)d[_key4-1]=arguments[_key4];return b.bind.apply(b,[void 0].concat(d))};// Transducers +var mapping=exports.mapping=function mapping(b){return(// mapper: x -> y +function(d){return(// reducer: (state, value) -> new state +function(e,h){return d(e,b(h))})})};var filtering=exports.filtering=function filtering(b){return(// predicate: x -> true/false +function(d){return(// reducer: (state, value) -> new state +function(e,h){return b(h)?d(e,h):e})})};var concatter=exports.concatter=function concatter(b,d){return b.concat([d])}; +}); +___scope___.file("hamt.js", function(exports, require, module, __filename, __dirname){ + +'use strict';Object.defineProperty(exports,'__esModule',{value:!0});// compute the hamming weight +var hamming=exports.hamming=function hamming(e){return e-=1431655765&e>>1,e=(858993459&e)+(858993459&e>>2),e=252645135&e+(e>>4),e>>=8,e>>=16,127&e};var popcount=exports.popcount=function popcount(e){if(e.key)return 1;var f=e.children;if(f){var g=0;for(var l in f)g+=popcount(f[l]);return g}};// hash fn +var hash=exports.hash=function hash(){var e=0>>g*f&(1< points to other nodes (List children) - */ - - let item = Object.create(null); - if (key !== undefined) { - item.key = key; - item.hash = h; - item.val = val; - } - return item; -}; -/* harmony export (immutable) */ exports["node"] = node; - - -const map = (root, fn) => { - if (root.key !== undefined) return node(root.key, fn(root.val, root.key), root.hash); - - let d = cloneNode(root), - c = d.children; - - if (c) { - for (var i in c) { - c[i] = map(c[i], fn); - } - } - - return d; -}; -/* harmony export (immutable) */ exports["map"] = map; - - -const filter = (root, fn) => { - if (root.key !== undefined) return fn(root.val, root.key) ? root : undefined; - - let d = cloneNode(root), - c = d.children; - - if (c) { - for (var i in c) { - if (!filter(c[i], fn)) delete c[i]; - } - } - - return d; -}; -/* harmony export (immutable) */ exports["filter"] = filter; - - -const reduce = (root, fn, acc) => { - if (root.key !== undefined) return fn(acc, root.val, root.key); - - let c = root.children; - if (c) { - for (var i in c) acc = reduce(c[i], fn, acc); - - return acc; - } -}; -/* harmony export (immutable) */ exports["reduce"] = reduce; - - -const toList = (root, r = []) => { - if (root.key !== undefined) r.push(root.val); - - let c = root.children; - if (c) { - for (var i in c) { - toList(c[i], r); - } - } - - return r; -}; -/* harmony export (immutable) */ exports["toList"] = toList; - - -const toOrderedList = (root, r = []) => { - let i = 0, - n; - - do { - n = get(root, i++); - n !== undefined && r.push(n); - } while (n); - - return r; -}; -/* harmony export (immutable) */ exports["toOrderedList"] = toOrderedList; - - -const toJSON = (root, r = {}) => { - if (root.key !== undefined) r[root.key] = root.val; - - let c = root.children; - if (c) { - for (var i in c) { - toJson(c[i], r); - } - } - - return r; -}; -/* harmony export (immutable) */ exports["toJSON"] = toJSON; - - -const push = (root, val) => set(root, popcount(root), val); -/* harmony export (immutable) */ exports["push"] = push; - - -const pop = root => unset(root, popcount(root) - 1); -/* harmony export (immutable) */ exports["pop"] = pop; - - -const shift = root => reduce(unset(root, 0), (acc, v, k) => set(acc, k - 1, v), node()); -/* harmony export (immutable) */ exports["shift"] = shift; - - -const unshift = (root, val) => set(reduce(root, (acc, v, k) => set(acc, k + 1, v), node()), 0, val); -/* harmony export (immutable) */ exports["unshift"] = unshift; - - -const hamt = node; -/* harmony export (immutable) */ exports["hamt"] = hamt; - - -// console.clear() + */return void 0!==e&&(l.key=e,l.hash=g,l.val=f),l};var map=exports.map=function map(e,f){if(e.key!==void 0)return node(e.key,f(e.val,e.key),e.hash);var g=cloneNode(e),l=g.children;if(l)for(var m in l)l[m]=map(l[m],f);return g};var filter=exports.filter=function filter(e,f){if(e.key!==void 0)return f(e.val,e.key)?e:void 0;var g=cloneNode(e),l=g.children;if(l)for(var m in l)filter(l[m],f)||delete l[m];return g};var reduce=exports.reduce=function reduce(e,f,g){if(e.key!==void 0)return f(g,e.val,e.key);var l=e.children;if(l){for(var m in l)g=reduce(l[m],f,g);return g}};var toList=exports.toList=function toList(e){var f=1 console.log(...args) // const j = (...a) => console.log(JSON.stringify(a)) - // let x = hamt() // let s = 20 - // Array(s).fill(1).map((v,i) => { // x = set(x, i, i) // }) - // l(toList(x)) // l(toJson(x)) - // x = map(x, x => log(x*x) || x*x) // l(get(x, 19)) - // l(x) // l(reduce(x, (acc, x) => acc+x, 0)) - // x = unset(x, 1) // Array(s).fill(1).map((_,i) => { // if(!get(x, i)) l(i) // // l(get(x, i)) // }) - -/***/ }, - -/***/ "./src/index.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__batch__ = __webpack_require__("./src/batch.js"); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__vdom__ = __webpack_require__("./src/vdom.js"); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixin__ = __webpack_require__("./src/mixin.js"); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__model__ = __webpack_require__("./src/model.js"); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__observable__ = __webpack_require__("./src/observable.js"); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__hamt__ = __webpack_require__("./src/hamt.js"); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__worker__ = __webpack_require__("./src/worker.js"); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__fp__ = __webpack_require__("./src/fp.js"); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "log", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["a"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "rAF", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["b"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "c", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["c"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "cof", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["d"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "cob", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["e"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "pf", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["f"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "curry", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["g"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "mapping", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["h"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "filtering", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["i"]; })); -/* harmony namespace reexport (by provided) */ __webpack_require__.d(exports, "concatter", (function() { return __WEBPACK_IMPORTED_MODULE_7__fp__["j"]; })); - -/* harmony reexport (binding) */ __webpack_require__.d(exports, "batch", (function() { return __WEBPACK_IMPORTED_MODULE_0__batch__["a"]; })); - - -/* harmony reexport (binding) */ __webpack_require__.d(exports, "vdom", (function() { return __WEBPACK_IMPORTED_MODULE_1__vdom__["a"]; })); - - -/* harmony reexport (binding) */ __webpack_require__.d(exports, "mixin", (function() { return __WEBPACK_IMPORTED_MODULE_2__mixin__["a"]; })); - - -/* harmony reexport (binding) */ __webpack_require__.d(exports, "model", (function() { return __WEBPACK_IMPORTED_MODULE_3__model__["a"]; })); - - -/* harmony reexport (binding) */ __webpack_require__.d(exports, "obs", (function() { return __WEBPACK_IMPORTED_MODULE_4__observable__["a"]; })); - - -/* harmony reexport (module object) */ __webpack_require__.d(exports, "hamt", (function() { return __WEBPACK_IMPORTED_MODULE_5__hamt__; })); - - -/* harmony reexport (module object) */ __webpack_require__.d(exports, "worker", (function() { return __WEBPACK_IMPORTED_MODULE_6__worker__; })); - - - -const hash = (v, _v = JSON.stringify(v)) => { - let hash = 0; - for (let i = 0, len = _v.length; i < len; ++i) { - const c = _v.charCodeAt(i); - hash = (hash << 5) - hash + c | 0; - } - return hash; -}; -/* harmony export (immutable) */ exports["hash"] = hash; - - -/***/ }, - -/***/ "./src/mixin.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; - -const mixin = (...classes) => { - class _mixin {} - let proto = _mixin.prototype; - - classes.map(({ prototype: p }) => { - Object.getOwnPropertyNames(p).map(key => { - let oldFn = proto[key] || (() => {}); - proto[key] = (...args) => { - oldFn(...args); - return p[key](...args); - }; - }); - }); - - return _mixin; -}; - -/* harmony default export */ exports["a"] = mixin; - -/***/ }, - -/***/ "./src/model.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -// Validate JS objects for their "shape" -const model = { - is(type, value) { - if (type && type.isValid instanceof Function) { - return type.isValid(value); - } else if (type === String && (value instanceof String || typeof value === 'string') || type === Number && (value instanceof Number || typeof value === 'number') || type === Boolean && (value instanceof Boolean || typeof value === 'boolean') || type === Function && (value instanceof Function || typeof value === 'function') || type === Object && (value instanceof Object || typeof value === 'object') || type === undefined) { - return true; - } - - return false; - }, - check(types, required, data) { - Object.keys(types).forEach(key => { - let t = types[key], - value = data[key]; - - if (required[key] || value !== undefined) { - if (!(t instanceof Array)) t = [t]; - - let i = t.reduce((a, _type) => a || MODEL.is(_type, value), false); - if (!i) { - throw `{${ key }: ${ JSON.stringify(value) }} is not one of ${ t.map(x => `\n - ${ x }`) }`; - } - } - }); - - return true; - }, - init(...args) { - let types, required, logic; - args.map(x => { - if (x instanceof Function && !logic) { - logic = x; - } else if (typeof x === 'object') { - if (!types) { - types = x; - } else if (!required) { - required = x; - } - } - }); - - const isValid = data => { - const pipe = logic ? [check, logic] : [check]; - return pipe.reduce((a, v) => a && v(types || {}, required || {}, data), true); - }; - - const whenValid = data => new Promise((res, rej) => isValid(data) && res(data)); - - return { isValid, whenValid }; - }, - ArrayOf(M) { - return MODEL.init((t, r, data) => { - if (!(data instanceof Array)) throw `${ data } not an Array`; - data.map(x => { - if (!MODEL.is(M, x)) throw `${ x } is not a model instance`; - }); - return true; - }); - } -}; - -/* harmony default export */ exports["a"] = model; - -/** +}); +___scope___.file("index.js", function(exports, require, module, __filename, __dirname){ + +'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.hash=void 0;var _batch=require('./batch'),_batch2=_interopRequireDefault(_batch),_vdom=require('./vdom'),_vdom2=_interopRequireDefault(_vdom),_mixin=require('./mixin'),_mixin2=_interopRequireDefault(_mixin),_model=require('./model'),_model2=_interopRequireDefault(_model),_observable=require('./observable'),_observable2=_interopRequireDefault(_observable),_hamt=require('./hamt'),hamt=_interopRequireWildcard(_hamt),_worker=require('./worker'),worker=_interopRequireWildcard(_worker),_fp=require('./fp'),fp=_interopRequireWildcard(_fp);function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var hash=exports.hash=function hash(a){var b=1L){var M=K.children[L];K.insertBefore(J,M)}else K.appendChild(J)},D=function D(J,K){// if vdom is a function, execute it until it isn't +for(var L=2_N2.length;)B(_O2[_O2.length-1]);for(var _P2=0;_P2P?O():(L=!0,J)})};return{finish:O,resolve:function resolve(P){var Q=Object.keys(P);if(!Q.length)return Promise.resolve(!0);var R=[];return Q.forEach(function(S){for(var T=P[S];T instanceof Function;)T=T();T&&T.then instanceof Function&&R.push(T.then(function(U){return J[S]=U}))}),M(R)},getState:function getState(){return J},promises:K,isDone:function isDone(){return L}}},F=function F(J,K){for(var L=J(K);L instanceof Function;)L=J(instance.getState());return L},G=['className','id'],H=function H(J){for(;J instanceof Function;)J=J();return J instanceof Array?new Promise(function(K){return K(I.apply(void 0,_toConsumableArray(J)))}):J?'object'==('undefined'==typeof J?'undefined':_typeof(J))?(J.resolve?J.resolve():Promise.resolve()).then(function(K){if(K||(K=J),K instanceof Array)return new Promise(function(W){return W(I.apply(void 0,_toConsumableArray(K)))});var _K=K,L=_K.tag,M=_K.id,N=_K.className,O=_K.attrs,P=_K.children,Q=_K.instance,R=M||O&&O.id?' id="'+(M||O&&O.id||'')+'"':'',S=N||O&&O.className?' class="'+((N||'')+' '+(O.className||'')).trim()+'"':'';l(K);var T='',U='';for(var V in O||Object.create(null))'style'===V?T+=' style="'+y(O[V])+'"':'innerHTML'===V?U=O[V]:-1===G.indexOf(V)&&(T+=' '+V+'="'+O[V]+'"');return!U&&P?I.apply(void 0,_toConsumableArray(P)).then(function(W){return'<'+L+R+S+T+'>'+W+''}):0==='br,input,img'.split(',').filter(function(W){return W===L}).length?new Promise(function(W){return W('<'+L+R+S+T+'>'+U+'')}):new Promise(function(W){return W('<'+L+R+S+T+' />')})}):new Promise(function(K){return K(J)}):new Promise(function(K){return K('')})},I=function I(){for(var _len3=arguments.length,J=Array(_len3),_key3=0;_key3<_len3;_key3++)J[_key3]=arguments[_key3];return Promise.all(J.map(H)).then(function(K){return K.filter(function(L){return!!L}).join('')})};// creatign html, strip events from DOM element... for now just deleting +// recycle or create a new el +// find parent element, and remove the input element +return{container:function container(J){var K=1 log(e+'')) **/ +}); +___scope___.file("observable.js", function(exports, require, module, __filename, __dirname){ -/***/ }, - -/***/ "./src/observable.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -// async-supporting-observables -const obs = state => { - let subscribers = []; - - const fn = val => { - if (val !== undefined) { - state = val; - for (let i = 0, len = subscribers.length; i < len; i++) subscribers[i](val); - } - return state; - }; - - fn.map = f => { - const o = obs(); - subscribers.push(val => o(f(val))); - return o; - }; - - fn.filter = f => { - const o = obs(); - subscribers.push(val => f(val) && o(val)); - return o; - }; - - fn.then = f => { - subscribers.push(val => f(val)); - return fn; - }; - - fn.take = n => { - const values = [], - o = obs(); - - const cb = val => { - if (values.length < n) values.push(val); - - if (values.length === n) { - subscribers.delete(cb); - return o(values); - } - }; - - subscribers.push(cb); - - return o; - }; - - fn.takeWhile = f => { - const values = [], - o = obs(); - - const cb = val => { - if (!f(val)) { - subscribers = subscribers.filter(x => x !== cb); - return o(values); - } - - values.push(val); - }; - - subscribers.push(cb); - - return o; - }; - - fn.reduce = (f, acc) => { - const o = obs(); - - subscribers.push(val => { - acc = f(acc, val); - o(acc); - }); - - return o; - }; - - fn.maybe = f => { - const success = obs(), - error = obs(), - cb = val => f(val).then(d => success(d)).catch(e => error(e)); - - subscribers.push(cb); - - return [success, error]; - }; - - fn.stop = () => subscribers = []; - - fn.debounce = ms => { - const o = obs(); - let ts = +new Date(); - subscribers.push(val => { - const now = +new Date(); - if (now - ts >= ms) { - ts = +new Date(); - o(val); - } - }); - return o; - }; - - return fn; -}; - -obs.from = f => { - const o = obs(); - f(x => o(x)); - return o; -}; - -obs.union = (...fs) => { - const o = obs(); - fs.map(f => f.then(o)); - return o; -}; - -/* harmony default export */ exports["a"] = obs; - -/***/ }, - -/***/ "./src/vdom.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -const rAF = typeof document !== 'undefined' && (requestAnimationFrame || webkitRequestAnimationFrame || mozRequestAnimationFrame) || process && process.nextTick || (cb => setTimeout(cb, 16.6)); - -// Virtual DOMs -const vdom = (() => { - const class_id_regex = () => { - return (/[#\.][^#\.]+/ig - ); - }, - tagName_regex = () => { - return (/^([^\.#]+)\b/i - ); - }; - - const parseSelector = s => { - let test = null, - tagreg = tagName_regex().exec(s), - tag = tagreg && tagreg.slice(1)[0], - reg = class_id_regex(), - vdom = Object.create(null); - - if (tag) s = s.substr(tag.length); - vdom.className = ''; - vdom.tag = tag || 'div'; - - while ((test = reg.exec(s)) !== null) { - test = test[0]; - if (test[0] === '.') vdom.className = (vdom.className + ' ' + test.substr(1)).trim();else if (test[0] === '#') vdom.id = test.substr(1); - } - return vdom; - }; - - const debounce = (func, wait, immediate, timeout) => (...args) => { - let later = () => { - timeout = null; - !immediate && func(...args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait || 0); - callNow && func(...args); - }; - - const hash = (v, _v = JSON.stringify(v)) => { - let hash = 0; - for (let i = 0, len = _v.length; i < len; ++i) { - const c = _v.charCodeAt(i); - hash = (hash << 5) - hash + c | 0; - } - return hash; - }; - - const m = (selector, attrs = Object.create(null), ...children) => { - if (attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function) { - if (attrs instanceof Array) children.unshift(...attrs);else children.unshift(attrs); - attrs = Object.create(null); - } - let vdom = parseSelector(selector); - if (children.length) vdom.children = children; - vdom.attrs = attrs; - vdom.shouldUpdate = attrs.shouldUpdate; - vdom.unload = attrs.unload; - vdom.config = attrs.config; - vdom.__hash = hash(vdom); - delete attrs.unload; - delete attrs.shouldUpdate; - delete attrs.config; - return vdom; - }; - - // creatign html, strip events from DOM element... for now just deleting - const stripEvents = ({ attrs }) => { - let a = Object.create(null); - - if (attrs) { - for (var name in attrs) { - if (name[0] === 'o' && name[1] === 'n') { - a[name] = attrs[name]; - delete attrs[name]; - } - } - } - - return a; - }; - - const applyEvents = (events, el, strip_existing = true) => { - strip_existing && removeEvents(el); - for (var name in events) { - el[name] = events[name]; - } - }; - - const flatten = (arr, a = []) => { - for (var i = 0, len = arr.length; i < len; i++) { - let v = arr[i]; - if (!(v instanceof Array)) { - a.push(v); - } else { - flatten(v, a); - } - } - return a; - }; - - const EVENTS = 'mouseover,mouseout,wheel,mousemove,blur,focus,click,abort,afterprint,animationend,animationiteration,animationstart,beforeprint,canplay,canplaythrough,change,contextmenu,dblclick,drag,dragend,dragenter,dragleave,dragover,dragstart,drop,durationchange,emptied,ended,error,load,input,invalid,keydown,keypress,keyup,loadeddata,loadedmetadata,mousedown,mouseenter,mouseleave,mouseup,pause,pointercancel,pointerdown,pointerenter,pointerleave,pointermove,pointerout,pointerover,pointerup,play,playing,ratechange,reset,resize,scroll,seeked,seeking,select,selectstart,selectionchange,show,submit,timeupdate,touchstart,touchend,touchcancel,touchmove,touchenter,touchleave,transitionend,volumechange,waiting'.split(',').map(x => 'on' + x); - - const removeEvents = el => { - // strip away event handlers on el, if it exists - if (!el) return; - for (var i in EVENTS) { - el[i] = null; - } - }; - - let mnt; - - const mount = (fn, el) => { - mnt = [el, fn]; - render(fn, el); - }; - - const render = debounce((fn, el) => rAF(_ => { - applyUpdates(fn, el.children[0], el); - })); - - const update = () => { - if (!mnt) return; - let [el, fn] = mnt; - render(fn, el); - }; - - const stylify = style => { - let s = ''; - for (var i in style) { - s += `${ i }:${ style[i] };`; - } - return s; - }; - - const setAttrs = ({ attrs, id, className, __hash }, el) => { - el.className = ''; - el.style = ''; - - if (attrs) { - for (var attr in attrs) { - if (attr === 'style') { - el.style = stylify(attrs[attr]); - } else if (attr === 'innerHTML') { - rAF(() => el.innerHTML = attrs[attr]); - } else if (attr === 'value') { - rAF(() => el.value = attrs[attr]); - } else { - el.setAttribute(attr, attrs[attr]); - } - } - } - let _id = attrs.id || id; - if (_id) el.id = _id; - let _className = ((attrs.className || '') + ' ' + (className || '')).trim(); - if (_className) el.className = _className; - el.__hash = __hash; - }; - - // recycle or create a new el - const createTag = (vdom = Object.create(null), el, parent = el && el.parentElement) => { - let __vdom = vdom; - // make text nodes from primitive types - if (typeof vdom !== 'object') { - let t = document.createTextNode(vdom); - if (el) { - parent.insertBefore(t, el); - removeEl(el); - } else { - parent.appendChild(t); - } - return t; - } - - // else make an HTMLElement from "tag" types - let { tag, attrs, id, className, unload, shouldUpdate, config, __hash } = vdom, - shouldExchange = !el || !el.tagName || tag && el.tagName.toLowerCase() !== tag.toLowerCase(), - _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el); - - if (!attrs) return; - if (el && (!_shouldUpdate || !vdom instanceof Function && el.__hash === __hash)) { - return; - } - - if (shouldExchange) { - let t = document.createElement(tag); - el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t); - el = t; - } +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});// async-supporting-observables +var obs=function obs(a){var b=[],c=function c(g){if(void 0!==g){a=g;for(var h=0,j=b.length;h=g&&(j=+new Date,h(k))}),h},c};obs.from=function(a){var b=obs();return a(function(c){return b(c)}),b},obs.union=function(){for(var _len=arguments.length,a=Array(_len),_key=0;_key<_len;_key++)a[_key]=arguments[_key];var b=obs();return a.map(function(c){return c.then(b)}),b};exports.default=obs; +}); +___scope___.file("worker.js", function(exports, require, module, __filename, __dirname){ - setAttrs(vdom, el); - if (el.unload instanceof Function) { - rAF(el.unload); - } - if (unload instanceof Function) { - el.unload = unload; - } - applyEvents(stripEvents(vdom), el); - config && rAF(_ => config(el)); - return el; - }; - - // find parent element, and remove the input element - const removeEl = el => { - if (!el) return; - el.parentElement.removeChild(el); - removeEvents(el); - // removed for now, added unload logic to the immediate draw()s - if (el.unload instanceof Function) el.unload(); - }; - - const insertAt = (el, parent, i) => { - if (parent.children.length > i) { - let next_sib = parent.children[i]; - parent.insertBefore(el, next_sib); - } else { - parent.appendChild(el); - } - }; - - const applyUpdates = (vdom, el, parent = el && el.parentElement) => { - let v = vdom; - // if vdom is a function, execute it until it isn't - while (vdom instanceof Function) vdom = vdom(); - - if (!vdom) return; - - if (vdom.resolve instanceof Function) { - let i = parent.children.length; - return vdom.resolve().then(v => { - if (!el) { - let x = createTag(v, null, parent); - insertAt(x, parent, i); - applyUpdates(v, x, parent); - } else { - applyUpdates(v, el, parent); - } - }); - } - - // create/edit el under parent - let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent); - - if (!_el) return; - - if (vdom instanceof Array || vdom.children) { - let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children), - el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes; - - while (el_children.length > vdom_children.length) { - removeEl(el_children[el_children.length - 1]); - } - - for (let i = 0; i < vdom_children.length; i++) { - applyUpdates(vdom_children[i], el_children[i], _el); - } - } else { - while (_el.childNodes.length > 0) { - removeEl(_el.childNodes[_el.childNodes.length - 1]); - } - } - }; - - const qs = (s = 'body', el = document) => el.querySelector(s); - - const resolver = (states = {}) => { - let promises = [], - done = false; - - const _await = (_promises = []) => { - promises = [...promises, ..._promises]; - return finish(); - }; - - const wait = (ms = 0) => new Promise(res => setTimeout(res, ms)); - - const isDone = () => done; - - const finish = () => { - const total = promises.length; - return wait().then(_ => Promise.all(promises)).then(values => { - if (promises.length > total) { - return finish(); - } - done = true; - return states; - }); - }; - - const resolve = props => { - const keys = Object.keys(props); - if (!keys.length) return Promise.resolve(true); - - let f = []; - keys.forEach(name => { - let x = props[name]; - - while (x instanceof Function) x = x(); - - if (x && x.then instanceof Function) f.push(x.then(d => states[name] = d)); - }); - - return _await(f); - }; - - const getState = () => states; - - return { finish, resolve, getState, promises, isDone }; - }; - - const gs = (view, state) => { - let r = view(state); - while (r instanceof Function) r = view(instance.getState()); - return r; - }; - - const container = (view, queries = {}, instance = resolver()) => { - let wrapper_view = state => instance.isDone() ? view(state) : m('span'); - - return () => { - let r = gs(wrapper_view, instance.getState()); - instance.resolve(queries); - - if (r instanceof Array) { - let d = instance.finish().then(_ => gs(wrapper_view, instance.getState())); - - return r.map((x, i) => { - x.resolve = _ => d.then(vdom => vdom[i]); - return x; - }); - } - - r.resolve = _ => instance.finish().then(_ => gs(wrapper_view, instance.getState())); - - return r; - }; - }; - - const reservedAttrs = ['className', 'id']; - - const toHTML = _vdom => { - while (_vdom instanceof Function) _vdom = _vdom(); - if (_vdom instanceof Array) return new Promise(r => r(html(..._vdom))); - if (!_vdom) return new Promise(r => r('')); - if (typeof _vdom !== 'object') return new Promise(r => r(_vdom)); - return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => { - if (!vdom) vdom = _vdom; - - if (vdom instanceof Array) return new Promise(r => r(html(...vdom))); - - const { tag, id, className, attrs, children, instance } = vdom, - _id = id || attrs && attrs.id ? ` id="${ id || attrs && attrs.id || '' }"` : '', - _class = className || attrs && attrs.className ? ` class="${ ((className || '') + ' ' + (attrs.className || '')).trim() }"` : ''; - - const events = stripEvents(vdom); - let _attrs = '', - inner = ''; - for (var i in attrs || Object.create(null)) { - if (i === 'style') { - _attrs += ` style="${ stylify(attrs[i]) }"`; - } else if (i === 'innerHTML') { - inner = attrs[i]; - } else if (reservedAttrs.indexOf(i) === -1) { - _attrs += ` ${ i }="${ attrs[i] }"`; - } - } - - if (!inner && children) return html(...children).then(str => `<${ tag }${ _id }${ _class }${ _attrs }>${ str }`); - - if ('br,input,img'.split(',').filter(x => x === tag).length === 0) return new Promise(r => r(`<${ tag }${ _id }${ _class }${ _attrs }>${ inner }`)); - - return new Promise(r => r(`<${ tag }${ _id }${ _class }${ _attrs } />`)); - }); - }; - - const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join('')); - - return { container, html, qs, update, mount, m, debounce }; -})(); - -/* harmony default export */ exports["a"] = vdom; - -/* -usage: - -let component = () => - new Array(20).fill(true).map(x => - m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100))) - -client-side ------ -mount(component, qs()) - -client-side constant re-rendering ------ -const run = () => { - setTimeout(run, 20) - update() -} -run() -*/ - -/* CONTAINER / HTML USAGE (Server-side rendering) - -const name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500)) - -let x = container(data => [ - m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}), - m('div', data.name), - ], - {name} -) - -html(x).then(x => log(x)).catch(e => log(e+'')) -*/ - -/***/ }, - -/***/ "./src/worker.js": -/***/ function(module, exports, __webpack_require__) { - -"use strict"; -const supports = (...q) => () => q.reduce((acc, s) => acc || window[s] !== undefined && /[native code]/.test(window[s] + '') && window[s], false); - -const supportsWorkers = supports('Worker'); - -const supportsBlobs = supports('Blob'); - -const supportsURLs = supports('URL', 'webkitURL'); - -const supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder'); - -/* +'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var supports=function supports(){for(var _len=arguments.length,a=Array(_len),_key=0;_key<_len;_key++)a[_key]=arguments[_key];return function(){return a.reduce(function(b,d){return b||window[d]!==void 0&&/[native code]/.test(window[d]+'')&&window[d]},!1)}},supportsWorkers=supports('Worker'),supportsBlobs=supports('Blob'),supportsURLs=supports('URL','webkitURL'),supportsBuilders=supports('BlobBuilder','WebKitBlobBuilder','MozBlobBuilder');/* worker:: [X] -> Worker where X : Function | String the last X provided in the arguments will be setup as the handler for self.onmessage() -*/ -const worker = (...code) => { - if (!supportsWorkers()) throw 'WebWorkers not supported'; - - code[code.length - 1] = `self.onmessage=${ code[code.length - 1] }`; - - const B = supportsBlobs(), - U = supportsBuilders(), - W = supportsURLs(); - - let blob; - - if (supportsBlobs()) { - blob = new B(code.map(c => c + ''), { type: 'application/javascript' }); - } else if (U) { - blob = new U(); - code.map(c => blob.append(c + '')); - blob = blob.getBlob(); - } else { - blob = `data:application/javascript,` + `${ encodeURIComponent(code.reduce((acc, c) => acc + c, '')) }`; - } - - let url = W.createObjectURL(blob); - return new Worker(url); -}; -/* harmony export (immutable) */ exports["worker"] = worker; - - -const farm = (n, ...code) => { - let workers = Array(n).fill(1).map(x => worker(...code)), - current = 0, - iter = () => { - let _n = current; - ++current >= n && (current = 0); - return current; - }, - pipe, - onerror; - - workers.map(w => { - w.onmessage = e => pipe instanceof Function && pipe(e.data); - w.onerror = e => onerror instanceof Function && onerror(e); - }); - - const exec = (...args) => { - let w = workers[iter()]; - w && w.postMessage(args); - }; - - exec.pipe = fn => { - pipe = fn; - return exec; - }; - exec.error = fn => { - onerror = fn; - return exec; - }; - return exec; -}; -/* harmony export (immutable) */ exports["farm"] = farm; - - -/***/ }, - -/***/ 0: -/***/ function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__("./src/index.js"); - - -/***/ } - -/******/ }); \ No newline at end of file +*/var worker=exports.worker=function worker(){for(var _len2=arguments.length,a=Array(_len2),_key2=0;_key2<_len2;_key2++)a[_key2]=arguments[_key2];if(!supportsWorkers())throw'WebWorkers not supported';a[a.length-1]='self.onmessage='+a[a.length-1];var b=supportsBlobs(),d=supportsBuilders(),f=supportsURLs(),g;supportsBlobs()?g=new b(a.map(function(i){return i+''}),{type:'application/javascript'}):d?(g=new d,a.map(function(i){return g.append(i+'')}),g=g.getBlob()):g='data:application/javascript,'+(''+encodeURIComponent(a.reduce(function(i,j){return i+j},'')));var h=f.createObjectURL(g);return new Worker(h)};var farm=exports.farm=function farm(a){for(var _len3=arguments.length,b=Array(1<_len3?_len3-1:0),_key3=1;_key3<_len3;_key3++)b[_key3-1]=arguments[_key3];var d=Array(a).fill(1).map(function(){return worker.apply(void 0,b)}),f=0,g=function g(){return++f>=a&&(f=0),f},h,i;d.map(function(k){k.onmessage=function(l){return h instanceof Function&&h(l.data)},k.onerror=function(l){return i instanceof Function&&i(l)}});var j=function j(){for(var _len4=arguments.length,k=Array(_len4),_key4=0;_key4<_len4;_key4++)k[_key4]=arguments[_key4];var l=d[g()];l&&l.postMessage(k)};return j.pipe=function(k){return h=k,j},j.error=function(k){return i=k,j},j}; +}); +}); +FuseBox.expose([{"alias":"clan-fp","pkg":"default"}]); +}) +(function(e){var r="undefined"!=typeof window&&window.navigator;r&&(window.global=window),e=r&&"undefined"==typeof __fbx__dnm__?e:module.exports;var t=r?window.__fsbx__=window.__fsbx__||{}:global.$fsbx=global.$fsbx||{};r||(global.require=require);var n=t.p=t.p||{},i=t.e=t.e||{},o=function(e){if(/^([@a-z].*)$/.test(e)){if("@"===e[0]){var r=e.split("/"),t=r.splice(2,r.length).join("/");return[r[0]+"/"+r[1],t||void 0]}return e.split(/\/(.+)?/)}},a=function(e){return e.substring(0,e.lastIndexOf("/"))||"./"},f=function(){for(var e=[],r=0;r options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n\t, fp\n}\n","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n"]} \ No newline at end of file diff --git a/fuse.js b/fuse.js new file mode 100644 index 0000000..bdb464c --- /dev/null +++ b/fuse.js @@ -0,0 +1,77 @@ +const f = require("fuse-box") + , chokidar = require('chokidar') + , dev = process.env.NODE_ENV !== 'production' + +let rootConfig = { + homeDir: "src/" + , cache: dev + , package: 'clan-fp' + , globals: { 'default': 'clan-fp' } + , plugins: (browser) => + [ + f.BabelPlugin({ + // limit2project: false + // , test: /\.js$/ + config: { + sourceMaps: true + , presets: + (dev ? [] : ['babili']) + .concat([ + // 'react' + 'latest' + // , 'stage-0' + ]) + , plugins: [ + "fast-async" + ] + } + }) + ] +} + +let configs = [ + { + sourceMap: { + bundleReference: "index.js.map" + , outFile: "./build/index.js.map" + } + , outFile: "./build/index.js" + , inFile: "[./**/*.js]" + } +] + +const processAll = $ => + configs.map(c => { + let d = Object.assign({}, rootConfig, c) + , inFile = d.inFile + + d.plugins = d.plugins(d.browser || false) + delete d.inFile + delete d.browser + + f.FuseBox.init(d).bundle(inFile) + }) + +const debounce = (func, wait, immediate, timeout) => + () => { + let context = this + , args = arguments + , later = $ => { + timeout = null + !immediate && func.apply(context, args) + } + , callNow = immediate && !timeout + + clearTimeout(timeout) + timeout = setTimeout(later, wait) + callNow && func.apply(context, args) + } + +let p = debounce(processAll, 250) + +dev && + chokidar + .watch('src') + .on('all', p) + +p() \ No newline at end of file diff --git a/package.json b/package.json index 5f56477..a7851f9 100644 --- a/package.json +++ b/package.json @@ -2,30 +2,34 @@ "name": "clan-fp", "version": "0.0.26", "scripts": { - "prestart": "rimraf build/*", - "start": "webpack --watch", - "prebuild": "rimraf build/*", - "build": "cross-env NODE_ENV=production webpack", - "deploy": "npm run build; git add .; git commit -am \"comitting and pushing new patch version\"; npm version patch; git push origin master; npm publish;" + "prestart": "rimraf .fusebox build", + "start": "node fuse", + "prebuild": "rimraf .fusebox build", + "build": "cross-env NODE_ENV=production node fuse", + "deploy": "npm run build; git add .; git commit -am \"comitting and pushing new patch version\"; npm version patch; git push origin --all; npm publish;" }, "main": "build/index.js", "module": "src/index.js", "author": "Matt Keas (@matthiasak)", "license": "MIT", "devDependencies": { - "@terse/webpack": "^1.0.6", - "babel-core": "^6.18.2", - "babel-loader": "^6.2.8", - "babel-polyfill": "^6.16.0", + "babel-core": "^6.21.0", + "babel-preset-babili": "^0.0.9", + "babel-preset-env": "^1.1.4", + "babel-preset-latest": "^6.16.0", + "babel-preset-react": "^6.16.0", "babel-preset-stage-0": "^6.16.0", + "chokidar": "^1.6.1", "cross-env": "^3.1.3", - "ghooks": "^1.3.2", - "now": "^0.33.0", + "fast-async": "^6.2.0", + "fuse-box": "^1.3.36", + "husky": "^0.12.0", + "now": "^0.37.1", "npm-run-all": "^3.1.1", - "optimize-js-plugin": "^0.0.4", "rimraf": "^2.5.4", - "start-server-webpack-plugin": "^2.1.1", - "webpack": "^2.1.0-beta", - "yarn": "^0.17.9" + "yarn": "^0.18.1" + }, + "dependencies": { + "uglify-js": "^2.7.5" } } diff --git a/src/batch.js b/src/batch.js index 08717b8..97cf30f 100644 --- a/src/batch.js +++ b/src/batch.js @@ -13,17 +13,17 @@ const batch = f => { key = `${url}:${JSON.stringify(options)}` if((method || '').toLowerCase() === 'post') - return f(url, {...options, compress: false}) + return f(url, Object.assign({}, options, {compress: false})) return inflight[key] || (inflight[key] = new Promise((res,rej) => { - f(url, {...options, compress: false}) + f(url, Object.assign({}, options, {compress: false})) .then(d => res(d)) .catch(e => rej(e)) }) .then(data => { - inflight = {...inflight, [key]: undefined} + inflight = Object.assign({}, inflight, {[key]: undefined}) return data }) .catch(e => diff --git a/src/index.js b/src/index.js index 4d1e89d..2888d8b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,11 +1,12 @@ -export batch from './batch' -export vdom from './vdom' -export mixin from './mixin' -export model from './model' -export obs from './observable' -export * as hamt from './hamt' -export * as worker from './worker' -export * from './fp' +import batch from './batch' +import vdom from './vdom' +import mixin from './mixin' +import model from './model' +import obs from './observable' +import * as hamt from './hamt' +import * as worker from './worker' +import * as fp from './fp' + export const hash = (v,_v=JSON.stringify(v)) => { let hash = 0 for (let i = 0, len = _v.length; i < len; ++i) { @@ -13,4 +14,15 @@ export const hash = (v,_v=JSON.stringify(v)) => { hash = (((hash << 5) - hash) + c) | 0 } return hash -} \ No newline at end of file +} + +module.exports = { + batch + , vdom + , mixin + , model + , obs + , hamt + , worker + , fp +} diff --git a/src/mixin.js b/src/mixin.js index da95895..1290282 100644 --- a/src/mixin.js +++ b/src/mixin.js @@ -1,14 +1,15 @@ const mixin = (...classes) => { class _mixin {} + let proto = _mixin.prototype classes.map(({prototype:p}) => { Object.getOwnPropertyNames(p).map(key => { - let oldFn = proto[key] || (() => {}) - proto[key] = (...args) => { - oldFn(...args) - return p[key](...args) + let oldFn = proto[key] || ($ => {}) + proto[key] = function() { + oldFn.apply(null, [].slice.call(arguments)) + return p[key].apply(null, [].slice.call(arguments)) } }) }) @@ -16,4 +17,4 @@ const mixin = (...classes) => { return _mixin } -export default mixin \ No newline at end of file +module.exports = mixin \ No newline at end of file diff --git a/src/vdom.js b/src/vdom.js index b817f48..a3c4fac 100644 --- a/src/vdom.js +++ b/src/vdom.js @@ -3,11 +3,10 @@ const rAF = (requestAnimationFrame || webkitRequestAnimationFrame || mozRequestAnimationFrame) || - process && process.nextTick || (cb => setTimeout(cb, 16.6)) // Virtual DOMs -const vdom = (() => { +const vdom = () => { const class_id_regex = () => { return /[#\.][^#\.]+/ig }, @@ -402,9 +401,9 @@ const vdom = (() => { const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join('')) return {container, html, qs, update, mount, m, debounce} -})() +} -export default vdom +module.exports = vdom() /* usage: diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 71103cd..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,33 +0,0 @@ -let config = - require("@terse/webpack") - .api() - .entry({ - index: "./src/index.js" - }) - .loader( - 'babel-loader' - , '.js' - , { - exclude: /node_modules/ - , query: { cacheDirectory: true, presets: ['stage-0'] } - }) - .plugin("webpack.NamedModulesPlugin") - .plugin("optimize-js-plugin") - .plugin("webpack.NoErrorsPlugin") - .externals(/^@?\w[a-z\-0-9\./]+$/) - .output({ - path: './build' - , library: 'clan' - , libraryTarget: 'commonjs2' - }) - .target("node") - .sourcemap("source-map") - .when("development", api => api - .entry({ - index: "./src/index.js" - })) - .getConfig() - -delete config.module.preLoaders - -module.exports = config \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 5084ef2..12b5a2b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,45 +2,41 @@ # yarn lockfile v1 -"@terse/webpack@^1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@terse/webpack/-/webpack-1.0.6.tgz#2cc292b2fd617f8e305d660acc6f6c536fb2daf4" - dependencies: - lodash "^4.15.0" - npm-install-webpack-plugin "^4.0.4" - start-server-webpack-plugin "^2.0.1" - webpack "2.1.0-beta.22" - -Base64@~0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/Base64/-/Base64-0.2.1.tgz#ba3a4230708e186705065e66babdd4c35cf60028" - abbrev@1: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" -acorn@^3.2.0, acorn@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +acorn-es7-plugin@>=1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/acorn-es7-plugin/-/acorn-es7-plugin-1.1.5.tgz#f31e1a618f439bfdde8851dd875a3a163ca8201f" -acorn@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.3.tgz#1a3e850b428e73ba6b09d1cc527f5aaad4d03ef1" +acorn-es7@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/acorn-es7/-/acorn-es7-0.1.0.tgz#4a6de4522faacb4c31209e1b73b5f301ed2bb30a" + dependencies: + acorn "^2.6.4" -after@0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.1.tgz#ab5d4fb883f596816d3515f8f791c0af486dd627" +acorn-jsx@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" -ajv-keywords@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.1.1.tgz#02550bc605a3e576041565628af972e06c549d50" +acorn@>=2.5.2, acorn@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" -ajv@^4.7.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.9.0.tgz#5a358085747b134eb567d6d15e015f1d7802f45c" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" +acorn@^2.6.4: + version "2.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +after@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" @@ -50,9 +46,9 @@ align-text@^0.1.1, align-text@^0.1.3: longest "^1.0.1" repeat-string "^1.5.2" -ansi-escapes@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.3.0.tgz#070883c337d5e4ce9e124fce2639267f2a14d554" +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" ansi-escapes@1.4.0, ansi-escapes@^1.1.0: version "1.4.0" @@ -62,10 +58,14 @@ ansi-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" -ansi-styles@^2.1.0, ansi-styles@^2.2.1: +ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" +ansi@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/ansi/-/ansi-0.3.1.tgz#0c42d4fb17160d5a9af1e484bace1c66922c1b21" + any-promise@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -77,6 +77,14 @@ anymatch@^1.3.0: arrify "^1.0.0" micromatch "^2.1.5" +app-root-path@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-1.4.0.tgz#6335d865c9640d0fad99004e5a79232238e92dfa" + +app-root-path@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" + aproba@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" @@ -137,14 +145,6 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -asn1.js@^4.0.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.0.tgz#f71a1243f3e79d46d7b07d7fbf4824ee73af054a" - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" @@ -157,12 +157,6 @@ assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" -assert@^1.1.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - dependencies: - util "0.10.3" - async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -174,22 +168,6 @@ async-retry@0.2.1: babel-runtime "6.5.0" retry "0.9.0" -async@2.0.0-rc.4: - version "2.0.0-rc.4" - resolved "https://registry.yarnpkg.com/async/-/async-2.0.0-rc.4.tgz#9b7f60724c17962a973f787419e0ebc5571dbad8" - dependencies: - lodash "^4.3.0" - -async@^1.3.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - -async@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.1.2.tgz#612a4ab45ef42a70cde806bad86ee6db047e8385" - dependencies: - lodash "^4.14.0" - async@~0.2.6: version "0.2.10" resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" @@ -206,27 +184,27 @@ aws4@^1.2.1: version "1.5.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" -babel-code-frame@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.16.0.tgz#f90e60da0862909d3ce098733b5d3987c97cb8de" +babel-code-frame@^6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.20.0.tgz#b968f839090f9a8bc6d41938fb96cb84f7387b26" dependencies: chalk "^1.1.0" esutils "^2.0.2" js-tokens "^2.0.0" -babel-core@^6.18.0, babel-core@^6.18.2: - version "6.18.2" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.18.2.tgz#d8bb14dd6986fa4f3566a26ceda3964fa0e04e5b" +babel-core@^6.18.0, babel-core@^6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.21.0.tgz#75525480c21c803f826ef3867d22c19f080a3724" dependencies: - babel-code-frame "^6.16.0" - babel-generator "^6.18.0" + babel-code-frame "^6.20.0" + babel-generator "^6.21.0" babel-helpers "^6.16.0" babel-messages "^6.8.0" babel-register "^6.18.0" - babel-runtime "^6.9.1" + babel-runtime "^6.20.0" babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-traverse "^6.21.0" + babel-types "^6.21.0" babylon "^6.11.0" convert-source-map "^1.1.0" debug "^2.1.1" @@ -238,13 +216,13 @@ babel-core@^6.18.0, babel-core@^6.18.2: slash "^1.0.0" source-map "^0.5.0" -babel-generator@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.19.0.tgz#9b2f244204777a3d6810ec127c673c87b349fac5" +babel-generator@^6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.21.0.tgz#605f1269c489a1c75deeca7ea16d43d4656c8494" dependencies: babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.19.0" + babel-runtime "^6.20.0" + babel-types "^6.21.0" detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.2.0" @@ -267,15 +245,24 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.8.0: babel-types "^6.18.0" babel-helper-builder-react-jsx@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.18.0.tgz#ab02f19a2eb7ace936dd87fa55896d02be59bf71" + version "6.21.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.21.1.tgz#c4a24208655be9dc1cccf14d366da176f20645e4" dependencies: babel-runtime "^6.9.0" - babel-types "^6.18.0" + babel-types "^6.21.0" esutils "^2.0.0" lodash "^4.2.0" -babel-helper-define-map@^6.8.0: +babel-helper-call-delegate@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.18.0.tgz#05b14aafa430884b034097ef29e9f067ea4133bd" + dependencies: + babel-helper-hoist-variables "^6.18.0" + babel-runtime "^6.0.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-helper-define-map@^6.18.0, babel-helper-define-map@^6.8.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.18.0.tgz#8d6c85dc7fbb4c19be3de40474d18e97c3676ec2" dependencies: @@ -284,6 +271,10 @@ babel-helper-define-map@^6.8.0: babel-types "^6.18.0" lodash "^4.2.0" +babel-helper-evaluate-path@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.0.3.tgz#1d103ac9d4a59e5d431842212f151785f7ac547b" + babel-helper-explode-assignable-expression@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.18.0.tgz#14b8e8c2d03ad735d4b20f1840b24cd1f65239fe" @@ -301,7 +292,11 @@ babel-helper-explode-class@^6.8.0: babel-traverse "^6.18.0" babel-types "^6.18.0" -babel-helper-function-name@^6.18.0: +babel-helper-flip-expressions@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.0.1.tgz#c2ba1599426e7928333fd5c08eee6cdf8328c848" + +babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6" dependencies: @@ -318,16 +313,65 @@ babel-helper-get-function-arity@^6.18.0: babel-runtime "^6.0.0" babel-types "^6.18.0" -babel-helper-remap-async-to-generator@^6.16.0, babel-helper-remap-async-to-generator@^6.16.2: +babel-helper-hoist-variables@^6.18.0: version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.18.0.tgz#336cdf3cab650bb191b02fc16a3708e7be7f9ce5" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.18.0.tgz#a835b5ab8b46d6de9babefae4d98ea41e866b82a" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-helper-is-nodes-equiv@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" + +babel-helper-is-void-0@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.0.1.tgz#ed74553b883e68226ae45f989a99b02c190f105a" + +babel-helper-optimise-call-expression@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.18.0.tgz#9261d0299ee1a4f08a6dd28b7b7c777348fd8f0f" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-helper-regex@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.18.0.tgz#ae0ebfd77de86cb2f1af258e2cc20b5fe893ecc6" + dependencies: + babel-runtime "^6.9.0" + babel-types "^6.18.0" + lodash "^4.2.0" + +babel-helper-remap-async-to-generator@^6.16.0, babel-helper-remap-async-to-generator@^6.16.2: + version "6.20.3" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.20.3.tgz#9dd3b396f13e35ef63e538098500adc24c63c4e7" dependencies: babel-helper-function-name "^6.18.0" + babel-runtime "^6.20.0" + babel-template "^6.16.0" + babel-traverse "^6.20.0" + babel-types "^6.20.0" + +babel-helper-remove-or-void@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.0.1.tgz#f602790e465acf2dfbe84fb3dd210c43a2dd7262" + +babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e" + dependencies: + babel-helper-optimise-call-expression "^6.18.0" + babel-messages "^6.8.0" babel-runtime "^6.0.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" +babel-helper-to-multiple-sequence-expressions@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.0.2.tgz#07d5d2e674aa62962ac9e0000b539920c301c4b9" + babel-helpers@^6.16.0: version "6.16.0" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" @@ -335,21 +379,73 @@ babel-helpers@^6.16.0: babel-runtime "^6.0.0" babel-template "^6.16.0" -babel-loader@^6.2.8: - version "6.2.8" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-6.2.8.tgz#30d7183aef60afc140b36443676b7acb4c12ac9c" - dependencies: - find-cache-dir "^0.1.1" - loader-utils "^0.2.11" - mkdirp "^0.5.1" - object-assign "^4.0.1" - babel-messages@^6.8.0: version "6.8.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" dependencies: babel-runtime "^6.0.0" +babel-plugin-check-es2015-constants@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz#dbf024c32ed37bfda8dee1e76da02386a8d26fe7" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-minify-constant-folding@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.0.3.tgz#a511e839562489811987a7a503c43c312c40138a" + dependencies: + babel-helper-evaluate-path "^0.0.3" + +babel-plugin-minify-dead-code-elimination@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.1.tgz#1a0133fcd06c7fa477b01c193ba3213c8944ff01" + dependencies: + babel-helper-remove-or-void "^0.0.1" + lodash.some "^4.6.0" + +babel-plugin-minify-flip-comparisons@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.0.1.tgz#679f4493a692afc705c4b79fde1dadb535c4eb08" + dependencies: + babel-helper-is-void-0 "^0.0.1" + +babel-plugin-minify-guarded-expressions@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.0.3.tgz#6da1caa0b6abda964647377bd5e19afdbf91cae8" + dependencies: + babel-helper-flip-expressions "^0.0.1" + +babel-plugin-minify-infinity@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.0.3.tgz#4cc99b61d12b434ce80ad675103335c589cba9a1" + +babel-plugin-minify-mangle-names@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.0.5.tgz#53e4905de90a215622012cc003c3e0d5bdf18a8a" + +babel-plugin-minify-numeric-literals@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.0.1.tgz#9597e6c31154d7daf3744d0bd417c144b275bd53" + +babel-plugin-minify-replace@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.0.1.tgz#5d5aea7cb9899245248d1ee9ce7a2fe556a8facc" + +babel-plugin-minify-simplify@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.0.5.tgz#71d1de1993a138282c679aad74060829b2b13ed2" + dependencies: + babel-helper-flip-expressions "^0.0.1" + babel-helper-is-nodes-equiv "^0.0.1" + babel-helper-to-multiple-sequence-expressions "^0.0.2" + +babel-plugin-minify-type-constructors@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.0.2.tgz#4f9a28951e776f31ac11a29cd58cf9eef8b2e292" + dependencies: + babel-helper-is-void-0 "^0.0.1" + babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" @@ -402,9 +498,9 @@ babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" -babel-plugin-syntax-trailing-function-commas@^6.3.13: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.13.0.tgz#2b84b7d53dd744f94ff1fad7669406274b23f541" +babel-plugin-syntax-trailing-function-commas@^6.13.0, babel-plugin-syntax-trailing-function-commas@^6.3.13, babel-plugin-syntax-trailing-function-commas@^6.8.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.20.0.tgz#442835e19179f45b87e92d477d70b9f1f18b5c4f" babel-plugin-transform-async-generator-functions@^6.17.0: version "6.17.0" @@ -414,7 +510,7 @@ babel-plugin-transform-async-generator-functions@^6.17.0: babel-plugin-syntax-async-generators "^6.5.0" babel-runtime "^6.0.0" -babel-plugin-transform-async-to-generator@^6.16.0: +babel-plugin-transform-async-to-generator@^6.16.0, babel-plugin-transform-async-to-generator@^6.8.0: version "6.16.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz#19ec36cb1486b59f9f468adfa42ce13908ca2999" dependencies: @@ -457,7 +553,176 @@ babel-plugin-transform-do-expressions@^6.3.13: babel-plugin-syntax-do-expressions "^6.8.0" babel-runtime "^6.0.0" -babel-plugin-transform-exponentiation-operator@^6.3.13: +babel-plugin-transform-es2015-arrow-functions@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz#5b63afc3181bdc9a8c4d481b5a4f3f7d7fef3d9d" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.8.0.tgz#ed95d629c4b5a71ae29682b998f70d9833eb366d" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-block-scoping@^6.18.0, babel-plugin-transform-es2015-block-scoping@^6.6.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.21.0.tgz#e840687f922e70fb2c42bb13501838c174a115ed" + dependencies: + babel-runtime "^6.20.0" + babel-template "^6.15.0" + babel-traverse "^6.21.0" + babel-types "^6.21.0" + lodash "^4.2.0" + +babel-plugin-transform-es2015-classes@^6.18.0, babel-plugin-transform-es2015-classes@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.18.0.tgz#ffe7a17321bf83e494dcda0ae3fc72df48ffd1d9" + dependencies: + babel-helper-define-map "^6.18.0" + babel-helper-function-name "^6.18.0" + babel-helper-optimise-call-expression "^6.18.0" + babel-helper-replace-supers "^6.18.0" + babel-messages "^6.8.0" + babel-runtime "^6.9.0" + babel-template "^6.14.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + +babel-plugin-transform-es2015-computed-properties@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.8.0.tgz#f51010fd61b3bd7b6b60a5fdfd307bb7a5279870" + dependencies: + babel-helper-define-map "^6.8.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" + +babel-plugin-transform-es2015-destructuring@^6.18.0, babel-plugin-transform-es2015-destructuring@^6.6.0: + version "6.19.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.19.0.tgz#ff1d911c4b3f4cab621bd66702a869acd1900533" + dependencies: + babel-runtime "^6.9.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.6.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.8.0.tgz#fd8f7f7171fc108cc1c70c3164b9f15a81c25f7d" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.8.0" + +babel-plugin-transform-es2015-for-of@^6.18.0, babel-plugin-transform-es2015-for-of@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.18.0.tgz#4c517504db64bf8cfc119a6b8f177211f2028a70" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-function-name@^6.3.13, babel-plugin-transform-es2015-function-name@^6.9.0: + version "6.9.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz#8c135b17dbd064e5bba56ec511baaee2fca82719" + dependencies: + babel-helper-function-name "^6.8.0" + babel-runtime "^6.9.0" + babel-types "^6.9.0" + +babel-plugin-transform-es2015-literals@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.8.0.tgz#50aa2e5c7958fc2ab25d74ec117e0cc98f046468" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-modules-amd@^6.18.0, babel-plugin-transform-es2015-modules-amd@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.18.0.tgz#49a054cbb762bdf9ae2d8a807076cfade6141e40" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" + +babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.18.0.tgz#c15ae5bb11b32a0abdcc98a5837baa4ee8d67bcc" + dependencies: + babel-plugin-transform-strict-mode "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.16.0" + babel-types "^6.18.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.12.0, babel-plugin-transform-es2015-modules-systemjs@^6.18.0: + version "6.19.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.19.0.tgz#50438136eba74527efa00a5b0fefaf1dc4071da6" + dependencies: + babel-helper-hoist-variables "^6.18.0" + babel-runtime "^6.11.6" + babel-template "^6.14.0" + +babel-plugin-transform-es2015-modules-umd@^6.12.0, babel-plugin-transform-es2015-modules-umd@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.18.0.tgz#23351770ece5c1f8e83ed67cb1d7992884491e50" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" + +babel-plugin-transform-es2015-object-super@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.8.0.tgz#1b858740a5a4400887c23dcff6f4d56eea4a24c5" + dependencies: + babel-helper-replace-supers "^6.8.0" + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-parameters@^6.18.0, babel-plugin-transform-es2015-parameters@^6.6.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.21.0.tgz#46a655e6864ef984091448cdf024d87b60b2a7d8" + dependencies: + babel-helper-call-delegate "^6.18.0" + babel-helper-get-function-arity "^6.18.0" + babel-runtime "^6.9.0" + babel-template "^6.16.0" + babel-traverse "^6.21.0" + babel-types "^6.21.0" + +babel-plugin-transform-es2015-shorthand-properties@^6.18.0, babel-plugin-transform-es2015-shorthand-properties@^6.3.13: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.18.0.tgz#e2ede3b7df47bf980151926534d1dd0cbea58f43" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-plugin-transform-es2015-spread@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.8.0.tgz#0217f737e3b821fa5a669f187c6ed59205f05e9c" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-sticky-regex@^6.3.13: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.8.0.tgz#e73d300a440a35d5c64f5c2a344dc236e3df47be" + dependencies: + babel-helper-regex "^6.8.0" + babel-runtime "^6.0.0" + babel-types "^6.8.0" + +babel-plugin-transform-es2015-template-literals@^6.6.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.8.0.tgz#86eb876d0a2c635da4ec048b4f7de9dfc897e66b" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.18.0, babel-plugin-transform-es2015-typeof-symbol@^6.6.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.18.0.tgz#0b14c48629c90ff47a0650077f6aa699bee35798" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-es2015-unicode-regex@^6.3.13: + version "6.11.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz#6298ceabaad88d50a3f4f392d8de997260f6ef2c" + dependencies: + babel-helper-regex "^6.8.0" + babel-runtime "^6.0.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.3.13, babel-plugin-transform-exponentiation-operator@^6.8.0: version "6.8.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.8.0.tgz#db25742e9339eade676ca9acec46f955599a68a4" dependencies: @@ -473,8 +738,8 @@ babel-plugin-transform-export-extensions@^6.3.13: babel-runtime "^6.0.0" babel-plugin-transform-flow-strip-types@^6.3.13: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.18.0.tgz#4d3e642158661e9b40db457c004a30817fa32592" + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.21.0.tgz#2eea3f8b5bb234339b47283feac155cfb237b948" dependencies: babel-plugin-syntax-flow "^6.18.0" babel-runtime "^6.0.0" @@ -486,11 +751,35 @@ babel-plugin-transform-function-bind@^6.3.13: babel-plugin-syntax-function-bind "^6.8.0" babel-runtime "^6.0.0" +babel-plugin-transform-member-expression-literals@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.0.tgz#718755a70492a895d8f41810afa9998bc09f57b9" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-merge-sibling-variables@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.0.tgz#724074e4ef78b601fcf9a34165c972a1b6117e99" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-minify-booleans@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.8.0.tgz#b1a48864a727847696b84eae36fa4d085a54b42b" + dependencies: + babel-runtime "^6.0.0" + babel-plugin-transform-object-rest-spread@^6.16.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.19.0.tgz#f6ac428ee3cb4c6aa00943ed1422ce813603b34c" + version "6.20.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.20.2.tgz#e816c55bba77b14c16365d87e2ae48c8fd18fc2e" dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.20.0" + +babel-plugin-transform-property-literals@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.8.0.tgz#a65b2e6e1274d25df0f3a4c5e85bc8f1cdd9e019" + dependencies: babel-runtime "^6.0.0" babel-plugin-transform-react-display-name@^6.3.13: @@ -521,13 +810,144 @@ babel-plugin-transform-react-jsx@^6.3.13: babel-plugin-syntax-jsx "^6.8.0" babel-runtime "^6.0.0" -babel-polyfill@^6.16.0: +babel-plugin-transform-regenerator@^6.16.0, babel-plugin-transform-regenerator@^6.6.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.21.0.tgz#75d0c7e7f84f379358f508451c68a2c5fa5a9703" + dependencies: + regenerator-transform "0.9.8" + +babel-plugin-transform-regexp-constructors@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.0.3.tgz#463200d8371a06f077226b967858369211b5cfe3" + +babel-plugin-transform-remove-undefined@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.0.3.tgz#34baeb7bde4fc01d5235304ee891e7b6bff00432" + +babel-plugin-transform-simplify-comparison-operators@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.8.0.tgz#0183d65bfdc54c80d922a3a9b3008e25fa9d32a7" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-strict-mode@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" + dependencies: + babel-runtime "^6.0.0" + babel-types "^6.18.0" + +babel-plugin-transform-undefined-to-void@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.8.0.tgz#bc5b6b4908d3b1262170e67cb3963903ddce167e" + dependencies: + babel-runtime "^6.0.0" + +babel-preset-babili@^0.0.9: + version "0.0.9" + resolved "https://registry.yarnpkg.com/babel-preset-babili/-/babel-preset-babili-0.0.9.tgz#699f08703ff1c84f4f6c229ffe5662c8f1861bf2" + dependencies: + babel-plugin-minify-constant-folding "^0.0.3" + babel-plugin-minify-dead-code-elimination "^0.1.1" + babel-plugin-minify-flip-comparisons "^0.0.1" + babel-plugin-minify-guarded-expressions "^0.0.3" + babel-plugin-minify-infinity "^0.0.3" + babel-plugin-minify-mangle-names "^0.0.5" + babel-plugin-minify-numeric-literals "^0.0.1" + babel-plugin-minify-replace "^0.0.1" + babel-plugin-minify-simplify "^0.0.5" + babel-plugin-minify-type-constructors "^0.0.2" + babel-plugin-transform-member-expression-literals "^6.8.0" + babel-plugin-transform-merge-sibling-variables "^6.8.0" + babel-plugin-transform-minify-booleans "^6.8.0" + babel-plugin-transform-property-literals "^6.8.0" + babel-plugin-transform-regexp-constructors "^0.0.3" + babel-plugin-transform-remove-undefined "^0.0.3" + babel-plugin-transform-simplify-comparison-operators "^6.8.0" + babel-plugin-transform-undefined-to-void "^6.8.0" + +babel-preset-env@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.1.4.tgz#d876f9fcff5fe0612db3dcbc0c87503b41d4873f" + dependencies: + babel-plugin-check-es2015-constants "^6.3.13" + babel-plugin-syntax-trailing-function-commas "^6.13.0" + babel-plugin-transform-async-to-generator "^6.8.0" + babel-plugin-transform-es2015-arrow-functions "^6.3.13" + babel-plugin-transform-es2015-block-scoped-functions "^6.3.13" + babel-plugin-transform-es2015-block-scoping "^6.6.0" + babel-plugin-transform-es2015-classes "^6.6.0" + babel-plugin-transform-es2015-computed-properties "^6.3.13" + babel-plugin-transform-es2015-destructuring "^6.6.0" + babel-plugin-transform-es2015-duplicate-keys "^6.6.0" + babel-plugin-transform-es2015-for-of "^6.6.0" + babel-plugin-transform-es2015-function-name "^6.3.13" + babel-plugin-transform-es2015-literals "^6.3.13" + babel-plugin-transform-es2015-modules-amd "^6.8.0" + babel-plugin-transform-es2015-modules-commonjs "^6.6.0" + babel-plugin-transform-es2015-modules-systemjs "^6.12.0" + babel-plugin-transform-es2015-modules-umd "^6.12.0" + babel-plugin-transform-es2015-object-super "^6.3.13" + babel-plugin-transform-es2015-parameters "^6.6.0" + babel-plugin-transform-es2015-shorthand-properties "^6.3.13" + babel-plugin-transform-es2015-spread "^6.3.13" + babel-plugin-transform-es2015-sticky-regex "^6.3.13" + babel-plugin-transform-es2015-template-literals "^6.6.0" + babel-plugin-transform-es2015-typeof-symbol "^6.6.0" + babel-plugin-transform-es2015-unicode-regex "^6.3.13" + babel-plugin-transform-exponentiation-operator "^6.8.0" + babel-plugin-transform-regenerator "^6.6.0" + browserslist "^1.4.0" + +babel-preset-es2015@^6.16.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.18.0.tgz#b8c70df84ec948c43dcf2bf770e988eb7da88312" + dependencies: + babel-plugin-check-es2015-constants "^6.3.13" + babel-plugin-transform-es2015-arrow-functions "^6.3.13" + babel-plugin-transform-es2015-block-scoped-functions "^6.3.13" + babel-plugin-transform-es2015-block-scoping "^6.18.0" + babel-plugin-transform-es2015-classes "^6.18.0" + babel-plugin-transform-es2015-computed-properties "^6.3.13" + babel-plugin-transform-es2015-destructuring "^6.18.0" + babel-plugin-transform-es2015-duplicate-keys "^6.6.0" + babel-plugin-transform-es2015-for-of "^6.18.0" + babel-plugin-transform-es2015-function-name "^6.9.0" + babel-plugin-transform-es2015-literals "^6.3.13" + babel-plugin-transform-es2015-modules-amd "^6.18.0" + babel-plugin-transform-es2015-modules-commonjs "^6.18.0" + babel-plugin-transform-es2015-modules-systemjs "^6.18.0" + babel-plugin-transform-es2015-modules-umd "^6.18.0" + babel-plugin-transform-es2015-object-super "^6.3.13" + babel-plugin-transform-es2015-parameters "^6.18.0" + babel-plugin-transform-es2015-shorthand-properties "^6.18.0" + babel-plugin-transform-es2015-spread "^6.3.13" + babel-plugin-transform-es2015-sticky-regex "^6.3.13" + babel-plugin-transform-es2015-template-literals "^6.6.0" + babel-plugin-transform-es2015-typeof-symbol "^6.18.0" + babel-plugin-transform-es2015-unicode-regex "^6.3.13" + babel-plugin-transform-regenerator "^6.16.0" + +babel-preset-es2016@^6.16.0: version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.16.0.tgz#2d45021df87e26a374b6d4d1a9c65964d17f2422" + resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.16.0.tgz#c7daf5feedeee99c867813bdf0d573d94ca12812" dependencies: - babel-runtime "^6.9.1" - core-js "^2.4.0" - regenerator-runtime "^0.9.5" + babel-plugin-transform-exponentiation-operator "^6.3.13" + +babel-preset-es2017@^6.16.0: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.16.0.tgz#536c6287778a758948ddd092b466b6ef50b786fa" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.8.0" + babel-plugin-transform-async-to-generator "^6.16.0" + +babel-preset-latest@^6.16.0: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.16.0.tgz#5b87e19e250bb1213f13af4ec9dc7a51d53f388d" + dependencies: + babel-preset-es2015 "^6.16.0" + babel-preset-es2016 "^6.16.0" + babel-preset-es2017 "^6.16.0" babel-preset-react@^6.16.0: version "6.16.0" @@ -588,12 +1008,12 @@ babel-register@^6.18.0: mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@6.18.0, babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.9.0, babel-runtime@^6.9.1: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.18.0.tgz#0f4177ffd98492ef13b9f823e9994a02584c9078" +babel-runtime@6.20.0, babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.9.0, babel-runtime@^6.9.1: + version "6.20.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.20.0.tgz#87300bdcf4cd770f09bf0048c64204e17806d16f" dependencies: core-js "^2.4.0" - regenerator-runtime "^0.9.5" + regenerator-runtime "^0.10.0" babel-runtime@6.5.0: version "6.5.0" @@ -601,7 +1021,7 @@ babel-runtime@6.5.0: dependencies: core-js "^1.2.0" -babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.8.0: +babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.8.0: version "6.16.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.16.0.tgz#e149dd1a9f03a35f817ddbc4d0481988e7ebc8ca" dependencies: @@ -611,25 +1031,25 @@ babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.8.0: babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.16.0, babel-traverse@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.19.0.tgz#68363fb821e26247d52a519a84b2ceab8df4f55a" +babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-traverse@^6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" dependencies: - babel-code-frame "^6.16.0" + babel-code-frame "^6.20.0" babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.19.0" + babel-runtime "^6.20.0" + babel-types "^6.21.0" babylon "^6.11.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.13.0, babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.19.0.tgz#8db2972dbed01f1192a8b602ba1e1e4c516240b9" +babel-types@^6.13.0, babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20.0, babel-types@^6.21.0, babel-types@^6.8.0, babel-types@^6.9.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" dependencies: - babel-runtime "^6.9.1" + babel-runtime "^6.20.0" esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^1.0.1" @@ -670,19 +1090,15 @@ better-assert@~1.0.0: dependencies: callsite "1.0.0" -big.js@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.1.3.tgz#4cada2193652eb3ca9ec8e55c9015669c9806978" - binary-extensions@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.7.0.tgz#6c1610db163abfb34edfe42fa423343a1e01185d" + version "1.8.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" bl@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" + version "1.2.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.0.tgz#1397e7ec42c5f5dc387470c500e34a9f6be9ea98" dependencies: - readable-stream "~2.0.5" + readable-stream "^2.0.5" blob@0.0.4: version "0.0.4" @@ -695,12 +1111,8 @@ block-stream@*: inherits "~2.0.0" bluebird@^3.3.3: - version "3.4.6" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.6.tgz#01da8d821d87813d158967e743d5fe6c62cf8c0f" - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + version "3.4.7" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" boom@2.x.x: version "2.10.1" @@ -723,60 +1135,11 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -brorand@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.6.tgz#4028706b915f91f7b349a2e0bf3c376039d216e5" - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" - dependencies: - buffer-xor "^1.0.2" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - inherits "^2.0.1" - -browserify-cipher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.0.tgz#10773910c3c206d5420a46aad8694f820b85968f" - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" - -browserify-zlib@~0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" +browserslist@^1.4.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.5.1.tgz#67c3f2a1a6ad174cd01d25d2362e6e6083b26986" dependencies: - pako "~0.2.0" + caniuse-db "^1.0.30000601" buffer-crc32@~0.2.3: version "0.2.13" @@ -786,10 +1149,6 @@ buffer-shims@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" -buffer-xor@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - buffer@^3.0.1: version "3.6.0" resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb" @@ -798,13 +1157,12 @@ buffer@^3.0.1: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^4.3.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" +buffer@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.2.tgz#41d0407ff76782e9ec19f52f88e237ce6bb0de6d" dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" - isarray "^1.0.0" builtin-modules@^1.0.0: version "1.1.1" @@ -826,6 +1184,10 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" +caniuse-db@^1.0.30000601: + version "1.0.30000602" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000602.tgz#06b2cbfb6c3aeef7ddb18cd588043549ad1a2d4e" + capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" @@ -848,16 +1210,6 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.1.tgz#509afb67066e7499f7eb3535c77445772ae2d019" - dependencies: - ansi-styles "^2.1.0" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -868,7 +1220,7 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.4.3: +chokidar@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -887,18 +1239,16 @@ ci-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" -cipher-base@^1.0.0, cipher-base@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" - dependencies: - inherits "^2.0.1" - -cli-cursor@^1.0.1: +cli-cursor@^1.0.1, cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" dependencies: restore-cursor "^1.0.1" +cli-spinners@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a" + cli-width@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" @@ -911,14 +1261,6 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - clone@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" @@ -930,44 +1272,28 @@ cmd-shim@^2.0.1: graceful-fs "^4.1.2" mkdirp "~0.5.0" -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -colors@~0.6.0-1: - version "0.6.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" dependencies: delayed-stream "~1.0.0" -commander@2.9.0, commander@^2.9.0: +commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: graceful-readlink ">= 1.0.0" -commander@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781" - commander@~2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" dependencies: graceful-readlink ">= 1.0.0" -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -988,28 +1314,24 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.7, concat-stream@^1.5.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" +concat-stream@^1.4.7: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: - inherits "~2.0.1" - readable-stream "~2.0.0" - typedarray "~0.0.5" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" -console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" +concat-with-sourcemaps@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz#f55b3be2aeb47601b10a2d5259ccfb70fd2f1dd6" dependencies: - date-now "^0.1.4" + source-map "^0.5.1" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - convert-source-map@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" @@ -1034,48 +1356,18 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -create-ecdh@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - create-error-class@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" dependencies: capture-stack-trace "^1.0.0" -create-hash@^1.1.0, create-hash@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - ripemd160 "^1.0.0" - sha.js "^2.3.6" - -create-hmac@^1.1.0, create-hmac@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" - dependencies: - create-hash "^1.1.0" - inherits "^2.0.1" - cross-env@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.1.3.tgz#58cd8231808f50089708b091f7dd37275a8e8154" dependencies: cross-spawn "^3.0.1" -cross-spawn-async@^2.1.1: - version "2.2.5" - resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" - dependencies: - lru-cache "^4.0.0" - which "^1.2.8" - cross-spawn@5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.0.1.tgz#a3bbb302db2297cbea3c04edf36941f4613aa399" @@ -1104,21 +1396,6 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" -crypto-browserify@^3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -1132,15 +1409,11 @@ d@^0.1.1, d@~0.1.1: es5-ext "~0.10.2" dashdash@^1.12.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.0.tgz#29e486c5418bf0f356034a993d51686a33e84141" + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" dependencies: assert-plus "^1.0.0" -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - death@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/death/-/death-1.0.0.tgz#4d46e15488d4b636b699f0671b04632d752fd2de" @@ -1151,13 +1424,19 @@ debug@2.2.0, debug@~2.2.0: dependencies: ms "0.7.1" -debug@2.3.3, debug@^2.1.1, debug@^2.2.0: +debug@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/debug/-/debug-2.3.3.tgz#40c453e67e6e13c901ddec317af8986cda9eff8c" dependencies: ms "0.7.2" -decamelize@^1.0.0, decamelize@^1.1.1: +debug@^2.1.1, debug@^2.2.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + dependencies: + ms "0.7.2" + +decamelize@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1213,6 +1492,10 @@ deep-extend@~0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" @@ -1234,13 +1517,6 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" -des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" @@ -1251,22 +1527,10 @@ diff@^2.2.1: version "2.2.3" resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99" -diffie-hellman@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - docker-file-parser@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/docker-file-parser/-/docker-file-parser-0.1.0.tgz#8aff4967aa36df61e50f36091571f95e4457ae8b" -domain-browser@^1.1.1: - version "1.1.7" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" - download@5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/download/-/download-5.0.2.tgz#89c8ab55a3be41ef2c8d787995af81a1d91d2302" @@ -1293,30 +1557,17 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" -elliptic@^6.0.0: - version "6.3.2" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48" - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - inherits "^2.0.1" - -email-prompt@0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/email-prompt/-/email-prompt-0.1.8.tgz#75086b02a818e5b61c8d6cb7388c0b0a50e521bf" +email-prompt@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/email-prompt/-/email-prompt-0.2.0.tgz#b16d1970b7b2537b01920fe01f5062641a1f41f3" dependencies: - ansi-escapes "1.3.0" - chalk "1.1.1" + ansi-escapes "1.4.0" + chalk "1.1.3" email-validator@1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/email-validator/-/email-validator-1.0.7.tgz#4621ca32fc741eb833ac98d5fb55670b7e056c95" -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" @@ -1329,14 +1580,14 @@ end-of-stream@^1.0.0: dependencies: once "~1.3.0" -engine.io-client@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-1.8.1.tgz#71237e9bbce04862675d4d6bfbef351c8b6a35a3" +engine.io-client@1.8.2: + version "1.8.2" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-1.8.2.tgz#c38767547f2a7d184f5752f6f0ad501006703766" dependencies: component-emitter "1.2.1" component-inherit "0.0.3" debug "2.3.3" - engine.io-parser "1.3.1" + engine.io-parser "1.3.2" has-cors "1.1.0" indexof "0.0.1" parsejson "0.0.3" @@ -1346,36 +1597,21 @@ engine.io-client@1.8.1: xmlhttprequest-ssl "1.5.3" yeast "0.1.2" -engine.io-parser@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-1.3.1.tgz#9554f1ae33107d6fbd170ca5466d2f833f6a07cf" +engine.io-parser@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-1.3.2.tgz#937b079f0007d0893ec56d46cb220b8cb435220a" dependencies: - after "0.8.1" + after "0.8.2" arraybuffer.slice "0.0.6" base64-arraybuffer "0.1.5" blob "0.0.4" - has-binary "0.1.6" + has-binary "0.1.7" wtf-8 "1.0.0" -enhanced-resolve@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-2.3.0.tgz#a115c32504b6302e85a76269d7a57ccdd962e359" - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.3.0" - object-assign "^4.0.1" - tapable "^0.2.3" - err-code@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.1.tgz#739d71b6851f24d050ea18c79a5b722420771d59" -errno@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" - dependencies: - prr "~0.0.0" - error-ex@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" @@ -1425,9 +1661,24 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -estree-walker@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.0.tgz#f67ca8f57b9ed66d886af816c099c779b315d4db" +escodegen@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + +esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" @@ -1445,26 +1696,11 @@ event-stream@~3.3.0: stream-combiner "~0.0.4" through "~2.3.1" -events@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - -evp_bytestokey@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" - dependencies: - create-hash "^1.1.1" - -execa@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" +exec-sh@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10" dependencies: - cross-spawn-async "^2.1.1" - is-stream "^1.1.0" - npm-run-path "^1.0.0" - object-assign "^4.0.1" - path-key "^1.0.0" - strip-eof "^1.0.0" + merge "^1.1.3" exit-hook@^1.0.0: version "1.1.1" @@ -1504,6 +1740,16 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +fast-async@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/fast-async/-/fast-async-6.2.0.tgz#7ebb47836cac1288ce89c2116506bf3e4e03d79d" + dependencies: + nodent ">=3.0.8" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + fd-slicer@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65" @@ -1547,13 +1793,9 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" find-up@^1.0.0: version "1.1.2" @@ -1562,13 +1804,6 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -findup@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/findup/-/findup-0.1.5.tgz#8ad929a3393bac627957a7e5de4623b06b0e2ceb" - dependencies: - colors "~0.6.0-1" - commander "~2.1.0" - for-in@^0.1.5: version "0.1.6" resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" @@ -1648,6 +1883,26 @@ function-bind@^1.0.2, function-bind@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" +fuse-box@^1.3.36: + version "1.3.36" + resolved "https://registry.yarnpkg.com/fuse-box/-/fuse-box-1.3.36.tgz#49493a2928f2b8d5d2adf2506c741e99fdc13c97" + dependencies: + acorn "^4.0.3" + acorn-es7 "^0.1.0" + acorn-jsx "^3.0.1" + ansi "^0.3.1" + app-root-path "^2.0.1" + buffer "^5.0.0" + concat-with-sourcemaps "^1.0.4" + escodegen "^1.8.1" + glob "^7.1.1" + mkdirp "^0.5.1" + pretty-time "^0.2.0" + prettysize "0.0.3" + realm-utils "^1.0.6" + request "^2.79.0" + watch "^1.0.1" + gauge@~2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.6.0.tgz#d35301ad18e96902b4751dcbbe40f4218b942a46" @@ -1663,17 +1918,17 @@ gauge@~2.6.0: wide-align "^1.1.0" gauge@~2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.1.tgz#388473894fe8be5e13ffcdb8b93e4ed0616428c7" + version "2.7.2" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774" dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" - has-color "^0.1.7" has-unicode "^2.0.0" object-assign "^4.1.0" signal-exit "^3.0.0" string-width "^1.0.1" strip-ansi "^3.0.1" + supports-color "^0.2.0" wide-align "^1.1.0" generate-function@^2.0.0: @@ -1686,10 +1941,6 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" -get-caller-file@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" - get-proxy@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/get-proxy/-/get-proxy-1.1.0.tgz#894854491bc591b0f147d7ae570f5c678b7256eb" @@ -1700,31 +1951,23 @@ get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" -get-stream@^2.2.0, get-stream@^2.3.0: +get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + getpass@^0.1.1: version "0.1.6" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" dependencies: assert-plus "^1.0.0" -ghooks@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/ghooks/-/ghooks-1.3.2.tgz#bee29deec4283e23eb1ff37d94a8120acd4332e9" - dependencies: - execa "^0.4.0" - findup "0.1.5" - lodash.clone "4.3.2" - manage-path "2.0.0" - opt-cli "1.5.1" - path-exists "^2.0.0" - spawn-command "0.0.2" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -1738,7 +1981,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@7.1.1, glob@^7.0.3, glob@^7.0.5: +glob@7.1.1, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -1754,29 +1997,25 @@ globals@^9.0.0: resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" got@^6.3.0: - version "6.6.3" - resolved "https://registry.yarnpkg.com/got/-/got-6.6.3.tgz#ff72c56d7f040eb8918ffb80fb62bcaf489d4eec" + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" dependencies: create-error-class "^3.0.0" duplexer3 "^0.1.4" - get-stream "^2.3.0" + get-stream "^3.0.0" is-redirect "^1.0.0" is-retry-allowed "^1.0.0" is-stream "^1.0.0" lowercase-keys "^1.0.0" - node-status-codes "^2.0.0" - timed-out "^3.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" unzip-response "^2.0.1" url-parse-lax "^1.0.0" -graceful-fs@4.1.11, graceful-fs@^4.1.6, graceful-fs@^4.1.9: +graceful-fs@4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -graceful-fs@^4.1.2: - version "4.1.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131" - "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" @@ -1800,12 +2039,6 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-binary@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/has-binary/-/has-binary-0.1.6.tgz#25326f39cfa4f616ad8787894e3af2cfbc7b6e10" - dependencies: - isarray "0.0.1" - has-binary@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/has-binary/-/has-binary-0.1.7.tgz#68e61eb16210c9545a0a5cce06a873912fe1e68c" @@ -1820,20 +2053,10 @@ has-cors@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" -hash.js@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" - dependencies: - inherits "^2.0.1" - hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" @@ -1867,13 +2090,6 @@ hpack.js@^2.1.6: readable-stream "^2.0.1" wbuf "^1.1.0" -http-browserify@^1.3.2: - version "1.7.0" - resolved "https://registry.yarnpkg.com/http-browserify/-/http-browserify-1.7.0.tgz#33795ade72df88acfbfd36773cefeda764735b20" - dependencies: - Base64 "~0.2.0" - inherits "~2.0.1" - http-deceiver@^1.2.4: version "1.2.7" resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" @@ -1886,13 +2102,17 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -https-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" +husky@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.12.0.tgz#3a44922fce8071803242c3c7522a6582c50525dc" + dependencies: + find-parent-dir "^0.3.0" + is-ci "^1.0.9" + normalize-path "^1.0.0" iconv-lite@^0.4.8, iconv-lite@~0.4.13: - version "0.4.13" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" + version "0.4.15" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" ieee754@^1.1.4: version "1.1.8" @@ -1913,14 +2133,10 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - ini@1.3.4, ini@^1.3.4, ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" @@ -1944,20 +2160,12 @@ inquirer@^1.2.2: strip-ansi "^3.0.0" through "^2.3.6" -interpret@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" - invariant@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" dependencies: loose-envify "^1.0.0" -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - is-absolute@^0.1.5: version "0.1.7" resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.1.7.tgz#847491119fccb5fb436217cc737f7faad50f603f" @@ -1988,7 +2196,7 @@ is-callable@^1.1.1, is-callable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" -is-ci@^1.0.9: +is-ci@^1.0.10, is-ci@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" dependencies: @@ -2145,16 +2353,14 @@ jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -2164,8 +2370,8 @@ json3@3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" json5@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.0.tgz#9b20715b026cbe3778fd769edccd822d8332a5b2" + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" jsonfile@^2.1.0: version "2.4.0" @@ -2178,8 +2384,8 @@ jsonify@~0.0.0: resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" jsonpointer@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.0.tgz#6661e161d2fc445f19f98430231343722e1fcbd5" + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: version "1.3.1" @@ -2190,8 +2396,8 @@ jsprim@^1.2.2: verror "1.3.6" kind-of@^3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.0.4.tgz#7b8ecf18a4e17f8269d73b501c9f232c96887a74" + version "3.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" dependencies: is-buffer "^1.0.2" @@ -2205,16 +2411,17 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - leven@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.0.0.tgz#74c45744439550da185801912829f61d22071bc1" +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -2225,36 +2432,19 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" -loader-runner@^2.1.0, loader-runner@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.2.0.tgz#824c1b699c4e7a2b6501b85902d5b862bf45b3fa" - -loader-utils@^0.2.11, loader-utils@^0.2.16: - version "0.2.16" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d" - dependencies: - big.js "^3.1.3" - emojis-list "^2.0.0" - json5 "^0.5.0" - object-assign "^4.0.1" - -lodash._baseclone@~4.5.0: - version "4.5.7" - resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz#ce42ade08384ef5d62fa77c30f61a46e686f8434" +lodash.some@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" -lodash.assign@^4.0.3, lodash.assign@^4.0.6: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" +lodash@^4.2.0, lodash@^4.3.0: + version "4.17.3" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.3.tgz#557ed7d2a9438cac5fd5a43043ca60cb455e01f7" -lodash.clone@4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.3.2.tgz#e56b176b6823a7dde38f7f2bf58de7d5971200e9" +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" dependencies: - lodash._baseclone "~4.5.0" - -lodash@^4.14.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: - version "4.17.2" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" + chalk "^1.0.0" longest@^1.0.1: version "1.0.1" @@ -2277,33 +2467,20 @@ lowercase-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" -lru-cache@^4.0.0, lru-cache@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.1.tgz#1343955edaf2e37d9b9e7ee7241e27c4b9fb72be" +lru-cache@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: pseudomap "^1.0.1" yallist "^2.0.0" -magic-string@^0.16.0: - version "0.16.0" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.16.0.tgz#970ebb0da7193301285fb1aa650f39bdd81eb45a" - dependencies: - vlq "^0.2.1" - -manage-path@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/manage-path/-/manage-path-2.0.0.tgz#f4cf8457b926eeee2a83b173501414bc76eb9597" - map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" -memory-fs@^0.3.0, memory-fs@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.3.0.tgz#7bcc6b629e3a43e871d7e29aca6ae8a7f15cbb20" - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" micromatch@^2.1.5: version "2.3.11" @@ -2323,13 +2500,6 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" -miller-rabin@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - mime-db@~1.25.0: version "1.25.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392" @@ -2385,8 +2555,12 @@ mz@^2.3.1: thenify-all "^1.0.0" nan@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.4.0.tgz#fb3c59d45fe4effe215f0b890f8adf6eb32d2232" + version "2.5.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8" + +nanoseconds@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/nanoseconds/-/nanoseconds-0.1.0.tgz#69ec39fcd00e77ab3a72de0a43342824cd79233a" node-emoji@^1.0.4: version "1.4.3" @@ -2420,51 +2594,37 @@ node-gyp@^3.2.1: tar "^2.0.0" which "1" -node-libs-browser@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-1.0.0.tgz#ff8ad6c2cfa78043bdd0091ec07f0aaa581620fc" - dependencies: - assert "^1.1.1" - browserify-zlib "~0.1.4" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^1.0.0" - http-browserify "^1.3.2" - https-browserify "0.0.1" - os-browserify "~0.2.0" - path-browserify "0.0.0" - process "~0.11.0" - punycode "^1.2.4" - querystring-es3 "~0.2.0" - readable-stream "^2.0.5" - stream-browserify "^2.0.1" - string_decoder "~0.10.25" - timers-browserify "^1.0.1" - tty-browserify "0.0.0" - url "~0.11.0" - util "~0.10.3" - vm-browserify "0.0.4" - node-pre-gyp@^0.6.29: - version "0.6.31" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.31.tgz#d8a00ddaa301a940615dbcc8caad4024d58f6017" + version "0.6.32" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5" dependencies: mkdirp "~0.5.1" nopt "~3.0.6" - npmlog "^4.0.0" + npmlog "^4.0.1" rc "~1.1.6" - request "^2.75.0" + request "^2.79.0" rimraf "~2.5.4" semver "~5.3.0" tar "~2.2.1" tar-pack "~3.3.0" -node-status-codes@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-2.0.1.tgz#298067659cb68a2b4670abbefde02a3819981f5b" +node-version@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-version/-/node-version-1.0.0.tgz#1b9b9584a9a7f7a6123f215cd14a652bf21ab19e" + +nodent-runtime@>=3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/nodent-runtime/-/nodent-runtime-3.0.3.tgz#49a25f4f4efb092c40d97be9e73de7e53a5f8361" + +nodent@>=3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/nodent/-/nodent-3.0.8.tgz#53bd61d2b5d3bfdcb44c28b63065d6c86cf552f0" + dependencies: + acorn ">=2.5.2" + acorn-es7-plugin ">=1.1.5" + nodent-runtime ">=3.0.3" + resolve "1.2.0" + source-map "0.5.6" "nopt@2 || 3", nopt@~3.0.6: version "3.0.6" @@ -2481,26 +2641,30 @@ normalize-package-data@^2.3.2: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" +normalize-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + normalize-path@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" -now@^0.33.0: - version "0.33.2" - resolved "https://registry.yarnpkg.com/now/-/now-0.33.2.tgz#8ce3f403812484a3fcc3270c8f19602871965e79" +now@^0.37.1: + version "0.37.1" + resolved "https://registry.yarnpkg.com/now/-/now-0.37.1.tgz#96c25724d2312bb7ea5f71b80371336d3ea4f887" dependencies: ansi-escapes "1.4.0" arr-flatten "1.0.1" array-unique "0.3.2" async-retry "0.2.1" - babel-runtime "6.18.0" + babel-runtime "6.20.0" bytes "2.4.0" chalk "1.1.3" copy-paste "1.3.0" cross-spawn "5.0.1" docker-file-parser "0.1.0" download "5.0.2" - email-prompt "0.1.8" + email-prompt "0.2.0" email-validator "1.0.7" fs-promise "1.0.0" glob "7.1.1" @@ -2511,25 +2675,21 @@ now@^0.33.0: minimist "1.2.0" ms "0.7.2" node-fetch "1.6.3" + node-version "1.0.0" + ora "0.4.0" progress "1.1.8" + psl "1.1.15" resumer "0.0.0" semver-compare "1.0.0" - socket.io-client "1.7.1" + socket.io-client "1.7.2" spdy "3.4.4" split-array "1.0.1" text-table "0.2.0" tmp-promise "1.0.2" -npm-install-webpack-plugin@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/npm-install-webpack-plugin/-/npm-install-webpack-plugin-4.0.4.tgz#8097ba6383acc48c11f21e64d85555e894d339dd" - dependencies: - cross-spawn "^4.0.0" - memory-fs "^0.3.0" - npm-run-all@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-3.1.1.tgz#5c6fe867332f08342b1a1ea99f447ab86c95cb02" + version "3.1.2" + resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-3.1.2.tgz#c7e3faf4aa0a59bf0dcfc12601166151692171cf" dependencies: chalk "^1.1.3" cross-spawn "^4.0.0" @@ -2542,12 +2702,6 @@ npm-run-all@^3.1.1: shell-quote "^1.6.1" string.prototype.padend "^3.0.0" -npm-run-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" - dependencies: - path-key "^1.0.0" - "npmlog@0 || 1 || 2 || 3": version "3.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-3.1.2.tgz#2d46fa874337af9498a2f12bb43d8d0be4a36873" @@ -2557,9 +2711,9 @@ npm-run-path@^1.0.0: gauge "~2.6.0" set-blocking "~2.0.0" -npmlog@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.1.tgz#d14f503b4cd79710375553004ba96e6662fbc0b8" +npmlog@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" @@ -2617,50 +2771,34 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" -opt-cli@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/opt-cli/-/opt-cli-1.5.1.tgz#04db447b13c96b992eb31685266f4ed0d9736dc2" - dependencies: - commander "2.9.0" - lodash.clone "4.3.2" - manage-path "2.0.0" - spawn-command "0.0.2-1" - -optimize-js-plugin@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/optimize-js-plugin/-/optimize-js-plugin-0.0.4.tgz#69e7a67e0f66c69f7fc0c7b25c5d33b2db6c2817" - dependencies: - optimize-js "^1.0.0" - webpack-sources "^0.1.2" - -optimize-js@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/optimize-js/-/optimize-js-1.0.2.tgz#1c5b8fd33ea9bd7fa3e4ecc0a9efa7e95f372907" +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: - acorn "^3.3.0" - concat-stream "^1.5.1" - estree-walker "^0.3.0" - magic-string "^0.16.0" - yargs "^4.8.1" + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" options@>=0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" -os-browserify@~0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" +ora@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-0.4.0.tgz#fccb5a82e169ccd27c491bd00cc1924ff7a390bd" + dependencies: + chalk "^1.1.1" + cli-cursor "^1.0.2" + cli-spinners "^1.0.0" + log-symbols "^1.0.2" os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.0.0" - os-shim@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" @@ -2670,26 +2808,12 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" osenv@0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.3.tgz#83cf05c6d6458fc4d5ac6362ea325d92f2754217" + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -pako@~0.2.0: - version "0.2.9" - resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" - -parse-asn1@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -2729,10 +2853,6 @@ path-array@^1.0.0: dependencies: array-index "^1.0.0" -path-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -2743,10 +2863,6 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-key@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" - path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -2761,12 +2877,6 @@ pause-stream@0.0.11: dependencies: through "~2.3" -pbkdf2@^3.0.3: - version "3.0.9" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" - dependencies: - create-hmac "^1.1.2" - pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -2785,11 +2895,9 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - dependencies: - find-up "^1.0.0" +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" prepend-http@^1.0.1: version "1.0.4" @@ -2799,6 +2907,17 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +pretty-time@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/pretty-time/-/pretty-time-0.2.0.tgz#7a3bdec4049c620cd7c42b7f342b74d56e73d74e" + dependencies: + is-number "^2.0.2" + nanoseconds "^0.1.0" + +prettysize@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/prettysize/-/prettysize-0.0.3.tgz#14afff6a645e591a4ddf1c72919c23b4146181a1" + private@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1" @@ -2807,10 +2926,6 @@ process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" -process@~0.11.0: - version "0.11.9" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" - progress@1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" @@ -2824,10 +2939,6 @@ proper-lockfile@^1.1.3: graceful-fs "^4.1.2" retry "^0.10.0" -prr@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" - ps-tree@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014" @@ -2838,21 +2949,11 @@ pseudomap@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" -public-encrypt@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" +psl@1.1.15: + version "1.1.15" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.15.tgz#4bcd312929a5a88657c35d23b425712fb0c74f00" -punycode@^1.2.4, punycode@^1.4.1: +punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -2860,25 +2961,13 @@ qs@~6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" -querystring-es3@~0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - randomatic@^1.1.3: - version "1.1.5" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.5.tgz#5e9ef5f2d573c67bd2b8124ae90b5156e457840b" + version "1.1.6" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" dependencies: is-number "^2.0.2" kind-of "^3.0.2" -randombytes@^2.0.0, randombytes@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" - rc@^1.1.2, rc@~1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" @@ -2909,9 +2998,9 @@ read@^1.0.7: dependencies: mute-stream "~0.0.4" -readable-stream@^2.0.0, readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" +readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -2921,10 +3010,11 @@ readable-stream@^2.0.0, readable-stream@~2.1.4: string_decoder "~0.10.x" util-deprecate "~1.0.1" -"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@~2.0.0, readable-stream@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" +readable-stream@~2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" dependencies: + buffer-shims "^1.0.0" core-util-is "~1.0.0" inherits "~2.0.1" isarray "~1.0.0" @@ -2941,9 +3031,28 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" -regenerator-runtime@^0.9.5: - version "0.9.6" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.9.6.tgz#d33eb95d0d2001a4be39659707c51b0cb71ce029" +realm-utils@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/realm-utils/-/realm-utils-1.0.6.tgz#2418ee18b898657a6e0ed59239542e28272c7bc8" + dependencies: + app-root-path "^1.3.0" + mkdirp "^0.5.1" + +regenerate@^1.2.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" + +regenerator-runtime@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" + +regenerator-transform@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.8.tgz#0f88bb2bc03932ddb7b6b7312e68078f01026d6c" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" regex-cache@^0.4.2: version "0.4.3" @@ -2952,6 +3061,24 @@ regex-cache@^0.4.2: is-equal-shallow "^0.1.3" is-primitive "^2.0.0" +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -2970,7 +3097,7 @@ request-capture-har@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/request-capture-har/-/request-capture-har-1.1.4.tgz#e6ad76eb8e7a1714553fdbeef32cd4518e4e2013" -request@2, request@^2.75.0: +request@2, request@^2.75.0, request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -2995,13 +3122,9 @@ request@2, request@^2.75.0: tunnel-agent "~0.4.1" uuid "^3.0.0" -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +resolve@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" restore-cursor@^1.0.1: version "1.0.1" @@ -3021,8 +3144,8 @@ retry@0.9.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.9.0.tgz#6f697e50a0e4ddc8c8f7fb547a9b60dead43678d" retry@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.0.tgz#649e15ca408422d98318161935e7f7d652d435dd" + version "0.10.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" right-align@^0.1.1: version "0.1.3" @@ -3036,10 +3159,6 @@ rimraf@2, rimraf@^2.5.0, rimraf@^2.5.4, rimraf@~2.5.1, rimraf@~2.5.4: dependencies: glob "^7.0.5" -ripemd160@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" - roadrunner@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/roadrunner/-/roadrunner-1.1.0.tgz#1180a30d64e1970d8f55dd8cb0da8ffccecad71e" @@ -3054,6 +3173,10 @@ rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + seek-bzip@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" @@ -3072,7 +3195,7 @@ semver-compare@1.0.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -3080,12 +3203,6 @@ set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" -sha.js@^2.3.6: - version "2.4.8" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" - dependencies: - inherits "^2.0.1" - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -3106,8 +3223,8 @@ shell-quote@^1.6.1: jsonify "~0.0.0" signal-exit@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.1.tgz#5a4c884992b63a7acd9badb7894c3ee9cfccad81" + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" slash@^1.0.0: version "1.0.0" @@ -3119,15 +3236,15 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -socket.io-client@1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-1.7.1.tgz#6c23725edff804f3919c1ce4ebb25e591c6e61d7" +socket.io-client@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-1.7.2.tgz#39fdb0c3dd450e321b7e40cfd83612ec533dd644" dependencies: backo2 "1.0.2" component-bind "1.0.0" component-emitter "1.2.1" debug "2.3.3" - engine.io-client "1.8.1" + engine.io-client "1.8.2" has-binary "0.1.7" indexof "0.0.1" object-component "0.0.3" @@ -3144,27 +3261,21 @@ socket.io-parser@2.3.1: isarray "0.0.1" json3 "3.3.2" -source-list-map@~0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.6.tgz#e1e6f94f0b40c4d28dcf8f5b8766e0e45636877f" - source-map-support@^0.4.2: - version "0.4.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.6.tgz#32552aa64b458392a85eab3b0b5ee61527167aeb" + version "0.4.8" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.8.tgz#4871918d8a3af07289182e974e32844327b2e98b" dependencies: source-map "^0.5.3" -source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1, source-map@~0.5.3: +source-map@0.5.6, source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -spawn-command@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" - -spawn-command@0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" spawn-sync@^1.0.15: version "1.0.15" @@ -3232,24 +3343,13 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -start-server-webpack-plugin@^2.0.1, start-server-webpack-plugin@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/start-server-webpack-plugin/-/start-server-webpack-plugin-2.1.1.tgz#f0c632f50dbfc4a29de1f9231df68dd8b0e5a919" - -stream-browserify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - stream-combiner@~0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" dependencies: duplexer "~0.1.1" -string-width@^1.0.1, string-width@^1.0.2: +string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -3269,7 +3369,7 @@ string.prototype.padend@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" -string_decoder@~0.10.25, string_decoder@~0.10.x: +string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -3300,10 +3400,6 @@ strip-dirs@^1.1.1: minimist "^1.1.0" sum-up "^1.0.1" -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - strip-json-comments@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" @@ -3320,24 +3416,18 @@ sum-up@^1.0.1: dependencies: chalk "^1.0.0" +supports-color@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" - dependencies: - has-flag "^1.0.0" - sync-exec@~0.6.x: version "0.6.2" resolved "https://registry.yarnpkg.com/sync-exec/-/sync-exec-0.6.2.tgz#717d22cc53f0ce1def5594362f3a89a2ebb91105" -tapable@^0.2.3, tapable@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.4.tgz#a7814605089d4ba896c33c7e3566e13dcd194aa5" - tar-pack@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" @@ -3388,15 +3478,9 @@ through@2, through@^2.3.6, through@~2.3, through@~2.3.1, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -timed-out@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-3.0.0.tgz#ff88de96030ce960eabd42487db61d3add229273" - -timers-browserify@^1.0.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" - dependencies: - process "~0.11.0" +timed-out@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.0.tgz#b0fb98d7fed4f36b028698122769c07ef87a8690" tmp-promise@1.0.2: version "1.0.2" @@ -3437,34 +3521,27 @@ trim-repeated@^1.0.0: dependencies: escape-string-regexp "^1.0.2" -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - tunnel-agent@^0.4.0, tunnel-agent@~0.4.1: version "0.4.3" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.3.tgz#3da382f670f25ded78d7b3d1792119bca0b7132d" + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" -typedarray@~0.0.5: +typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -uglify-js@~2.6.0: - version "2.6.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.6.4.tgz#65ea2fb3059c9394692f15fed87c2b36c16b9adf" - dependencies: - async "~0.2.6" - source-map "~0.5.1" - uglify-to-browserify "~1.0.0" - yargs "~3.10.0" - -uglify-js@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.4.tgz#a295a0de12b6a650c031c40deb0dc40b14568bd2" +uglify-js@^2.7.5: + version "2.7.5" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" dependencies: async "~0.2.6" source-map "~0.5.1" @@ -3500,13 +3577,6 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" -url@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - dependencies: - punycode "1.3.2" - querystring "0.2.0" - user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" @@ -3517,15 +3587,9 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -util@0.10.3, util@~0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - dependencies: - inherits "2.0.1" - uuid@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.0.tgz#6728fc0459c450d796a99c31837569bdf672d728" + version "3.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" validate-npm-package-license@^3.0.1: version "3.0.1" @@ -3540,23 +3604,12 @@ verror@1.3.6: dependencies: extsprintf "1.0.2" -vlq@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.1.tgz#14439d711891e682535467f8587c5630e4222a6c" - -vm-browserify@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - dependencies: - indexof "0.0.1" - -watchpack@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.1.0.tgz#42d44627464a2fadffc9308c0f7562cfde795f24" +watch@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/watch/-/watch-1.0.1.tgz#37b7fc4b7bccafa9f6398dca56a2a45455db4aa2" dependencies: - async "2.0.0-rc.4" - chokidar "^1.4.3" - graceful-fs "^4.1.2" + exec-sh "^0.2.0" + minimist "^1.2.0" wbuf@^1.1.0, wbuf@^1.4.0: version "1.7.2" @@ -3564,65 +3617,7 @@ wbuf@^1.1.0, wbuf@^1.4.0: dependencies: minimalistic-assert "^1.0.0" -webpack-sources@^0.1.0, webpack-sources@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.3.tgz#15ce2fb79d0a1da727444ba7c757bf164294f310" - dependencies: - source-list-map "~0.1.0" - source-map "~0.5.3" - -webpack@2.1.0-beta.22: - version "2.1.0-beta.22" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.1.0-beta.22.tgz#b073cf6dbb1993f43bffdde4528ba32f7894d330" - dependencies: - acorn "^3.2.0" - async "^1.3.0" - clone "^1.0.2" - enhanced-resolve "^2.2.0" - interpret "^1.0.0" - loader-runner "^2.1.0" - loader-utils "^0.2.11" - memory-fs "~0.3.0" - mkdirp "~0.5.0" - node-libs-browser "^1.0.0" - object-assign "^4.0.1" - source-map "^0.5.3" - supports-color "^3.1.0" - tapable "~0.2.3" - uglify-js "~2.6.0" - watchpack "^1.0.0" - webpack-sources "^0.1.0" - yargs "^4.7.1" - -webpack@^2.1.0-beta: - version "2.1.0-beta.27" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.1.0-beta.27.tgz#06cb802e44118159e46b7533ae76b0d84c8c89d8" - dependencies: - acorn "^4.0.3" - ajv "^4.7.0" - ajv-keywords "^1.1.1" - async "^2.1.2" - enhanced-resolve "^2.2.0" - interpret "^1.0.0" - loader-runner "^2.2.0" - loader-utils "^0.2.16" - memory-fs "~0.3.0" - mkdirp "~0.5.0" - node-libs-browser "^1.0.0" - object-assign "^4.0.1" - source-map "^0.5.3" - supports-color "^3.1.0" - tapable "~0.2.3" - uglify-js "~2.7.3" - watchpack "^1.0.0" - webpack-sources "^0.1.0" - yargs "^6.0.0" - -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - -which@1, which@^1.2.8, which@^1.2.9: +which@1, which@^1.2.9: version "1.2.12" resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" dependencies: @@ -3638,19 +3633,13 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" -window-size@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" - wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" -wrap-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.0.0.tgz#7d30f8f873f9a5bbc3a64dabc8d177e071ae426f" - dependencies: - string-width "^1.0.1" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" wrappy@1: version "1.0.2" @@ -3675,65 +3664,10 @@ xtend@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - yallist@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4" -yargs-parser@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" - dependencies: - camelcase "^3.0.0" - lodash.assign "^4.0.6" - -yargs-parser@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.1.0.tgz#313df030f20124124aeae8fbab2da53ec28c56d7" - dependencies: - camelcase "^3.0.0" - -yargs@^4.7.1, yargs@^4.8.1: - version "4.8.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" - dependencies: - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - lodash.assign "^4.0.3" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.1" - which-module "^1.0.0" - window-size "^0.2.0" - y18n "^3.2.1" - yargs-parser "^2.4.1" - -yargs@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.4.0.tgz#816e1a866d5598ccf34e5596ddce22d92da490d4" - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - window-size "^0.2.0" - y18n "^3.2.1" - yargs-parser "^4.1.0" - yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" @@ -3743,9 +3677,9 @@ yargs@~3.10.0: decamelize "^1.0.0" window-size "0.1.0" -yarn@^0.17.9: - version "0.17.10" - resolved "https://registry.yarnpkg.com/yarn/-/yarn-0.17.10.tgz#f72c7a100ef5e0c12d4daa7dc05f1f292a6212c6" +yarn@^0.18.1: + version "0.18.1" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-0.18.1.tgz#02e2efee30255a60b6df4b5b2c7da9c1fd4c8e83" dependencies: babel-runtime "^6.0.0" bytes "^2.4.0" @@ -3762,7 +3696,7 @@ yarn@^0.17.9: inquirer "^1.2.2" invariant "^2.2.0" is-builtin-module "^1.0.0" - is-ci "^1.0.9" + is-ci "^1.0.10" leven "^2.0.0" loud-rejection "^1.2.0" minimatch "^3.0.3" From 49b44f7ce3655a29a8156d229475991ac3219229 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 15:54:50 -0600 Subject: [PATCH 02/19] 0.0.27 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a7851f9..d9405be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clan-fp", - "version": "0.0.26", + "version": "0.0.27", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", From 4ac95ff424011f79c8452428fba674de20906f44 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 16:48:34 -0600 Subject: [PATCH 03/19] comitting and pushing new patch version --- build/index.js | 182 ++++++++++++++++++++++----------------------- build/index.js.map | 2 +- fuse.js | 47 +++++------- package.json | 2 +- 4 files changed, 110 insertions(+), 123 deletions(-) diff --git a/build/index.js b/build/index.js index 6a8f653..ce9ee12 100644 --- a/build/index.js +++ b/build/index.js @@ -1,5 +1,9 @@ (function(FuseBox){ FuseBox.pkg("clan-fp", {}, function(___scope___){ +___scope___.file("index.js", function(exports, require, module, __filename, __dirname){ + +'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.hash=void 0;var _batch=require('./batch'),_batch2=_interopRequireDefault(_batch),_vdom=require('./vdom'),_vdom2=_interopRequireDefault(_vdom),_mixin=require('./mixin'),_mixin2=_interopRequireDefault(_mixin),_model=require('./model'),_model2=_interopRequireDefault(_model),_observable=require('./observable'),_observable2=_interopRequireDefault(_observable),_hamt=require('./hamt'),hamt=_interopRequireWildcard(_hamt),_worker=require('./worker'),worker=_interopRequireWildcard(_worker),_fp=require('./fp'),fp=_interopRequireWildcard(_fp);function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var hash=exports.hash=function hash(a){var b=1 options) -> Promise -var batch=function batch(a){var b={};return function(c){var g=1 U) -> (U -> V) -> (T -> V) -var c=exports.c=function c(b,d){return function(e){return b(d(e))}};// cof :: [(an -> bn)] -> a0 -> bn -// compose forward -var cof=exports.cof=function cof(){for(var _len=arguments.length,b=Array(_len),_key=0;_key<_len;_key++)b[_key]=arguments[_key];return b.reduce(function(d,e){return c(d,e)})};// cob :: [(an -> bn)] -> b0 -> an -// compose backwards -var cob=exports.cob=function cob(){for(var _len2=arguments.length,b=Array(_len2),_key2=0;_key2<_len2;_key2++)b[_key2]=arguments[_key2];return cof.apply(void 0,_toConsumableArray(b.reverse()))};// functional utilities -// pointfree -var pf=exports.pf=function pf(b){return function(){for(var _len3=arguments.length,d=Array(_len3),_key3=0;_key3<_len3;_key3++)d[_key3]=arguments[_key3];return function(e){return b.apply(e,d)}}};// curry -// curry :: (T -> U) -> [args] -> ( -> U) -var curry=exports.curry=function curry(b){for(var _len4=arguments.length,d=Array(1<_len4?_len4-1:0),_key4=1;_key4<_len4;_key4++)d[_key4-1]=arguments[_key4];return b.bind.apply(b,[void 0].concat(d))};// Transducers -var mapping=exports.mapping=function mapping(b){return(// mapper: x -> y -function(d){return(// reducer: (state, value) -> new state -function(e,h){return d(e,b(h))})})};var filtering=exports.filtering=function filtering(b){return(// predicate: x -> true/false -function(d){return(// reducer: (state, value) -> new state -function(e,h){return b(h)?d(e,h):e})})};var concatter=exports.concatter=function concatter(b,d){return b.concat([d])}; -}); -___scope___.file("hamt.js", function(exports, require, module, __filename, __dirname){ - -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});// compute the hamming weight -var hamming=exports.hamming=function hamming(e){return e-=1431655765&e>>1,e=(858993459&e)+(858993459&e>>2),e=252645135&e+(e>>4),e>>=8,e>>=16,127&e};var popcount=exports.popcount=function popcount(e){if(e.key)return 1;var f=e.children;if(f){var g=0;for(var l in f)g+=popcount(f[l]);return g}};// hash fn -var hash=exports.hash=function hash(){var e=0>>g*f&(1< points to other nodes (List children) - */return void 0!==e&&(l.key=e,l.hash=g,l.val=f),l};var map=exports.map=function map(e,f){if(e.key!==void 0)return node(e.key,f(e.val,e.key),e.hash);var g=cloneNode(e),l=g.children;if(l)for(var m in l)l[m]=map(l[m],f);return g};var filter=exports.filter=function filter(e,f){if(e.key!==void 0)return f(e.val,e.key)?e:void 0;var g=cloneNode(e),l=g.children;if(l)for(var m in l)filter(l[m],f)||delete l[m];return g};var reduce=exports.reduce=function reduce(e,f,g){if(e.key!==void 0)return f(g,e.val,e.key);var l=e.children;if(l){for(var m in l)g=reduce(l[m],f,g);return g}};var toList=exports.toList=function toList(e){var f=1 console.log(...args) -// const j = (...a) => console.log(JSON.stringify(a)) -// let x = hamt() -// let s = 20 -// Array(s).fill(1).map((v,i) => { -// x = set(x, i, i) -// }) -// l(toList(x)) -// l(toJson(x)) -// x = map(x, x => log(x*x) || x*x) -// l(get(x, 19)) -// l(x) -// l(reduce(x, (acc, x) => acc+x, 0)) -// x = unset(x, 1) -// Array(s).fill(1).map((_,i) => { -// if(!get(x, i)) l(i) -// // l(get(x, i)) -// }) -}); -___scope___.file("index.js", function(exports, require, module, __filename, __dirname){ - -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.hash=void 0;var _batch=require('./batch'),_batch2=_interopRequireDefault(_batch),_vdom=require('./vdom'),_vdom2=_interopRequireDefault(_vdom),_mixin=require('./mixin'),_mixin2=_interopRequireDefault(_mixin),_model=require('./model'),_model2=_interopRequireDefault(_model),_observable=require('./observable'),_observable2=_interopRequireDefault(_observable),_hamt=require('./hamt'),hamt=_interopRequireWildcard(_hamt),_worker=require('./worker'),worker=_interopRequireWildcard(_worker),_fp=require('./fp'),fp=_interopRequireWildcard(_fp);function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var hash=exports.hash=function hash(a){var b=1L){var M=K.children[L];K.insertBefore(J,M)}else K.appendChild(J)},D=function D(J,K){// if vdom is a function, execute it until it isn't for(var L=2_N2.length;)B(_O2[_O2.length-1]);for(var _P2=0;_P2P?O():(L=!0,J)})};return{finish:O,resolve:function resolve(P){var Q=Object.keys(P);if(!Q.length)return Promise.resolve(!0);var R=[];return Q.forEach(function(S){for(var T=P[S];T instanceof Function;)T=T();T&&T.then instanceof Function&&R.push(T.then(function(U){return J[S]=U}))}),M(R)},getState:function getState(){return J},promises:K,isDone:function isDone(){return L}}},F=function F(J,K){for(var L=J(K);L instanceof Function;)L=J(instance.getState());return L},G=['className','id'],H=function H(J){for(;J instanceof Function;)J=J();return J instanceof Array?new Promise(function(K){return K(I.apply(void 0,_toConsumableArray(J)))}):J?'object'==('undefined'==typeof J?'undefined':_typeof(J))?(J.resolve?J.resolve():Promise.resolve()).then(function(K){if(K||(K=J),K instanceof Array)return new Promise(function(W){return W(I.apply(void 0,_toConsumableArray(K)))});var _K=K,L=_K.tag,M=_K.id,N=_K.className,O=_K.attrs,P=_K.children,Q=_K.instance,R=M||O&&O.id?' id="'+(M||O&&O.id||'')+'"':'',S=N||O&&O.className?' class="'+((N||'')+' '+(O.className||'')).trim()+'"':'';l(K);var T='',U='';for(var V in O||Object.create(null))'style'===V?T+=' style="'+y(O[V])+'"':'innerHTML'===V?U=O[V]:-1===G.indexOf(V)&&(T+=' '+V+'="'+O[V]+'"');return!U&&P?I.apply(void 0,_toConsumableArray(P)).then(function(W){return'<'+L+R+S+T+'>'+W+''}):0==='br,input,img'.split(',').filter(function(W){return W===L}).length?new Promise(function(W){return W('<'+L+R+S+T+'>'+U+'')}):new Promise(function(W){return W('<'+L+R+S+T+' />')})}):new Promise(function(K){return K(J)}):new Promise(function(K){return K('')})},I=function I(){for(var _len3=arguments.length,J=Array(_len3),_key3=0;_key3<_len3;_key3++)J[_key3]=arguments[_key3];return Promise.all(J.map(H)).then(function(K){return K.filter(function(L){return!!L}).join('')})};// creatign html, strip events from DOM element... for now just deleting +var _M=J instanceof Array?L:A(J,K,L);if(_M)if(J instanceof Array||J.children){for(var _N2=o(J instanceof Array?J:J.children),_O2=J instanceof Array?L.childNodes:_M.childNodes;_O2.length>_N2.length;)B(_O2[_O2.length-1]);for(var _P2=0;_P2P?O():(L=!0,J)})};return{finish:O,resolve:function resolve(P){var Q=Object.keys(P);if(!Q.length)return Promise.resolve(!0);var R=[];return Q.forEach(function(S){for(var T=P[S];T instanceof Function;)T=T();T&&T.then instanceof Function&&R.push(T.then(function(U){return J[S]=U}))}),M(R)},getState:function getState(){return J},promises:K,isDone:function isDone(){return L}}},F=function F(J,K){for(var L=J(K);L instanceof Function;)L=J(instance.getState());return L},G=['className','id'],H=function H(J){for(;J instanceof Function;)J=J();return J instanceof Array?new Promise(function(K){return K(I.apply(void 0,_toConsumableArray(J)))}):J?'object'==('undefined'==typeof J?'undefined':_typeof(J))?(J.resolve?J.resolve():Promise.resolve()).then(function(K){if(K||(K=J),K instanceof Array)return new Promise(function(W){return W(I.apply(void 0,_toConsumableArray(K)))});var _K=K,L=_K.tag,M=_K.id,N=_K.className,O=_K.attrs,P=_K.children,Q=_K.instance,R=M||O&&O.id?' id="'+(M||O&&O.id||'')+'"':'',S=N||O&&O.className?' class="'+((N||'')+' '+(O.className||'')).trim()+'"':'';l(K);var T='',U='';for(var V in O||Object.create(null))'style'==V?T+=' style="'+y(O[V])+'"':'innerHTML'==V?U=O[V]:-1===G.indexOf(V)&&(T+=' '+V+'="'+O[V]+'"');return!U&&P?I.apply(void 0,_toConsumableArray(P)).then(function(W){return'<'+L+R+S+T+'>'+W+''}):0==='br,input,img'.split(',').filter(function(W){return W===L}).length?new Promise(function(W){return W('<'+L+R+S+T+'>'+U+'')}):new Promise(function(W){return W('<'+L+R+S+T+' />')})}):new Promise(function(K){return K(J)}):new Promise(function(K){return K('')})},I=function I(){for(var _len3=arguments.length,J=Array(_len3),_key3=0;_key3<_len3;_key3++)J[_key3]=arguments[_key3];return Promise.all(J.map(H)).then(function(K){return K.filter(function(L){return!!L}).join('')})};// creatign html, strip events from DOM element... for now just deleting // recycle or create a new el // find parent element, and remove the input element return{container:function container(J){var K=1=g&&(j=+new Date,h(k))}),h},c};obs.from=function(a){var b=obs();return a(function(c){return b(c)}),b},obs.union=function(){for(var _len=arguments.length,a=Array(_len),_key=0;_key<_len;_key++)a[_key]=arguments[_key];var b=obs();return a.map(function(c){return c.then(b)}),b};exports.default=obs; }); +___scope___.file("hamt.js", function(exports, require, module, __filename, __dirname){ + +'use strict';Object.defineProperty(exports,'__esModule',{value:!0});// compute the hamming weight +var hamming=exports.hamming=function hamming(e){return e-=1431655765&e>>1,e=(858993459&e)+(858993459&e>>2),e=252645135&e+(e>>4),e>>=8,e>>=16,127&e};var popcount=exports.popcount=function popcount(e){if(e.key)return 1;var f=e.children;if(f){var g=0;for(var l in f)g+=popcount(f[l]);return g}};// hash fn +var hash=exports.hash=function hash(){var e=0>>g*f&(1< points to other nodes (List children) + */return void 0!==e&&(l.key=e,l.hash=g,l.val=f),l};var map=exports.map=function map(e,f){if(e.key!==void 0)return node(e.key,f(e.val,e.key),e.hash);var g=cloneNode(e),l=g.children;if(l)for(var m in l)l[m]=map(l[m],f);return g};var filter=exports.filter=function filter(e,f){if(e.key!==void 0)return f(e.val,e.key)?e:void 0;var g=cloneNode(e),l=g.children;if(l)for(var m in l)filter(l[m],f)||delete l[m];return g};var reduce=exports.reduce=function reduce(e,f,g){if(e.key!==void 0)return f(g,e.val,e.key);var l=e.children;if(l){for(var m in l)g=reduce(l[m],f,g);return g}};var toList=exports.toList=function toList(e){var f=1 console.log(...args) +// const j = (...a) => console.log(JSON.stringify(a)) +// let x = hamt() +// let s = 20 +// Array(s).fill(1).map((v,i) => { +// x = set(x, i, i) +// }) +// l(toList(x)) +// l(toJson(x)) +// x = map(x, x => log(x*x) || x*x) +// l(get(x, 19)) +// l(x) +// l(reduce(x, (acc, x) => acc+x, 0)) +// x = unset(x, 1) +// Array(s).fill(1).map((_,i) => { +// if(!get(x, i)) l(i) +// // l(get(x, i)) +// }) +}); ___scope___.file("worker.js", function(exports, require, module, __filename, __dirname){ 'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var supports=function supports(){for(var _len=arguments.length,a=Array(_len),_key=0;_key<_len;_key++)a[_key]=arguments[_key];return function(){return a.reduce(function(b,d){return b||window[d]!==void 0&&/[native code]/.test(window[d]+'')&&window[d]},!1)}},supportsWorkers=supports('Worker'),supportsBlobs=supports('Blob'),supportsURLs=supports('URL','webkitURL'),supportsBuilders=supports('BlobBuilder','WebKitBlobBuilder','MozBlobBuilder');/* worker:: [X] -> Worker where X : Function | String the last X provided in the arguments will be setup as the handler for self.onmessage() -*/var worker=exports.worker=function worker(){for(var _len2=arguments.length,a=Array(_len2),_key2=0;_key2<_len2;_key2++)a[_key2]=arguments[_key2];if(!supportsWorkers())throw'WebWorkers not supported';a[a.length-1]='self.onmessage='+a[a.length-1];var b=supportsBlobs(),d=supportsBuilders(),f=supportsURLs(),g;supportsBlobs()?g=new b(a.map(function(i){return i+''}),{type:'application/javascript'}):d?(g=new d,a.map(function(i){return g.append(i+'')}),g=g.getBlob()):g='data:application/javascript,'+(''+encodeURIComponent(a.reduce(function(i,j){return i+j},'')));var h=f.createObjectURL(g);return new Worker(h)};var farm=exports.farm=function farm(a){for(var _len3=arguments.length,b=Array(1<_len3?_len3-1:0),_key3=1;_key3<_len3;_key3++)b[_key3-1]=arguments[_key3];var d=Array(a).fill(1).map(function(){return worker.apply(void 0,b)}),f=0,g=function g(){return++f>=a&&(f=0),f},h,i;d.map(function(k){k.onmessage=function(l){return h instanceof Function&&h(l.data)},k.onerror=function(l){return i instanceof Function&&i(l)}});var j=function j(){for(var _len4=arguments.length,k=Array(_len4),_key4=0;_key4<_len4;_key4++)k[_key4]=arguments[_key4];var l=d[g()];l&&l.postMessage(k)};return j.pipe=function(k){return h=k,j},j.error=function(k){return i=k,j},j}; +*/var worker=exports.worker=function worker(){for(var _len2=arguments.length,a=Array(_len2),_key2=0;_key2<_len2;_key2++)a[_key2]=arguments[_key2];if(!supportsWorkers())throw'WebWorkers not supported';a[a.length-1]='self.onmessage='+a[a.length-1];var b=supportsBlobs(),d=supportsBuilders(),f=supportsURLs(),g=void 0;supportsBlobs()?g=new b(a.map(function(i){return i+''}),{type:'application/javascript'}):d?(g=new d,a.map(function(i){return g.append(i+'')}),g=g.getBlob()):g='data:application/javascript,'+(''+encodeURIComponent(a.reduce(function(i,j){return i+j},'')));var h=f.createObjectURL(g);return new Worker(h)};var farm=exports.farm=function farm(a){for(var _len3=arguments.length,b=Array(1<_len3?_len3-1:0),_key3=1;_key3<_len3;_key3++)b[_key3-1]=arguments[_key3];var d=Array(a).fill(1).map(function(){return worker.apply(void 0,b)}),f=0,g=function g(){return++f>=a&&(f=0),f},h=void 0,i=void 0;d.map(function(k){k.onmessage=function(l){return h instanceof Function&&h(l.data)},k.onerror=function(l){return i instanceof Function&&i(l)}});var j=function j(){for(var _len4=arguments.length,k=Array(_len4),_key4=0;_key4<_len4;_key4++)k[_key4]=arguments[_key4];var l=d[g()];l&&l.postMessage(k)};return j.pipe=function(k){return h=k,j},j.error=function(k){return i=k,j},j}; +}); +___scope___.file("fp.js", function(exports, require, module, __filename, __dirname){ +var process = require("process"); +'use strict';Object.defineProperty(exports,'__esModule',{value:!0});function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i U) -> (U -> V) -> (T -> V) +var c=exports.c=function c(b,d){return function(e){return b(d(e))}};// cof :: [(an -> bn)] -> a0 -> bn +// compose forward +var cof=exports.cof=function cof(){for(var _len=arguments.length,b=Array(_len),_key=0;_key<_len;_key++)b[_key]=arguments[_key];return b.reduce(function(d,e){return c(d,e)})};// cob :: [(an -> bn)] -> b0 -> an +// compose backwards +var cob=exports.cob=function cob(){for(var _len2=arguments.length,b=Array(_len2),_key2=0;_key2<_len2;_key2++)b[_key2]=arguments[_key2];return cof.apply(void 0,_toConsumableArray(b.reverse()))};// functional utilities +// pointfree +var pf=exports.pf=function pf(b){return function(){for(var _len3=arguments.length,d=Array(_len3),_key3=0;_key3<_len3;_key3++)d[_key3]=arguments[_key3];return function(e){return b.apply(e,d)}}};// curry +// curry :: (T -> U) -> [args] -> ( -> U) +var curry=exports.curry=function curry(b){for(var _len4=arguments.length,d=Array(1<_len4?_len4-1:0),_key4=1;_key4<_len4;_key4++)d[_key4-1]=arguments[_key4];return b.bind.apply(b,[void 0].concat(d))};// Transducers +var mapping=exports.mapping=function mapping(b){return(// mapper: x -> y +function(d){return(// reducer: (state, value) -> new state +function(e,h){return d(e,b(h))})})};var filtering=exports.filtering=function filtering(b){return(// predicate: x -> true/false +function(d){return(// reducer: (state, value) -> new state +function(e,h){return b(h)?d(e,h):e})})};var concatter=exports.concatter=function concatter(b,d){return b.concat([d])}; }); }); FuseBox.expose([{"alias":"clan-fp","pkg":"default"}]); diff --git a/build/index.js.map b/build/index.js.map index 709a265..af889ad 100644 --- a/build/index.js.map +++ b/build/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["batch.js","fp.js","hamt.js","index.js","vdom.js","mixin.js","model.js","observable.js","worker.js"],"names":["batch","inflight","url","options","method","key","JSON","stringify","toLowerCase","f","Object","assign","compress","Promise","res","rej","then","d","catch","e","data","console","error","log","rAF","document","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","process","nextTick","setTimeout","cb","c","g","x","cof","fns","reduce","acc","fn","cob","reverse","pf","args","apply","curry","bind","mapping","mapper","reducer","result","value","filtering","predicate","concatter","thing","concat","hamming","popcount","root","children","sum","i","hash","v","length","charCodeAt","comp","a","b","HMAP_SIZE","MAX_DEPTH","vec","h","range","shallowClone","y","create","cloneNode","node","val","numChildren","set","newroot","r","n","bits","cp","cn","rh","j","__r","__n","vecr","vecn","_r","get","first","unset","_n","item","map","filter","toList","push","toOrderedList","toJSON","toJson","pop","shift","k","unshift","hamt","worker","fp","_v","len","module","exports","vdom","mixin","model","obs","class_id_regex","tagName_regex","parseSelector","test","tagreg","exec","s","tag","slice","reg","substr","className","trim","id","debounce","func","wait","immediate","timeout","callNow","clearTimeout","m","selector","attrs","Array","Function","shouldUpdate","unload","config","__hash","stripEvents","name","applyEvents","events","el","strip_existing","removeEvents","flatten","arr","EVENTS","split","mnt","render","applyUpdates","stylify","style","setAttrs","attr","innerHTML","setAttribute","_id","_className","createTag","parent","parentElement","t","createTextNode","insertBefore","removeEl","appendChild","shouldExchange","tagName","_shouldUpdate","createElement","removeChild","insertAt","next_sib","resolve","_el","vdom_children","el_children","childNodes","resolver","states","promises","done","_await","_promises","finish","ms","total","all","props","keys","forEach","getState","isDone","gs","view","state","instance","reservedAttrs","toHTML","_vdom","html","_class","_attrs","inner","indexOf","str","join","container","queries","wrapper_view","qs","querySelector","update","mount","classes","_mixin","proto","prototype","p","getOwnPropertyNames","oldFn","call","arguments","is","type","isValid","String","Number","Boolean","check","types","required","_type","MODEL","init","logic","pipe","whenValid","ArrayOf","M","subscribers","o","take","values","delete","takeWhile","maybe","success","stop","ts","Date","now","from","union","fs","supports","q","window","supportsWorkers","supportsBlobs","supportsURLs","supportsBuilders","code","B","U","W","blob","append","getBlob","encodeURIComponent","createObjectURL","Worker","farm","workers","fill","current","iter","onerror","w","onmessage","postMessage"],"mappings":";;;;wOACA;AACA;AACA;AACA;AAEA;AACA,GAAMA,OAAQ,QAARA,MAAQ,GAAK,CACf,GAAIC,KAAJ,CAEA,MAAO,UAACC,CAAD,CAAqB,IAAfC,EAAe,8DACTA,CADS,CACnBC,CADmB,IACnBA,MADmB,CAEpBC,CAFoB,CAEXH,CAFW,KAEJI,KAAKC,SAAL,CAAeJ,CAAf,CAFI,OAIY,MAAjC,IAACC,GAAU,EAAX,EAAeI,WAAf,EAJqB,CAKbC,EAAEP,CAAF,CAAOQ,OAAOC,MAAP,IAAkBR,CAAlB,CAA2B,CAACS,WAAD,CAA3B,CAAP,CALa,CAOjBX,EAASI,CAAT,IACFJ,EAASI,CAAT,EACG,GAAIQ,QAAJ,CAAY,SAACC,CAAD,CAAKC,CAAL,CAAa,CACrBN,EAAEP,CAAF,CAAOQ,OAAOC,MAAP,IAAkBR,CAAlB,CAA2B,CAACS,WAAD,CAA3B,CAAP,EACCI,IADD,CACM,kBAAKF,GAAIG,CAAJ,CAAL,CADN,EAECC,KAFD,CAEO,kBAAKH,GAAII,CAAJ,CAAL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OA,CACV,CANL,CAOMvC,CAPN,CAQMyC,CARN,CAUAJ,EAAQ7L,GAAR,CAAY,WAAK,CACbkM,EAAEC,SAAF,CAAc,kBAAK3C,aAAgBzG,SAAhB,EAA4ByG,EAAK3O,EAAEC,IAAP,CAAjC,CADD,CAEboR,EAAED,OAAF,CAAY,kBAAKA,aAAmBlJ,SAAnB,EAA+BkJ,EAAQpR,CAAR,CAApC,CACf,CAHD,CAXgC,CAgBhC,GAAM8G,GAAO,QAAPA,EAAO,EAAa,gCAATrF,CAAS,0CAATA,CAAS,yBACtB,GAAI4P,GAAIL,EAAQG,GAAR,CAAR,CACAE,GAAKA,EAAEE,WAAF,CAAc9P,CAAd,CACR,CAHD,CAaA,MARAqF,GAAK6H,IAAL,CAAY,WAAM,CAEd,MADAA,GAAOtN,CACP,CAAOyF,CACV,CAKD,CAJAA,EAAK3G,KAAL,CAAa,WAAM,CAEf,MADAiR,GAAU/P,CACV,CAAOyF,CACV,CACD,CAAOA,CACV,CA9BM","file":"","sourcesContent":["\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n\t, fp\n}\n","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n"]} \ No newline at end of file +{"version":3,"sources":["index.js","batch.js","vdom.js","mixin.js","model.js","observable.js","hamt.js","worker.js","fp.js"],"names":["hamt","worker","fp","hash","v","_v","JSON","stringify","i","len","length","c","charCodeAt","module","exports","batch","vdom","mixin","model","obs","inflight","url","options","method","key","toLowerCase","f","Object","assign","compress","Promise","res","rej","then","d","catch","e","data","console","error","rAF","document","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","setTimeout","cb","class_id_regex","tagName_regex","parseSelector","test","tagreg","exec","s","tag","slice","reg","create","substr","className","trim","id","debounce","func","wait","immediate","timeout","args","callNow","clearTimeout","m","selector","children","attrs","Array","Function","unshift","shouldUpdate","unload","config","__hash","stripEvents","a","name","applyEvents","events","el","strip_existing","removeEvents","flatten","arr","push","EVENTS","split","map","x","mnt","render","fn","applyUpdates","stylify","style","setAttrs","attr","innerHTML","value","setAttribute","_id","_className","createTag","parent","parentElement","t","createTextNode","insertBefore","removeEl","appendChild","shouldExchange","tagName","_shouldUpdate","createElement","removeChild","insertAt","next_sib","resolve","_el","vdom_children","el_children","childNodes","resolver","states","promises","done","_await","_promises","finish","ms","total","all","props","keys","forEach","getState","isDone","gs","view","state","r","instance","reservedAttrs","toHTML","_vdom","html","_class","_attrs","inner","indexOf","str","filter","join","container","queries","wrapper_view","qs","querySelector","update","mount","classes","_mixin","proto","prototype","p","getOwnPropertyNames","oldFn","apply","call","arguments","is","type","isValid","String","Number","Boolean","check","types","required","reduce","_type","MODEL","init","logic","pipe","whenValid","ArrayOf","M","subscribers","val","o","take","n","values","delete","takeWhile","acc","maybe","success","stop","ts","Date","now","from","union","fs","hamming","popcount","root","sum","comp","b","HMAP_SIZE","MAX_DEPTH","vec","h","range","shallowClone","y","cloneNode","node","numChildren","set","newroot","bits","cp","cn","rh","j","__r","__n","vecr","vecn","_r","get","first","unset","_n","item","toList","toOrderedList","toJSON","toJson","pop","shift","k","supports","q","window","supportsWorkers","supportsBlobs","supportsURLs","supportsBuilders","code","B","U","W","blob","append","getBlob","encodeURIComponent","createObjectURL","Worker","farm","workers","fill","current","iter","onerror","w","onmessage","postMessage","log","process","nextTick","g","cof","fns","cob","reverse","pf","curry","bind","mapping","mapper","reducer","result","filtering","predicate","concatter","thing","concat"],"mappings":";;;;wFAAA,iXAKYA,IALZ,4DAMYC,MANZ,sDAOYC,EAPZ,6UASO,GAAMC,mBAAO,QAAPA,KAAO,CAACC,CA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lB","file":"","sourcesContent":["import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n\t, fp\n}\n","\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n"]} \ No newline at end of file diff --git a/fuse.js b/fuse.js index bdb464c..ef6f7e9 100644 --- a/fuse.js +++ b/fuse.js @@ -2,25 +2,24 @@ const f = require("fuse-box") , chokidar = require('chokidar') , dev = process.env.NODE_ENV !== 'production' -let rootConfig = { +let c = { homeDir: "src/" , cache: dev , package: 'clan-fp' , globals: { 'default': 'clan-fp' } + , sourceMap: { + bundleReference: "index.js.map" + , outFile: "./build/index.js.map" + } + , outFile: "./build/index.js" + , inFile: "[index.js]" , plugins: (browser) => [ f.BabelPlugin({ - // limit2project: false - // , test: /\.js$/ config: { sourceMaps: true - , presets: - (dev ? [] : ['babili']) - .concat([ - // 'react' - 'latest' - // , 'stage-0' - ]) + , presets: ['latest'] + , env: { production: {presets: ['babili'] }} , plugins: [ "fast-async" ] @@ -29,28 +28,16 @@ let rootConfig = { ] } -let configs = [ - { - sourceMap: { - bundleReference: "index.js.map" - , outFile: "./build/index.js.map" - } - , outFile: "./build/index.js" - , inFile: "[./**/*.js]" - } -] - -const processAll = $ => - configs.map(c => { - let d = Object.assign({}, rootConfig, c) - , inFile = d.inFile +const processAll = $ => { + let d = Object.assign({}, c) + , inFile = d.inFile - d.plugins = d.plugins(d.browser || false) - delete d.inFile - delete d.browser + d.plugins = d.plugins(d.browser || false) + delete d.inFile + delete d.browser - f.FuseBox.init(d).bundle(inFile) - }) + f.FuseBox.init(d).bundle(inFile) +} const debounce = (func, wait, immediate, timeout) => () => { diff --git a/package.json b/package.json index d9405be..db24bcd 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "start": "node fuse", "prebuild": "rimraf .fusebox build", "build": "cross-env NODE_ENV=production node fuse", - "deploy": "npm run build; git add .; git commit -am \"comitting and pushing new patch version\"; npm version patch; git push origin --all; npm publish;" + "deploy": "npm run build && git add . && git commit -am \"comitting and pushing new patch version\" && npm version patch && git push origin --all && npm publish;" }, "main": "build/index.js", "module": "src/index.js", From 1142aacb305e2d632d754dc5a574268256d7d10e Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 16:48:34 -0600 Subject: [PATCH 04/19] 0.0.28 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db24bcd..9c521e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clan-fp", - "version": "0.0.27", + "version": "0.0.28", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", From 16f8354afddf81263bb4cd3c6be217a3f6a14796 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 16:51:51 -0600 Subject: [PATCH 05/19] comitting and pushing new patch version --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9c521e3..3f918c2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "start": "node fuse", "prebuild": "rimraf .fusebox build", "build": "cross-env NODE_ENV=production node fuse", - "deploy": "npm run build && git add . && git commit -am \"comitting and pushing new patch version\" && npm version patch && git push origin --all && npm publish;" + "push": "git add . && git commit -am \"comitting and pushing new patch version\" && git push origin --all", + "deploy": "npm run build && npm run push && npm version patch && npm publish" }, "main": "build/index.js", "module": "src/index.js", @@ -27,9 +28,7 @@ "now": "^0.37.1", "npm-run-all": "^3.1.1", "rimraf": "^2.5.4", + "uglify-js": "^2.7.5", "yarn": "^0.18.1" - }, - "dependencies": { - "uglify-js": "^2.7.5" } } From bfe5dfcc8a0805ae02ed4b19b54d25e25909e3b8 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 16:54:40 -0600 Subject: [PATCH 06/19] comitting and pushing new patch version --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3f918c2..750d2f0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "prebuild": "rimraf .fusebox build", "build": "cross-env NODE_ENV=production node fuse", "push": "git add . && git commit -am \"comitting and pushing new patch version\" && git push origin --all", - "deploy": "npm run build && npm run push && npm version patch && npm publish" + "deploy": "npm-run-all build push n", + "n": "npm version patch && npm publish" }, "main": "build/index.js", "module": "src/index.js", From 196d4bedd1eb2724143b62f39a065a40dbb097b6 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 16:54:43 -0600 Subject: [PATCH 07/19] 0.0.29 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 750d2f0..bbc970c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clan-fp", - "version": "0.0.28", + "version": "0.0.29", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", From 7f64e69246af3cb750051206afe86eba350389ff Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 20:31:08 -0600 Subject: [PATCH 08/19] comitting and pushing new patch version --- build/index.js | 2 +- fuse.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/index.js b/build/index.js index ce9ee12..bbed1ab 100644 --- a/build/index.js +++ b/build/index.js @@ -178,7 +178,7 @@ function(d){return(// reducer: (state, value) -> new state function(e,h){return b(h)?d(e,h):e})})};var concatter=exports.concatter=function concatter(b,d){return b.concat([d])}; }); }); -FuseBox.expose([{"alias":"clan-fp","pkg":"default"}]); +FuseBox.expose([{"alias":"clan-fp","pkg":"clan-fp"}]); }) (function(e){var r="undefined"!=typeof window&&window.navigator;r&&(window.global=window),e=r&&"undefined"==typeof __fbx__dnm__?e:module.exports;var t=r?window.__fsbx__=window.__fsbx__||{}:global.$fsbx=global.$fsbx||{};r||(global.require=require);var n=t.p=t.p||{},i=t.e=t.e||{},o=function(e){if(/^([@a-z].*)$/.test(e)){if("@"===e[0]){var r=e.split("/"),t=r.splice(2,r.length).join("/");return[r[0]+"/"+r[1],t||void 0]}return e.split(/\/(.+)?/)}},a=function(e){return e.substring(0,e.lastIndexOf("/"))||"./"},f=function(){for(var e=[],r=0;r Date: Sun, 1 Jan 2017 20:31:12 -0600 Subject: [PATCH 09/19] 0.0.30 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bbc970c..7c660c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clan-fp", - "version": "0.0.29", + "version": "0.0.30", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", From fe219048ab39a71a5baf1c7198b07b31dac5a496 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 22:07:00 -0600 Subject: [PATCH 10/19] comitting and pushing new patch version --- build/index.js | 1556 ++++++++++++++++++++++++++++++++++++++++++-- build/index.js.map | 2 +- fuse.js | 10 +- 3 files changed, 1491 insertions(+), 77 deletions(-) diff --git a/build/index.js b/build/index.js index bbed1ab..3c53ede 100644 --- a/build/index.js +++ b/build/index.js @@ -2,38 +2,809 @@ FuseBox.pkg("clan-fp", {}, function(___scope___){ ___scope___.file("index.js", function(exports, require, module, __filename, __dirname){ -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.hash=void 0;var _batch=require('./batch'),_batch2=_interopRequireDefault(_batch),_vdom=require('./vdom'),_vdom2=_interopRequireDefault(_vdom),_mixin=require('./mixin'),_mixin2=_interopRequireDefault(_mixin),_model=require('./model'),_model2=_interopRequireDefault(_model),_observable=require('./observable'),_observable2=_interopRequireDefault(_observable),_hamt=require('./hamt'),hamt=_interopRequireWildcard(_hamt),_worker=require('./worker'),worker=_interopRequireWildcard(_worker),_fp=require('./fp'),fp=_interopRequireWildcard(_fp);function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var hash=exports.hash=function hash(a){var b=1 1 && arguments[1] !== undefined ? arguments[1] : JSON.stringify(v); + + var hash = 0; + for (var i = 0, len = _v.length; i < len; ++i) { + var c = _v.charCodeAt(i); + hash = (hash << 5) - hash + c | 0; + } + return hash; +}; + +module.exports = { + batch: _batch2.default, + vdom: _vdom2.default, + mixin: _mixin2.default, + model: _model2.default, + obs: _observable2.default, + hamt: hamt, + worker: worker, + fp: fp +}; }); ___scope___.file("batch.js", function(exports, require, module, __filename, __dirname){ -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}// batched requests +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +// batched requests // The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or // back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another // to that URL is "in-flight", the Promise returned by both of those calls will be resolved by a single network request. + // f :: (url -> options) -> Promise -var batch=function batch(a){var b={};return function(c){var g=1 1 && arguments[1] !== undefined ? arguments[1] : {}; + var method = options.method, + key = url + ':' + JSON.stringify(options); + + + if ((method || '').toLowerCase() === 'post') return f(url, Object.assign({}, options, { compress: false })); + + return inflight[key] || (inflight[key] = new Promise(function (res, rej) { + f(url, Object.assign({}, options, { compress: false })).then(function (d) { + return res(d); + }).catch(function (e) { + return rej(e); + }); + }).then(function (data) { + inflight = Object.assign({}, inflight, _defineProperty({}, key, undefined)); + return data; + }).catch(function (e) { + return console.error(e, url); + })); + }; +}; + +exports.default = batch; }); ___scope___.file("vdom.js", function(exports, require, module, __filename, __dirname){ -'use strict';var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i['return']&&_i['return']()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError('Invalid attempt to destructure non-iterable instance')}}();var _typeof='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&'function'==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj},rAF='undefined'!=typeof document&&(requestAnimationFrame||webkitRequestAnimationFrame||mozRequestAnimationFrame)||function(b){return setTimeout(b,16.6)},vdom=function vdom(){var b=function b(){return /[#\.][^#\.]+/ig},e=function e(){return /^([^\.#]+)\b/i},g=function g(J){var K=null,L=e().exec(J),M=L&&L.slice(1)[0],N=b(),O=Object.create(null);for(M&&(J=J.substr(M.length)),O.className='',O.tag=M||'div';null!==(K=N.exec(J));)K=K[0],'.'===K[0]?O.className=(O.className+' '+K.substr(1)).trim():'#'===K[0]&&(O.id=K.substr(1));return O},h=function h(J,K,L,M){return function(){for(var _len=arguments.length,N=Array(_len),_key=0;_key<_len;_key++)N[_key]=arguments[_key];var O=L&&!M;clearTimeout(M),M=setTimeout(function(){M=null,L||J.apply(void 0,N)},K||0),O&&J.apply(void 0,N)}},j=function j(J){var K=1L){var M=K.children[L];K.insertBefore(J,M)}else K.appendChild(J)},D=function D(J,K){// if vdom is a function, execute it until it isn't -for(var L=2_N2.length;)B(_O2[_O2.length-1]);for(var _P2=0;_P2P?O():(L=!0,J)})};return{finish:O,resolve:function resolve(P){var Q=Object.keys(P);if(!Q.length)return Promise.resolve(!0);var R=[];return Q.forEach(function(S){for(var T=P[S];T instanceof Function;)T=T();T&&T.then instanceof Function&&R.push(T.then(function(U){return J[S]=U}))}),M(R)},getState:function getState(){return J},promises:K,isDone:function isDone(){return L}}},F=function F(J,K){for(var L=J(K);L instanceof Function;)L=J(instance.getState());return L},G=['className','id'],H=function H(J){for(;J instanceof Function;)J=J();return J instanceof Array?new Promise(function(K){return K(I.apply(void 0,_toConsumableArray(J)))}):J?'object'==('undefined'==typeof J?'undefined':_typeof(J))?(J.resolve?J.resolve():Promise.resolve()).then(function(K){if(K||(K=J),K instanceof Array)return new Promise(function(W){return W(I.apply(void 0,_toConsumableArray(K)))});var _K=K,L=_K.tag,M=_K.id,N=_K.className,O=_K.attrs,P=_K.children,Q=_K.instance,R=M||O&&O.id?' id="'+(M||O&&O.id||'')+'"':'',S=N||O&&O.className?' class="'+((N||'')+' '+(O.className||'')).trim()+'"':'';l(K);var T='',U='';for(var V in O||Object.create(null))'style'==V?T+=' style="'+y(O[V])+'"':'innerHTML'==V?U=O[V]:-1===G.indexOf(V)&&(T+=' '+V+'="'+O[V]+'"');return!U&&P?I.apply(void 0,_toConsumableArray(P)).then(function(W){return'<'+L+R+S+T+'>'+W+''}):0==='br,input,img'.split(',').filter(function(W){return W===L}).length?new Promise(function(W){return W('<'+L+R+S+T+'>'+U+'')}):new Promise(function(W){return W('<'+L+R+S+T+' />')})}):new Promise(function(K){return K(J)}):new Promise(function(K){return K('')})},I=function I(){for(var _len3=arguments.length,J=Array(_len3),_key3=0;_key3<_len3;_key3++)J[_key3]=arguments[_key3];return Promise.all(J.map(H)).then(function(K){return K.filter(function(L){return!!L}).join('')})};// creatign html, strip events from DOM element... for now just deleting -// recycle or create a new el -// find parent element, and remove the input element -return{container:function container(J){var K=1 1 && arguments[1] !== undefined ? arguments[1] : JSON.stringify(v); + + var hash = 0; + for (var i = 0, len = _v.length; i < len; ++i) { + var c = _v.charCodeAt(i); + hash = (hash << 5) - hash + c | 0; + } + return hash; + }; + + var m = function m(selector) { + for (var _len2 = arguments.length, children = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + children[_key2 - 2] = arguments[_key2]; + } + + var attrs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Object.create(null); + + if (attrs.tag || !((typeof attrs === 'undefined' ? 'undefined' : _typeof(attrs)) === 'object') || attrs instanceof Array || attrs instanceof Function) { + if (attrs instanceof Array) children.unshift.apply(children, _toConsumableArray(attrs));else children.unshift(attrs); + attrs = Object.create(null); + } + var vdom = parseSelector(selector); + if (children.length) vdom.children = children; + vdom.attrs = attrs; + vdom.shouldUpdate = attrs.shouldUpdate; + vdom.unload = attrs.unload; + vdom.config = attrs.config; + vdom.__hash = hash(vdom); + delete attrs.unload; + delete attrs.shouldUpdate; + delete attrs.config; + return vdom; + }; + + // creatign html, strip events from DOM element... for now just deleting + var stripEvents = function stripEvents(_ref) { + var attrs = _ref.attrs; + + var a = Object.create(null); + + if (attrs) { + for (var name in attrs) { + if (name[0] === 'o' && name[1] === 'n') { + a[name] = attrs[name]; + delete attrs[name]; + } + } + } + + return a; + }; + + var applyEvents = function applyEvents(events, el) { + var strip_existing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + + strip_existing && removeEvents(el); + for (var name in events) { + el[name] = events[name]; + } + }; + + var flatten = function flatten(arr) { + var a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + for (var i = 0, len = arr.length; i < len; i++) { + var v = arr[i]; + if (!(v instanceof Array)) { + a.push(v); + } else { + flatten(v, a); + } + } + return a; + }; + + var EVENTS = 'mouseover,mouseout,wheel,mousemove,blur,focus,click,abort,afterprint,animationend,animationiteration,animationstart,beforeprint,canplay,canplaythrough,change,contextmenu,dblclick,drag,dragend,dragenter,dragleave,dragover,dragstart,drop,durationchange,emptied,ended,error,load,input,invalid,keydown,keypress,keyup,loadeddata,loadedmetadata,mousedown,mouseenter,mouseleave,mouseup,pause,pointercancel,pointerdown,pointerenter,pointerleave,pointermove,pointerout,pointerover,pointerup,play,playing,ratechange,reset,resize,scroll,seeked,seeking,select,selectstart,selectionchange,show,submit,timeupdate,touchstart,touchend,touchcancel,touchmove,touchenter,touchleave,transitionend,volumechange,waiting'.split(',').map(function (x) { + return 'on' + x; + }); + + var removeEvents = function removeEvents(el) { + // strip away event handlers on el, if it exists + if (!el) return; + for (var i in EVENTS) { + el[i] = null; + } + }; + + var mnt = void 0; + + var mount = function mount(fn, el) { + mnt = [el, fn]; + render(fn, el); + }; + + var render = debounce(function (fn, el) { + return rAF(function (_) { + applyUpdates(fn, el.children[0], el); + }); + }); + + var update = function update() { + if (!mnt) return; + + var _mnt = mnt, + _mnt2 = _slicedToArray(_mnt, 2), + el = _mnt2[0], + fn = _mnt2[1]; + + render(fn, el); + }; + + var stylify = function stylify(style) { + var s = ''; + for (var i in style) { + s += i + ':' + style[i] + ';'; + } + return s; + }; + + var setAttrs = function setAttrs(_ref2, el) { + var attrs = _ref2.attrs, + id = _ref2.id, + className = _ref2.className, + __hash = _ref2.__hash; + + el.className = ''; + el.style = ''; + + if (attrs) { + for (var attr in attrs) { + if (attr === 'style') { + el.style = stylify(attrs[attr]); + } else if (attr === 'innerHTML') { + rAF(function () { + return el.innerHTML = attrs[attr]; + }); + } else if (attr === 'value') { + rAF(function () { + return el.value = attrs[attr]; + }); + } else { + el.setAttribute(attr, attrs[attr]); + } + } + } + var _id = attrs.id || id; + if (_id) el.id = _id; + var _className = ((attrs.className || '') + ' ' + (className || '')).trim(); + if (_className) el.className = _className; + el.__hash = __hash; + }; + + // recycle or create a new el + var createTag = function createTag() { + var vdom = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Object.create(null); + var el = arguments[1]; + var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : el && el.parentElement; + + var __vdom = vdom; + // make text nodes from primitive types + if ((typeof vdom === 'undefined' ? 'undefined' : _typeof(vdom)) !== 'object') { + var t = document.createTextNode(vdom); + if (el) { + parent.insertBefore(t, el); + removeEl(el); + } else { + parent.appendChild(t); + } + return t; + } + + // else make an HTMLElement from "tag" types + + var tag = vdom.tag, + attrs = vdom.attrs, + id = vdom.id, + className = vdom.className, + unload = vdom.unload, + shouldUpdate = vdom.shouldUpdate, + config = vdom.config, + __hash = vdom.__hash, + shouldExchange = !el || !el.tagName || tag && el.tagName.toLowerCase() !== tag.toLowerCase(), + _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el); + + if (!attrs) return; + if (el && (!_shouldUpdate || !vdom instanceof Function && el.__hash === __hash)) { + return; + } + + if (shouldExchange) { + var _t = document.createElement(tag); + el ? (parent.insertBefore(_t, el), removeEl(el)) : parent.appendChild(_t); + el = _t; + } + + setAttrs(vdom, el); + if (el.unload instanceof Function) { + rAF(el.unload); + } + if (unload instanceof Function) { + el.unload = unload; + } + applyEvents(stripEvents(vdom), el); + config && rAF(function (_) { + return config(el); + }); + return el; + }; + + // find parent element, and remove the input element + var removeEl = function removeEl(el) { + if (!el) return; + el.parentElement.removeChild(el); + removeEvents(el); + // removed for now, added unload logic to the immediate draw()s + if (el.unload instanceof Function) el.unload(); + }; + + var insertAt = function insertAt(el, parent, i) { + if (parent.children.length > i) { + var next_sib = parent.children[i]; + parent.insertBefore(el, next_sib); + } else { + parent.appendChild(el); + } + }; + + var applyUpdates = function applyUpdates(vdom, el) { + var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : el && el.parentElement; + + var v = vdom; + // if vdom is a function, execute it until it isn't + while (vdom instanceof Function) { + vdom = vdom(); + }if (!vdom) return; + + if (vdom.resolve instanceof Function) { + var _ret = function () { + var i = parent.children.length; + return { + v: vdom.resolve().then(function (v) { + if (!el) { + var x = createTag(v, null, parent); + insertAt(x, parent, i); + applyUpdates(v, x, parent); + } else { + applyUpdates(v, el, parent); + } + }) + }; + }(); + + if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; + } + + // create/edit el under parent + var _el = vdom instanceof Array ? parent : createTag(vdom, el, parent); + + if (!_el) return; + + if (vdom instanceof Array || vdom.children) { + var vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children), + el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes; + + while (el_children.length > vdom_children.length) { + removeEl(el_children[el_children.length - 1]); + } + + for (var i = 0; i < vdom_children.length; i++) { + applyUpdates(vdom_children[i], el_children[i], _el); + } + } else { + while (_el.childNodes.length > 0) { + removeEl(_el.childNodes[_el.childNodes.length - 1]); + } + } + }; + + var qs = function qs() { + var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'body'; + var el = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; + return el.querySelector(s); + }; + + var resolver = function resolver() { + var states = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var promises = [], + done = false; + + var _await = function _await() { + var _promises = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + promises = [].concat(_toConsumableArray(promises), _toConsumableArray(_promises)); + return finish(); + }; + + var wait = function wait() { + var ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + return new Promise(function (res) { + return setTimeout(res, ms); + }); + }; + + var isDone = function isDone() { + return done; + }; + + var finish = function finish() { + var total = promises.length; + return wait().then(function (_) { + return Promise.all(promises); + }).then(function (values) { + if (promises.length > total) { + return finish(); + } + done = true; + return states; + }); + }; + + var resolve = function resolve(props) { + var keys = Object.keys(props); + if (!keys.length) return Promise.resolve(true); + + var f = []; + keys.forEach(function (name) { + var x = props[name]; + + while (x instanceof Function) { + x = x(); + }if (x && x.then instanceof Function) f.push(x.then(function (d) { + return states[name] = d; + })); + }); + + return _await(f); + }; + + var getState = function getState() { + return states; + }; + + return { finish: finish, resolve: resolve, getState: getState, promises: promises, isDone: isDone }; + }; + + var gs = function gs(view, state) { + var r = view(state); + while (r instanceof Function) { + r = view(instance.getState()); + }return r; + }; + + var container = function container(view) { + var queries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var instance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : resolver(); + + var wrapper_view = function wrapper_view(state) { + return instance.isDone() ? view(state) : m('span'); + }; + + return function () { + var r = gs(wrapper_view, instance.getState()); + instance.resolve(queries); + + if (r instanceof Array) { + var _ret2 = function () { + var d = instance.finish().then(function (_) { + return gs(wrapper_view, instance.getState()); + }); + + return { + v: r.map(function (x, i) { + x.resolve = function (_) { + return d.then(function (vdom) { + return vdom[i]; + }); + }; + return x; + }) + }; + }(); + + if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; + } + + r.resolve = function (_) { + return instance.finish().then(function (_) { + return gs(wrapper_view, instance.getState()); + }); + }; + + return r; + }; + }; + + var reservedAttrs = ['className', 'id']; + + var toHTML = function toHTML(_vdom) { + while (_vdom instanceof Function) { + _vdom = _vdom(); + }if (_vdom instanceof Array) return new Promise(function (r) { + return r(html.apply(undefined, _toConsumableArray(_vdom))); + }); + if (!_vdom) return new Promise(function (r) { + return r(''); + }); + if ((typeof _vdom === 'undefined' ? 'undefined' : _typeof(_vdom)) !== 'object') return new Promise(function (r) { + return r(_vdom); + }); + return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(function (vdom) { + if (!vdom) vdom = _vdom; + + if (vdom instanceof Array) return new Promise(function (r) { + return r(html.apply(undefined, _toConsumableArray(vdom))); + }); + + var _vdom2 = vdom, + tag = _vdom2.tag, + id = _vdom2.id, + className = _vdom2.className, + attrs = _vdom2.attrs, + children = _vdom2.children, + instance = _vdom2.instance, + _id = id || attrs && attrs.id ? ' id="' + (id || attrs && attrs.id || '') + '"' : '', + _class = className || attrs && attrs.className ? ' class="' + ((className || '') + ' ' + (attrs.className || '')).trim() + '"' : ''; + + var events = stripEvents(vdom); + var _attrs = '', + inner = ''; + for (var i in attrs || Object.create(null)) { + if (i === 'style') { + _attrs += ' style="' + stylify(attrs[i]) + '"'; + } else if (i === 'innerHTML') { + inner = attrs[i]; + } else if (reservedAttrs.indexOf(i) === -1) { + _attrs += ' ' + i + '="' + attrs[i] + '"'; + } + } + + if (!inner && children) return html.apply(undefined, _toConsumableArray(children)).then(function (str) { + return '<' + tag + _id + _class + _attrs + '>' + str + ''; + }); + + if ('br,input,img'.split(',').filter(function (x) { + return x === tag; + }).length === 0) return new Promise(function (r) { + return r('<' + tag + _id + _class + _attrs + '>' + inner + ''); + }); + + return new Promise(function (r) { + return r('<' + tag + _id + _class + _attrs + ' />'); + }); + }); + }; + + var html = function html() { + for (var _len3 = arguments.length, v = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + v[_key3] = arguments[_key3]; + } + + return Promise.all(v.map(toHTML)).then(function (x) { + return x.filter(function (x) { + return !!x; + }).join(''); + }); + }; + + return { container: container, html: html, qs: qs, update: update, mount: mount, m: m, debounce: debounce }; +}; + +module.exports = vdom(); + +/* +usage: + +let component = () => + new Array(20).fill(true).map(x => + m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100))) + +client-side +----- +mount(component, qs()) + +client-side constant re-rendering +----- +const run = () => { + setTimeout(run, 20) + update() +} +run() +*/ + +/* CONTAINER / HTML USAGE (Server-side rendering) + +const name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500)) + +let x = container(data => [ + m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}), + m('div', data.name), + ], + {name} +) + +html(x).then(x => log(x)).catch(e => log(e+'')) +*/ }); ___scope___.file("mixin.js", function(exports, require, module, __filename, __dirname){ -"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var mixin=function mixin(){for(var _len=arguments.length,a=Array(_len),_key=0;_key<_len;_key++)a[_key]=arguments[_key];var b=function b(){_classCallCheck(this,b)},c=b.prototype;return a.map(function(_ref){var d=_ref.prototype;Object.getOwnPropertyNames(d).map(function(e){var f=c[e]||function(){};c[e]=function(){return f.apply(null,[].slice.call(arguments)),d[e].apply(null,[].slice.call(arguments))}})}),b};module.exports=mixin; +"use strict"; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var mixin = function mixin() { + for (var _len = arguments.length, classes = Array(_len), _key = 0; _key < _len; _key++) { + classes[_key] = arguments[_key]; + } + + var _mixin = function _mixin() { + _classCallCheck(this, _mixin); + }; + + var proto = _mixin.prototype; + + classes.map(function (_ref) { + var p = _ref.prototype; + + Object.getOwnPropertyNames(p).map(function (key) { + var oldFn = proto[key] || function ($) {}; + proto[key] = function () { + oldFn.apply(null, [].slice.call(arguments)); + return p[key].apply(null, [].slice.call(arguments)); + }; + }); + }); + + return _mixin; +}; + +module.exports = mixin; }); ___scope___.file("model.js", function(exports, require, module, __filename, __dirname){ -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _typeof='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&'function'==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj},model={is:function is(b,c){return b&&b.isValid instanceof Function?b.isValid(c):b===String&&(c instanceof String||'string'==typeof c)||b===Number&&(c instanceof Number||'number'==typeof c)||b===Boolean&&(c instanceof Boolean||'boolean'==typeof c)||b===Function&&(c instanceof Function||'function'==typeof c)||b===Object&&(c instanceof Object||'object'==('undefined'==typeof c?'undefined':_typeof(c)))||void 0===b},check:function check(b,c,d){return Object.keys(b).forEach(function(e){var f=b[e],g=d[e];if(c[e]||void 0!==g){f instanceof Array||(f=[f]);var h=f.reduce(function(j,k){return j||MODEL.is(k,g)},!1);if(!h)throw'{'+e+': '+JSON.stringify(g)+'} is not one of '+f.map(function(j){return'\n - '+j})}}),!0},init:function init(){var c=void 0,d=void 0,e=void 0;for(var _len=arguments.length,b=Array(_len),_key=0;_key<_len;_key++)b[_key]=arguments[_key];b.map(function(g){g instanceof Function&&!e?e=g:'object'==('undefined'==typeof g?'undefined':_typeof(g))&&(c?!d&&(d=g):c=g)});var f=function f(g){var h=e?[check,e]:[check];return h.reduce(function(j,k){return j&&k(c||{},d||{},g)},!0)};return{isValid:f,whenValid:function whenValid(g){return new Promise(function(h){return f(g)&&h(g)})}}},ArrayOf:function ArrayOf(b){return MODEL.init(function(c,d,e){if(!(e instanceof Array))throw e+' not an Array';return e.map(function(f){if(!MODEL.is(b,f))throw f+' is not a model instance'}),!0})}};// Validate JS objects for their "shape" -exports.default=model;/** +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +// Validate JS objects for their "shape" +var model = { + is: function is(type, value) { + if (type && type.isValid instanceof Function) { + return type.isValid(value); + } else if (type === String && (value instanceof String || typeof value === 'string') || type === Number && (value instanceof Number || typeof value === 'number') || type === Boolean && (value instanceof Boolean || typeof value === 'boolean') || type === Function && (value instanceof Function || typeof value === 'function') || type === Object && (value instanceof Object || (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') || type === undefined) { + return true; + } + + return false; + }, + check: function check(types, required, data) { + Object.keys(types).forEach(function (key) { + var t = types[key], + value = data[key]; + + if (required[key] || value !== undefined) { + if (!(t instanceof Array)) t = [t]; + + var i = t.reduce(function (a, _type) { + return a || MODEL.is(_type, value); + }, false); + if (!i) { + throw '{' + key + ': ' + JSON.stringify(value) + '} is not one of ' + t.map(function (x) { + return '\n - ' + x; + }); + } + } + }); + + return true; + }, + init: function init() { + var types = void 0, + required = void 0, + logic = void 0; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + args.map(function (x) { + if (x instanceof Function && !logic) { + logic = x; + } else if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object') { + if (!types) { + types = x; + } else if (!required) { + required = x; + } + } + }); + + var isValid = function isValid(data) { + var pipe = logic ? [check, logic] : [check]; + return pipe.reduce(function (a, v) { + return a && v(types || {}, required || {}, data); + }, true); + }; + + var whenValid = function whenValid(data) { + return new Promise(function (res, rej) { + return isValid(data) && res(data); + }); + }; + + return { isValid: isValid, whenValid: whenValid }; + }, + ArrayOf: function ArrayOf(M) { + return MODEL.init(function (t, r, data) { + if (!(data instanceof Array)) throw data + ' not an Array'; + data.map(function (x) { + if (!MODEL.is(M, x)) throw x + ' is not a model instance'; + }); + return true; + }); + } +}; + +exports.default = model; + +/** Use it // create a Name model with required first/last, @@ -84,65 +855,518 @@ Activity.whenValid(a).then(log).catch(e => log(e+'')) }); ___scope___.file("observable.js", function(exports, require, module, __filename, __dirname){ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});// async-supporting-observables -var obs=function obs(a){var b=[],c=function c(g){if(void 0!==g){a=g;for(var h=0,j=b.length;h=g&&(j=+new Date,h(k))}),h},c};obs.from=function(a){var b=obs();return a(function(c){return b(c)}),b},obs.union=function(){for(var _len=arguments.length,a=Array(_len),_key=0;_key<_len;_key++)a[_key]=arguments[_key];var b=obs();return a.map(function(c){return c.then(b)}),b};exports.default=obs; +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// async-supporting-observables +var obs = function obs(state) { + var subscribers = []; + + var fn = function fn(val) { + if (val !== undefined) { + state = val; + for (var i = 0, len = subscribers.length; i < len; i++) { + subscribers[i](val); + } + } + return state; + }; + + fn.map = function (f) { + var o = obs(); + subscribers.push(function (val) { + return o(f(val)); + }); + return o; + }; + + fn.filter = function (f) { + var o = obs(); + subscribers.push(function (val) { + return f(val) && o(val); + }); + return o; + }; + + fn.then = function (f) { + subscribers.push(function (val) { + return f(val); + }); + return fn; + }; + + fn.take = function (n) { + var values = [], + o = obs(); + + var cb = function cb(val) { + if (values.length < n) values.push(val); + + if (values.length === n) { + subscribers.delete(cb); + return o(values); + } + }; + + subscribers.push(cb); + + return o; + }; + + fn.takeWhile = function (f) { + var values = [], + o = obs(); + + var cb = function cb(val) { + if (!f(val)) { + subscribers = subscribers.filter(function (x) { + return x !== cb; + }); + return o(values); + } + + values.push(val); + }; + + subscribers.push(cb); + + return o; + }; + + fn.reduce = function (f, acc) { + var o = obs(); + + subscribers.push(function (val) { + acc = f(acc, val); + o(acc); + }); + + return o; + }; + + fn.maybe = function (f) { + var success = obs(), + error = obs(), + cb = function cb(val) { + return f(val).then(function (d) { + return success(d); + }).catch(function (e) { + return error(e); + }); + }; + + subscribers.push(cb); + + return [success, error]; + }; + + fn.stop = function () { + return subscribers = []; + }; + + fn.debounce = function (ms) { + var o = obs(); + var ts = +new Date(); + subscribers.push(function (val) { + var now = +new Date(); + if (now - ts >= ms) { + ts = +new Date(); + o(val); + } + }); + return o; + }; + + return fn; +}; + +obs.from = function (f) { + var o = obs(); + f(function (x) { + return o(x); + }); + return o; +}; + +obs.union = function () { + for (var _len = arguments.length, fs = Array(_len), _key = 0; _key < _len; _key++) { + fs[_key] = arguments[_key]; + } + + var o = obs(); + fs.map(function (f) { + return f.then(o); + }); + return o; +}; + +exports.default = obs; }); ___scope___.file("hamt.js", function(exports, require, module, __filename, __dirname){ -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});// compute the hamming weight -var hamming=exports.hamming=function hamming(e){return e-=1431655765&e>>1,e=(858993459&e)+(858993459&e>>2),e=252645135&e+(e>>4),e>>=8,e>>=16,127&e};var popcount=exports.popcount=function popcount(e){if(e.key)return 1;var f=e.children;if(f){var g=0;for(var l in f)g+=popcount(f[l]);return g}};// hash fn -var hash=exports.hash=function hash(){var e=0>>g*f&(1<> 1 & 0x55555555; + x = (x & 0x33333333) + (x >> 2 & 0x33333333); + x = x + (x >> 4) & 0x0f0f0f0f; + x += x >> 8; + x += x >> 16; + return x & 0x7f; +}; + +var popcount = exports.popcount = function popcount(root) { + if (root.key) return 1; + + var c = root.children; + if (c) { + var sum = 0; + for (var i in c) { + sum += popcount(c[i]); + }return sum; + } +}; + +// hash fn +var hash = exports.hash = function hash() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + + v = JSON.stringify(v); + var hash = 5381; + for (var i = 0; i < v.length; i++) { + hash = (hash << 5) + hash + v.charCodeAt(i); + }return hash; +}; + +// compare two hashes +var comp = exports.comp = function comp(a, b) { + return hash(a) === hash(b); +}; + +// get a bit vector +var HMAP_SIZE = exports.HMAP_SIZE = 8; +var MAX_DEPTH = exports.MAX_DEPTH = 32 / HMAP_SIZE - 1; +var vec = exports.vec = function vec() { + var h = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var range = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : HMAP_SIZE; + return h >>> range * i & (1 << range) - 1; +}; + +var shallowClone = exports.shallowClone = function shallowClone(x) { + var y = Object.create(null); + for (var i in x) { + y[i] = x[i]; + }return y; +}; + +var cloneNode = exports.cloneNode = function cloneNode(x) { + var y = node(); + if (!x) return y; + + if (x.children) { + y.children = shallowClone(x.children); + } else if (x.key !== undefined) { + y.key = x.key; + y.val = x.val; + y.hash = x.hash; + } + + return y; +}; + +var numChildren = exports.numChildren = function numChildren(x) { + var c = 0; + for (var i in x) { + ++c; + }return c; +}; + +var set = exports.set = function set(root, key, val) { + if (root.key === undefined && !root.children) return node(key, val); + + var newroot = cloneNode(root), + h = hash(key); + + // walk the tree + for (var i = 3, r = root, n = newroot; i >= 0; --i) { + var bits = vec(h, i); + + if (r.key !== undefined) { + // if we have a collision + if (r.key === key || i === 0) { + // if keys match or is leaf, just overwrite n's val + n.val = val; + } else if (i !== 0) { + // else if r is not at max depth and keys don't match + // add levels to both trees, new tree must be able + // to access old data + + // 0. create makeshift value node for r + // and new value node for n + var cp = node(r.key, r.val, r.hash); + var cn = node(key, val, h); + var rh = r.hash; + + // 1. delete value props from nodes + delete r.key; + delete r.val; + delete r.hash; + delete n.key; + delete n.val; + delete n.hash; + + // 2. create layers until bit-vectors don't collide + for (var j = i, __r = r, __n = n; j >= 0; j--) { + var vecr = vec(rh, j), + vecn = vec(h, j); + + // create new layer for c and r + var c = __r.children = Object.create(null); + var d = __n.children = shallowClone(c); + + if (vecr !== vecn) { + c[vecr] = cp; + d[vecr] = cp; + d[vecn] = cn; + break; + } else { + __r = c[vecr] = node(); + __n = d[vecn] = cloneNode(__r); + } + } + } + break; + } else if (r.children) { + var _r = r.children[bits]; + if (!_r) { + n = n.children[bits] = node(key, val); + break; + } else { + r = _r; + n = n.children[bits] = cloneNode(r); + } + } + } + + return newroot; +}; + +var get = exports.get = function get(root, key) { + if (root.key === key) return root.val; + var h = hash(key); + for (var i = 3, r = root; i >= 0; --i) { + if (!r.children) return undefined; + r = r.children[vec(h, i)]; + if (!r) return undefined; + if (r.key !== undefined) return r.val; + } + + return undefined; +}; + +var first = exports.first = function first(root) { + var c = root.children; + for (var i in c) { + return c[i]; + } +}; + +var unset = exports.unset = function unset(root, key) { + var n = cloneNode(root), + h = hash(key); + + for (var i = 3, _n = n, p = n; i >= -1; --i) { + if (_n.key) { + delete _n.key; + delete _n.val; + delete _n.hash; + return n; + + // let c = numChildren(p) + + // if(c === 1) { + // // if only child, delete child and parent? + // delete p.children + // } else if(c===2){ + // // if 2 children, promote sibling as parent value nod + // delete p.children[bits] + // let sibling = first(p) + // delete p.children + // if(sibling.children){ + // p.children = sibling.children + // } else if(p.key) { + // p.val = sibling.val + // p.hash = sibling.hash + // p.key = sibling.key + // } + // } else { + // // if more than 2 children, just delete the one + // delete p.children[bits] + // } + // return n + } + + var bits = vec(h, i); + _n = _n && _n.children && _n.children[bits]; + if (!_n) return n; + p = _n; + } + return n; +}; + +var node = exports.node = function node(key, val) { + var h = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : key !== undefined && hash(key); + + /* potential props of a tree node - key - hashkey - val - value - children - { ... } -> points to other nodes (List children) - */return void 0!==e&&(l.key=e,l.hash=g,l.val=f),l};var map=exports.map=function map(e,f){if(e.key!==void 0)return node(e.key,f(e.val,e.key),e.hash);var g=cloneNode(e),l=g.children;if(l)for(var m in l)l[m]=map(l[m],f);return g};var filter=exports.filter=function filter(e,f){if(e.key!==void 0)return f(e.val,e.key)?e:void 0;var g=cloneNode(e),l=g.children;if(l)for(var m in l)filter(l[m],f)||delete l[m];return g};var reduce=exports.reduce=function reduce(e,f,g){if(e.key!==void 0)return f(g,e.val,e.key);var l=e.children;if(l){for(var m in l)g=reduce(l[m],f,g);return g}};var toList=exports.toList=function toList(e){var f=1 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (root.key !== undefined) r.push(root.val); + + var c = root.children; + if (c) { + for (var i in c) { + toList(c[i], r); + } + } + + return r; +}; + +var toOrderedList = exports.toOrderedList = function toOrderedList(root) { + var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + var i = 0, + n = void 0; + + do { + n = get(root, i++); + n !== undefined && r.push(n); + } while (n); + + return r; +}; + +var toJSON = exports.toJSON = function toJSON(root) { + var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (root.key !== undefined) r[root.key] = root.val; + + var c = root.children; + if (c) { + for (var i in c) { + toJson(c[i], r); + } + } + + return r; +}; + +var push = exports.push = function push(root, val) { + return set(root, popcount(root), val); +}; + +var pop = exports.pop = function pop(root) { + return unset(root, popcount(root) - 1); +}; + +var shift = exports.shift = function shift(root) { + return reduce(unset(root, 0), function (acc, v, k) { + return set(acc, k - 1, v); + }, node()); +}; + +var unshift = exports.unshift = function unshift(root, val) { + return set(reduce(root, function (acc, v, k) { + return set(acc, k + 1, v); + }, node()), 0, val); +}; + +var hamt = exports.hamt = node; + +// console.clear() // const l = (...args) => console.log(...args) // const j = (...a) => console.log(JSON.stringify(a)) + // let x = hamt() // let s = 20 + // Array(s).fill(1).map((v,i) => { // x = set(x, i, i) // }) + // l(toList(x)) // l(toJson(x)) + // x = map(x, x => log(x*x) || x*x) // l(get(x, 19)) + // l(x) // l(reduce(x, (acc, x) => acc+x, 0)) + // x = unset(x, 1) // Array(s).fill(1).map((_,i) => { // if(!get(x, i)) l(i) @@ -151,34 +1375,226 @@ var q=vec(l,m);if(o=o&&o.children&&o.children[q],!o)return g}return g};var node= }); ___scope___.file("worker.js", function(exports, require, module, __filename, __dirname){ -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var supports=function supports(){for(var _len=arguments.length,a=Array(_len),_key=0;_key<_len;_key++)a[_key]=arguments[_key];return function(){return a.reduce(function(b,d){return b||window[d]!==void 0&&/[native code]/.test(window[d]+'')&&window[d]},!1)}},supportsWorkers=supports('Worker'),supportsBlobs=supports('Blob'),supportsURLs=supports('URL','webkitURL'),supportsBuilders=supports('BlobBuilder','WebKitBlobBuilder','MozBlobBuilder');/* +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var supports = function supports() { + for (var _len = arguments.length, q = Array(_len), _key = 0; _key < _len; _key++) { + q[_key] = arguments[_key]; + } + + return function () { + return q.reduce(function (acc, s) { + return acc || window[s] !== undefined && /[native code]/.test(window[s] + '') && window[s]; + }, false); + }; +}; + +var supportsWorkers = supports('Worker'); + +var supportsBlobs = supports('Blob'); + +var supportsURLs = supports('URL', 'webkitURL'); + +var supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder'); + +/* worker:: [X] -> Worker where X : Function | String the last X provided in the arguments will be setup as the handler for self.onmessage() -*/var worker=exports.worker=function worker(){for(var _len2=arguments.length,a=Array(_len2),_key2=0;_key2<_len2;_key2++)a[_key2]=arguments[_key2];if(!supportsWorkers())throw'WebWorkers not supported';a[a.length-1]='self.onmessage='+a[a.length-1];var b=supportsBlobs(),d=supportsBuilders(),f=supportsURLs(),g=void 0;supportsBlobs()?g=new b(a.map(function(i){return i+''}),{type:'application/javascript'}):d?(g=new d,a.map(function(i){return g.append(i+'')}),g=g.getBlob()):g='data:application/javascript,'+(''+encodeURIComponent(a.reduce(function(i,j){return i+j},'')));var h=f.createObjectURL(g);return new Worker(h)};var farm=exports.farm=function farm(a){for(var _len3=arguments.length,b=Array(1<_len3?_len3-1:0),_key3=1;_key3<_len3;_key3++)b[_key3-1]=arguments[_key3];var d=Array(a).fill(1).map(function(){return worker.apply(void 0,b)}),f=0,g=function g(){return++f>=a&&(f=0),f},h=void 0,i=void 0;d.map(function(k){k.onmessage=function(l){return h instanceof Function&&h(l.data)},k.onerror=function(l){return i instanceof Function&&i(l)}});var j=function j(){for(var _len4=arguments.length,k=Array(_len4),_key4=0;_key4<_len4;_key4++)k[_key4]=arguments[_key4];var l=d[g()];l&&l.postMessage(k)};return j.pipe=function(k){return h=k,j},j.error=function(k){return i=k,j},j}; +*/ +var worker = exports.worker = function worker() { + for (var _len2 = arguments.length, code = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + code[_key2] = arguments[_key2]; + } + + if (!supportsWorkers()) throw 'WebWorkers not supported'; + + code[code.length - 1] = 'self.onmessage=' + code[code.length - 1]; + + var B = supportsBlobs(), + U = supportsBuilders(), + W = supportsURLs(); + + var blob = void 0; + + if (supportsBlobs()) { + blob = new B(code.map(function (c) { + return c + ''; + }), { type: 'application/javascript' }); + } else if (U) { + blob = new U(); + code.map(function (c) { + return blob.append(c + ''); + }); + blob = blob.getBlob(); + } else { + blob = 'data:application/javascript,' + ('' + encodeURIComponent(code.reduce(function (acc, c) { + return acc + c; + }, ''))); + } + + var url = W.createObjectURL(blob); + return new Worker(url); +}; + +var farm = exports.farm = function farm(n) { + for (var _len3 = arguments.length, code = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + code[_key3 - 1] = arguments[_key3]; + } + + var workers = Array(n).fill(1).map(function (x) { + return worker.apply(undefined, code); + }), + current = 0, + iter = function iter() { + var _n = current; + ++current >= n && (current = 0); + return current; + }, + pipe = void 0, + onerror = void 0; + + workers.map(function (w) { + w.onmessage = function (e) { + return pipe instanceof Function && pipe(e.data); + }; + w.onerror = function (e) { + return onerror instanceof Function && onerror(e); + }; + }); + + var exec = function exec() { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + var w = workers[iter()]; + w && w.postMessage(args); + }; + + exec.pipe = function (fn) { + pipe = fn; + return exec; + }; + exec.error = function (fn) { + onerror = fn; + return exec; + }; + return exec; +}; }); ___scope___.file("fp.js", function(exports, require, module, __filename, __dirname){ var process = require("process"); -'use strict';Object.defineProperty(exports,'__esModule',{value:!0});function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i U) -> (U -> V) -> (T -> V) -var c=exports.c=function c(b,d){return function(e){return b(d(e))}};// cof :: [(an -> bn)] -> a0 -> bn +var c = exports.c = function c(f, g) { + return function (x) { + return f(g(x)); + }; +}; + +// cof :: [(an -> bn)] -> a0 -> bn // compose forward -var cof=exports.cof=function cof(){for(var _len=arguments.length,b=Array(_len),_key=0;_key<_len;_key++)b[_key]=arguments[_key];return b.reduce(function(d,e){return c(d,e)})};// cob :: [(an -> bn)] -> b0 -> an +var cof = exports.cof = function cof() { + for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) { + fns[_key] = arguments[_key]; + } + + return fns.reduce(function (acc, fn) { + return c(acc, fn); + }); +}; + +// cob :: [(an -> bn)] -> b0 -> an // compose backwards -var cob=exports.cob=function cob(){for(var _len2=arguments.length,b=Array(_len2),_key2=0;_key2<_len2;_key2++)b[_key2]=arguments[_key2];return cof.apply(void 0,_toConsumableArray(b.reverse()))};// functional utilities +var cob = exports.cob = function cob() { + for (var _len2 = arguments.length, fns = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + fns[_key2] = arguments[_key2]; + } + + return cof.apply(undefined, _toConsumableArray(fns.reverse())); +}; + +// functional utilities // pointfree -var pf=exports.pf=function pf(b){return function(){for(var _len3=arguments.length,d=Array(_len3),_key3=0;_key3<_len3;_key3++)d[_key3]=arguments[_key3];return function(e){return b.apply(e,d)}}};// curry +var pf = exports.pf = function pf(fn) { + return function () { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return function (x) { + return fn.apply(x, args); + }; + }; +}; + +// curry // curry :: (T -> U) -> [args] -> ( -> U) -var curry=exports.curry=function curry(b){for(var _len4=arguments.length,d=Array(1<_len4?_len4-1:0),_key4=1;_key4<_len4;_key4++)d[_key4-1]=arguments[_key4];return b.bind.apply(b,[void 0].concat(d))};// Transducers -var mapping=exports.mapping=function mapping(b){return(// mapper: x -> y -function(d){return(// reducer: (state, value) -> new state -function(e,h){return d(e,b(h))})})};var filtering=exports.filtering=function filtering(b){return(// predicate: x -> true/false -function(d){return(// reducer: (state, value) -> new state -function(e,h){return b(h)?d(e,h):e})})};var concatter=exports.concatter=function concatter(b,d){return b.concat([d])}; +var curry = exports.curry = function curry(fn) { + for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { + args[_key4 - 1] = arguments[_key4]; + } + + return fn.bind.apply(fn, [undefined].concat(args)); +}; + +// Transducers +var mapping = exports.mapping = function mapping(mapper) { + return (// mapper: x -> y + function (reducer) { + return (// reducer: (state, value) -> new state + function (result, value) { + return reducer(result, mapper(value)); + } + ); + } + ); +}; + +var filtering = exports.filtering = function filtering(predicate) { + return (// predicate: x -> true/false + function (reducer) { + return (// reducer: (state, value) -> new state + function (result, value) { + return predicate(value) ? reducer(result, value) : result; + } + ); + } + ); +}; + +var concatter = exports.concatter = function concatter(thing, value) { + return thing.concat([value]); +}; }); }); -FuseBox.expose([{"alias":"clan-fp","pkg":"clan-fp"}]); +FuseBox.expose([{"alias":"clan-fp","pkg":"default"}]); + +FuseBox.import("clan-fp/index.js"); +FuseBox.main("clan-fp/index.js"); }) (function(e){var r="undefined"!=typeof window&&window.navigator;r&&(window.global=window),e=r&&"undefined"==typeof __fbx__dnm__?e:module.exports;var t=r?window.__fsbx__=window.__fsbx__||{}:global.$fsbx=global.$fsbx||{};r||(global.require=require);var n=t.p=t.p||{},i=t.e=t.e||{},o=function(e){if(/^([@a-z].*)$/.test(e)){if("@"===e[0]){var r=e.split("/"),t=r.splice(2,r.length).join("/");return[r[0]+"/"+r[1],t||void 0]}return e.split(/\/(.+)?/)}},a=function(e){return e.substring(0,e.lastIndexOf("/"))||"./"},f=function(){for(var e=[],r=0;r {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n\t, fp\n}\n","\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n"]} \ No newline at end of file +{"version":3,"sources":["index.js","batch.js","vdom.js","mixin.js","model.js","observable.js","hamt.js","worker.js","fp.js"],"names":["hamt","worker","fp","hash","v","_v","JSON","stringify","i","len","length","c","charCodeAt","module","exports","batch","vdom","mixin","model","obs","inflight","url","options","method","key","toLowerCase","f","Object","assign","compress","Promise","res","rej","then","d","catch","e","undefined","data","console","error","rAF","document","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","setTimeout","cb","class_id_regex","tagName_regex","parseSelector","test","tagreg","exec","s","tag","slice","reg","create","substr","className","trim","id","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","m","selector","children","attrs","Array","Function","unshift","shouldUpdate","unload","config","__hash","stripEvents","a","name","applyEvents","events","el","strip_existing","removeEvents","flatten","arr","push","EVENTS","split","map","x","mnt","mount","fn","render","applyUpdates","update","stylify","style","setAttrs","attr","innerHTML","value","setAttribute","_id","_className","createTag","parent","parentElement","__vdom","t","createTextNode","insertBefore","removeEl","appendChild","shouldExchange","tagName","_shouldUpdate","createElement","removeChild","insertAt","next_sib","resolve","_el","vdom_children","el_children","childNodes","qs","querySelector","resolver","states","promises","done","_await","_promises","finish","ms","isDone","total","all","props","keys","forEach","getState","gs","view","state","r","instance","container","queries","wrapper_view","reservedAttrs","toHTML","_vdom","html","_class","_attrs","inner","indexOf","str","filter","join","classes","_mixin","proto","prototype","p","getOwnPropertyNames","oldFn","apply","call","arguments","is","type","isValid","String","Number","Boolean","check","types","required","reduce","_type","MODEL","init","logic","pipe","whenValid","ArrayOf","M","subscribers","val","o","take","n","values","delete","takeWhile","acc","maybe","success","stop","ts","Date","now","from","union","fs","hamming","popcount","root","sum","comp","b","HMAP_SIZE","MAX_DEPTH","vec","h","range","shallowClone","y","cloneNode","node","numChildren","set","newroot","bits","cp","cn","rh","j","__r","__n","vecr","vecn","_r","get","first","unset","_n","item","toList","toOrderedList","toJSON","toJson","pop","shift","k","supports","q","window","supportsWorkers","supportsBlobs","supportsURLs","supportsBuilders","code","B","U","W","blob","append","getBlob","encodeURIComponent","createObjectURL","Worker","farm","workers","fill","current","iter","onerror","w","onmessage","postMessage","log","process","nextTick","g","cof","fns","cob","reverse","pf","curry","bind","mapping","mapper","reducer","result","filtering","predicate","concatter","thing","concat"],"mappings":";;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;IAAYA;;AACZ;;IAAYC;;AACZ;;IAAYC;;;;;;AAEL,IAAMC,sBAAO,cAACC,CAAD,EAA4B;AAAA,QAAzBC,EAAyB,uEAAtBC,KAAKC,SAAL,CAAeH,CAAf,CAAsB;;AAC5C,QAAID,OAAO,CAAX;AACA,SAAK,IAAIK,IAAI,CAAR,EAAWC,MAAMJ,GAAGK,MAAzB,EAAiCF,IAAIC,GAArC,EAA0C,EAAED,CAA5C,EAA+C;AAC3C,YAAMG,IAAIN,GAAGO,UAAH,CAAcJ,CAAd,CAAV;AACAL,eAAS,CAACA,QAAQ,CAAT,IAAcA,IAAf,GAAuBQ,CAAxB,GAA6B,CAApC;AACH;AACD,WAAOR,IAAP;AACH,CAPM;;AASPU,OAAOC,OAAP,GAAiB;AAChBC,0BADgB;AAEdC,wBAFc;AAGdC,0BAHc;AAIdC,0B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;;AAAA,WAAYD,wCAAOC,IAAIE,OAAJ,EAAP,EAAZ;AAAA,CAAZ;;AAEP;AACA;AACO,IAAMC,kBAAK,SAALA,EAAK;AAAA,WAAM;AAAA,2CAAI9N,IAAJ;AAAIA,gBAAJ;AAAA;;AAAA,eAAa;AAAA,mBAAKgC,GAAG6E,KAAH,CAAShF,CAAT,EAAY7B,IAAZ,CAAL;AAAA,SAAb;AAAA,KAAN;AAAA,CAAX;;AAEP;AACA;AACO,IAAM+N,wBAAQ,SAARA,KAAQ,CAAC/L,EAAD;AAAA,uCAAQhC,IAAR;AAAQA,YAAR;AAAA;;AAAA,WACpBgC,GAAGgM,IAAH,YAAQ/P,SAAR,SAAsB+B,IAAtB,EADoB;AAAA,CAAd;;AAIP;AACO,IAAMiO,4BAAU,SAAVA,OAAU,CAACC,MAAD;AAAA,WAAY;AAC/B,kBAACC,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI0L,QAAQC,MAAR,EAAgBF,OAAOzL,KAAP,CAAhB,CADJ;AAAA;AADJ;AAAA;AADmB;AAAA,CAAhB;;AAKA,IAAM4L,gCAAY,SAAZA,SAAY,CAACC,SAAD;AAAA,WAAe;AACpC,kBAACH,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI6L,UAAU7L,KAAV,IAAmB0L,QAAQC,MAAR,EAAgB3L,KAAhB,CAAnB,GAA4C2L,MADhD;AAAA;AADJ;AAAA;AADqB;AAAA,CAAlB;;AAKA,IAAMG,gCAAY,SAAZA,SAAY,CAACC,KAAD,EAAQ/L,KAAR;AAAA,WACrB+L,MAAMC,MAAN,CAAa,CAAChM,KAAD,CAAb,CADqB;AAAA,CAAlB","file":"","sourcesContent":["import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n\t, fp\n}\n","\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n"]} \ No newline at end of file diff --git a/fuse.js b/fuse.js index 65d26e4..9a401c5 100644 --- a/fuse.js +++ b/fuse.js @@ -6,23 +6,21 @@ let c = { homeDir: "src/" , cache: dev , package: 'clan-fp' - , globals: { 'clan-fp': 'clan-fp' } + , globals: { default: 'clan-fp' } , sourceMap: { bundleReference: "index.js.map" , outFile: "./build/index.js.map" } , outFile: "./build/index.js" - , inFile: "[index.js]" + , inFile: "> index.js [**/*.js]" , plugins: (browser) => [ f.BabelPlugin({ config: { sourceMaps: true , presets: ['latest'] - , env: { production: {presets: ['babili'] }} - , plugins: [ - "fast-async" - ] + // , env: { production: {presets: ['babili'] }} + , plugins: ["fast-async"] } }) ] From 601c476e7c9ce09904baf922652c9a3fb3129b1c Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Sun, 1 Jan 2017 22:07:06 -0600 Subject: [PATCH 11/19] 0.0.31 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c660c8..b47450e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clan-fp", - "version": "0.0.30", + "version": "0.0.31", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", From 82f454b18b4815379fd471e38b23bb082fb2e77f Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Mon, 2 Jan 2017 16:28:02 -0600 Subject: [PATCH 12/19] comitting and pushing new patch version --- build/index.js | 7 +++---- build/index.js.map | 2 +- src/index.js | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/build/index.js b/build/index.js index 3c53ede..f4421c5 100644 --- a/build/index.js +++ b/build/index.js @@ -56,16 +56,15 @@ var hash = exports.hash = function hash(v) { return hash; }; -module.exports = { +module.exports = Object.assign({}, fp, { batch: _batch2.default, vdom: _vdom2.default, mixin: _mixin2.default, model: _model2.default, obs: _observable2.default, hamt: hamt, - worker: worker, - fp: fp -}; + worker: worker +}); }); ___scope___.file("batch.js", function(exports, require, module, __filename, __dirname){ diff --git a/build/index.js.map b/build/index.js.map index 1b3ed52..aa63145 100644 --- a/build/index.js.map +++ b/build/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["index.js","batch.js","vdom.js","mixin.js","model.js","observable.js","hamt.js","worker.js","fp.js"],"names":["hamt","worker","fp","hash","v","_v","JSON","stringify","i","len","length","c","charCodeAt","module","exports","batch","vdom","mixin","model","obs","inflight","url","options","method","key","toLowerCase","f","Object","assign","compress","Promise","res","rej","then","d","catch","e","undefined","data","console","error","rAF","document","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","setTimeout","cb","class_id_regex","tagName_regex","parseSelector","test","tagreg","exec","s","tag","slice","reg","create","substr","className","trim","id","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","m","selector","children","attrs","Array","Function","unshift","shouldUpdate","unload","config","__hash","stripEvents","a","name","applyEvents","events","el","strip_existing","removeEvents","flatten","arr","push","EVENTS","split","map","x","mnt","mount","fn","render","applyUpdates","update","stylify","style","setAttrs","attr","innerHTML","value","setAttribute","_id","_className","createTag","parent","parentElement","__vdom","t","createTextNode","insertBefore","removeEl","appendChild","shouldExchange","tagName","_shouldUpdate","createElement","removeChild","insertAt","next_sib","resolve","_el","vdom_children","el_children","childNodes","qs","querySelector","resolver","states","promises","done","_await","_promises","finish","ms","isDone","total","all","props","keys","forEach","getState","gs","view","state","r","instance","container","queries","wrapper_view","reservedAttrs","toHTML","_vdom","html","_class","_attrs","inner","indexOf","str","filter","join","classes","_mixin","proto","prototype","p","getOwnPropertyNames","oldFn","apply","call","arguments","is","type","isValid","String","Number","Boolean","check","types","required","reduce","_type","MODEL","init","logic","pipe","whenValid","ArrayOf","M","subscribers","val","o","take","n","values","delete","takeWhile","acc","maybe","success","stop","ts","Date","now","from","union","fs","hamming","popcount","root","sum","comp","b","HMAP_SIZE","MAX_DEPTH","vec","h","range","shallowClone","y","cloneNode","node","numChildren","set","newroot","bits","cp","cn","rh","j","__r","__n","vecr","vecn","_r","get","first","unset","_n","item","toList","toOrderedList","toJSON","toJson","pop","shift","k","supports","q","window","supportsWorkers","supportsBlobs","supportsURLs","supportsBuilders","code","B","U","W","blob","append","getBlob","encodeURIComponent","createObjectURL","Worker","farm","workers","fill","current","iter","onerror","w","onmessage","postMessage","log","process","nextTick","g","cof","fns","cob","reverse","pf","curry","bind","mapping","mapper","reducer","result","filtering","predicate","concatter","thing","concat"],"mappings":";;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;IAAYA;;AACZ;;IAAYC;;AACZ;;IAAYC;;;;;;AAEL,IAAMC,sBAAO,cAACC,CAAD,EAA4B;AAAA,QAAzBC,EAAyB,uEAAtBC,KAAKC,SAAL,CAAeH,CAAf,CAAsB;;AAC5C,QAAID,OAAO,CAAX;AACA,SAAK,IAAIK,IAAI,CAAR,EAAWC,MAAMJ,GAAGK,MAAzB,EAAiCF,IAAIC,GAArC,EAA0C,EAAED,CAA5C,EAA+C;AAC3C,YAAMG,IAAIN,GAAGO,UAAH,CAAcJ,CAAd,CAAV;AACAL,eAAS,CAACA,QAAQ,CAAT,IAAcA,IAAf,GAAuBQ,CAAxB,GAA6B,CAApC;AACH;AACD,WAAOR,IAAP;AACH,CAPM;;AASPU,OAAOC,OAAP,GAAiB;AAChBC,0BADgB;AAEdC,wBAFc;AAGdC,0BAHc;AAIdC,0BAJc;AAKdC,6BALc;AAMdnB,cANc;AAOdC,kBAPc;AAQdC;AARc,CAAjB;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;;AAEA;AACA,IAAMa,QAAQ,SAARA,KAAQ,IAAK;AACf,QAAIK,WAAW,EAAf;;AAEA,WAAO,UA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BAAKgC,GAAG6E,KAAH,CAAShF,CAAT,EAAY7B,IAAZ,CAAL;AAAA,SAAb;AAAA,KAAN;AAAA,CAAX;;AAEP;AACA;AACO,IAAM+N,wBAAQ,SAARA,KAAQ,CAAC/L,EAAD;AAAA,uCAAQhC,IAAR;AAAQA,YAAR;AAAA;;AAAA,WACpBgC,GAAGgM,IAAH,YAAQ/P,SAAR,SAAsB+B,IAAtB,EADoB;AAAA,CAAd;;AAIP;AACO,IAAMiO,4BAAU,SAAVA,OAAU,CAACC,MAAD;AAAA,WAAY;AAC/B,kBAACC,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI0L,QAAQC,MAAR,EAAgBF,OAAOzL,KAAP,CAAhB,CADJ;AAAA;AADJ;AAAA;AADmB;AAAA,CAAhB;;AAKA,IAAM4L,gCAAY,SAAZA,SAAY,CAACC,SAAD;AAAA,WAAe;AACpC,kBAACH,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI6L,UAAU7L,KAAV,IAAmB0L,QAAQC,MAAR,EAAgB3L,KAAhB,CAAnB,GAA4C2L,MADhD;AAAA;AADJ;AAAA;AADqB;AAAA,CAAlB;;AAKA,IAAMG,gCAAY,SAAZA,SAAY,CAACC,KAAD,EAAQ/L,KAAR;AAAA,WACrB+L,MAAMC,MAAN,CAAa,CAAChM,KAAD,CAAb,CADqB;AAAA,CAAlB","file":"","sourcesContent":["import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n\t, fp\n}\n","\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n"]} \ No newline at end of file +{"version":3,"sources":["index.js","batch.js","vdom.js","mixin.js","model.js","observable.js","hamt.js","worker.js","fp.js"],"names":["hamt","worker","fp","hash","v","_v","JSON","stringify","i","len","length","c","charCodeAt","module","exports","Object","assign","batch","vdom","mixin","model","obs","inflight","url","options","method","key","toLowerCase","f","compress","Promise","res","rej","then","d","catch","e","undefined","data","console","error","rAF","document","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","setTimeout","cb","class_id_regex","tagName_regex","parseSelector","test","tagreg","exec","s","tag","slice","reg","create","substr","className","trim","id","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","m","selector","children","attrs","Array","Function","unshift","shouldUpdate","unload","config","__hash","stripEvents","a","name","applyEvents","events","el","strip_existing","removeEvents","flatten","arr","push","EVENTS","split","map","x","mnt","mount","fn","render","applyUpdates","update","stylify","style","setAttrs","attr","innerHTML","value","setAttribute","_id","_className","createTag","parent","parentElement","__vdom","t","createTextNode","insertBefore","removeEl","appendChild","shouldExchange","tagName","_shouldUpdate","createElement","removeChild","insertAt","next_sib","resolve","_el","vdom_children","el_children","childNodes","qs","querySelector","resolver","states","promises","done","_await","_promises","finish","ms","isDone","total","all","props","keys","forEach","getState","gs","view","state","r","instance","container","queries","wrapper_view","reservedAttrs","toHTML","_vdom","html","_class","_attrs","inner","indexOf","str","filter","join","classes","_mixin","proto","prototype","p","getOwnPropertyNames","oldFn","apply","call","arguments","is","type","isValid","String","Number","Boolean","check","types","required","reduce","_type","MODEL","init","logic","pipe","whenValid","ArrayOf","M","subscribers","val","o","take","n","values","delete","takeWhile","acc","maybe","success","stop","ts","Date","now","from","union","fs","hamming","popcount","root","sum","comp","b","HMAP_SIZE","MAX_DEPTH","vec","h","range","shallowClone","y","cloneNode","node","numChildren","set","newroot","bits","cp","cn","rh","j","__r","__n","vecr","vecn","_r","get","first","unset","_n","item","toList","toOrderedList","toJSON","toJson","pop","shift","k","supports","q","window","supportsWorkers","supportsBlobs","supportsURLs","supportsBuilders","code","B","U","W","blob","append","getBlob","encodeURIComponent","createObjectURL","Worker","farm","workers","fill","current","iter","onerror","w","onmessage","postMessage","log","process","nextTick","g","cof","fns","cob","reverse","pf","curry","bind","mapping","mapper","reducer","result","filtering","predicate","concatter","thing","concat"],"mappings":";;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;IAAYA;;AACZ;;IAAYC;;AACZ;;IAAYC;;;;;;AAEL,IAAMC,sBAAO,cAACC,CAAD,EAA4B;AAAA,QAAzBC,EAAyB,uEAAtBC,KAAKC,SAAL,CAAeH,CAAf,CAAsB;;AAC5C,QAAID,OAAO,CAAX;AACA,SAAK,IAAIK,IAAI,CAAR,EAAWC,MAAMJ,GAAGK,MAAzB,EAAiCF,IAAIC,GAArC,EAA0C,EAAED,CAA5C,EAA+C;AAC3C,YAAMG,IAAIN,GAAGO,UAAH,CAAcJ,CAAd,CAAV;AACAL,eAAS,CAACA,QAAQ,CAAT,IAAcA,IAAf,GAAuBQ,CAAxB,GAA6B,CAApC;AACH;AACD,WAAOR,IAAP;AACH,CAPM;;AASPU,OAAOC,OAAP,GAAiBC,OAAOC,MAAP,CAAc,EAAd,EAAkBd,EAAlB,EAAsB;AACtCe,0BADsC;AAEpCC,wBAFoC;AAGpCC,0BAHoC;AAIpCC,0BAJoC;AAKpCC,6BALoC;AAMpCrB,cANoC;AAOpCC;AAPoC,CAAtB,CAAjB;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;;AAEA;AACA,IAAMgB,QAAQ,SAARA,KAAQ,IAAK;AACf,QAAIK,WAAW,EAAf;;AAEA,WAAO,UAACC,GAAD,EAAqB;AAAA,YAAfC,OAAe,uEAAP,EAAO;AACpB,YAACC,MAAD,GAAWD,OAAX,CAACC,MAAD;AAAA,YACAC,GADA,GACSH,GADT,SACgBjB,KAAKC,SAAL,CAAeiB,OAAf,CADhB;;;AAGJ,YAAG,CAACC,UAAU,EAAX,EAAeE,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AA,WACpBgC,GAAGgM,IAAH,YAAQ/P,SAAR,SAAsB+B,IAAtB,EADoB;AAAA,CAAd;;AAIP;AACO,IAAMiO,4BAAU,SAAVA,OAAU,CAACC,MAAD;AAAA,WAAY;AAC/B,kBAACC,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI0L,QAAQC,MAAR,EAAgBF,OAAOzL,KAAP,CAAhB,CADJ;AAAA;AADJ;AAAA;AADmB;AAAA,CAAhB;;AAKA,IAAM4L,gCAAY,SAAZA,SAAY,CAACC,SAAD;AAAA,WAAe;AACpC,kBAACH,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI6L,UAAU7L,KAAV,IAAmB0L,QAAQC,MAAR,EAAgB3L,KAAhB,CAAnB,GAA4C2L,MADhD;AAAA;AADJ;AAAA;AADqB;AAAA,CAAlB;;AAKA,IAAMG,gCAAY,SAAZA,SAAY,CAACC,KAAD,EAAQ/L,KAAR;AAAA,WACrB+L,MAAMC,MAAN,CAAa,CAAChM,KAAD,CAAb,CADqB;AAAA,CAAlB","file":"","sourcesContent":["import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = Object.assign({}, fp, {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n})\n","\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n"]} \ No newline at end of file diff --git a/src/index.js b/src/index.js index 2888d8b..10e7075 100644 --- a/src/index.js +++ b/src/index.js @@ -16,7 +16,7 @@ export const hash = (v,_v=JSON.stringify(v)) => { return hash } -module.exports = { +module.exports = Object.assign({}, fp, { batch , vdom , mixin @@ -24,5 +24,4 @@ module.exports = { , obs , hamt , worker - , fp -} +}) From 3ec2b5a2fd882ba19dd50b88aca7514757243871 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Mon, 2 Jan 2017 16:28:06 -0600 Subject: [PATCH 13/19] 0.0.32 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b47450e..280da4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clan-fp", - "version": "0.0.31", + "version": "0.0.32", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", From e77d269998e9e4d4cb25fc99b99c46ef271b4155 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Mon, 2 Jan 2017 17:48:06 -0600 Subject: [PATCH 14/19] adding release --- fuse.js | 6 +- package.json | 1 + yarn.lock | 690 +++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 666 insertions(+), 31 deletions(-) diff --git a/fuse.js b/fuse.js index 9a401c5..5bfabdb 100644 --- a/fuse.js +++ b/fuse.js @@ -12,7 +12,7 @@ let c = { , outFile: "./build/index.js.map" } , outFile: "./build/index.js" - , inFile: "> index.js [**/*.js]" + , inFile: "> index.js [index.js]" , plugins: (browser) => [ f.BabelPlugin({ @@ -29,11 +29,7 @@ let c = { const processAll = $ => { let d = Object.assign({}, c) , inFile = d.inFile - d.plugins = d.plugins(d.browser || false) - delete d.inFile - delete d.browser - f.FuseBox.init(d).bundle(inFile) } diff --git a/package.json b/package.json index 280da4d..90bc554 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "husky": "^0.12.0", "now": "^0.37.1", "npm-run-all": "^3.1.1", + "release": "^1.0.6", "rimraf": "^2.5.4", "uglify-js": "^2.7.5", "yarn": "^0.18.1" diff --git a/yarn.lock b/yarn.lock index 12b5a2b..44d86f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,10 +34,21 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +after-all-results@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/after-all-results/-/after-all-results-2.0.0.tgz#6ac2fc202b500f88da8f4f5530cfa100f4c6a2d0" + after@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" +agent-base@2: + version "2.0.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.0.1.tgz#bd8f9e86a8eb221fffa07bd14befd55df142815e" + dependencies: + extend "~3.0.0" + semver "~5.0.1" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -50,6 +61,12 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-align@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-1.1.0.tgz#2f0c1658829739add5ebb15e6b0c6e3423f016ba" + dependencies: + string-width "^1.0.1" + ansi-escapes@1.4.0, ansi-escapes@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -96,6 +113,16 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.0 || ^1.1.13" +args@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/args/-/args-2.2.1.tgz#cda22875f43e54755b9084221d3e8260112cd3b5" + dependencies: + camelcase "^3.0.0" + chalk "^1.1.3" + loud-rejection "^1.3.0" + minimist "^1.2.0" + pkginfo "^0.4.0" + arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -161,7 +188,7 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" -async-retry@0.2.1: +async-retry@0.2.1, async-retry@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-0.2.1.tgz#a8ca3a101bc146dd75de5e6464263f26c1fcd44f" dependencies: @@ -1120,6 +1147,20 @@ boom@2.x.x: dependencies: hoek "2.x.x" +boxen@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-0.6.0.tgz#8364d4248ac34ff0ef1b2f2bf49a6c60ce0d81b6" + dependencies: + ansi-align "^1.1.0" + camelcase "^2.1.0" + chalk "^1.1.1" + cli-boxes "^1.0.0" + filled-array "^1.0.0" + object-assign "^4.0.1" + repeating "^2.0.0" + string-width "^1.0.1" + widest-line "^1.0.0" + brace-expansion@^1.0.0: version "1.1.6" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" @@ -1141,6 +1182,13 @@ browserslist@^1.4.0: dependencies: caniuse-db "^1.0.30000601" +bubble-stream-error@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/bubble-stream-error/-/bubble-stream-error-1.0.0.tgz#7dad97f17128da396169bf37ada4acb195361e30" + dependencies: + once "^1.3.3" + sliced "^1.0.1" + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -1180,6 +1228,10 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" +camelcase@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" @@ -1188,6 +1240,10 @@ caniuse-db@^1.0.30000601: version "1.0.30000602" resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000602.tgz#06b2cbfb6c3aeef7ddb18cd588043549ad1a2d4e" +capitalize@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/capitalize/-/capitalize-1.0.0.tgz#dc802c580aee101929020d2ca14b4ca8a0ae44be" + capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" @@ -1220,6 +1276,14 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +child-process-promise@^2.1.3: + version "2.2.0" + resolved "https://registry.yarnpkg.com/child-process-promise/-/child-process-promise-2.2.0.tgz#08f6c9ed7848c770c0a2539cb132f4ce0840a866" + dependencies: + cross-spawn "^4.0.2" + node-version "^1.0.0" + promise-polyfill "^6.0.1" + chokidar@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" @@ -1239,6 +1303,10 @@ ci-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + cli-cursor@^1.0.1, cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -1328,6 +1396,20 @@ concat-with-sourcemaps@^1.0.4: dependencies: source-map "^0.5.1" +configstore@^2.0.0, configstore@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-2.1.0.tgz#737a3a7036e9886102aa6099e47bb33ab1aba1a1" + dependencies: + dot-prop "^3.0.0" + graceful-fs "^4.1.2" + mkdirp "^0.5.0" + object-assign "^4.0.1" + os-tmpdir "^1.0.0" + osenv "^0.1.0" + uuid "^2.0.1" + write-file-atomic "^1.1.2" + xdg-basedir "^2.0.0" + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -1356,7 +1438,7 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -create-error-class@^3.0.0: +create-error-class@^3.0.0, create-error-class@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" dependencies: @@ -1383,7 +1465,7 @@ cross-spawn@^3.0.1: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^4.0.0: +cross-spawn@^4.0.0, cross-spawn@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" dependencies: @@ -1402,6 +1484,12 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" +cwd@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/cwd/-/cwd-0.9.1.tgz#41e10a7e1ab833dc59c2eca83814c7de77b5a4fd" + dependencies: + find-pkg "^0.1.0" + d@^0.1.1, d@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" @@ -1418,6 +1506,12 @@ death@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/death/-/death-1.0.0.tgz#4d46e15488d4b636b699f0671b04632d752fd2de" +debug@2, debug@^2.1.1, debug@^2.2.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + dependencies: + ms "0.7.2" + debug@2.2.0, debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" @@ -1430,11 +1524,9 @@ debug@2.3.3: dependencies: ms "0.7.2" -debug@^2.1.1, debug@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" - dependencies: - ms "0.7.2" +debug@~0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-0.8.1.tgz#20ff4d26f5e422cb68a1bacbbb61039ad8c1c130" decamelize@^1.0.0: version "1.2.0" @@ -1531,6 +1623,12 @@ docker-file-parser@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/docker-file-parser/-/docker-file-parser-0.1.0.tgz#8aff4967aa36df61e50f36091571f95e4457ae8b" +dot-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" + dependencies: + is-obj "^1.0.0" + download@5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/download/-/download-5.0.2.tgz#89c8ab55a3be41ef2c8d787995af81a1d91d2302" @@ -1543,6 +1641,12 @@ download@5.0.2: mkdirp "^0.5.1" pify "^2.3.0" +duplexer2@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -1574,7 +1678,7 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" -end-of-stream@^1.0.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.1.0.tgz#e9353258baa9108965efc41cb0ef8ade2f3cfb07" dependencies: @@ -1718,7 +1822,19 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -extend@^3.0.0, extend@~3.0.0: +expand-tilde@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" + dependencies: + os-homedir "^1.0.1" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend@3, extend@^3.0.0, extend@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" @@ -1763,6 +1879,16 @@ figures@^1.3.5: escape-string-regexp "^1.0.5" object-assign "^4.1.0" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-name@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/file-name/-/file-name-0.1.0.tgz#12b122f120f9c34dbc176c1ab81a548aced6def7" + file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" @@ -1793,10 +1919,27 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" +filled-array@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84" + +find-file-up@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/find-file-up/-/find-file-up-0.1.3.tgz#cf68091bcf9f300a40da411b37da5cce5a2fbea0" + dependencies: + fs-exists-sync "^0.1.0" + resolve-dir "^0.1.0" + find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" +find-pkg@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/find-pkg/-/find-pkg-0.1.2.tgz#1bdc22c06e36365532e2a248046854b9788da557" + dependencies: + find-file-up "^0.1.2" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -1804,6 +1947,13 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" +follow-redirects@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-0.0.7.tgz#34b90bab2a911aa347571da90f22bd36ecd8a919" + dependencies: + debug "^2.2.0" + stream-consume "^0.1.0" + for-in@^0.1.5: version "0.1.6" resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" @@ -1834,6 +1984,10 @@ from@~0: version "0.1.3" resolved "https://registry.yarnpkg.com/from/-/from-0.1.3.tgz#ef63ac2062ac32acf7862e0d40b44b896f22f3bc" +fs-exists-sync@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" + fs-extra@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" @@ -1968,6 +2122,69 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +git-commits@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/git-commits/-/git-commits-1.2.0.tgz#42bd54b416928b201c71c843057da71fba775cca" + dependencies: + git-parse-commit "^1.0.0" + git-spawned-stream "^0.1.1" + split-transform-stream "^1.0.0" + +git-config-path@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/git-config-path/-/git-config-path-1.0.1.tgz#6d33f7ed63db0d0e118131503bab3aca47d54664" + dependencies: + extend-shallow "^2.0.1" + fs-exists-sync "^0.1.0" + homedir-polyfill "^1.0.0" + +git-parse-commit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/git-parse-commit/-/git-parse-commit-1.0.0.tgz#b5bde7bd94f6a01ea3883a25520530d69ab71176" + dependencies: + git-parse-human2 "~0.0.1" + +git-parse-human2@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/git-parse-human2/-/git-parse-human2-0.0.1.tgz#56fa61c78d98564bc66e2eb989d8e989bba0db36" + +git-repo-name@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/git-repo-name/-/git-repo-name-0.6.0.tgz#af09884656aa537ec625c7087008175cd61228ff" + dependencies: + cwd "^0.9.1" + file-name "^0.1.0" + lazy-cache "^1.0.4" + remote-origin-url "^0.5.1" + +git-spawned-stream@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/git-spawned-stream/-/git-spawned-stream-0.1.1.tgz#38927da02e52d862396861bf996557452643802b" + dependencies: + debug "~0.8.1" + spawn-to-readstream "~0.1.3" + +git-state@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/git-state/-/git-state-3.1.0.tgz#89a8b60b98ffc94028a921f49c0da8e5869b1316" + dependencies: + after-all-results "^2.0.0" + +git-username@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/git-username/-/git-username-0.5.0.tgz#38c561dac9cbf334097a31bd9a38af0cb40a3123" + dependencies: + remote-origin-url "^0.4.0" + +github@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/github/-/github-7.2.0.tgz#6d9133479ce67ed1af4997a6b51faeee81bf6059" + dependencies: + follow-redirects "0.0.7" + https-proxy-agent "^1.0.0" + mime "^1.2.11" + netrc "^0.1.4" + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -1992,10 +2209,46 @@ glob@7.1.1, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +global-modules@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" + dependencies: + global-prefix "^0.1.4" + is-windows "^0.2.0" + +global-prefix@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-0.1.5.tgz#8d3bc6b8da3ca8112a160d8d496ff0462bfef78f" + dependencies: + homedir-polyfill "^1.0.0" + ini "^1.3.4" + is-windows "^0.2.0" + which "^1.2.12" + globals@^9.0.0: version "9.14.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" +got@^5.0.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-5.7.1.tgz#5f81635a61e4a6589f180569ea4e381680a51f35" + dependencies: + create-error-class "^3.0.1" + duplexer2 "^0.1.4" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + node-status-codes "^1.0.0" + object-assign "^4.0.1" + parse-json "^2.1.0" + pinkie-promise "^2.0.0" + read-all-stream "^3.0.0" + readable-stream "^2.0.5" + timed-out "^3.0.0" + unzip-response "^1.0.2" + url-parse-lax "^1.0.0" + got@^6.3.0: version "6.7.1" resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" @@ -2077,6 +2330,12 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" +homedir-polyfill@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + hosted-git-info@^2.1.4: version "2.1.5" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" @@ -2102,6 +2361,14 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" +https-proxy-agent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6" + dependencies: + agent-base "2" + debug "2" + extend "3" + husky@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/husky/-/husky-0.12.0.tgz#3a44922fce8071803242c3c7522a6582c50525dc" @@ -2122,6 +2389,10 @@ ignore@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435" +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" @@ -2137,7 +2408,7 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -ini@1.3.4, ini@^1.3.4, ini@~1.3.0: +ini@1.3.4, ini@^1.3.3, ini@^1.3.4, ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" @@ -2160,6 +2431,25 @@ inquirer@^1.2.2: strip-ansi "^3.0.0" through "^2.3.6" +inquirer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-2.0.0.tgz#e1351687b90d150ca403ceaa3cefb1e3065bef4b" + dependencies: + ansi-escapes "^1.1.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + external-editor "^1.1.0" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.6" + pinkie-promise "^2.0.0" + run-async "^2.2.0" + rx "^4.1.0" + string-width "^2.0.0" + strip-ansi "^3.0.0" + through "^2.3.6" + invariant@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" @@ -2216,7 +2506,7 @@ is-equal-shallow@^0.1.3: dependencies: is-primitive "^2.0.0" -is-extendable@^0.1.1: +is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -2236,6 +2526,10 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" @@ -2255,12 +2549,20 @@ is-natural-number@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-2.1.1.tgz#7d4c5728377ef386c3e194a9911bf57c6dc335e7" +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + is-number@^2.0.2, is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" dependencies: kind-of "^3.0.2" +is-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" @@ -2313,6 +2615,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -2407,10 +2713,20 @@ klaw@^1.0.0: optionalDependencies: graceful-fs "^4.1.9" -lazy-cache@^1.0.3: +latest-version@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-2.0.0.tgz#56f8d6139620847b8017f8f1f4d78e211324168b" + dependencies: + package-json "^2.0.0" + +lazy-cache@^1.0.3, lazy-cache@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" +lazy-req@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-1.1.0.tgz#bdaebead30f8d824039ce0ce149d4daa07ba1fac" + leven@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.0.0.tgz#74c45744439550da185801912829f61d22071bc1" @@ -2422,6 +2738,10 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +limit-spawn@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/limit-spawn/-/limit-spawn-0.0.3.tgz#cc09c24467a0f0a1ed10a5196dba597cad3f65dc" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -2436,7 +2756,7 @@ lodash.some@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" -lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.13.1, lodash@^4.2.0, lodash@^4.3.0: version "4.17.3" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.3.tgz#557ed7d2a9438cac5fd5a43043ca60cb455e01f7" @@ -2456,7 +2776,7 @@ loose-envify@^1.0.0: dependencies: js-tokens "^2.0.0" -loud-rejection@^1.2.0: +loud-rejection@^1.2.0, loud-rejection@^1.3.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" dependencies: @@ -2510,6 +2830,10 @@ mime-types@^2.1.12, mime-types@~2.1.7: dependencies: mime-db "~1.25.0" +mime@^1.2.11: + version "1.3.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" + minimalistic-assert@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" @@ -2562,6 +2886,14 @@ nanoseconds@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/nanoseconds/-/nanoseconds-0.1.0.tgz#69ec39fcd00e77ab3a72de0a43342824cd79233a" +native-or-bluebird@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/native-or-bluebird/-/native-or-bluebird-1.2.0.tgz#39c47bfd7825d1fb9ffad32210ae25daadf101c9" + +netrc@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/netrc/-/netrc-0.1.4.tgz#6be94fcaca8d77ade0a9670dc460914c94472444" + node-emoji@^1.0.4: version "1.4.3" resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.4.3.tgz#5272f70b823c4df6d7c39f84fd8203f35b3e5d36" @@ -2608,7 +2940,11 @@ node-pre-gyp@^0.6.29: tar "~2.2.1" tar-pack "~3.3.0" -node-version@1.0.0: +node-status-codes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" + +node-version@1.0.0, node-version@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-version/-/node-version-1.0.0.tgz#1b9b9584a9a7f7a6123f215cd14a652bf21ab19e" @@ -2740,6 +3076,10 @@ object-keys@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" +object-keys@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + object-path@^0.11.2: version "0.11.3" resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.3.tgz#3e21a42ad07234d815429ae9e15c1c5f38050554" @@ -2755,7 +3095,7 @@ obuf@^1.0.0, obuf@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.1.tgz#104124b6c602c6796881a042541d36db43a5264e" -once@^1.3.0: +once@^1.3.0, once@^1.3.1, once@^1.3.3: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2771,6 +3111,10 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +open@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/open/-/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc" + optionator@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -2786,7 +3130,7 @@ options@>=0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" -ora@0.4.0: +ora@0.4.0, ora@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/ora/-/ora-0.4.0.tgz#fccb5a82e169ccd27c491bd00cc1924ff7a390bd" dependencies: @@ -2795,7 +3139,7 @@ ora@0.4.0: cli-spinners "^1.0.0" log-symbols "^1.0.2" -os-homedir@^1.0.0: +os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -2807,13 +3151,37 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@0: +osenv@0, osenv@^0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +package-json@^2.0.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-2.4.0.tgz#0d15bd67d1cbbddbb2ca222ff2edb86bcb31a8bb" + dependencies: + got "^5.0.0" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + +parse-git-config@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-0.2.0.tgz#272833fdd15fea146fb75d336d236b963b6ff706" + dependencies: + ini "^1.3.3" + +parse-git-config@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-1.1.1.tgz#d3a9984317132f57398712bba438e129590ddf8c" + dependencies: + extend-shallow "^2.0.1" + fs-exists-sync "^0.1.0" + git-config-path "^1.0.1" + ini "^1.3.4" + parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -2823,12 +3191,16 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-json@^2.2.0: +parse-json@^2.1.0, parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" dependencies: error-ex "^1.2.0" +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + parsejson@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/parsejson/-/parsejson-0.0.3.tgz#ab7e3759f209ece99437973f7d0f1f64ae0e64ab" @@ -2895,6 +3267,14 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +pkginfo@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.0.tgz#349dbb7ffd38081fcadc0853df687f0c7744cd65" + +pluralize@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-3.1.0.tgz#84213d0a12356069daa84060c559242633161368" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -2930,6 +3310,10 @@ progress@1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" +promise-polyfill@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-6.0.2.tgz#d9c86d3dc4dc2df9016e88946defd69b49b41162" + proper-lockfile@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-1.2.0.tgz#ceff5dd89d3e5f10fb75e1e8e76bc75801a59c34" @@ -2953,6 +3337,21 @@ psl@1.1.15: version "1.1.15" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.15.tgz#4bcd312929a5a88657c35d23b425712fb0c74f00" +pump-chain@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pump-chain/-/pump-chain-1.0.0.tgz#7d57d8d9ad8181ea808f5413c4f2bc1e786a5e37" + dependencies: + bubble-stream-error "^1.0.0" + pump "^1.0.1" + sliced "^1.0.1" + +pump@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.2.tgz#3b3ee6512f94f0e575538c17995f9f16990a5d51" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -2961,6 +3360,17 @@ qs@~6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" +query-string@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.2.3.tgz#9f27273d207a25a8ee4c7b8c74dcd45d556db822" + dependencies: + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +random-string@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/random-string/-/random-string-0.1.2.tgz#2d6afb6076651316ac5b8a62d63106db31eb8d44" + randomatic@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" @@ -2968,7 +3378,7 @@ randomatic@^1.1.3: is-number "^2.0.2" kind-of "^3.0.2" -rc@^1.1.2, rc@~1.1.6: +rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@~1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" dependencies: @@ -2977,6 +3387,13 @@ rc@^1.1.2, rc@~1.1.6: minimist "^1.2.0" strip-json-comments "~1.0.4" +read-all-stream@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" + dependencies: + pinkie-promise "^2.0.0" + readable-stream "^2.0.0" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -2998,7 +3415,7 @@ read@^1.0.7: dependencies: mute-stream "~0.0.4" -readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.2.2: +readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" dependencies: @@ -3010,6 +3427,15 @@ readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2. string_decoder "~0.10.x" util-deprecate "~1.0.1" +readable-stream@~1.0.17: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readable-stream@~2.1.4: version "2.1.5" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" @@ -3069,6 +3495,18 @@ regexpu-core@^2.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" +registry-auth-token@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.1.0.tgz#997c08256e0c7999837b90e944db39d8a790276b" + dependencies: + rc "^1.1.6" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + dependencies: + rc "^1.0.1" + regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" @@ -3079,6 +3517,46 @@ regjsparser@^0.1.4: dependencies: jsesc "~0.5.0" +release@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/release/-/release-1.0.6.tgz#a986e39d3e18af12d6aa2c5542b61d90b238f5fc" + dependencies: + args "^2.2.1" + async-retry "^0.2.1" + capitalize "^1.0.0" + chalk "^1.1.3" + configstore "^2.1.0" + git-commits "^1.2.0" + git-repo-name "^0.6.0" + git-state "^3.1.0" + git-username "^0.5.0" + github "^7.1.0" + inquirer "^2.0.0" + open "0.0.5" + ora "^0.4.0" + pluralize "^3.1.0" + query-string "^4.2.3" + random-string "^0.1.2" + request "^2.79.0" + request-promise-native "^1.0.3" + semver "^5.3.0" + tagged-versions "^1.2.0" + then-sleep "^1.0.1" + trim "0.0.1" + update-notifier "^1.0.3" + +remote-origin-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/remote-origin-url/-/remote-origin-url-0.4.0.tgz#4d3e2902f34e2d37d1c263d87710b77eb4086a30" + dependencies: + parse-git-config "^0.2.0" + +remote-origin-url@^0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/remote-origin-url/-/remote-origin-url-0.5.2.tgz#e8dd2e188b4f2c215f0127e76ab81b14f38eb748" + dependencies: + parse-git-config "^1.0.2" + repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -3097,6 +3575,19 @@ request-capture-har@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/request-capture-har/-/request-capture-har-1.1.4.tgz#e6ad76eb8e7a1714553fdbeef32cd4518e4e2013" +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.3.tgz#9cb2b2f69f137e4acf35116a08a441cbfd0c0134" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.0.0" + request@2, request@^2.75.0, request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -3122,6 +3613,13 @@ request@2, request@^2.75.0, request@^2.79.0: tunnel-agent "~0.4.1" uuid "^3.0.0" +resolve-dir@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e" + dependencies: + expand-tilde "^1.2.2" + global-modules "^0.2.3" + resolve@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" @@ -3191,10 +3689,20 @@ semver-compare@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.1.0, semver@~5.3.0: +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" +semver@~5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a" + set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -3230,6 +3738,14 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +sliced@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" @@ -3284,6 +3800,13 @@ spawn-sync@^1.0.15: concat-stream "^1.4.7" os-shim "^0.1.2" +spawn-to-readstream@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/spawn-to-readstream/-/spawn-to-readstream-0.1.3.tgz#96768b72739ac64ffa77c8ce2cbf98c2d21d8dbf" + dependencies: + limit-spawn "0.0.3" + through2 "~0.4.1" + spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -3322,12 +3845,26 @@ split-array@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/split-array/-/split-array-1.0.1.tgz#7d0c10366705f3aa4620529ab755bf7ed2220da1" +split-transform-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/split-transform-stream/-/split-transform-stream-1.0.0.tgz#5a37d8383f4e92340d6bd7fb502f482417b9497a" + dependencies: + pump-chain "^1.0.0" + split "^1.0.0" + through2 "^2.0.0" + split@0.3: version "0.3.3" resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" dependencies: through "2" +split@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/split/-/split-1.0.0.tgz#c4395ce683abcd254bc28fe1dabb6e5c27dcffae" + dependencies: + through "2" + sshpk@^1.7.0: version "1.10.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.1.tgz#30e1a5d329244974a1af61511339d595af6638b0" @@ -3343,12 +3880,24 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +stealthy-require@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.0.0.tgz#1a8ed8fc19a8b56268f76f5a1a3e3832b0c26200" + stream-combiner@~0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" dependencies: duplexer "~0.1.1" +stream-consume@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3357,6 +3906,13 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + string.prototype.codepointat@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/string.prototype.codepointat/-/string.prototype.codepointat-0.2.0.tgz#6b26e9bd3afcaa7be3b4269b526de1b82000ac78" @@ -3428,6 +3984,13 @@ sync-exec@~0.6.x: version "0.6.2" resolved "https://registry.yarnpkg.com/sync-exec/-/sync-exec-0.6.2.tgz#717d22cc53f0ce1def5594362f3a89a2ebb91105" +tagged-versions@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tagged-versions/-/tagged-versions-1.2.0.tgz#3cc492ac8b1ae56a6adc0ecfbaf67451343c36fe" + dependencies: + child-process-promise "^2.1.3" + semver "^5.3.0" + tar-pack@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" @@ -3462,6 +4025,12 @@ text-table@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +then-sleep@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/then-sleep/-/then-sleep-1.0.1.tgz#759823bdc4de56ba2a20812868eb872a803ed1f9" + dependencies: + native-or-bluebird "^1.2.0" + thenify-all@^1.0.0, thenify-all@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" @@ -3474,10 +4043,28 @@ thenify-all@^1.0.0, thenify-all@^1.6.0: dependencies: any-promise "^1.0.0" +through2@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +through2@~0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.4.2.tgz#dbf5866031151ec8352bb6c4db64a2292a840b9b" + dependencies: + readable-stream "~1.0.17" + xtend "~2.1.1" + through@2, through@^2.3.6, through@~2.3, through@~2.3.1, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +timed-out@^3.0.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-3.1.3.tgz#95860bfcc5c76c277f8f8326fd0f5b2e20eba217" + timed-out@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.0.tgz#b0fb98d7fed4f36b028698122769c07ef87a8690" @@ -3521,6 +4108,10 @@ trim-repeated@^1.0.0: dependencies: escape-string-regexp "^1.0.2" +trim@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + tunnel-agent@^0.4.0, tunnel-agent@~0.4.1: version "0.4.3" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" @@ -3567,10 +4158,27 @@ unbzip2-stream@^1.0.9: buffer "^3.0.1" through "^2.3.6" +unzip-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" + unzip-response@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" +update-notifier@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-1.0.3.tgz#8f92c515482bd6831b7c93013e70f87552c7cf5a" + dependencies: + boxen "^0.6.0" + chalk "^1.0.0" + configstore "^2.0.0" + is-npm "^1.0.0" + latest-version "^2.0.0" + lazy-req "^1.1.0" + semver-diff "^2.0.0" + xdg-basedir "^2.0.0" + url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" @@ -3587,6 +4195,10 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +uuid@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -3617,7 +4229,7 @@ wbuf@^1.1.0, wbuf@^1.4.0: dependencies: minimalistic-assert "^1.0.0" -which@1, which@^1.2.9: +which@1, which@^1.2.12, which@^1.2.9: version "1.2.12" resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" dependencies: @@ -3629,6 +4241,12 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.1" +widest-line@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-1.0.0.tgz#0c09c85c2a94683d0d7eaf8ee097d564bf0e105c" + dependencies: + string-width "^1.0.1" + window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" @@ -3645,6 +4263,14 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.2.0.tgz#14c66d4e4cb3ca0565c28cf3b7a6f3e4d5938fab" + dependencies: + graceful-fs "^4.1.2" + imurmurhash "^0.1.4" + slide "^1.1.5" + ws@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.1.tgz#082ddb6c641e85d4bb451f03d52f06eabdb1f018" @@ -3656,14 +4282,26 @@ wtf-8@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a" +xdg-basedir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" + dependencies: + os-homedir "^1.0.0" + xmlhttprequest-ssl@1.5.3: version "1.5.3" resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz#185a888c04eca46c3e4070d99f7b49de3528992d" -xtend@^4.0.0: +xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" +xtend@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + dependencies: + object-keys "~0.4.0" + yallist@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4" From be2d599485817ad2f8f48ae32be272bbce58ee81 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Mon, 2 Jan 2017 17:51:34 -0600 Subject: [PATCH 15/19] comitting and pushing new patch version --- package.json | 3 ++ yarn.lock | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 96 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 90bc554..7054d6a 100644 --- a/package.json +++ b/package.json @@ -32,5 +32,8 @@ "rimraf": "^2.5.4", "uglify-js": "^2.7.5", "yarn": "^0.18.1" + }, + "dependencies": { + "ghooks": "^2.0.0" } } diff --git a/yarn.lock b/yarn.lock index 44d86f4..fc20e63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1344,18 +1344,26 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +colors@~0.6.0-1: + version "0.6.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" + combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" dependencies: delayed-stream "~1.0.0" -commander@^2.9.0: +commander@2.9.0, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: graceful-readlink ">= 1.0.0" +commander@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781" + commander@~2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" @@ -1450,6 +1458,13 @@ cross-env@^3.1.3: dependencies: cross-spawn "^3.0.1" +cross-spawn-async@^2.1.1: + version "2.2.5" + resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" + dependencies: + lru-cache "^4.0.0" + which "^1.2.8" + cross-spawn@5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.0.1.tgz#a3bbb302db2297cbea3c04edf36941f4613aa399" @@ -1806,6 +1821,17 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" +execa@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" + dependencies: + cross-spawn-async "^2.1.1" + is-stream "^1.1.0" + npm-run-path "^1.0.0" + object-assign "^4.0.1" + path-key "^1.0.0" + strip-eof "^1.0.0" + exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" @@ -1947,6 +1973,13 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" +findup@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/findup/-/findup-0.1.5.tgz#8ad929a3393bac627957a7e5de4623b06b0e2ceb" + dependencies: + colors "~0.6.0-1" + commander "~2.1.0" + follow-redirects@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-0.0.7.tgz#34b90bab2a911aa347571da90f22bd36ecd8a919" @@ -2122,6 +2155,18 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +ghooks@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ghooks/-/ghooks-2.0.0.tgz#affd83a36e8b8fbdded9b851457c48ac74c8eab8" + dependencies: + execa "^0.4.0" + findup "0.1.5" + lodash.clone "4.3.2" + manage-path "2.0.0" + opt-cli "1.5.1" + path-exists "^2.0.0" + spawn-command "0.0.2" + git-commits@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/git-commits/-/git-commits-1.2.0.tgz#42bd54b416928b201c71c843057da71fba775cca" @@ -2752,6 +2797,16 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +lodash._baseclone@~4.5.0: + version "4.5.7" + resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz#ce42ade08384ef5d62fa77c30f61a46e686f8434" + +lodash.clone@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.3.2.tgz#e56b176b6823a7dde38f7f2bf58de7d5971200e9" + dependencies: + lodash._baseclone "~4.5.0" + lodash.some@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" @@ -2787,13 +2842,17 @@ lowercase-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" -lru-cache@^4.0.1: +lru-cache@^4.0.0, lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: pseudomap "^1.0.1" yallist "^2.0.0" +manage-path@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/manage-path/-/manage-path-2.0.0.tgz#f4cf8457b926eeee2a83b173501414bc76eb9597" + map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" @@ -3038,6 +3097,12 @@ npm-run-all@^3.1.1: shell-quote "^1.6.1" string.prototype.padend "^3.0.0" +npm-run-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" + dependencies: + path-key "^1.0.0" + "npmlog@0 || 1 || 2 || 3": version "3.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-3.1.2.tgz#2d46fa874337af9498a2f12bb43d8d0be4a36873" @@ -3115,6 +3180,15 @@ open@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/open/-/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc" +opt-cli@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/opt-cli/-/opt-cli-1.5.1.tgz#04db447b13c96b992eb31685266f4ed0d9736dc2" + dependencies: + commander "2.9.0" + lodash.clone "4.3.2" + manage-path "2.0.0" + spawn-command "0.0.2-1" + optionator@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -3235,6 +3309,10 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-key@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" + path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -3793,6 +3871,14 @@ source-map@~0.2.0: dependencies: amdefine ">=0.0.4" +spawn-command@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" + +spawn-command@0.0.2-1: + version "0.0.2-1" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + spawn-sync@^1.0.15: version "1.0.15" resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476" @@ -3956,6 +4042,10 @@ strip-dirs@^1.1.1: minimist "^1.1.0" sum-up "^1.0.1" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + strip-json-comments@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" @@ -4229,7 +4319,7 @@ wbuf@^1.1.0, wbuf@^1.4.0: dependencies: minimalistic-assert "^1.0.0" -which@1, which@^1.2.12, which@^1.2.9: +which@1, which@^1.2.12, which@^1.2.8, which@^1.2.9: version "1.2.12" resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" dependencies: From 685c80a4ff51bf28389576c56ca6e38b114e1942 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Mon, 2 Jan 2017 17:51:39 -0600 Subject: [PATCH 16/19] 0.0.33 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7054d6a..f6f1e43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clan-fp", - "version": "0.0.32", + "version": "0.0.33", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", From 3655b3ca700085d1cbd5c92a5dfb16cc9df6d62b Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Mon, 2 Jan 2017 17:52:35 -0600 Subject: [PATCH 17/19] comitting and pushing new patch version --- package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index f6f1e43..85d96f0 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "cross-env": "^3.1.3", "fast-async": "^6.2.0", "fuse-box": "^1.3.36", + "ghooks": "^2.0.0", "husky": "^0.12.0", "now": "^0.37.1", "npm-run-all": "^3.1.1", @@ -32,8 +33,5 @@ "rimraf": "^2.5.4", "uglify-js": "^2.7.5", "yarn": "^0.18.1" - }, - "dependencies": { - "ghooks": "^2.0.0" } } From 76b921038d9ba733f90d7efcc76fd2bf6809eeb6 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Mon, 2 Jan 2017 17:58:57 -0600 Subject: [PATCH 18/19] comitting and pushing new patch version --- fuse.js | 2 +- package.json | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/fuse.js b/fuse.js index 5bfabdb..e855046 100644 --- a/fuse.js +++ b/fuse.js @@ -29,7 +29,7 @@ let c = { const processAll = $ => { let d = Object.assign({}, c) , inFile = d.inFile - d.plugins = d.plugins(d.browser || false) + d.plugins = d.plugins(!!d.browser) f.FuseBox.init(d).bundle(inFile) } diff --git a/package.json b/package.json index 85d96f0..036fe0d 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,28 @@ { "name": "clan-fp", "version": "0.0.33", + "description": "A set of opinionated, functional utilities that work particularly well when used together", "scripts": { "prestart": "rimraf .fusebox build", "start": "node fuse", "prebuild": "rimraf .fusebox build", "build": "cross-env NODE_ENV=production node fuse", "push": "git add . && git commit -am \"comitting and pushing new patch version\" && git push origin --all", - "deploy": "npm-run-all build push n", - "n": "npm version patch && npm publish" + "deploy": "npm-run-all build push release n", + "n": "npm version patch && npm publish", + "release": "release" }, + "repository": { + "type": "git", + "url": "git@github.com/matthiasak/clan" + }, + "keywords": [ + "fp", + "observables", + "immutable", + "data", + "server" + ], "main": "build/index.js", "module": "src/index.js", "author": "Matt Keas (@matthiasak)", From 7e54a9108b32919e281f98caffe742c7f514a976 Mon Sep 17 00:00:00 2001 From: Matt Keas Date: Tue, 3 Jan 2017 11:34:39 -0600 Subject: [PATCH 19/19] comitting and pushing new patch version --- build/index.js | 106 +++++++++++++++++++++++++++++++++++++++++++++ build/index.js.map | 2 +- fuse.js | 2 +- 3 files changed, 108 insertions(+), 2 deletions(-) diff --git a/build/index.js b/build/index.js index f4421c5..e8d1357 100644 --- a/build/index.js +++ b/build/index.js @@ -1590,6 +1590,112 @@ var concatter = exports.concatter = function concatter(thing, value) { }; }); }); +FuseBox.pkg("process", {}, function(___scope___){ +___scope___.file("index.js", function(exports, require, module, __filename, __dirname){ + +// From https://github.com/defunctzombie/node-process/blob/master/browser.js +// shim for using process in browser +if (FuseBox.isServer) { + module.exports = global.process; +} else { + var productionEnv = false; //require('@system-env').production; + + var process = module.exports = {}; + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); + } + + process.nextTick = function(fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } + }; + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function() { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = { + NODE_ENV: productionEnv ? 'production' : 'development' + }; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + 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'); + }; + process.umask = function() { return 0; }; + +} +}); +return ___scope___.entry = "index.js"; +}); FuseBox.expose([{"alias":"clan-fp","pkg":"default"}]); FuseBox.import("clan-fp/index.js"); diff --git a/build/index.js.map b/build/index.js.map index aa63145..e13229f 100644 --- a/build/index.js.map +++ b/build/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["index.js","batch.js","vdom.js","mixin.js","model.js","observable.js","hamt.js","worker.js","fp.js"],"names":["hamt","worker","fp","hash","v","_v","JSON","stringify","i","len","length","c","charCodeAt","module","exports","Object","assign","batch","vdom","mixin","model","obs","inflight","url","options","method","key","toLowerCase","f","compress","Promise","res","rej","then","d","catch","e","undefined","data","console","error","rAF","document","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","setTimeout","cb","class_id_regex","tagName_regex","parseSelector","test","tagreg","exec","s","tag","slice","reg","create","substr","className","trim","id","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","m","selector","children","attrs","Array","Function","unshift","shouldUpdate","unload","config","__hash","stripEvents","a","name","applyEvents","events","el","strip_existing","removeEvents","flatten","arr","push","EVENTS","split","map","x","mnt","mount","fn","render","applyUpdates","update","stylify","style","setAttrs","attr","innerHTML","value","setAttribute","_id","_className","createTag","parent","parentElement","__vdom","t","createTextNode","insertBefore","removeEl","appendChild","shouldExchange","tagName","_shouldUpdate","createElement","removeChild","insertAt","next_sib","resolve","_el","vdom_children","el_children","childNodes","qs","querySelector","resolver","states","promises","done","_await","_promises","finish","ms","isDone","total","all","props","keys","forEach","getState","gs","view","state","r","instance","container","queries","wrapper_view","reservedAttrs","toHTML","_vdom","html","_class","_attrs","inner","indexOf","str","filter","join","classes","_mixin","proto","prototype","p","getOwnPropertyNames","oldFn","apply","call","arguments","is","type","isValid","String","Number","Boolean","check","types","required","reduce","_type","MODEL","init","logic","pipe","whenValid","ArrayOf","M","subscribers","val","o","take","n","values","delete","takeWhile","acc","maybe","success","stop","ts","Date","now","from","union","fs","hamming","popcount","root","sum","comp","b","HMAP_SIZE","MAX_DEPTH","vec","h","range","shallowClone","y","cloneNode","node","numChildren","set","newroot","bits","cp","cn","rh","j","__r","__n","vecr","vecn","_r","get","first","unset","_n","item","toList","toOrderedList","toJSON","toJson","pop","shift","k","supports","q","window","supportsWorkers","supportsBlobs","supportsURLs","supportsBuilders","code","B","U","W","blob","append","getBlob","encodeURIComponent","createObjectURL","Worker","farm","workers","fill","current","iter","onerror","w","onmessage","postMessage","log","process","nextTick","g","cof","fns","cob","reverse","pf","curry","bind","mapping","mapper","reducer","result","filtering","predicate","concatter","thing","concat"],"mappings":";;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;IAAYA;;AACZ;;IAAYC;;AACZ;;IAAYC;;;;;;AAEL,IAAMC,sBAAO,cAACC,CAAD,EAA4B;AAAA,QAAzBC,EAAyB,uEAAtBC,KAAKC,SAAL,CAAeH,CAAf,CAAsB;;AAC5C,QAAID,OAAO,CAAX;AACA,SAAK,IAAIK,IAAI,CAAR,EAAWC,MAAMJ,GAAGK,MAAzB,EAAiCF,IAAIC,GAArC,EAA0C,EAAED,CAA5C,EAA+C;AAC3C,YAAMG,IAAIN,GAAGO,UAAH,CAAcJ,CAAd,CAAV;AACAL,eAAS,CAACA,QAAQ,CAAT,IAAcA,IAAf,GAAuBQ,CAAxB,GAA6B,CAApC;AACH;AACD,WAAOR,IAAP;AACH,CAPM;;AASPU,OAAOC,OAAP,GAAiBC,OAAOC,MAAP,CAAc,EAAd,EAAkBd,EAAlB,EAAsB;AACtCe,0BADsC;AAEpCC,wBAFoC;AAGpCC,0BAHoC;AAIpCC,0BAJoC;AAKpCC,6BALoC;AAMpCrB,cANoC;AAOpCC;AAPoC,CAAtB,CAAjB;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;;AAEA;AACA,IAAMgB,QAAQ,SAARA,KAAQ,IAAK;AACf,QAAIK,WAAW,EAAf;;AAEA,WAAO,UAACC,GAAD,EAAqB;AAAA,YAAfC,OAAe,uEAAP,EAAO;AACpB,YAACC,MAAD,GAAWD,OAAX,CAACC,MAAD;AAAA,YACAC,GADA,GACSH,GADT,SACgBjB,KAAKC,SAAL,CAAeiB,OAAf,CADhB;;;AAGJ,YAAG,CAACC,UAAU,EAAX,EAAeE,WAAf,OAAiC,MAApC,EACI,OAAOC,EAAEL,GAAF,EAAOR,OAAOC,MAAP,CAAc,EAAd,EAAkBQ,OAA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AAMiO,4BAAU,SAAVA,OAAU,CAACC,MAAD;AAAA,WAAY;AAC/B,kBAACC,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI0L,QAAQC,MAAR,EAAgBF,OAAOzL,KAAP,CAAhB,CADJ;AAAA;AADJ;AAAA;AADmB;AAAA,CAAhB;;AAKA,IAAM4L,gCAAY,SAAZA,SAAY,CAACC,SAAD;AAAA,WAAe;AACpC,kBAACH,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI6L,UAAU7L,KAAV,IAAmB0L,QAAQC,MAAR,EAAgB3L,KAAhB,CAAnB,GAA4C2L,MADhD;AAAA;AADJ;AAAA;AADqB;AAAA,CAAlB;;AAKA,IAAMG,gCAAY,SAAZA,SAAY,CAACC,KAAD,EAAQ/L,KAAR;AAAA,WACrB+L,MAAMC,MAAN,CAAa,CAAChM,KAAD,CAAb,CADqB;AAAA,CAAlB","file":"","sourcesContent":["import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = Object.assign({}, fp, {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n})\n","\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n"]} \ No newline at end of file +{"version":3,"sources":["index.js","batch.js","vdom.js","mixin.js","model.js","observable.js","hamt.js","worker.js","fp.js","packages/process@0.0.0"],"names":["hamt","worker","fp","hash","v","_v","JSON","stringify","i","len","length","c","charCodeAt","module","exports","Object","assign","batch","vdom","mixin","model","obs","inflight","url","options","method","key","toLowerCase","f","compress","Promise","res","rej","then","d","catch","e","undefined","data","console","error","rAF","document","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","setTimeout","cb","class_id_regex","tagName_regex","parseSelector","test","tagreg","exec","s","tag","slice","reg","create","substr","className","trim","id","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","m","selector","children","attrs","Array","Function","unshift","shouldUpdate","unload","config","__hash","stripEvents","a","name","applyEvents","events","el","strip_existing","removeEvents","flatten","arr","push","EVENTS","split","map","x","mnt","mount","fn","render","applyUpdates","update","stylify","style","setAttrs","attr","innerHTML","value","setAttribute","_id","_className","createTag","parent","parentElement","__vdom","t","createTextNode","insertBefore","removeEl","appendChild","shouldExchange","tagName","_shouldUpdate","createElement","removeChild","insertAt","next_sib","resolve","_el","vdom_children","el_children","childNodes","qs","querySelector","resolver","states","promises","done","_await","_promises","finish","ms","isDone","total","all","props","keys","forEach","getState","gs","view","state","r","instance","container","queries","wrapper_view","reservedAttrs","toHTML","_vdom","html","_class","_attrs","inner","indexOf","str","filter","join","classes","_mixin","proto","prototype","p","getOwnPropertyNames","oldFn","apply","call","arguments","is","type","isValid","String","Number","Boolean","check","types","required","reduce","_type","MODEL","init","logic","pipe","whenValid","ArrayOf","M","subscribers","val","o","take","n","values","delete","takeWhile","acc","maybe","success","stop","ts","Date","now","from","union","fs","hamming","popcount","root","sum","comp","b","HMAP_SIZE","MAX_DEPTH","vec","h","range","shallowClone","y","cloneNode","node","numChildren","set","newroot","bits","cp","cn","rh","j","__r","__n","vecr","vecn","_r","get","first","unset","_n","item","toList","toOrderedList","toJSON","toJson","pop","shift","k","supports","q","window","supportsWorkers","supportsBlobs","supportsURLs","supportsBuilders","code","B","U","W","blob","append","getBlob","encodeURIComponent","createObjectURL","Worker","farm","workers","fill","current","iter","onerror","w","onmessage","postMessage","log","process","nextTick","g","cof","fns","cob","reverse","pf","curry","bind","mapping","mapper","reducer","result","filtering","predicate","concatter","thing","concat"],"mappings":";;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;IAAYA;;AACZ;;I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AAAA;AADJ;AAAA;AADmB;AAAA,CAAhB;;AAKA,IAAM4L,gCAAY,SAAZA,SAAY,CAACC,SAAD;AAAA,WAAe;AACpC,kBAACH,OAAD;AAAA,mBAAa;AACT,0BAACC,MAAD,EAAS3L,KAAT;AAAA,2BACI6L,UAAU7L,KAAV,IAAmB0L,QAAQC,MAAR,EAAgB3L,KAAhB,CAAnB,GAA4C2L,MADhD;AAAA;AADJ;AAAA;AADqB;AAAA,CAAlB;;AAKA,IAAMG,gCAAY,SAAZA,SAAY,CAACC,KAAD,EAAQ/L,KAAR;AAAA,WACrB+L,MAAMC,MAAN,CAAa,CAAChM,KAAD,CAAb,CADqB;AAAA,CAAlB;;;AC5CP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"","sourcesContent":["import batch from './batch'\nimport vdom from './vdom'\nimport mixin from './mixin'\nimport model from './model'\nimport obs from './observable'\nimport * as hamt from './hamt'\nimport * as worker from './worker'\nimport * as fp from './fp'\n\nexport const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n}\n\nmodule.exports = Object.assign({}, fp, {\n\tbatch\n\t, vdom\n\t, mixin\n\t, model\n\t, obs\n\t, hamt\n\t, worker\n})\n","\n// batched requests\n// The `fetch()` module batches in-flight requests, so if at any point in time, anywhere in my front-end or\n// back-end application I have a calls occur to `fetch('http://api.github.com/users/matthiasak')` while another\n// to that URL is \"in-flight\", the Promise returned by both of those calls will be resolved by a single network request.\n\n// f :: (url -> options) -> Promise\nconst batch = f => {\n let inflight = {}\n\n return (url, options={}) => {\n let {method} = options,\n key = `${url}:${JSON.stringify(options)}`\n\n if((method || '').toLowerCase() === 'post')\n return f(url, Object.assign({}, options, {compress: false}))\n\n return inflight[key] ||\n (inflight[key] =\n new Promise((res,rej) => {\n f(url, Object.assign({}, options, {compress: false}))\n .then(d => res(d))\n .catch(e => rej(e))\n })\n .then(data => {\n inflight = Object.assign({}, inflight, {[key]: undefined})\n return data\n })\n .catch(e =>\n console.error(e, url)))\n }\n}\n\nexport default batch","const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n (cb => setTimeout(cb, 16.6))\n\n// Virtual DOMs\nconst vdom = () => {\n const class_id_regex = () => {\n return /[#\\.][^#\\.]+/ig\n },\n tagName_regex = () => {\n return /^([^\\.#]+)\\b/i\n }\n\n const parseSelector = s => {\n let test = null,\n tagreg = tagName_regex().exec(s),\n tag = tagreg && tagreg.slice(1)[0],\n reg = class_id_regex(),\n vdom = Object.create(null)\n\n if(tag) s = s.substr(tag.length)\n vdom.className = ''\n vdom.tag = tag || 'div'\n\n while((test = reg.exec(s)) !== null){\n test = test[0]\n if(test[0] === '.')\n vdom.className = (vdom.className+' '+test.substr(1)).trim()\n else if(test[0] === '#')\n vdom.id = test.substr(1)\n }\n return vdom\n }\n\n const debounce = (func, wait, immediate, timeout) =>\n (...args) => {\n let later = () => {\n timeout = null\n !immediate && func(...args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait || 0)\n callNow && func(...args)\n }\n\n const hash = (v,_v=JSON.stringify(v)) => {\n let hash = 0\n for (let i = 0, len = _v.length; i < len; ++i) {\n const c = _v.charCodeAt(i)\n hash = (((hash << 5) - hash) + c) | 0\n }\n return hash\n }\n\n const m = (selector, attrs=Object.create(null), ...children) => {\n if(attrs.tag || !(typeof attrs === 'object') || attrs instanceof Array || attrs instanceof Function){\n if(attrs instanceof Array) children.unshift(...attrs)\n else children.unshift(attrs)\n attrs = Object.create(null)\n }\n let vdom = parseSelector(selector)\n if(children.length)\n vdom.children = children\n vdom.attrs = attrs\n vdom.shouldUpdate = attrs.shouldUpdate\n vdom.unload = attrs.unload\n vdom.config = attrs.config\n vdom.__hash = hash(vdom)\n delete attrs.unload\n delete attrs.shouldUpdate\n delete attrs.config\n return vdom\n }\n\n // creatign html, strip events from DOM element... for now just deleting\n const stripEvents = ({attrs}) => {\n let a = Object.create(null)\n\n if(attrs){\n for(var name in attrs){\n if(name[0]==='o'&&name[1]==='n') {\n a[name] = attrs[name]\n delete attrs[name]\n }\n }\n }\n\n return a\n }\n\n const applyEvents = (events, el, strip_existing=true) => {\n strip_existing && removeEvents(el)\n for(var name in events){\n el[name] = events[name]\n }\n }\n\n const flatten = (arr, a=[]) => {\n for(var i=0,len=arr.length; i 'on'+x)\n\n const removeEvents = el => {\n // strip away event handlers on el, if it exists\n if(!el) return;\n for(var i in EVENTS){\n el[i] = null\n }\n }\n\n let mnt\n\n const mount = (fn, el) => {\n mnt = [el, fn]\n render(fn, el)\n }\n\n const render = debounce((fn, el) => rAF(_ => {\n applyUpdates(fn, el.children[0], el)\n }))\n\n const update = () => {\n if(!mnt) return\n let [el, fn] = mnt\n render(fn, el)\n }\n\n const stylify = style => {\n let s = ''\n for(var i in style){\n s+=`${i}:${style[i]};`\n }\n return s\n }\n\n const setAttrs = ({attrs, id, className, __hash},el) => {\n \tel.className = ''\n \tel.style = ''\n\n if(attrs){\n for(var attr in attrs){\n if(attr === 'style') {\n el.style = stylify(attrs[attr])\n } else if(attr === 'innerHTML'){\n rAF(() => el.innerHTML = attrs[attr])\n } else if(attr === 'value'){\n rAF(() => el.value = attrs[attr])\n } else {\n el.setAttribute(attr, attrs[attr])\n }\n }\n }\n let _id = attrs.id || id\n if(_id) el.id = _id\n let _className = ((attrs.className || '') + ' ' + (className || '')).trim()\n if(_className) el.className = _className\n el.__hash = __hash\n }\n\n // recycle or create a new el\n const createTag = (vdom=Object.create(null), el, parent=el&&el.parentElement) => {\n let __vdom = vdom\n // make text nodes from primitive types\n if(typeof vdom !== 'object'){\n let t = document.createTextNode(vdom)\n if(el){\n parent.insertBefore(t,el)\n removeEl(el)\n } else {\n parent.appendChild(t)\n }\n return t\n }\n\n // else make an HTMLElement from \"tag\" types\n let {tag, attrs, id, className, unload, shouldUpdate, config, __hash} = vdom,\n shouldExchange = !el || !el.tagName || (tag && el.tagName.toLowerCase() !== tag.toLowerCase()),\n _shouldUpdate = !(shouldUpdate instanceof Function) || shouldUpdate(el)\n\n if(!attrs) return\n if(el && (!_shouldUpdate || ((!vdom instanceof Function) && el.__hash === __hash))) {\n return\n }\n\n if(shouldExchange){\n let t = document.createElement(tag)\n el ? (parent.insertBefore(t, el), removeEl(el)) : parent.appendChild(t)\n el = t\n }\n\n setAttrs(vdom, el)\n if(el.unload instanceof Function) {\n rAF(el.unload)\n }\n if(unload instanceof Function) {\n el.unload = unload\n }\n applyEvents(stripEvents(vdom), el)\n config && rAF(_ => config(el))\n return el\n }\n\n // find parent element, and remove the input element\n const removeEl = el => {\n if(!el) return\n el.parentElement.removeChild(el)\n removeEvents(el)\n // removed for now, added unload logic to the immediate draw()s\n if(el.unload instanceof Function)\n el.unload()\n }\n\n const insertAt = (el, parent, i) => {\n if(parent.children.length > i) {\n let next_sib = parent.children[i]\n parent.insertBefore(el, next_sib)\n } else {\n parent.appendChild(el)\n }\n }\n\n const applyUpdates = (vdom, el, parent=el&&el.parentElement) => {\n let v = vdom\n // if vdom is a function, execute it until it isn't\n while(vdom instanceof Function)\n vdom = vdom()\n\n if(!vdom) return\n\n if(vdom.resolve instanceof Function){\n let i = parent.children.length\n return vdom.resolve().then(v => {\n if(!el) {\n let x = createTag(v, null, parent)\n insertAt(x, parent, i)\n applyUpdates(v, x, parent)\n } else {\n applyUpdates(v, el, parent)\n }\n })\n }\n\n // create/edit el under parent\n let _el = vdom instanceof Array ? parent : createTag(vdom, el, parent)\n\n if(!_el) return\n\n if(vdom instanceof Array || vdom.children){\n let vdom_children = flatten(vdom instanceof Array ? vdom : vdom.children),\n el_children = vdom instanceof Array ? parent.childNodes : _el.childNodes\n\n while(el_children.length > vdom_children.length){\n removeEl(el_children[el_children.length-1])\n }\n\n for(let i=0; i 0){\n removeEl(_el.childNodes[_el.childNodes.length-1])\n }\n }\n }\n\n const qs = (s='body', el=document) => el.querySelector(s)\n\n const resolver = (states = {}) => {\n let promises = [],\n done = false\n\n const _await = (_promises = []) => {\n promises = [...promises, ..._promises]\n return finish()\n }\n\n const wait = (ms=0) => new Promise(res => setTimeout(res, ms))\n\n const isDone = () => done\n\n const finish = () => {\n const total = promises.length\n return wait().then(_ => Promise.all(promises)).then(values => {\n if(promises.length > total){\n return finish()\n }\n done = true\n return states\n })\n }\n\n const resolve = (props) => {\n const keys = Object.keys(props)\n if (!keys.length)\n return Promise.resolve(true)\n\n let f = []\n keys.forEach(name => {\n let x = props[name]\n\n while(x instanceof Function)\n x = x()\n\n if(x && x.then instanceof Function)\n f.push(x.then(d => states[name] = d))\n })\n\n return _await(f)\n }\n\n const getState = () => states\n\n return { finish, resolve, getState, promises, isDone }\n }\n\n const gs = (view, state) => {\n let r = view(state)\n while(r instanceof Function)\n r = view(instance.getState())\n return r\n }\n\n const container = (view, queries={}, instance=resolver()) => {\n let wrapper_view = state =>\n instance.isDone() ? view(state) : m('span')\n\n return () => {\n let r = gs(wrapper_view, instance.getState())\n instance.resolve(queries)\n\n if(r instanceof Array) {\n let d = instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r.map((x,i) => {\n x.resolve = _ => d.then(vdom => vdom[i])\n return x\n })\n }\n\n r.resolve = _ => instance.finish().then(_ =>\n gs(wrapper_view, instance.getState()))\n\n return r\n }\n }\n\n const reservedAttrs = ['className','id']\n\n const toHTML = _vdom => {\n while(_vdom instanceof Function) _vdom = _vdom()\n if(_vdom instanceof Array) return new Promise(r => r(html(..._vdom)))\n if(!_vdom) return new Promise(r => r(''))\n if(typeof _vdom !== 'object') return new Promise(r => r(_vdom))\n return (_vdom.resolve ? _vdom.resolve() : Promise.resolve()).then(vdom => {\n if(!vdom) vdom = _vdom\n\n if(vdom instanceof Array) return new Promise(r => r(html(...vdom)))\n\n const {tag, id, className, attrs, children, instance} = vdom,\n _id = (id || (attrs && attrs.id)) ? ` id=\"${(id || (attrs && attrs.id) || '')}\"` : '',\n _class = (className || (attrs && attrs.className)) ? ` class=\"${((className||'') + ' ' + (attrs.className||'')).trim()}\"` : ''\n\n const events = stripEvents(vdom)\n let _attrs = '',\n inner = ''\n for(var i in (attrs || Object.create(null))){\n if(i === 'style'){\n _attrs += ` style=\"${stylify(attrs[i])}\"`\n } else if(i === 'innerHTML') {\n inner = attrs[i]\n } else if(reservedAttrs.indexOf(i) === -1){\n _attrs += ` ${i}=\"${attrs[i]}\"`\n }\n }\n\n if(!inner && children)\n return html(...children).then(str =>\n `<${tag}${_id}${_class}${_attrs}>${str}`)\n\n if('br,input,img'.split(',').filter(x => x===tag).length === 0)\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs}>${inner}`))\n\n return new Promise(r => r(`<${tag}${_id}${_class}${_attrs} />`))\n })\n }\n\n const html = (...v) => Promise.all(v.map(toHTML)).then(x => x.filter(x => !!x).join(''))\n\n return {container, html, qs, update, mount, m, debounce}\n}\n\nmodule.exports = vdom()\n\n/*\nusage:\n\nlet component = () =>\n new Array(20).fill(true).map(x =>\n m('div', {onMouseOver: e => log(e.target.innerHTML)}, range(1,100)))\n\nclient-side\n-----\nmount(component, qs())\n\nclient-side constant re-rendering\n-----\nconst run = () => {\n setTimeout(run, 20)\n update()\n}\nrun()\n*/\n\n/* CONTAINER / HTML USAGE (Server-side rendering)\n\nconst name = _ => new Promise(res => setTimeout(_ => res('matt'), 1500))\n\nlet x = container(data => [\n m('div.test.row', {className:'hola', 'data-name':data.name, style:{border:'1px solid black'}}),\n m('div', data.name),\n ],\n {name}\n)\n\nhtml(x).then(x => log(x)).catch(e => log(e+''))\n*/\n","\nconst mixin = (...classes) => {\n class _mixin {}\n\n let proto = _mixin.prototype\n\n classes.map(({prototype:p}) => {\n Object.getOwnPropertyNames(p).map(key => {\n let oldFn = proto[key] || ($ => {})\n proto[key] = function() {\n oldFn.apply(null, [].slice.call(arguments))\n return p[key].apply(null, [].slice.call(arguments))\n }\n })\n })\n\n return _mixin\n}\n\nmodule.exports = mixin","// Validate JS objects for their \"shape\"\nconst model = {\n is(type, value) {\n if(type && type.isValid instanceof Function){\n return type.isValid(value)\n } else if((type === String && ((value instanceof String) || typeof value === 'string'))\n || (type === Number && ((value instanceof Number) || typeof value === 'number'))\n || (type === Boolean && ((value instanceof Boolean) || typeof value === 'boolean'))\n || (type === Function && ((value instanceof Function) || typeof value === 'function'))\n || (type === Object && ((value instanceof Object) || typeof value === 'object'))\n || (type === undefined)\n ){\n return true\n }\n\n return false\n },\n check(types, required, data) {\n Object.keys(types).forEach(key => {\n let t = types[key],\n value = data[key]\n\n if(required[key] || value !== undefined){\n if(!(t instanceof Array)) t = [t]\n\n let i = t.reduce((a,_type) => a || MODEL.is(_type, value), false)\n if(!i) {\n throw `{${key}: ${JSON.stringify(value)}} is not one of ${t.map(x => `\\n - ${x}`)}`\n }\n }\n })\n\n return true\n },\n init(...args) {\n let types, required, logic\n args.map(x => {\n if(x instanceof Function && !logic){ logic = x }\n else if(typeof x === 'object') {\n if(!types){ types = x }\n else if(!required){ required = x }\n }\n })\n\n const isValid = (data) => {\n const pipe = logic ? [check, logic] : [check]\n return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)\n }\n\n const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))\n\n return {isValid, whenValid}\n },\n ArrayOf(M) {\n return MODEL.init((t,r,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!MODEL.is(M, x))\n throw `${x} is not a model instance`\n })\n return true\n })\n }\n}\n\nexport default model\n\n/**\nUse it\n\n// create a Name model with required first/last,\n// but optional middle\nlet Name = MODEL.init({\n first: String,\n middle: String,\n last: String\n}, {first:true, last:true})\n\n// create a Tags model with extra checks\nlet Tags = MODEL.init((types,required,data) => {\n if(!(data instanceof Array)) throw `${data} not an Array`\n data.map(x => {\n if(!is(String, x))\n throw `[${data}] contains non-String`\n })\n return true\n})\n\n// create a Price model that just has a business logic fn\nlet Price = MODEL.init((t,r,d) => {\n return (d instanceof Number || typeof d === 'number') && d !== 0\n})\n\n// create an Activity model with a required type and name,\n// all others optional\nlet Activity = MODEL.init({\n type: [String, Function, Number],\n latlng: Array,\n title: String,\n tags: Tags,\n name: Name,\n price: Price\n}, {name:true, price: true})\n\n// create a new Activity instance, throwing errors if there are\n// any invalid fields.\nlet a = {\n tags: ['1','2'],\n type: 1,\n name: {first:'matt',last:'keas'},\n price: 100.43,\n url: 'http://www.google.com'\n}\nActivity.whenValid(a).then(log).catch(e => log(e+''))\n**/\n","// async-supporting-observables\nconst obs = (state) => {\n let subscribers = []\n\n const fn = (val) => {\n if(val !== undefined){\n state = val\n for(let i = 0, len = subscribers.length; i {\n const o = obs()\n subscribers.push(val => o(f(val)))\n return o\n }\n\n fn.filter = f => {\n const o = obs()\n subscribers.push(val => f(val) && o(val))\n return o\n }\n\n fn.then = f => {\n subscribers.push(val => f(val))\n return fn\n }\n\n fn.take = (n) => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(values.length < n)\n values.push(val)\n\n if(values.length === n) {\n subscribers.delete(cb)\n return o(values)\n }\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.takeWhile = f => {\n const values = [],\n \to = obs()\n\n const cb = val => {\n if(!f(val)) {\n subscribers = subscribers.filter(x => x !== cb)\n return o(values)\n }\n\n\t\t\tvalues.push(val)\n }\n\n subscribers.push(cb)\n\n return o\n }\n\n fn.reduce = (f,acc) => {\n const o = obs()\n\n subscribers.push(val => {\n acc = f(acc,val)\n o(acc)\n })\n\n return o\n }\n\n fn.maybe = f => {\n const success = obs(),\n error = obs(),\n cb = val =>\n \t\tf(val)\n\t\t\t\t .then(d => success(d))\n .catch(e => error(e))\n\n subscribers.push(cb)\n\n return [ success, error ]\n }\n\n fn.stop = () => subscribers = []\n\n fn.debounce = ms => {\n const o = obs()\n let ts = +new Date\n subscribers.push(val => {\n const now = +new Date\n if(now - ts >= ms){\n ts = +new Date\n o(val)\n }\n })\n return o\n }\n\n return fn\n}\n\nobs.from = f => {\n const o = obs()\n f(x => o(x))\n return o\n}\n\nobs.union = (...fs) => {\n const o = obs()\n fs.map(f => f.then(o))\n return o\n}\n\nexport default obs","// compute the hamming weight\nexport const hamming = x => {\n x -= ((x >> 1) & 0x55555555)\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333)\n x = (x + (x >> 4)) & 0x0f0f0f0f\n x += (x >> 8)\n x += (x >> 16)\n return (x & 0x7f)\n}\n\nexport const popcount = root => {\n if(root.key)\n return 1\n\n let c = root.children\n if(c) {\n var sum = 0\n for(var i in c) sum += popcount(c[i])\n return sum\n }\n}\n\n// hash fn\nexport const hash = (v='') => {\n v = JSON.stringify(v)\n var hash = 5381\n for (let i = 0; i < v.length; i++)\n hash = ((hash << 5) + hash) + v.charCodeAt(i)\n return hash\n}\n\n// compare two hashes\nexport const comp = (a,b) => hash(a) === hash(b)\n\n// get a bit vector\nexport const HMAP_SIZE = 8\nexport const MAX_DEPTH = 32 / HMAP_SIZE - 1\nexport const vec = (h=0, i=0, range=HMAP_SIZE) => (h >>> (range*i)) & ((1 << range) - 1)\n\nexport const shallowClone = x => {\n let y = Object.create(null)\n for(let i in x)\n y[i] = x[i]\n return y\n}\n\nexport const cloneNode = x => {\n let y = node()\n if(!x) return y\n\n if(x.children) {\n y.children = shallowClone(x.children)\n } else if(x.key !== undefined) {\n y.key = x.key\n y.val = x.val\n y.hash = x.hash\n }\n\n return y\n}\n\nexport const numChildren = x => {\n let c = 0\n for(var i in x) ++c\n return c\n}\n\nexport const set = (root, key, val) => {\n if((root.key === undefined) && !root.children) return node(key, val)\n\n const newroot = cloneNode(root), h = hash(key)\n\n // walk the tree\n for(var i = 3, r = root, n = newroot; i >= 0; --i){\n let bits = vec(h, i)\n\n if(r.key !== undefined){\n // if we have a collision\n if(r.key === key || i === 0) {\n // if keys match or is leaf, just overwrite n's val\n n.val = val\n } else if(i !== 0) {\n // else if r is not at max depth and keys don't match\n // add levels to both trees, new tree must be able\n // to access old data\n\n // 0. create makeshift value node for r\n // and new value node for n\n let cp = node(r.key, r.val, r.hash)\n let cn = node(key, val, h)\n let rh = r.hash\n\n // 1. delete value props from nodes\n delete r.key\n delete r.val\n delete r.hash\n delete n.key\n delete n.val\n delete n.hash\n\n // 2. create layers until bit-vectors don't collide\n for(let j = i, __r = r, __n = n; j >= 0; j--){\n let vecr = vec(rh, j),\n vecn = vec(h, j)\n\n // create new layer for c and r\n let c = __r.children = Object.create(null)\n let d = __n.children = shallowClone(c)\n\n if(vecr !== vecn) {\n c[vecr] = cp\n d[vecr] = cp\n d[vecn] = cn\n break\n } else {\n __r = c[vecr] = node()\n __n = d[vecn] = cloneNode(__r)\n }\n }\n }\n break\n } else if(r.children) {\n let _r = r.children[bits]\n if(!_r) {\n n = n.children[bits] = node(key, val)\n break\n } else {\n r = _r\n n = n.children[bits] = cloneNode(r)\n }\n }\n }\n\n return newroot\n}\n\nexport const get = (root, key) => {\n if(root.key === key) return root.val\n const h = hash(key)\n for(let i = 3, r = root; i >= 0; --i){\n if(!r.children) return undefined\n r = r.children[vec(h, i)]\n if(!r) return undefined\n if(r.key !== undefined) return r.val\n }\n\n return undefined\n}\n\nexport const first = root => {\n let c = root.children\n for(let i in c) return c[i]\n}\n\nexport const unset = (root, key) => {\n const n = cloneNode(root),\n h = hash(key)\n\n for(var i = 3, _n = n, p = n; i >= -1; --i) {\n if(_n.key) {\n delete _n.key\n delete _n.val\n delete _n.hash\n return n\n\n// let c = numChildren(p)\n\n// if(c === 1) {\n// // if only child, delete child and parent?\n// delete p.children\n// } else if(c===2){\n// // if 2 children, promote sibling as parent value nod\n// delete p.children[bits]\n// let sibling = first(p)\n// delete p.children\n// if(sibling.children){\n// p.children = sibling.children\n// } else if(p.key) {\n// p.val = sibling.val\n// p.hash = sibling.hash\n// p.key = sibling.key\n// }\n// } else {\n// // if more than 2 children, just delete the one\n// delete p.children[bits]\n// }\n// return n\n }\n\n const bits = vec(h, i)\n _n = _n && _n.children && _n.children[bits]\n if(!_n) return n\n p = _n\n }\n return n\n}\n\nexport const node = (key,val,h= key !== undefined && hash(key)) => {\n /*\n potential props of a tree node\n - key - hashkey\n - val - value\n - children - { ... } -> points to other nodes (List children)\n */\n\n let item = Object.create(null)\n if(key !== undefined){\n item.key = key\n item.hash = h\n item.val = val\n }\n return item\n}\n\nexport const map = (root, fn) => {\n if(root.key !== undefined)\n return node(root.key, fn(root.val, root.key), root.hash)\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n c[i] = map(c[i], fn)\n }\n }\n\n return d\n}\n\nexport const filter = (root, fn) => {\n if(root.key !== undefined)\n return fn(root.val, root.key) ? root : undefined\n\n let d = cloneNode(root),\n c = d.children\n\n if(c) {\n for(var i in c){\n if(!filter(c[i], fn))\n delete c[i]\n }\n }\n\n return d\n}\n\nexport const reduce = (root, fn, acc) => {\n if(root.key !== undefined)\n return fn(acc, root.val, root.key)\n\n let c = root.children\n if(c) {\n for(var i in c)\n acc = reduce(c[i], fn, acc)\n\n return acc\n }\n}\n\nexport const toList = (root, r=[]) => {\n if(root.key !== undefined) r.push(root.val)\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toList(c[i], r)\n }\n }\n\n return r\n}\n\nexport const toOrderedList = (root, r=[]) => {\n let i = 0,\n n\n\n do {\n n = get(root, i++)\n n !== undefined && r.push(n)\n } while(n)\n\n return r\n}\n\nexport const toJSON = (root, r={}) => {\n if(root.key !== undefined)\n r[root.key] = root.val\n\n let c = root.children\n if(c) {\n for(var i in c) {\n toJson(c[i], r)\n }\n }\n\n return r\n}\n\nexport const push = (root, val) => set(root, popcount(root), val)\n\nexport const pop = root => unset(root, popcount(root)-1)\n\nexport const shift = root => reduce(\n unset(root, 0),\n (acc,v,k) => set(acc, k-1, v),\n node())\n\nexport const unshift = (root, val) =>\n set(\n reduce(\n root,\n (acc,v,k) => set(acc, k+1, v),\n node()),\n 0,\n val)\n\nexport const hamt = node\n\n// console.clear()\n// const l = (...args) => console.log(...args)\n// const j = (...a) => console.log(JSON.stringify(a))\n\n// let x = hamt()\n// let s = 20\n\n// Array(s).fill(1).map((v,i) => {\n// x = set(x, i, i)\n// })\n\n// l(toList(x))\n// l(toJson(x))\n\n// x = map(x, x => log(x*x) || x*x)\n// l(get(x, 19))\n\n// l(x)\n// l(reduce(x, (acc, x) => acc+x, 0))\n\n// x = unset(x, 1)\n// Array(s).fill(1).map((_,i) => {\n// if(!get(x, i)) l(i)\n// // l(get(x, i))\n// })","const supports = (...q) => () =>\n q.reduce((acc,s) =>\n acc\n || (window[s] !== undefined)\n && /[native code]/.test(window[s]+'')\n && window[s]\n , false)\n\nconst supportsWorkers = supports('Worker')\n\nconst supportsBlobs = supports('Blob')\n\nconst supportsURLs = supports('URL', 'webkitURL')\n\nconst supportsBuilders = supports('BlobBuilder', 'WebKitBlobBuilder', 'MozBlobBuilder')\n\n/*\nworker:: [X] -> Worker where X : Function | String\n\nthe last X provided in the arguments will be setup as the handler for self.onmessage()\n*/\nexport const worker = (...code) => {\n if(!supportsWorkers()) throw 'WebWorkers not supported'\n\n code[code.length-1] = `self.onmessage=${code[code.length-1]}`\n\n const B = supportsBlobs()\n , U = supportsBuilders()\n , W = supportsURLs()\n\n let blob\n\n if(supportsBlobs()) {\n blob =\n new B(code.map(c => c+''),\n {type: 'application/javascript'})\n\n } else if(U){\n blob = new U\n code.map(c => blob.append(c+''))\n blob = blob.getBlob()\n } else {\n blob = `data:application/javascript,`\n +`${encodeURIComponent(\n code.reduce((acc,c) => acc+c, '')\n )}`\n }\n\n let url = W.createObjectURL(blob)\n return new Worker(url)\n}\n\nexport const farm = (n, ...code) => {\n let workers = Array(n).fill(1).map(x => worker(...code))\n , current = 0\n , iter = () => {\n let _n = current\n ++current >= n && (current = 0)\n return current\n }\n , pipe\n , onerror\n\n workers.map(w => {\n w.onmessage = e => pipe instanceof Function && pipe(e.data)\n w.onerror = e => onerror instanceof Function && onerror(e)\n })\n\n const exec = (...args) => {\n let w = workers[iter()]\n w && w.postMessage(args)\n }\n\n exec.pipe = fn => {\n pipe = fn\n return exec\n }\n exec.error = fn => {\n onerror = fn\n return exec\n }\n return exec\n}\n","export const log = (...a) => console.log(...a)\n\n// rAF\nexport const rAF =\n typeof document !== 'undefined' &&\n (requestAnimationFrame ||\n webkitRequestAnimationFrame ||\n mozRequestAnimationFrame) ||\n process && process.nextTick ||\n (cb => setTimeout(cb, 16.6))\n\n// composition\n// c :: (T -> U) -> (U -> V) -> (T -> V)\nexport const c = (f,g) => x => f(g(x))\n\n// cof :: [(an -> bn)] -> a0 -> bn\n// compose forward\nexport const cof = (...fns) => fns.reduce((acc,fn) => c(acc, fn))\n\n// cob :: [(an -> bn)] -> b0 -> an\n// compose backwards\nexport const cob = (...fns) => cof(...fns.reverse())\n\n// functional utilities\n// pointfree\nexport const pf = fn => (...args) => x => fn.apply(x, args)\n\n// curry\n// curry :: (T -> U) -> [args] -> ( -> U)\nexport const curry = (fn, ...args) =>\n\tfn.bind(undefined, ...args)\n\n\n// Transducers\nexport const mapping = (mapper) => // mapper: x -> y\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n reducer(result, mapper(value))\n\nexport const filtering = (predicate) => // predicate: x -> true/false\n (reducer) => // reducer: (state, value) -> new state\n (result, value) =>\n predicate(value) ? reducer(result, value) : result\n\nexport const concatter = (thing, value) =>\n thing.concat([value])\n",null]} \ No newline at end of file diff --git a/fuse.js b/fuse.js index e855046..4fc937f 100644 --- a/fuse.js +++ b/fuse.js @@ -12,7 +12,7 @@ let c = { , outFile: "./build/index.js.map" } , outFile: "./build/index.js" - , inFile: "> index.js [index.js]" + , inFile: "> index.js [src/**/*.js]" , plugins: (browser) => [ f.BabelPlugin({