├── src ├── index.js ├── feed.js ├── di.js └── signal.js ├── examples ├── public │ ├── favicon.ico │ └── index.html ├── .gitignore ├── src │ ├── index.js │ ├── App.js │ ├── components │ │ ├── ListTodos.js │ │ ├── Footer.js │ │ ├── Todo.js │ │ └── AddingNewToDo.js │ ├── stores │ │ └── ToDosStore.js │ └── index.css └── package.json ├── reports ├── lcov-report │ ├── sort-arrow-sprite.png │ ├── prettify.css │ ├── index.js.html │ ├── feed.jsx.html │ ├── waitFor.js.html │ ├── waitFor.jsx.html │ ├── feed.js.html │ ├── sorter.js │ ├── index.html │ ├── base.css │ ├── di.js.html │ ├── signal.js.html │ └── prettify.js ├── test-results.xml ├── lcov.info └── coverage.raw.json ├── .istanbul.yml ├── test ├── setup.js └── spec │ ├── di.spec.js │ ├── feed.spec.jsx │ └── signal.spec.js ├── .babelrc ├── .gitignore ├── lib ├── index.js ├── waitFor.js ├── feed.js ├── di.js └── signal.js ├── LICENSE ├── package.json └── README.md /src/index.js: -------------------------------------------------------------------------------- 1 | export * from './feed'; 2 | export * from './di'; 3 | export * from './signal'; 4 | -------------------------------------------------------------------------------- /examples/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/hocbox/master/examples/public/favicon.ico -------------------------------------------------------------------------------- /reports/lcov-report/sort-arrow-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/hocbox/master/reports/lcov-report/sort-arrow-sprite.png -------------------------------------------------------------------------------- /.istanbul.yml: -------------------------------------------------------------------------------- 1 | instrumentation: 2 | root: src 3 | extensions: ['.js', '.jsx'] 4 | include-all-sources: true 5 | es-module: true 6 | reporting: 7 | dir: reports 8 | -------------------------------------------------------------------------------- /test/setup.js: -------------------------------------------------------------------------------- 1 | import chai, { expect } from 'chai'; 2 | import sinon from 'sinon'; 3 | import sinonChai from 'sinon-chai'; 4 | 5 | chai.config.truncateThreshold = 0; 6 | 7 | global.expect = expect; 8 | global.sinon = sinon; 9 | 10 | chai.use(sinonChai); 11 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react", 4 | [ "es2015", { "loose": true } ], 5 | "stage-3" 6 | ], 7 | "plugins": [ 8 | "syntax-async-functions", 9 | "transform-html-import-to-string" 10 | ], 11 | "ignore": [ "node_modules/**/*" ] 12 | } 13 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | -------------------------------------------------------------------------------- /examples/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import ToDosStore from './stores/ToDosStore'; 5 | import './index.css'; 6 | 7 | import { register } from '../../lib'; 8 | 9 | const store = new ToDosStore(); 10 | 11 | register({ store }); 12 | 13 | ReactDOM.render( 14 | , 15 | document.getElementById('root') 16 | ); 17 | -------------------------------------------------------------------------------- /examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "feed", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^15.4.2", 7 | "react-dom": "^15.4.2" 8 | }, 9 | "devDependencies": { 10 | "react-scripts": "0.9.5" 11 | }, 12 | "scripts": { 13 | "start": "react-scripts start", 14 | "build": "react-scripts build", 15 | "eject": "react-scripts eject" 16 | } 17 | } -------------------------------------------------------------------------------- /examples/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import AddingNewToDo from './components/AddingNewToDo'; 3 | import ListTodos from './components/ListTodos'; 4 | import Footer from './components/Footer'; 5 | 6 | class App extends Component { 7 | render() { 8 | return ( 9 |
10 | 11 | 12 |
13 |
14 | ); 15 | } 16 | } 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /examples/src/components/ListTodos.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { wire } from '../../../lib'; 3 | import Todo from './Todo'; 4 | 5 | class ListTodos extends React.Component { 6 | render() { 7 | const { todos } = this.props; 8 | 9 | return ( 10 |
11 | { todos.map(todo => ) } 12 |
13 | ) 14 | } 15 | } 16 | 17 | export default wire(ListTodos, ['store'], store => ({ todos: store.getTodos() })); -------------------------------------------------------------------------------- /reports/lcov-report/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 2 | -------------------------------------------------------------------------------- /examples/src/components/Footer.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { wire, signal } from '../../../lib'; 3 | 4 | class Footer extends React.Component { 5 | render() { 6 | const { all, done } = this.props; 7 | const latestAddedTodo = this.props['new-todo']; 8 | 9 | return ( 10 |
11 | Done: { `${ done } / ${ all }` } 12 | Latest: { latestAddedTodo === true ? '...' : latestAddedTodo } 13 |
14 | ); 15 | } 16 | } 17 | 18 | export default wire( 19 | signal(Footer, ['new-todo']), 20 | ['store'], 21 | store => ({ 22 | all: store.getTodos().length, 23 | done: store.getTodos().filter(todo => todo.done).length 24 | }) 25 | ); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | -------------------------------------------------------------------------------- /src/feed.js: -------------------------------------------------------------------------------- 1 | 2 | import React from 'react'; 3 | 4 | export function feed(Component) { 5 | var _listeners = []; 6 | var _defaultFeedProps = {}; 7 | 8 | return class FeedComponent extends React.Component { 9 | static feed(props) { 10 | _defaultFeedProps = props; 11 | if (_listeners.length > 0) _listeners.forEach(l => l(props)); 12 | } 13 | constructor(props) { 14 | super(props); 15 | 16 | this.state = { feedProps: _defaultFeedProps }; 17 | 18 | if (props.feeder) { 19 | _listeners.push(() => this.setState({ feedProps: props.feeder() })); 20 | } else { 21 | _listeners.push(feedProps => this.setState({ feedProps })); 22 | } 23 | } 24 | render() { 25 | return ; 26 | } 27 | }; 28 | } -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | var _feed = require('./feed'); 6 | 7 | Object.keys(_feed).forEach(function (key) { 8 | if (key === "default" || key === "__esModule") return; 9 | Object.defineProperty(exports, key, { 10 | enumerable: true, 11 | get: function get() { 12 | return _feed[key]; 13 | } 14 | }); 15 | }); 16 | 17 | var _di = require('./di'); 18 | 19 | Object.keys(_di).forEach(function (key) { 20 | if (key === "default" || key === "__esModule") return; 21 | Object.defineProperty(exports, key, { 22 | enumerable: true, 23 | get: function get() { 24 | return _di[key]; 25 | } 26 | }); 27 | }); 28 | 29 | var _signal = require('./signal'); 30 | 31 | Object.keys(_signal).forEach(function (key) { 32 | if (key === "default" || key === "__esModule") return; 33 | Object.defineProperty(exports, key, { 34 | enumerable: true, 35 | get: function get() { 36 | return _signal[key]; 37 | } 38 | }); 39 | }); -------------------------------------------------------------------------------- /examples/src/components/Todo.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { signal } from '../../../lib'; 3 | 4 | class Todo extends React.Component { 5 | _markAsDone(id) { 6 | this.props.dispatch('mark-as-done', id); 7 | } 8 | _markAsNotDone(id) { 9 | this.props.dispatch('mark-as-not-done', id); 10 | } 11 | _delete(id) { 12 | this.props.dispatch('delete', id); 13 | } 14 | render() { 15 | const { text, id, done } = this.props.todo; 16 | const status = done ? 17 | mark as not done : 18 | mark as done; 19 | const backgroundColor = done ? '#009f00': 'transparent'; 20 | 21 | return ( 22 |
23 | { text } 24 |
25 | { status } 26 | delete 27 |
28 |
29 | ); 30 | } 31 | } 32 | 33 | export default signal(Todo); -------------------------------------------------------------------------------- /examples/src/stores/ToDosStore.js: -------------------------------------------------------------------------------- 1 | import { subscribe, invalidate } from '../../../lib'; 2 | 3 | var ID = 0; 4 | const getNewID = () => ++ID; 5 | 6 | export default class ToDos { 7 | constructor() { 8 | this._todos = []; 9 | subscribe({ 10 | 'new-todo': todo => { 11 | this._todos.push({ 12 | id: getNewID(), 13 | text: todo, 14 | done: false 15 | }); 16 | invalidate(); 17 | }, 18 | 'mark-as-done': id => { 19 | const todo = this._todos.find(todo => todo.id === id); 20 | 21 | if (todo) { 22 | todo.done = true; 23 | invalidate(); 24 | } 25 | }, 26 | 'mark-as-not-done': id => { 27 | const todo = this._todos.find(todo => todo.id === id); 28 | 29 | if (todo) { 30 | todo.done = false; 31 | invalidate(); 32 | } 33 | }, 34 | 'delete': id => { 35 | this._todos = this._todos.filter(todo => todo.id !== id); 36 | invalidate(); 37 | } 38 | }); 39 | } 40 | getTodos() { 41 | return this._todos; 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Krasimir Tsonev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/src/components/AddingNewToDo.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { signal } from '../../../lib'; 3 | 4 | const { Component } = React; 5 | const ENTER = 13; 6 | 7 | class AddingNewToDo extends Component { 8 | constructor(props){ 9 | super(props); 10 | 11 | this.state = { value: '' }; 12 | this._onValueChange = this._onValueChange.bind(this); 13 | this._onKeyUp = this._onKeyUp.bind(this); 14 | } 15 | componentDidMount() { 16 | this.refs.inputField.focus(); 17 | } 18 | _onValueChange(e) { 19 | this.setState({ value: e.target.value }); 20 | } 21 | _onKeyUp(e) { 22 | if (e.keyCode === ENTER && this.state.value !== '') { 23 | this.props.dispatch('new-todo', this.state.value); 24 | this.setState({ value: '' }); 25 | } 26 | } 27 | render() { 28 | return ( 29 |
30 | 37 |
38 | ); 39 | } 40 | } 41 | 42 | export default signal(AddingNewToDo); -------------------------------------------------------------------------------- /examples/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | React App 17 | 18 | 19 |
20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/src/index.css: -------------------------------------------------------------------------------- 1 | html { 2 | -webkit-box-sizing: border-box; 3 | -moz-box-sizing: border-box; 4 | box-sizing: border-box; 5 | } 6 | *, *:before, *:after { 7 | -webkit-box-sizing: inherit; 8 | -moz-box-sizing: inherit; 9 | box-sizing: inherit; 10 | } 11 | body { 12 | margin: 0; 13 | padding: 0; 14 | font-family: Helvetica, Tahoma, Verdana; 15 | font-size: 18px; 16 | background: #fff; 17 | } 18 | .main { 19 | max-width: 30em; 20 | margin-left: auto; 21 | margin-right: auto; 22 | padding-top: 1em; 23 | padding-bottom: 1em; 24 | } 25 | input[type='text'] { 26 | display: block; 27 | width: 100%; 28 | font-size: 1.4em; 29 | padding: 0.4em; 30 | } 31 | .todoList { 32 | margin-top: 1em; 33 | } 34 | .todo { 35 | background: #e4e4e4; 36 | padding: 1em; 37 | margin-bottom: 0.2em; 38 | border-radius: 4px; 39 | width: 100%; 40 | } 41 | .todo::after { 42 | content: " "; 43 | display: table; 44 | clear: both; 45 | } 46 | .todo .links { 47 | float: right; 48 | font-size: 0.8em; 49 | } 50 | .todo .links a { 51 | background: #c7c7c7; 52 | padding: 0.2em 0.4em; 53 | border-radius: 2px; 54 | display: inline-block; 55 | margin-left: 0.2em; 56 | cursor: pointer; 57 | } 58 | .todo .links a:hover { 59 | background: #000; 60 | color: #FFF; 61 | } 62 | .footer { 63 | color: #999; 64 | font-size: 0.8em; 65 | margin-top: 1em; 66 | text-align: center; 67 | } 68 | .footer span { 69 | display: inline-block; 70 | margin-right: 1em; 71 | } -------------------------------------------------------------------------------- /src/di.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | var Data = {}; 4 | 5 | function dependenciesToProps(dependencies, mapToProps, storage) { 6 | const deps = dependencies.map(key => { 7 | if (Data[storage][key]) return Data[storage][key]; 8 | throw new Error(`Hocbox: Missing dependency with key = "${ key }"`); 9 | }); 10 | 11 | return mapToProps.apply({}, deps); 12 | } 13 | function registerDependenciesToPropsCallback(func, storage) { 14 | if (!Data[storage]) Data[storage] = {}; 15 | if (!Data[storage].___dependenciesToProps___) Data[storage].___dependenciesToProps___ = []; 16 | Data[storage].___dependenciesToProps___.push(func); 17 | } 18 | 19 | export function clear() { 20 | Data = {}; 21 | } 22 | 23 | export function invalidate(storage = 'hocbox') { 24 | if (!Data[storage]) Data[storage] = {}; 25 | if (!Data[storage].___dependenciesToProps___) Data[storage].___dependenciesToProps___ = []; 26 | Data[storage].___dependenciesToProps___.forEach(f => f()); 27 | } 28 | 29 | export function register(dependencies, storage = 'hocbox') { 30 | if (!Data[storage]) Data[storage] = {}; 31 | Object.keys(dependencies).forEach(key => Data[storage][key] = dependencies[key]); 32 | } 33 | 34 | export function wire(Component, dependencies, mapToProps, storage = 'hocbox') { 35 | const _getDepsProps = dependenciesToProps.bind({}, dependencies, mapToProps, storage); 36 | var _listener; 37 | 38 | registerDependenciesToPropsCallback(() => _listener && _listener(), storage); 39 | 40 | return class DIComponent extends React.Component { 41 | constructor(props) { 42 | super(props); 43 | 44 | this.state = { depsProps: _getDepsProps() } 45 | _listener = () => this.setState({ depsProps: _getDepsProps() }); 46 | } 47 | render() { 48 | return ; 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /test/spec/di.spec.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { mount } from 'enzyme'; 3 | import { register, wire, invalidate, clear } from '../../src'; 4 | 5 | class DumpComponent extends React.Component { 6 | render() { 7 | return

{ this.props.getText() }

; 8 | } 9 | } 10 | var Foo, Bar; 11 | 12 | function renderComponent(Component, props = {}) { 13 | return mount(); 14 | } 15 | 16 | describe('Given the wire and register helpers', function () { 17 | beforeEach(function () { 18 | clear(); 19 | Foo = { 20 | word: 'Hey', 21 | getText: function () { return this.word; } 22 | }; 23 | }); 24 | 25 | describe('when we register dependency and wire a component to it', function () { 26 | it('should receive valid props when invalidate', function () { 27 | register({ Foo }); 28 | 29 | const component = renderComponent(wire( 30 | DumpComponent, 31 | ['Foo'], 32 | foo => ({ getText: foo.getText.bind(foo) }) 33 | )); 34 | 35 | expect(component.text()).to.equal('Hey'); 36 | 37 | Foo.word = 'Bye'; 38 | invalidate(); 39 | expect(component.text()).to.equal('Bye'); 40 | }); 41 | }); 42 | describe('when we use two storages', function () { 43 | it('should keep the data in separate storages', function () { 44 | register({ Foo }); 45 | register( 46 | { 47 | Foo: { 48 | word: 'Bye', 49 | getText: function () { return this.word; } 50 | }, 51 | }, 52 | 'blah' 53 | ); 54 | 55 | const componentA = renderComponent(wire( 56 | DumpComponent, 57 | ['Foo'], 58 | Foo => ({ getText: Foo.getText.bind(Foo) }) 59 | )); 60 | const componentB = renderComponent(wire( 61 | DumpComponent, 62 | ['Foo'], 63 | Foo => ({ getText: Foo.getText.bind(Foo) }), 64 | 'blah' 65 | )); 66 | 67 | expect(componentA.text()).to.equal('Hey'); 68 | expect(componentB.text()).to.equal('Bye'); 69 | 70 | }); 71 | }); 72 | }); 73 | -------------------------------------------------------------------------------- /reports/test-results.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hocbox", 3 | "version": "0.3.0", 4 | "description": "A collection of HOC react components", 5 | "main": "./lib/", 6 | "scripts": { 7 | "build": "npm run coverage && npm run test && babel src --out-dir lib", 8 | "test": "./node_modules/.bin/mocha --require babel-register --require babel-polyfill --require test/setup.js --require jsdom-global/register --reporter spec --slow 100 './test/spec/**/**.spec.{js,jsx}'", 9 | "test:watch": "./node_modules/.bin/mocha --require babel-register --require babel-polyfill --require test/setup.js --require jsdom-global/register --reporter spec --slow 100 --watch --watch-extensions jx,jsx,json './test/spec/**/**.spec.{js,jsx}'", 10 | "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require babel-register --require babel-polyfill --require test/setup.js --require jsdom-global/register --reporter xunit --reporter-options output=reports/test-results.xml './test/spec/**/**.spec.{js,jsx}'" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/krasimir/hocbox.git" 15 | }, 16 | "keywords": [ 17 | "react", 18 | "hoc", 19 | "helpers", 20 | "utilities" 21 | ], 22 | "author": "Krasimir Tsonev", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/krasimir/hocbox/issues" 26 | }, 27 | "homepage": "https://github.com/krasimir/hocbox#readme", 28 | "devDependencies": { 29 | "babel-cli": "6.24.0", 30 | "babel-plugin-add-module-exports": "0.2.0", 31 | "babel-plugin-dynamic-import-node": "1.0.0", 32 | "babel-plugin-jsx-strip-ext": "1.0.0", 33 | "babel-plugin-syntax-async-functions": "6.3.13", 34 | "babel-plugin-syntax-dynamic-import": "6.18.0", 35 | "babel-plugin-transform-html-import-to-string": "0.0.1", 36 | "babel-polyfill": "6.23.0", 37 | "babel-preset-es2015": "6.22.0", 38 | "babel-preset-react": "6.23.0", 39 | "babel-preset-stage-1": "6.22.0", 40 | "babel-preset-stage-3": "6.22.0", 41 | "babel-register": "6.24.0", 42 | "chai": "3.5.0", 43 | "chai-enzyme": "0.6.1", 44 | "create-react-app": "1.3.0", 45 | "enzyme": "2.7.1", 46 | "istanbul": "1.1.0-alpha.1", 47 | "jsdom": "9.8.3", 48 | "jsdom-global": "2.1.1", 49 | "mocha": "3.2.0", 50 | "react": "15.4.2", 51 | "react-addons-test-utils": "15.4.2", 52 | "react-dom": "15.4.2", 53 | "sinon": "2.0.0", 54 | "sinon-chai": "2.9.0" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/waitFor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | 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; }; 6 | 7 | exports.default = waitFor; 8 | 9 | var _react = require('react'); 10 | 11 | var _react2 = _interopRequireDefault(_react); 12 | 13 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 14 | 15 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 16 | 17 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 18 | 19 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 20 | 21 | function waitFor(Component) { 22 | var _listener; 23 | var _defaultWaitForProps = {}; 24 | var _ready = false; 25 | 26 | return function (_React$Component) { 27 | _inherits(FeedComponent, _React$Component); 28 | 29 | FeedComponent.done = function done(props) { 30 | _defaultWaitForProps = props; 31 | _ready = true; 32 | if (_listener) _listener(props); 33 | }; 34 | 35 | function FeedComponent(props) { 36 | _classCallCheck(this, FeedComponent); 37 | 38 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); 39 | 40 | _this.state = { waitForProps: _defaultWaitForProps }; 41 | _listener = function _listener(waitForProps) { 42 | return _this.setState({ waitForProps: waitForProps }); 43 | }; 44 | return _this; 45 | } 46 | 47 | FeedComponent.prototype.render = function render() { 48 | return _ready ? _react2.default.createElement(Component, _extends({}, this.props, this.state.waitForProps)) : null; 49 | }; 50 | 51 | return FeedComponent; 52 | }(_react2.default.Component); 53 | } -------------------------------------------------------------------------------- /reports/lcov-report/index.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for index.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files index.js 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 3/3 26 |
27 |
28 | 100% 29 | Branches 30 | 6/6 31 |
32 |
33 | 100% 34 | Functions 35 | 3/3 36 |
37 |
38 | 100% 39 | Lines 40 | 3/3 41 |
42 |
43 |
44 |
45 |

46 | 
56 | 
1 47 | 2 48 | 3 49 | 410x 50 | 20x 51 | 46x 52 |  
export * from './feed';
53 | export * from './di';
54 | export * from './signal';
55 |  
57 |
58 |
59 | 63 | 64 | 65 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/signal.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | var SignalStorage = {}; 4 | var SignalComponentID = 0; 5 | var SignalLog = []; 6 | 7 | function getNewId() { 8 | return ++SignalComponentID; 9 | } 10 | 11 | export function getLog() { 12 | return SignalLog; 13 | } 14 | 15 | export function clearLog() { 16 | SignalLog = []; 17 | } 18 | 19 | export function dispatch(key, data, source) { 20 | SignalLog.push({ 21 | key: key, 22 | data: data, 23 | source: source 24 | }); 25 | if (SignalStorage[key]) { 26 | Object.keys(SignalStorage[key]).forEach(id => { 27 | SignalStorage[key][id](data); 28 | }); 29 | } 30 | } 31 | export function subscribe(key, signalID, callback) { 32 | if (typeof key === 'object') { 33 | Object.keys(key).forEach(k => subscribe(k, key[k])); 34 | return; 35 | } 36 | if (!SignalStorage[key]) SignalStorage[key] = {}; 37 | if (typeof signalID === 'function') { 38 | callback = signalID; 39 | signalID = getNewId(); 40 | } 41 | if (!SignalStorage[key][signalID]) { 42 | SignalStorage[key][signalID] = callback; 43 | } 44 | } 45 | export function unsubscribe(key, signalID) { 46 | if (key === null) { 47 | Object.keys(SignalStorage).forEach(key => { 48 | if (SignalStorage[key][signalID]) delete SignalStorage[key][signalID]; 49 | }); 50 | } else { 51 | if (SignalStorage[key][signalID]) delete SignalStorage[key][signalID]; 52 | } 53 | } 54 | 55 | export function signal(Component, subscribeTo) { 56 | return class SignalComponent extends React.Component { 57 | constructor(props) { 58 | super(props); 59 | this._signalID = (Component.name || '') + '_' + getNewId(); 60 | this._dispatch = (key, data) => { 61 | dispatch(key, data, this._signalID); 62 | } 63 | this._subscribe = (...keys) => { 64 | keys.forEach(key => { 65 | subscribe(key, this._signalID, data => this.setState({ [key]: data })); 66 | }); 67 | } 68 | this._unsubscribe = (...keys) => { 69 | if (keys.length === 0) { 70 | unsubscribe(null, this._signalID); 71 | return; 72 | } 73 | keys.forEach(key => { 74 | unsubscribe(key, this._signalID); 75 | }); 76 | } 77 | 78 | subscribeTo && subscribeTo.forEach(to => this._subscribe(to)); 79 | Object.keys(props).forEach(prop => { 80 | if (props[prop] === true) this._subscribe(prop); 81 | }) 82 | } 83 | render() { 84 | return ; 90 | } 91 | }; 92 | } -------------------------------------------------------------------------------- /lib/feed.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | 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; }; 6 | 7 | exports.feed = feed; 8 | 9 | var _react = require('react'); 10 | 11 | var _react2 = _interopRequireDefault(_react); 12 | 13 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 14 | 15 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 16 | 17 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 18 | 19 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 20 | 21 | function feed(Component) { 22 | var _listeners = []; 23 | var _defaultFeedProps = {}; 24 | 25 | return function (_React$Component) { 26 | _inherits(FeedComponent, _React$Component); 27 | 28 | FeedComponent.feed = function feed(props) { 29 | _defaultFeedProps = props; 30 | if (_listeners.length > 0) _listeners.forEach(function (l) { 31 | return l(props); 32 | }); 33 | }; 34 | 35 | function FeedComponent(props) { 36 | _classCallCheck(this, FeedComponent); 37 | 38 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); 39 | 40 | _this.state = { feedProps: _defaultFeedProps }; 41 | 42 | if (props.feeder) { 43 | _listeners.push(function () { 44 | return _this.setState({ feedProps: props.feeder() }); 45 | }); 46 | } else { 47 | _listeners.push(function (feedProps) { 48 | return _this.setState({ feedProps: feedProps }); 49 | }); 50 | } 51 | return _this; 52 | } 53 | 54 | FeedComponent.prototype.render = function render() { 55 | return _react2.default.createElement(Component, _extends({}, this.props, this.state.feedProps)); 56 | }; 57 | 58 | return FeedComponent; 59 | }(_react2.default.Component); 60 | } -------------------------------------------------------------------------------- /test/spec/feed.spec.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { mount } from 'enzyme'; 3 | import { feed } from '../../src'; 4 | 5 | class DumpComponent extends React.Component { 6 | render() { 7 | return ( 8 |

{ `${ this.props.text || 'Hello' } ${ this.props.name || 'World' }` }

9 | ) 10 | } 11 | } 12 | 13 | function renderComponent(Component, props = {}) { 14 | return mount(); 15 | } 16 | 17 | describe('Given the food helper', function () { 18 | describe('when rendering the component', function () { 19 | it('should render "Hello world"', function () { 20 | const component = renderComponent(feed(DumpComponent)); 21 | 22 | expect(component.text()).to.equal('Hello World'); 23 | }); 24 | }); 25 | describe('when we pass our own props', function () { 26 | it('should render "Hey dude"', function () { 27 | const component = renderComponent(feed(DumpComponent), { text: 'Hey', name: 'dude' }); 28 | 29 | expect(component.text()).to.equal('Hey dude'); 30 | }); 31 | }); 32 | describe('when we feed the component after the first render', function () { 33 | it('should render "Dear component"', function () { 34 | const Component = feed(DumpComponent); 35 | const component = renderComponent(Component); 36 | 37 | Component.feed({ text: 'Dear', name: 'React' }); 38 | Component.feed({ text: 'Dear', name: 'component' }); 39 | 40 | expect(component.text()).to.equal('Dear component'); 41 | }); 42 | }); 43 | describe('when we feed before to have the component rendered', function () { 44 | it('should render "Dear programmer"', function () { 45 | const Component = feed(DumpComponent); 46 | 47 | Component.feed({ text: 'Dear', name: 'programmer' }); 48 | 49 | const component = renderComponent(Component); 50 | 51 | expect(component.text()).to.equal('Dear programmer'); 52 | }); 53 | }); 54 | describe('when we need to control two difference instance', function () { 55 | it('should feed them separately', function () { 56 | const Component = feed(DumpComponent); 57 | const feed1 = () => ({ text: 'Dear', name: 'developer' }); 58 | const feed2 = () => ({ text: 'Dear', name: 'designer' }); 59 | 60 | 61 | const component1 = renderComponent(Component, { feeder: feed1 }); 62 | const component2 = renderComponent(Component, { feeder: feed2 }); 63 | 64 | Component.feed(); 65 | 66 | expect(component1.text()).to.equal('Dear developer'); 67 | expect(component1.text()).to.not.equal('Dear designer'); 68 | expect(component2.text()).to.equal('Dear designer'); 69 | expect(component2.text()).to.not.equal('Dear developer'); 70 | }); 71 | }); 72 | }); 73 | -------------------------------------------------------------------------------- /lib/di.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | 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; }; 6 | 7 | exports.clear = clear; 8 | exports.invalidate = invalidate; 9 | exports.register = register; 10 | exports.wire = wire; 11 | 12 | var _react = require('react'); 13 | 14 | var _react2 = _interopRequireDefault(_react); 15 | 16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 17 | 18 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 19 | 20 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 21 | 22 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 23 | 24 | var Data = {}; 25 | 26 | function dependenciesToProps(dependencies, mapToProps, storage) { 27 | var deps = dependencies.map(function (key) { 28 | if (Data[storage][key]) return Data[storage][key]; 29 | throw new Error('Hocbox: Missing dependency with key = "' + key + '"'); 30 | }); 31 | 32 | return mapToProps.apply({}, deps); 33 | } 34 | function registerDependenciesToPropsCallback(func, storage) { 35 | if (!Data[storage]) Data[storage] = {}; 36 | if (!Data[storage].___dependenciesToProps___) Data[storage].___dependenciesToProps___ = []; 37 | Data[storage].___dependenciesToProps___.push(func); 38 | } 39 | 40 | function clear() { 41 | Data = {}; 42 | } 43 | 44 | function invalidate() { 45 | var storage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'hocbox'; 46 | 47 | if (!Data[storage]) Data[storage] = {}; 48 | if (!Data[storage].___dependenciesToProps___) Data[storage].___dependenciesToProps___ = []; 49 | Data[storage].___dependenciesToProps___.forEach(function (f) { 50 | return f(); 51 | }); 52 | } 53 | 54 | function register(dependencies) { 55 | var storage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hocbox'; 56 | 57 | if (!Data[storage]) Data[storage] = {}; 58 | Object.keys(dependencies).forEach(function (key) { 59 | return Data[storage][key] = dependencies[key]; 60 | }); 61 | } 62 | 63 | function wire(Component, dependencies, mapToProps) { 64 | var storage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'hocbox'; 65 | 66 | var _getDepsProps = dependenciesToProps.bind({}, dependencies, mapToProps, storage); 67 | var _listener; 68 | 69 | registerDependenciesToPropsCallback(function () { 70 | return _listener && _listener(); 71 | }, storage); 72 | 73 | return function (_React$Component) { 74 | _inherits(DIComponent, _React$Component); 75 | 76 | function DIComponent(props) { 77 | _classCallCheck(this, DIComponent); 78 | 79 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); 80 | 81 | _this.state = { depsProps: _getDepsProps() }; 82 | _listener = function _listener() { 83 | return _this.setState({ depsProps: _getDepsProps() }); 84 | }; 85 | return _this; 86 | } 87 | 88 | DIComponent.prototype.render = function render() { 89 | return _react2.default.createElement(Component, _extends({}, this.props, this.state.depsProps)); 90 | }; 91 | 92 | return DIComponent; 93 | }(_react2.default.Component); 94 | } -------------------------------------------------------------------------------- /reports/lcov-report/feed.jsx.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for feed.jsx 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files feed.jsx 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 12/12 26 |
27 |
28 | 100% 29 | Branches 30 | 2/2 31 |
32 |
33 | 100% 34 | Functions 35 | 6/6 36 |
37 |
38 | 100% 39 | Lines 40 | 10/10 41 |
42 |
43 |
44 |
45 |

 46 | 
119 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 17 63 | 18 64 | 19 65 | 20 66 | 21 67 | 22 68 | 23 69 | 24 70 | 25  71 | 1x 72 |   73 |   74 |   75 | 4x 76 |   77 | 4x 78 | 12x 79 | 12x 80 |   81 |   82 | 4x 83 | 4x 84 |   85 |   86 | 6x 87 |   88 |   89 |   90 | 3x 91 | 3x 92 |   93 |   94 |  
 
 95 | import React from 'react';
 96 |  
 97 | export default function feed(Component) {
 98 |   var _listener;
 99 |   var _defaultFeedProps = {};
100 |  
101 |   return {
102 |     Component: class FeedComponent extends React.Component {
103 |       constructor(props) {
104 |         super(props);
105 |  
106 |         this.state = { feedProps: _defaultFeedProps }
107 |         _listener = feedProps => this.setState({ feedProps });
108 |       }
109 |       render() {
110 |         return <Component { ...this.props } { ...this.state.feedProps } />;
111 |       }
112 |     },
113 |     update: function (props) {
114 |       _defaultFeedProps = props;
115 |       if (_listener) _listener(props);
116 |     }
117 |   }
118 | }
120 |
121 |
122 | 126 | 127 | 128 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /reports/lcov-report/waitFor.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for waitFor.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files waitFor.js 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 13/13 26 |
27 |
28 | 75% 29 | Branches 30 | 3/4 31 |
32 |
33 | 100% 34 | Functions 35 | 6/6 36 |
37 |
38 | 100% 39 | Lines 40 | 11/11 41 |
42 |
43 |
44 |
45 |

 46 | 
119 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 17 63 | 18 64 | 19 65 | 20 66 | 21 67 | 22 68 | 23 69 | 24 70 | 25  71 | 1x 72 |   73 |   74 |   75 | 2x 76 | 2x 77 |   78 | 10x 79 |   80 | 1x 81 | 1x 82 | 1x 83 |   84 | 6x 85 |   86 |   87 | 2x 88 | 2x 89 |   90 |   91 | 3x 92 |   93 |   94 |  
 
 95 | import React from 'react';
 96 |  
 97 | export default function waitFor(Component) {
 98 |   var _listener;
 99 |   var _defaultWaitForProps = {};
100 |   var _ready = false;
101 |  
102 |   return class FeedComponent extends React.Component {
103 |     static done(props) {
104 |       _defaultWaitForProps = props;
105 |       _ready = true;
106 |       Eif (_listener) _listener(props);
107 |     }
108 |     constructor(props) {
109 |       super(props);
110 |  
111 |       this.state = { waitForProps: _defaultWaitForProps }
112 |       _listener = waitForProps => this.setState({ waitForProps });
113 |     }
114 |     render() {
115 |       return _ready ? <Component { ...this.props } { ...this.state.waitForProps } /> : null;
116 |     }
117 |   };
118 | }
120 |
121 |
122 | 126 | 127 | 128 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /reports/lcov-report/waitFor.jsx.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for waitFor.jsx 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files waitFor.jsx 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 14/14 26 |
27 |
28 | 75% 29 | Branches 30 | 3/4 31 |
32 |
33 | 100% 34 | Functions 35 | 6/6 36 |
37 |
38 | 100% 39 | Lines 40 | 12/12 41 |
42 |
43 |
44 |
45 |

 46 | 
125 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 17 63 | 18 64 | 19 65 | 20 66 | 21 67 | 22 68 | 23 69 | 24 70 | 25 71 | 26 72 | 27  73 | 1x 74 |   75 |   76 |   77 | 2x 78 | 2x 79 |   80 | 2x 81 | 6x 82 | 6x 83 |   84 |   85 | 2x 86 | 2x 87 |   88 |   89 | 3x 90 |   91 |   92 |   93 | 1x 94 | 1x 95 | 1x 96 |   97 |   98 |  
 
 99 | import React from 'react';
100 |  
101 | export default function waitFor(Component) {
102 |   var _listener;
103 |   var _defaultWaitForProps = {};
104 |   var _ready = false;
105 |  
106 |   return {
107 |     Component: class FeedComponent extends React.Component {
108 |       constructor(props) {
109 |         super(props);
110 |  
111 |         this.state = { waitForProps: _defaultWaitForProps }
112 |         _listener = waitForProps => this.setState({ waitForProps });
113 |       }
114 |       render() {
115 |         return _ready ? <Component { ...this.props } { ...this.state.waitForProps } /> : null;
116 |       }
117 |     },
118 |     done: function (props) {
119 |       _defaultWaitForProps = props;
120 |       _ready = true;
121 |       Eif (_listener) _listener(props);
122 |     }
123 |   }
124 | }
126 |
127 |
128 | 132 | 133 | 134 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /reports/lcov-report/feed.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for feed.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files feed.js 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 16/16 26 |
27 |
28 | 100% 29 | Branches 30 | 4/4 31 |
32 |
33 | 100% 34 | Functions 35 | 8/8 36 |
37 |
38 | 100% 39 | Lines 40 | 12/12 41 |
42 |
43 |
44 |
45 |

 46 | 
128 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 17 63 | 18 64 | 19 65 | 20 66 | 21 67 | 22 68 | 23 69 | 24 70 | 25 71 | 26 72 | 27 73 | 28  74 | 1x 75 |   76 |   77 | 5x 78 | 5x 79 |   80 | 25x 81 |   82 | 4x 83 | 4x 84 |   85 | 18x 86 |   87 |   88 | 6x 89 |   90 | 6x 91 | 2x 92 |   93 | 4x 94 |   95 |   96 |   97 | 10x 98 |   99 |   100 |  
 
101 | import React from 'react';
102 |  
103 | export function feed(Component) {
104 |   var _listeners = [];
105 |   var _defaultFeedProps = {};
106 |  
107 |   return class FeedComponent extends React.Component {
108 |     static feed(props) {
109 |       _defaultFeedProps = props;
110 |       if (_listeners.length > 0) _listeners.forEach(l => l(props));
111 |     }
112 |     constructor(props) {
113 |       super(props);
114 |  
115 |       this.state = { feedProps: _defaultFeedProps };
116 |  
117 |       if (props.feeder) {
118 |         _listeners.push(() => this.setState({ feedProps: props.feeder() }));
119 |       } else {
120 |         _listeners.push(feedProps => this.setState({ feedProps }));
121 |       }
122 |     }
123 |     render() {
124 |       return <Component { ...this.props } { ...this.state.feedProps } />;
125 |     }
126 |   };
127 | }
129 |
130 |
131 | 135 | 136 | 137 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /reports/lcov.info: -------------------------------------------------------------------------------- 1 | TN: 2 | SF:/Users/krasimir/Work/Krasimir/hocbox/src/di.js 3 | FN:5,dependenciesToProps 4 | FN:6,(anonymous_6) 5 | FN:13,registerDependenciesToPropsCallback 6 | FN:19,clear 7 | FN:23,invalidate 8 | FN:26,(anonymous_10) 9 | FN:29,register 10 | FN:31,(anonymous_12) 11 | FN:34,wire 12 | FN:38,(anonymous_14) 13 | FN:40,(anonymous_15) 14 | FN:41,DIComponent 15 | FN:45,_listener 16 | FN:40,render 17 | FNF:14 18 | FNH:14 19 | FNDA:4,dependenciesToProps 20 | FNDA:4,(anonymous_6) 21 | FNDA:3,registerDependenciesToPropsCallback 22 | FNDA:2,clear 23 | FNDA:1,invalidate 24 | FNDA:1,(anonymous_10) 25 | FNDA:3,register 26 | FNDA:3,(anonymous_12) 27 | FNDA:3,wire 28 | FNDA:1,(anonymous_14) 29 | FNDA:3,(anonymous_15) 30 | FNDA:3,DIComponent 31 | FNDA:1,_listener 32 | FNDA:4,render 33 | DA:1,1 34 | DA:3,1 35 | DA:6,4 36 | DA:7,4 37 | DA:8,0 38 | DA:11,4 39 | DA:14,3 40 | DA:15,3 41 | DA:16,3 42 | DA:20,2 43 | DA:23,1 44 | DA:24,1 45 | DA:25,1 46 | DA:26,1 47 | DA:29,3 48 | DA:30,3 49 | DA:31,3 50 | DA:34,3 51 | DA:35,3 52 | DA:38,3 53 | DA:40,12 54 | DA:41,9 55 | DA:44,3 56 | DA:45,3 57 | DA:48,4 58 | LF:25 59 | LH:24 60 | BRDA:7,0,0,4 61 | BRDA:7,0,1,0 62 | BRDA:14,1,0,0 63 | BRDA:14,1,1,3 64 | BRDA:15,2,0,3 65 | BRDA:15,2,1,0 66 | BRDA:23,3,0,0 67 | BRDA:23,3,1,1 68 | BRDA:23,4,0,1 69 | BRDA:23,4,1,0 70 | BRDA:24,5,0,0 71 | BRDA:24,5,1,1 72 | BRDA:25,6,0,0 73 | BRDA:25,6,1,1 74 | BRDA:29,7,0,1 75 | BRDA:29,7,1,2 76 | BRDA:29,8,0,3 77 | BRDA:29,8,1,1 78 | BRDA:30,9,0,3 79 | BRDA:30,9,1,0 80 | BRDA:34,10,0,1 81 | BRDA:34,10,1,2 82 | BRDA:34,11,0,3 83 | BRDA:34,11,1,1 84 | BRDA:38,12,0,1 85 | BRDA:38,12,1,1 86 | BRF:26 87 | BRH:18 88 | end_of_record 89 | TN: 90 | SF:/Users/krasimir/Work/Krasimir/hocbox/src/feed.js 91 | FN:4,feed 92 | FN:8,(anonymous_6) 93 | FN:8,feed 94 | FN:11,(anonymous_8) 95 | FN:13,FeedComponent 96 | FN:19,(anonymous_10) 97 | FN:21,(anonymous_11) 98 | FN:8,render 99 | FNF:8 100 | FNH:8 101 | FNDA:5,feed 102 | FNDA:5,(anonymous_6) 103 | FNDA:4,feed 104 | FNDA:4,(anonymous_8) 105 | FNDA:6,FeedComponent 106 | FNDA:2,(anonymous_10) 107 | FNDA:2,(anonymous_11) 108 | FNDA:10,render 109 | DA:2,1 110 | DA:5,5 111 | DA:6,5 112 | DA:8,25 113 | DA:10,4 114 | DA:11,4 115 | DA:13,18 116 | DA:16,6 117 | DA:18,6 118 | DA:19,2 119 | DA:21,4 120 | DA:25,10 121 | LF:12 122 | LH:12 123 | BRDA:11,0,0,3 124 | BRDA:11,0,1,1 125 | BRDA:18,1,0,2 126 | BRDA:18,1,1,4 127 | BRF:4 128 | BRH:4 129 | end_of_record 130 | TN: 131 | SF:/Users/krasimir/Work/Krasimir/hocbox/src/index.js 132 | FN:1,(anonymous_0) 133 | FN:2,(anonymous_2) 134 | FN:3,(anonymous_4) 135 | FNF:3 136 | FNH:3 137 | FNDA:7,(anonymous_0) 138 | FNDA:14,(anonymous_2) 139 | FNDA:38,(anonymous_4) 140 | DA:1,10 141 | DA:2,20 142 | DA:3,46 143 | LF:3 144 | LH:3 145 | BRDA:1,0,0,3 146 | BRDA:1,0,1,3 147 | BRDA:2,1,0,6 148 | BRDA:2,1,1,9 149 | BRDA:3,2,0,8 150 | BRDA:3,2,1,13 151 | BRF:6 152 | BRH:6 153 | end_of_record 154 | TN: 155 | SF:/Users/krasimir/Work/Krasimir/hocbox/src/signal.js 156 | FN:7,getNewId 157 | FN:11,getLog 158 | FN:15,clearLog 159 | FN:19,dispatch 160 | FN:26,(anonymous_11) 161 | FN:31,subscribe 162 | FN:33,(anonymous_13) 163 | FN:45,unsubscribe 164 | FN:47,(anonymous_15) 165 | FN:55,signal 166 | FN:56,(anonymous_17) 167 | FN:57,SignalComponent 168 | FN:60,(anonymous_19) 169 | FN:63,(anonymous_20) 170 | FN:64,(anonymous_21) 171 | FN:65,(anonymous_22) 172 | FN:68,(anonymous_23) 173 | FN:73,(anonymous_24) 174 | FN:78,(anonymous_25) 175 | FN:79,(anonymous_26) 176 | FN:56,render 177 | FNF:21 178 | FNH:21 179 | FNDA:12,getNewId 180 | FNDA:1,getLog 181 | FNDA:8,clearLog 182 | FNDA:18,dispatch 183 | FNDA:26,(anonymous_11) 184 | FNDA:16,subscribe 185 | FNDA:2,(anonymous_13) 186 | FNDA:4,unsubscribe 187 | FNDA:3,(anonymous_15) 188 | FNDA:9,signal 189 | FNDA:9,(anonymous_17) 190 | FNDA:9,SignalComponent 191 | FNDA:7,(anonymous_19) 192 | FNDA:12,(anonymous_20) 193 | FNDA:12,(anonymous_21) 194 | FNDA:23,(anonymous_22) 195 | FNDA:4,(anonymous_23) 196 | FNDA:3,(anonymous_24) 197 | FNDA:2,(anonymous_25) 198 | FNDA:10,(anonymous_26) 199 | FNDA:32,render 200 | DA:1,1 201 | DA:3,1 202 | DA:4,1 203 | DA:5,1 204 | DA:8,12 205 | DA:12,1 206 | DA:16,8 207 | DA:20,18 208 | DA:25,18 209 | DA:26,16 210 | DA:27,26 211 | DA:32,16 212 | DA:33,2 213 | DA:34,1 214 | DA:36,15 215 | DA:37,15 216 | DA:38,3 217 | DA:39,3 218 | DA:41,15 219 | DA:42,15 220 | DA:46,4 221 | DA:47,1 222 | DA:48,3 223 | DA:51,3 224 | DA:56,36 225 | DA:57,27 226 | DA:59,9 227 | DA:60,9 228 | DA:61,7 229 | DA:63,12 230 | DA:64,12 231 | DA:65,23 232 | DA:68,9 233 | DA:69,4 234 | DA:70,1 235 | DA:71,1 236 | DA:73,3 237 | DA:74,3 238 | DA:78,9 239 | DA:79,9 240 | DA:80,10 241 | DA:84,32 242 | LF:42 243 | LH:42 244 | BRDA:25,0,0,16 245 | BRDA:25,0,1,2 246 | BRDA:32,1,0,1 247 | BRDA:32,1,1,15 248 | BRDA:32,2,0,0 249 | BRDA:32,2,1,16 250 | BRDA:36,3,0,8 251 | BRDA:36,3,1,7 252 | BRDA:37,4,0,3 253 | BRDA:37,4,1,12 254 | BRDA:41,5,0,15 255 | BRDA:41,5,1,0 256 | BRDA:46,6,0,1 257 | BRDA:46,6,1,3 258 | BRDA:48,7,0,2 259 | BRDA:48,7,1,1 260 | BRDA:51,8,0,1 261 | BRDA:51,8,1,2 262 | BRDA:59,9,0,9 263 | BRDA:59,9,1,6 264 | BRDA:69,10,0,1 265 | BRDA:69,10,1,3 266 | BRDA:78,11,0,9 267 | BRDA:78,11,1,1 268 | BRDA:80,12,0,10 269 | BRDA:80,12,1,0 270 | BRF:26 271 | BRH:23 272 | end_of_record 273 | -------------------------------------------------------------------------------- /test/spec/signal.spec.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { mount } from 'enzyme'; 3 | import { signal, dispatch, clearLog, getLog, subscribe } from '../../src'; 4 | 5 | describe('Given the signal helper', function () { 6 | afterEach(() => { 7 | clearLog(); 8 | }); 9 | describe('when dispatching a signal', function () { 10 | it('should receive the data of the signal as a prop', function () { 11 | const Component = signal(({ firstName, lastName }) => { 12 | return

Hello { firstName } { lastName}

; 13 | }); 14 | const result = mount(); 15 | 16 | dispatch('firstName', 'Foo'); 17 | dispatch('lastName', 'Bar'); 18 | 19 | expect(result.text()).to.equal('Hello Foo Bar'); 20 | }); 21 | describe('and when we subscribe by giving second argument of `signal` method', function () { 22 | it('should subscribe to the signals', function () { 23 | const Component = signal(({ firstName, lastName }) => { 24 | return

Hello { firstName } { lastName}

; 25 | }, ['firstName', 'lastName']); 26 | const result = mount(); 27 | 28 | dispatch('firstName', 'Foo'); 29 | dispatch('lastName', 'Bar'); 30 | 31 | expect(result.text()).to.equal('Hello Foo Bar'); 32 | }); 33 | }); 34 | }); 35 | describe('when we have two components and one of them dispatches a signal', function () { 36 | it('should receive correct props', function () { 37 | const ComponentA = signal(({ foo }) => { 38 | return

{ foo }

; 39 | }); 40 | const ComponentB = signal(({ dispatch }) => { 41 | dispatch('foo', 'bar'); 42 | return

Bar

; 43 | }); 44 | 45 | const resultA = mount(); 46 | mount(); 47 | 48 | expect(resultA.text()).to.equal('bar'); 49 | }); 50 | }); 51 | describe('when we unsubscribe for particular signal', function () { 52 | it('should not rerender', function () { 53 | const Component = signal(({ firstName, lastName, unsubscribe }) => { 54 | unsubscribe('firstName'); 55 | return

Hello { firstName } { lastName }

; 56 | }); 57 | const result = mount(); 58 | 59 | dispatch('firstName', 'Foo'); 60 | dispatch('lastName', 'Bar'); 61 | 62 | expect(result.text()).to.equal('Hello Bar'); 63 | }); 64 | }); 65 | describe('when we unsubscribe for all signals', function () { 66 | it('should not rerender', function () { 67 | const Component = signal(({ firstName, lastName, unsubscribe }) => { 68 | unsubscribe(); 69 | return

Hello { firstName } { lastName }

; 70 | }); 71 | const result = mount(); 72 | 73 | dispatch('firstName', 'Foo'); 74 | dispatch('lastName', 'Bar'); 75 | 76 | expect(result.text()).to.equal('Hello '); 77 | }); 78 | }); 79 | describe('when we dispatch multiple signals', function () { 80 | it('should provide the log hisotry', function () { 81 | const ComponentA = signal(function CA(props) { 82 | props.dispatch('tartar', 'A'); 83 | return

{ props.foo }

; 84 | }); 85 | const ComponentB = signal(function CB(props) { 86 | props.dispatch('foo', 'B'); 87 | return

{ props.bar }

; 88 | }); 89 | class ComponentCClass extends React.Component { 90 | constructor(props) { 91 | super(props); 92 | props.dispatch('bar', 'C'); 93 | } 94 | render() { 95 | return

{ this.props.tartar }

; 96 | } 97 | } 98 | const ComponentC = signal(ComponentCClass); 99 | 100 | mount(); 101 | mount(); 102 | mount(); 103 | 104 | expect(getLog()).to.deep.equal([ 105 | { key: 'tartar', data: 'A', source: 'CA_7' }, 106 | { key: 'foo', data: 'B', source: 'CB_8' }, 107 | { key: 'tartar', data: 'A', source: 'CA_7' }, 108 | { key: 'bar', data: 'C', source: 'ComponentCClass_9' }, 109 | { key: 'foo', data: 'B', source: 'CB_8' }, 110 | { key: 'tartar', data: 'A', source: 'CA_7' } 111 | ]) 112 | }); 113 | }); 114 | describe('when subscribing without signalID', function () { 115 | it('should still properly subscribe with a uid', function () { 116 | const spy = sinon.spy(); 117 | 118 | subscribe('test-signal', spy); 119 | dispatch('test-signal', 42); 120 | 121 | expect(spy).to.be.calledWith(42); 122 | }); 123 | }); 124 | describe('when subscribing using an object', function () { 125 | it('should properly react on dispatches', function () { 126 | const spy1 = sinon.spy(); 127 | const spy2 = sinon.spy(); 128 | 129 | subscribe({ 130 | 'test-signal1': spy1, 131 | 'test-signal2': spy2 132 | }); 133 | dispatch('test-signal1', 1); 134 | dispatch('test-signal2', 2); 135 | 136 | expect(spy1).to.be.calledWith(1); 137 | expect(spy2).to.be.calledWith(2); 138 | }); 139 | }); 140 | }); -------------------------------------------------------------------------------- /lib/signal.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.__esModule = true; 4 | 5 | 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; }; 6 | 7 | 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; }; 8 | 9 | exports.getLog = getLog; 10 | exports.clearLog = clearLog; 11 | exports.dispatch = dispatch; 12 | exports.subscribe = subscribe; 13 | exports.unsubscribe = unsubscribe; 14 | exports.signal = signal; 15 | 16 | var _react = require('react'); 17 | 18 | var _react2 = _interopRequireDefault(_react); 19 | 20 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 21 | 22 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 23 | 24 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 25 | 26 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 27 | 28 | var SignalStorage = {}; 29 | var SignalComponentID = 0; 30 | var SignalLog = []; 31 | 32 | function getNewId() { 33 | return ++SignalComponentID; 34 | } 35 | 36 | function getLog() { 37 | return SignalLog; 38 | } 39 | 40 | function clearLog() { 41 | SignalLog = []; 42 | } 43 | 44 | function dispatch(key, data, source) { 45 | SignalLog.push({ 46 | key: key, 47 | data: data, 48 | source: source 49 | }); 50 | if (SignalStorage[key]) { 51 | Object.keys(SignalStorage[key]).forEach(function (id) { 52 | SignalStorage[key][id](data); 53 | }); 54 | } 55 | } 56 | function subscribe(key, signalID, callback) { 57 | if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object') { 58 | Object.keys(key).forEach(function (k) { 59 | return subscribe(k, key[k]); 60 | }); 61 | return; 62 | } 63 | if (!SignalStorage[key]) SignalStorage[key] = {}; 64 | if (typeof signalID === 'function') { 65 | callback = signalID; 66 | signalID = getNewId(); 67 | } 68 | if (!SignalStorage[key][signalID]) { 69 | SignalStorage[key][signalID] = callback; 70 | } 71 | } 72 | function unsubscribe(key, signalID) { 73 | if (key === null) { 74 | Object.keys(SignalStorage).forEach(function (key) { 75 | if (SignalStorage[key][signalID]) delete SignalStorage[key][signalID]; 76 | }); 77 | } else { 78 | if (SignalStorage[key][signalID]) delete SignalStorage[key][signalID]; 79 | } 80 | } 81 | 82 | function signal(Component, subscribeTo) { 83 | return function (_React$Component) { 84 | _inherits(SignalComponent, _React$Component); 85 | 86 | function SignalComponent(props) { 87 | _classCallCheck(this, SignalComponent); 88 | 89 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); 90 | 91 | _this._signalID = (Component.name || '') + '_' + getNewId(); 92 | _this._dispatch = function (key, data) { 93 | dispatch(key, data, _this._signalID); 94 | }; 95 | _this._subscribe = function () { 96 | for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) { 97 | keys[_key] = arguments[_key]; 98 | } 99 | 100 | keys.forEach(function (key) { 101 | subscribe(key, _this._signalID, function (data) { 102 | var _this$setState; 103 | 104 | return _this.setState((_this$setState = {}, _this$setState[key] = data, _this$setState)); 105 | }); 106 | }); 107 | }; 108 | _this._unsubscribe = function () { 109 | for (var _len2 = arguments.length, keys = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 110 | keys[_key2] = arguments[_key2]; 111 | } 112 | 113 | if (keys.length === 0) { 114 | unsubscribe(null, _this._signalID); 115 | return; 116 | } 117 | keys.forEach(function (key) { 118 | unsubscribe(key, _this._signalID); 119 | }); 120 | }; 121 | 122 | subscribeTo && subscribeTo.forEach(function (to) { 123 | return _this._subscribe(to); 124 | }); 125 | Object.keys(props).forEach(function (prop) { 126 | if (props[prop] === true) _this._subscribe(prop); 127 | }); 128 | return _this; 129 | } 130 | 131 | SignalComponent.prototype.render = function render() { 132 | return _react2.default.createElement(Component, _extends({}, this.props, this.state, { 133 | dispatch: this._dispatch, 134 | subscribe: this._subscribe, 135 | unsubscribe: this._unsubscribe })); 136 | }; 137 | 138 | return SignalComponent; 139 | }(_react2.default.Component); 140 | } -------------------------------------------------------------------------------- /reports/lcov-report/sorter.js: -------------------------------------------------------------------------------- 1 | var addSorting = (function () { 2 | "use strict"; 3 | var cols, 4 | currentSort = { 5 | index: 0, 6 | desc: false 7 | }; 8 | 9 | // returns the summary table element 10 | function getTable() { return document.querySelector('.coverage-summary'); } 11 | // returns the thead element of the summary table 12 | function getTableHeader() { return getTable().querySelector('thead tr'); } 13 | // returns the tbody element of the summary table 14 | function getTableBody() { return getTable().querySelector('tbody'); } 15 | // returns the th element for nth column 16 | function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } 17 | 18 | // loads all columns 19 | function loadColumns() { 20 | var colNodes = getTableHeader().querySelectorAll('th'), 21 | colNode, 22 | cols = [], 23 | col, 24 | i; 25 | 26 | for (i = 0; i < colNodes.length; i += 1) { 27 | colNode = colNodes[i]; 28 | col = { 29 | key: colNode.getAttribute('data-col'), 30 | sortable: !colNode.getAttribute('data-nosort'), 31 | type: colNode.getAttribute('data-type') || 'string' 32 | }; 33 | cols.push(col); 34 | if (col.sortable) { 35 | col.defaultDescSort = col.type === 'number'; 36 | colNode.innerHTML = colNode.innerHTML + ''; 37 | } 38 | } 39 | return cols; 40 | } 41 | // attaches a data attribute to every tr element with an object 42 | // of data values keyed by column name 43 | function loadRowData(tableRow) { 44 | var tableCols = tableRow.querySelectorAll('td'), 45 | colNode, 46 | col, 47 | data = {}, 48 | i, 49 | val; 50 | for (i = 0; i < tableCols.length; i += 1) { 51 | colNode = tableCols[i]; 52 | col = cols[i]; 53 | val = colNode.getAttribute('data-value'); 54 | if (col.type === 'number') { 55 | val = Number(val); 56 | } 57 | data[col.key] = val; 58 | } 59 | return data; 60 | } 61 | // loads all row data 62 | function loadData() { 63 | var rows = getTableBody().querySelectorAll('tr'), 64 | i; 65 | 66 | for (i = 0; i < rows.length; i += 1) { 67 | rows[i].data = loadRowData(rows[i]); 68 | } 69 | } 70 | // sorts the table using the data for the ith column 71 | function sortByIndex(index, desc) { 72 | var key = cols[index].key, 73 | sorter = function (a, b) { 74 | a = a.data[key]; 75 | b = b.data[key]; 76 | return a < b ? -1 : a > b ? 1 : 0; 77 | }, 78 | finalSorter = sorter, 79 | tableBody = document.querySelector('.coverage-summary tbody'), 80 | rowNodes = tableBody.querySelectorAll('tr'), 81 | rows = [], 82 | i; 83 | 84 | if (desc) { 85 | finalSorter = function (a, b) { 86 | return -1 * sorter(a, b); 87 | }; 88 | } 89 | 90 | for (i = 0; i < rowNodes.length; i += 1) { 91 | rows.push(rowNodes[i]); 92 | tableBody.removeChild(rowNodes[i]); 93 | } 94 | 95 | rows.sort(finalSorter); 96 | 97 | for (i = 0; i < rows.length; i += 1) { 98 | tableBody.appendChild(rows[i]); 99 | } 100 | } 101 | // removes sort indicators for current column being sorted 102 | function removeSortIndicators() { 103 | var col = getNthColumn(currentSort.index), 104 | cls = col.className; 105 | 106 | cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); 107 | col.className = cls; 108 | } 109 | // adds sort indicators for current column being sorted 110 | function addSortIndicators() { 111 | getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; 112 | } 113 | // adds event listeners for all sorter widgets 114 | function enableUI() { 115 | var i, 116 | el, 117 | ithSorter = function ithSorter(i) { 118 | var col = cols[i]; 119 | 120 | return function () { 121 | var desc = col.defaultDescSort; 122 | 123 | if (currentSort.index === i) { 124 | desc = !currentSort.desc; 125 | } 126 | sortByIndex(i, desc); 127 | removeSortIndicators(); 128 | currentSort.index = i; 129 | currentSort.desc = desc; 130 | addSortIndicators(); 131 | }; 132 | }; 133 | for (i =0 ; i < cols.length; i += 1) { 134 | if (cols[i].sortable) { 135 | // add the click event handler on the th so users 136 | // dont have to click on those tiny arrows 137 | el = getNthColumn(i).querySelector('.sorter').parentElement; 138 | if (el.addEventListener) { 139 | el.addEventListener('click', ithSorter(i)); 140 | } else { 141 | el.attachEvent('onclick', ithSorter(i)); 142 | } 143 | } 144 | } 145 | } 146 | // adds sorting functionality to the UI 147 | return function () { 148 | if (!getTable()) { 149 | return; 150 | } 151 | cols = loadColumns(); 152 | loadData(cols); 153 | addSortIndicators(); 154 | enableUI(); 155 | }; 156 | })(); 157 | 158 | window.addEventListener('load', addSorting); 159 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HOCBox 2 | 3 | A collection of [Higher-order React components](https://github.com/krasimir/react-in-patterns/tree/master/patterns/higher-order-components) 4 | 5 | --- 6 | 7 | # Installation 8 | 9 | `npm i hocbox` 10 | 11 | # API 12 | 13 | --- 14 | 15 | ## `feed` 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
feed(<component>):<component>
For the cases when we want to rerender a component with given props
acceptsReact component
returnsEnhanced React Component with a static method `feed`
35 | 36 | 37 | ```js 38 | import { feed } from 'hocbox'; 39 | 40 | // We pass a React Component to feed 41 | const Component = feed(function({ answer }) { 42 | return

The answer is { answer || '...' }

; 43 | }); 44 | 45 | // ... and we render our Component 46 | class App extends React.Component { 47 | render() { 48 | return
; 49 | } 50 | } 51 | 52 | // Then later we rerender with given props 53 | Service('/api/get/the/answer').then(data => { 54 | Component.feed({ answer: data }); 55 | }); 56 | 57 | 58 | ``` 59 | 60 | *`Service` in the example above is just a HTTP layer that fetches data from let's say API.* 61 | 62 | --- 63 | 64 | ## Dependency injection 65 | 66 | Provide anything to any React component of your application. The dependencies are `register`ed at the very top layer and via the `wire` method they may reach your components. 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 |
register(<object>)
Defines dependencies
acceptsObject of key-value props
returnsnothing
86 | 87 | 88 | 89 | 90 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |
91 | wire(<component>, <array>, <function>):<component> 92 |
We describe what dependencies we need and map them to props sent to our component.
accepts 100 |
    101 |
  • React component
  • 102 |
  • Array of strings where every string is a key used in the register method
  • 103 |
  • Function that accepts the dependencies and has to return an object of key-value props
  • 104 |
105 |
returnsEnhanced React component
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
invalidate()
Invalidates the dependencies. Useful when we change some of them and we want to rerender.
acceptsnothing
returnsnothing
132 | 133 | ```js 134 | 135 | // in App.js 136 | import { register } from 'hocbox'; 137 | 138 | register({ TitleText: 'Hello world' }); 139 | 140 | 141 | // in Title.jsx 142 | import { wire } from 'hocbox'; 143 | 144 | const Title = function({ text }) { 145 | return

{ text }

; 146 | } 147 | 148 | export default wire( 149 | Title, // <--- component that needs something 150 | ['TitleText'], // <--- a key used in the `register` method 151 | text => ({ text }) // <--- mapping to props function 152 | ); 153 | ``` 154 | 155 | ## Signals 156 | 157 | Passing messages between components and other parts of your system. 158 | 159 | 160 | 161 | 162 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 |
163 | signal(<component>):<component> 164 |
Enhancing React component so it has dispatch, subscribe and unsubscribe methods as props.
acceptsReact component
returnsEnhanced React component
179 | 180 | 181 | 182 | 183 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 198 | 199 | 200 | 201 | 202 | 203 | 204 |
184 | subscribe(<string>, <function>) 185 |
Subscribing to a signal
accepts 193 |
    194 |
  • Name of the signal
  • 195 |
  • Callback
  • 196 |
197 |
returnsnothing
205 | 206 | 207 | 208 | 209 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 224 | 225 | 226 | 227 | 228 | 229 | 230 |
210 | dispatch(<string>, <data>) 211 |
Dispatching/emitting a signal
accepts 219 |
    220 |
  • Name of the signal
  • 221 |
  • Payload
  • 222 |
223 |
returnsnothing
-------------------------------------------------------------------------------- /reports/lcov-report/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for All files 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files 20 |

21 |
22 |
23 | 96.26% 24 | Statements 25 | 103/107 26 |
27 |
28 | 82.26% 29 | Branches 30 | 51/62 31 |
32 |
33 | 100% 34 | Functions 35 | 46/46 36 |
37 |
38 | 98.78% 39 | Lines 40 | 81/82 41 |
42 |
43 |
44 |
45 |
46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 |
FileStatementsBranchesFunctionsLines
di.js
88.57%31/3569.23%18/26100%14/1496%24/25
feed.js
100%16/16100%4/4100%8/8100%12/12
index.js
100%3/3100%6/6100%3/3100%3/3
signal.js
100%53/5388.46%23/26100%21/21100%42/42
115 |
116 |
117 | 121 | 122 | 123 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /reports/lcov-report/base.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin:0; padding: 0; 3 | height: 100%; 4 | } 5 | body { 6 | font-family: Helvetica Neue, Helvetica, Arial; 7 | font-size: 14px; 8 | color:#333; 9 | } 10 | .small { font-size: 12px; } 11 | *, *:after, *:before { 12 | -webkit-box-sizing:border-box; 13 | -moz-box-sizing:border-box; 14 | box-sizing:border-box; 15 | } 16 | h1 { font-size: 20px; margin: 0;} 17 | h2 { font-size: 14px; } 18 | pre { 19 | font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; 20 | margin: 0; 21 | padding: 0; 22 | -moz-tab-size: 2; 23 | -o-tab-size: 2; 24 | tab-size: 2; 25 | } 26 | a { color:#0074D9; text-decoration:none; } 27 | a:hover { text-decoration:underline; } 28 | .strong { font-weight: bold; } 29 | .space-top1 { padding: 10px 0 0 0; } 30 | .pad2y { padding: 20px 0; } 31 | .pad1y { padding: 10px 0; } 32 | .pad2x { padding: 0 20px; } 33 | .pad2 { padding: 20px; } 34 | .pad1 { padding: 10px; } 35 | .space-left2 { padding-left:55px; } 36 | .space-right2 { padding-right:20px; } 37 | .center { text-align:center; } 38 | .clearfix { display:block; } 39 | .clearfix:after { 40 | content:''; 41 | display:block; 42 | height:0; 43 | clear:both; 44 | visibility:hidden; 45 | } 46 | .fl { float: left; } 47 | @media only screen and (max-width:640px) { 48 | .col3 { width:100%; max-width:100%; } 49 | .hide-mobile { display:none!important; } 50 | } 51 | 52 | .quiet { 53 | color: #7f7f7f; 54 | color: rgba(0,0,0,0.5); 55 | } 56 | .quiet a { opacity: 0.7; } 57 | 58 | .fraction { 59 | font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; 60 | font-size: 10px; 61 | color: #555; 62 | background: #E8E8E8; 63 | padding: 4px 5px; 64 | border-radius: 3px; 65 | vertical-align: middle; 66 | } 67 | 68 | div.path a:link, div.path a:visited { color: #333; } 69 | table.coverage { 70 | border-collapse: collapse; 71 | margin: 10px 0 0 0; 72 | padding: 0; 73 | } 74 | 75 | table.coverage td { 76 | margin: 0; 77 | padding: 0; 78 | vertical-align: top; 79 | } 80 | table.coverage td.line-count { 81 | text-align: right; 82 | padding: 0 5px 0 20px; 83 | } 84 | table.coverage td.line-coverage { 85 | text-align: right; 86 | padding-right: 10px; 87 | min-width:20px; 88 | } 89 | 90 | table.coverage td span.cline-any { 91 | display: inline-block; 92 | padding: 0 5px; 93 | width: 100%; 94 | } 95 | .missing-if-branch { 96 | display: inline-block; 97 | margin-right: 5px; 98 | border-radius: 3px; 99 | position: relative; 100 | padding: 0 4px; 101 | background: #333; 102 | color: yellow; 103 | } 104 | 105 | .skip-if-branch { 106 | display: none; 107 | margin-right: 10px; 108 | position: relative; 109 | padding: 0 4px; 110 | background: #ccc; 111 | color: white; 112 | } 113 | .missing-if-branch .typ, .skip-if-branch .typ { 114 | color: inherit !important; 115 | } 116 | .coverage-summary { 117 | border-collapse: collapse; 118 | width: 100%; 119 | } 120 | .coverage-summary tr { border-bottom: 1px solid #bbb; } 121 | .keyline-all { border: 1px solid #ddd; } 122 | .coverage-summary td, .coverage-summary th { padding: 10px; } 123 | .coverage-summary tbody { border: 1px solid #bbb; } 124 | .coverage-summary td { border-right: 1px solid #bbb; } 125 | .coverage-summary td:last-child { border-right: none; } 126 | .coverage-summary th { 127 | text-align: left; 128 | font-weight: normal; 129 | white-space: nowrap; 130 | } 131 | .coverage-summary th.file { border-right: none !important; } 132 | .coverage-summary th.pct { } 133 | .coverage-summary th.pic, 134 | .coverage-summary th.abs, 135 | .coverage-summary td.pct, 136 | .coverage-summary td.abs { text-align: right; } 137 | .coverage-summary td.file { white-space: nowrap; } 138 | .coverage-summary td.pic { min-width: 120px !important; } 139 | .coverage-summary tfoot td { } 140 | 141 | .coverage-summary .sorter { 142 | height: 10px; 143 | width: 7px; 144 | display: inline-block; 145 | margin-left: 0.5em; 146 | background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; 147 | } 148 | .coverage-summary .sorted .sorter { 149 | background-position: 0 -20px; 150 | } 151 | .coverage-summary .sorted-desc .sorter { 152 | background-position: 0 -10px; 153 | } 154 | .status-line { height: 10px; } 155 | /* dark red */ 156 | .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } 157 | .low .chart { border:1px solid #C21F39 } 158 | /* medium red */ 159 | .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } 160 | /* light red */ 161 | .low, .cline-no { background:#FCE1E5 } 162 | /* light green */ 163 | .high, .cline-yes { background:rgb(230,245,208) } 164 | /* medium green */ 165 | .cstat-yes { background:rgb(161,215,106) } 166 | /* dark green */ 167 | .status-line.high, .high .cover-fill { background:rgb(77,146,33) } 168 | .high .chart { border:1px solid rgb(77,146,33) } 169 | 170 | 171 | .medium .chart { border:1px solid #666; } 172 | .medium .cover-fill { background: #666; } 173 | 174 | .cbranch-no { background: yellow !important; color: #111; } 175 | 176 | .cstat-skip { background: #ddd; color: #111; } 177 | .fstat-skip { background: #ddd; color: #111 !important; } 178 | .cbranch-skip { background: #ddd !important; color: #111; } 179 | 180 | span.cline-neutral { background: #eaeaea; } 181 | .medium { background: #eaeaea; } 182 | 183 | .cover-fill, .cover-empty { 184 | display:inline-block; 185 | height: 12px; 186 | } 187 | .chart { 188 | line-height: 0; 189 | } 190 | .cover-empty { 191 | background: white; 192 | } 193 | .cover-full { 194 | border-right: none !important; 195 | } 196 | pre.prettyprint { 197 | border: none !important; 198 | padding: 0 !important; 199 | margin: 0 !important; 200 | } 201 | .com { color: #999 !important; } 202 | .ignore-none { color: #999; font-weight: normal; } 203 | 204 | .wrapper { 205 | min-height: 100%; 206 | height: auto !important; 207 | height: 100%; 208 | margin: 0 auto -48px; 209 | } 210 | .footer, .push { 211 | height: 48px; 212 | } 213 | -------------------------------------------------------------------------------- /reports/lcov-report/di.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for di.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files di.js 20 |

21 |
22 |
23 | 88.57% 24 | Statements 25 | 31/35 26 |
27 |
28 | 69.23% 29 | Branches 30 | 18/26 31 |
32 |
33 | 100% 34 | Functions 35 | 14/14 36 |
37 |
38 | 96% 39 | Lines 40 | 24/25 41 |
42 |
43 |
44 |
45 |

 46 | 
197 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 17 63 | 18 64 | 19 65 | 20 66 | 21 67 | 22 68 | 23 69 | 24 70 | 25 71 | 26 72 | 27 73 | 28 74 | 29 75 | 30 76 | 31 77 | 32 78 | 33 79 | 34 80 | 35 81 | 36 82 | 37 83 | 38 84 | 39 85 | 40 86 | 41 87 | 42 88 | 43 89 | 44 90 | 45 91 | 46 92 | 47 93 | 48 94 | 49 95 | 50 96 | 511x 97 |   98 | 1x 99 |   100 |   101 | 4x 102 | 4x 103 |   104 |   105 |   106 | 4x 107 |   108 |   109 | 3x 110 | 3x 111 | 3x 112 |   113 |   114 |   115 | 2x 116 |   117 |   118 | 1x 119 | 1x 120 | 1x 121 | 1x 122 |   123 |   124 | 3x 125 | 3x 126 | 3x 127 |   128 |   129 | 3x 130 | 3x 131 |   132 |   133 | 3x 134 |   135 | 12x 136 | 9x 137 |   138 |   139 | 3x 140 | 3x 141 |   142 |   143 | 4x 144 |   145 |   146 |  
import React from 'react';
147 |  
148 | var Data = {};
149 |  
150 | function dependenciesToProps(dependencies, mapToProps, storage) {
151 |   const deps = dependencies.map(key => {
152 |     Eif (Data[storage][key]) return Data[storage][key];
153 |     throw new Error(`Hocbox: Missing dependency with key = "${ key }"`);
154 |   });
155 |  
156 |   return mapToProps.apply({}, deps);
157 | }
158 | function registerDependenciesToPropsCallback(func, storage) {
159 |   Iif (!Data[storage]) Data[storage] = {};
160 |   Eif (!Data[storage].___dependenciesToProps___) Data[storage].___dependenciesToProps___ = [];
161 |   Data[storage].___dependenciesToProps___.push(func);
162 | }
163 |  
164 | export function clear() {
165 |   Data = {};
166 | }
167 |  
168 | export function invalidate(storage = 'hocbox') {
169 |   Iif (!Data[storage]) Data[storage] = {};
170 |   Iif (!Data[storage].___dependenciesToProps___) Data[storage].___dependenciesToProps___ = [];
171 |   Data[storage].___dependenciesToProps___.forEach(f => f());
172 | }
173 |  
174 | export function register(dependencies, storage = 'hocbox') {
175 |   Eif (!Data[storage]) Data[storage] = {};
176 |   Object.keys(dependencies).forEach(key => Data[storage][key] = dependencies[key]);
177 | }
178 |  
179 | export function wire(Component, dependencies, mapToProps, storage = 'hocbox') {
180 |   const _getDepsProps = dependenciesToProps.bind({}, dependencies, mapToProps, storage);
181 |   var _listener;
182 |  
183 |   registerDependenciesToPropsCallback(() => _listener && _listener(), storage);
184 |  
185 |   return class DIComponent extends React.Component {
186 |     constructor(props) {
187 |       super(props);
188 |  
189 |       this.state = { depsProps: _getDepsProps() }
190 |       _listener = () => this.setState({ depsProps: _getDepsProps() });
191 |     }
192 |     render() {
193 |       return <Component { ...this.props } { ...this.state.depsProps } />;
194 |     }
195 |   }
196 | }
198 |
199 |
200 | 204 | 205 | 206 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /reports/lcov-report/signal.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for signal.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files signal.js 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 53/53 26 |
27 |
28 | 88.46% 29 | Branches 30 | 23/26 31 |
32 |
33 | 100% 34 | Functions 35 | 21/21 36 |
37 |
38 | 100% 39 | Lines 40 | 42/42 41 |
42 |
43 |
44 |
45 |

 46 | 
320 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 17 63 | 18 64 | 19 65 | 20 66 | 21 67 | 22 68 | 23 69 | 24 70 | 25 71 | 26 72 | 27 73 | 28 74 | 29 75 | 30 76 | 31 77 | 32 78 | 33 79 | 34 80 | 35 81 | 36 82 | 37 83 | 38 84 | 39 85 | 40 86 | 41 87 | 42 88 | 43 89 | 44 90 | 45 91 | 46 92 | 47 93 | 48 94 | 49 95 | 50 96 | 51 97 | 52 98 | 53 99 | 54 100 | 55 101 | 56 102 | 57 103 | 58 104 | 59 105 | 60 106 | 61 107 | 62 108 | 63 109 | 64 110 | 65 111 | 66 112 | 67 113 | 68 114 | 69 115 | 70 116 | 71 117 | 72 118 | 73 119 | 74 120 | 75 121 | 76 122 | 77 123 | 78 124 | 79 125 | 80 126 | 81 127 | 82 128 | 83 129 | 84 130 | 85 131 | 86 132 | 87 133 | 88 134 | 89 135 | 90 136 | 91 137 | 921x 138 |   139 | 1x 140 | 1x 141 | 1x 142 |   143 |   144 | 12x 145 |   146 |   147 |   148 | 1x 149 |   150 |   151 |   152 | 8x 153 |   154 |   155 |   156 | 18x 157 |   158 |   159 |   160 |   161 | 18x 162 | 16x 163 | 26x 164 |   165 |   166 |   167 |   168 | 16x 169 | 2x 170 | 1x 171 |   172 | 15x 173 | 15x 174 | 3x 175 | 3x 176 |   177 | 15x 178 | 15x 179 |   180 |   181 |   182 | 4x 183 | 1x 184 | 3x 185 |   186 |   187 | 3x 188 |   189 |   190 |   191 |   192 | 36x 193 | 27x 194 |   195 | 9x 196 | 9x 197 | 7x 198 |   199 | 12x 200 | 12x 201 | 23x 202 |   203 |   204 | 9x 205 | 4x 206 | 1x 207 | 1x 208 |   209 | 3x 210 | 3x 211 |   212 |   213 |   214 | 9x 215 | 9x 216 | 10x 217 |   218 |   219 |   220 | 32x 221 |   222 |   223 |   224 |   225 |   226 |   227 |   228 |  
import React from 'react';
229 |  
230 | var SignalStorage = {};
231 | var SignalComponentID = 0;
232 | var SignalLog = [];
233 |  
234 | function getNewId() {
235 |   return ++SignalComponentID;
236 | }
237 |  
238 | export function getLog() {
239 |   return SignalLog;
240 | }
241 |  
242 | export function clearLog() {
243 |   SignalLog = [];
244 | }
245 |  
246 | export function dispatch(key, data, source) {
247 |   SignalLog.push({
248 |     key: key,
249 |     data: data,
250 |     source: source
251 |   });
252 |   if (SignalStorage[key]) {
253 |     Object.keys(SignalStorage[key]).forEach(id => {
254 |       SignalStorage[key][id](data);
255 |     });
256 |   }
257 | }
258 | export function subscribe(key, signalID, callback) {
259 |   if (typeof key === 'object') {
260 |     Object.keys(key).forEach(k => subscribe(k, key[k]));
261 |     return;
262 |   }
263 |   if (!SignalStorage[key]) SignalStorage[key] = {};
264 |   if (typeof signalID === 'function') {
265 |     callback = signalID;
266 |     signalID = getNewId();
267 |   }
268 |   Eif (!SignalStorage[key][signalID]) {
269 |     SignalStorage[key][signalID] = callback;
270 |   }
271 | }
272 | export function unsubscribe(key, signalID) {
273 |   if (key === null) {
274 |     Object.keys(SignalStorage).forEach(key => {
275 |       if (SignalStorage[key][signalID]) delete SignalStorage[key][signalID];
276 |     });
277 |   } else {
278 |     if (SignalStorage[key][signalID]) delete SignalStorage[key][signalID];
279 |   }
280 | }
281 |  
282 | export function signal(Component, subscribeTo) {
283 |   return class SignalComponent extends React.Component {
284 |     constructor(props) {
285 |       super(props);
286 |       this._signalID = (Component.name || '') + '_' + getNewId();
287 |       this._dispatch = (key, data) => {
288 |         dispatch(key, data, this._signalID);
289 |       }
290 |       this._subscribe = (...keys) => {
291 |         keys.forEach(key => {
292 |           subscribe(key, this._signalID, data => this.setState({ [key]: data }));
293 |         });
294 |       }
295 |       this._unsubscribe = (...keys) => {
296 |         if (keys.length === 0) {
297 |           unsubscribe(null, this._signalID);
298 |           return;
299 |         }
300 |         keys.forEach(key => {
301 |           unsubscribe(key, this._signalID);
302 |         });
303 |       }
304 |  
305 |       subscribeTo && subscribeTo.forEach(to => this._subscribe(to));
306 |       Object.keys(props).forEach(prop => {
307 |         Eif (props[prop] === true) this._subscribe(prop);
308 |       })
309 |     }
310 |     render() {
311 |       return <Component
312 |         { ...this.props }
313 |         { ...this.state }
314 |         dispatch={ this._dispatch }
315 |         subscribe={ this._subscribe }
316 |         unsubscribe={ this._unsubscribe } />;
317 |     }
318 |   };
319 | }
321 |
322 |
323 | 327 | 328 | 329 | 336 | 337 | 338 | 339 | -------------------------------------------------------------------------------- /reports/lcov-report/prettify.js: -------------------------------------------------------------------------------- 1 | window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); 2 | -------------------------------------------------------------------------------- /reports/coverage.raw.json: -------------------------------------------------------------------------------- 1 | {"/Users/krasimir/Work/Krasimir/hocbox/src/index.js":{"path":"/Users/krasimir/Work/Krasimir/hocbox/src/index.js","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}},"1":{"start":{"line":5,"column":12},"end":{"line":5,"column":29}},"2":{"start":{"line":7,"column":0},"end":{"line":15,"column":3}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":56}},"4":{"start":{"line":8,"column":49},"end":{"line":8,"column":56}},"5":{"start":{"line":9,"column":2},"end":{"line":14,"column":5}},"6":{"start":{"line":12,"column":6},"end":{"line":12,"column":24}},"7":{"start":{"line":17,"column":10},"end":{"line":17,"column":25}},"8":{"start":{"line":19,"column":0},"end":{"line":27,"column":3}},"9":{"start":{"line":20,"column":2},"end":{"line":20,"column":56}},"10":{"start":{"line":20,"column":49},"end":{"line":20,"column":56}},"11":{"start":{"line":21,"column":2},"end":{"line":26,"column":5}},"12":{"start":{"line":24,"column":6},"end":{"line":24,"column":22}},"13":{"start":{"line":29,"column":14},"end":{"line":29,"column":33}},"14":{"start":{"line":31,"column":0},"end":{"line":39,"column":3}},"15":{"start":{"line":32,"column":2},"end":{"line":32,"column":56}},"16":{"start":{"line":32,"column":49},"end":{"line":32,"column":56}},"17":{"start":{"line":33,"column":2},"end":{"line":38,"column":5}},"18":{"start":{"line":36,"column":6},"end":{"line":36,"column":26}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":7,"column":27},"end":{"line":7,"column":28}},"loc":{"start":{"line":7,"column":42},"end":{"line":15,"column":1}},"line":7},"1":{"name":"get","decl":{"start":{"line":11,"column":18},"end":{"line":11,"column":21}},"loc":{"start":{"line":11,"column":24},"end":{"line":13,"column":5}},"line":11},"2":{"name":"(anonymous_2)","decl":{"start":{"line":19,"column":25},"end":{"line":19,"column":26}},"loc":{"start":{"line":19,"column":40},"end":{"line":27,"column":1}},"line":19},"3":{"name":"get","decl":{"start":{"line":23,"column":18},"end":{"line":23,"column":21}},"loc":{"start":{"line":23,"column":24},"end":{"line":25,"column":5}},"line":23},"4":{"name":"(anonymous_4)","decl":{"start":{"line":31,"column":29},"end":{"line":31,"column":30}},"loc":{"start":{"line":31,"column":44},"end":{"line":39,"column":1}},"line":31},"5":{"name":"get","decl":{"start":{"line":35,"column":18},"end":{"line":35,"column":21}},"loc":{"start":{"line":35,"column":24},"end":{"line":37,"column":5}},"line":35}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":56}},"type":"if","locations":[{"start":{"line":8,"column":2},"end":{"line":8,"column":56}},{"start":{"line":8,"column":2},"end":{"line":8,"column":56}}],"line":8},"1":{"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":47}},"type":"binary-expr","locations":[{"start":{"line":8,"column":6},"end":{"line":8,"column":23}},{"start":{"line":8,"column":27},"end":{"line":8,"column":47}}],"line":8},"2":{"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":56}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":20,"column":56}},{"start":{"line":20,"column":2},"end":{"line":20,"column":56}}],"line":20},"3":{"loc":{"start":{"line":20,"column":6},"end":{"line":20,"column":47}},"type":"binary-expr","locations":[{"start":{"line":20,"column":6},"end":{"line":20,"column":23}},{"start":{"line":20,"column":27},"end":{"line":20,"column":47}}],"line":20},"4":{"loc":{"start":{"line":32,"column":2},"end":{"line":32,"column":56}},"type":"if","locations":[{"start":{"line":32,"column":2},"end":{"line":32,"column":56}},{"start":{"line":32,"column":2},"end":{"line":32,"column":56}}],"line":32},"5":{"loc":{"start":{"line":32,"column":6},"end":{"line":32,"column":47}},"type":"binary-expr","locations":[{"start":{"line":32,"column":6},"end":{"line":32,"column":23}},{"start":{"line":32,"column":27},"end":{"line":32,"column":47}}],"line":32}},"s":{"0":1,"1":1,"2":1,"3":2,"4":1,"5":1,"6":5,"7":1,"8":1,"9":5,"10":1,"11":4,"12":9,"13":1,"14":1,"15":7,"16":1,"17":6,"18":31},"f":{"0":2,"1":5,"2":5,"3":9,"4":7,"5":31},"b":{"0":[1,1],"1":[2,2],"2":[1,4],"3":[5,5],"4":[1,6],"5":[7,7]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"547ff61558531179ef2660e4ebd7e97cbcc16d0e"},"/Users/krasimir/Work/Krasimir/hocbox/src/feed.js":{"path":"/Users/krasimir/Work/Krasimir/hocbox/src/feed.js","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}},"1":{"start":{"line":5,"column":15},"end":{"line":5,"column":256}},"2":{"start":{"line":5,"column":52},"end":{"line":5,"column":239}},"3":{"start":{"line":5,"column":110},"end":{"line":5,"column":122}},"4":{"start":{"line":5,"column":124},"end":{"line":5,"column":237}},"5":{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},"6":{"start":{"line":5,"column":207},"end":{"line":5,"column":233}},"7":{"start":{"line":5,"column":240},"end":{"line":5,"column":254}},"8":{"start":{"line":7,"column":0},"end":{"line":7,"column":20}},"9":{"start":{"line":9,"column":13},"end":{"line":9,"column":29}},"10":{"start":{"line":11,"column":14},"end":{"line":11,"column":44}},"11":{"start":{"line":13,"column":39},"end":{"line":13,"column":93}},"12":{"start":{"line":15,"column":50},"end":{"line":15,"column":151}},"13":{"start":{"line":15,"column":92},"end":{"line":15,"column":149}},"14":{"start":{"line":17,"column":50},"end":{"line":17,"column":151}},"15":{"start":{"line":17,"column":63},"end":{"line":17,"column":149}},"16":{"start":{"line":17,"column":152},"end":{"line":17,"column":238}},"17":{"start":{"line":19,"column":43},"end":{"line":19,"column":208}},"18":{"start":{"line":19,"column":106},"end":{"line":19,"column":206}},"19":{"start":{"line":19,"column":209},"end":{"line":19,"column":373}},"20":{"start":{"line":19,"column":374},"end":{"line":19,"column":492}},"21":{"start":{"line":19,"column":390},"end":{"line":19,"column":492}},"22":{"start":{"line":22,"column":19},"end":{"line":22,"column":21}},"23":{"start":{"line":23,"column":26},"end":{"line":23,"column":28}},"24":{"start":{"line":25,"column":2},"end":{"line":59,"column":31}},"25":{"start":{"line":26,"column":4},"end":{"line":26,"column":47}},"26":{"start":{"line":28,"column":4},"end":{"line":33,"column":6}},"27":{"start":{"line":29,"column":6},"end":{"line":29,"column":32}},"28":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"29":{"start":{"line":30,"column":33},"end":{"line":32,"column":9}},"30":{"start":{"line":31,"column":8},"end":{"line":31,"column":24}},"31":{"start":{"line":36,"column":6},"end":{"line":36,"column":43}},"32":{"start":{"line":38,"column":18},"end":{"line":38,"column":86}},"33":{"start":{"line":40,"column":6},"end":{"line":40,"column":53}},"34":{"start":{"line":42,"column":6},"end":{"line":50,"column":7}},"35":{"start":{"line":43,"column":8},"end":{"line":45,"column":11}},"36":{"start":{"line":44,"column":10},"end":{"line":44,"column":63}},"37":{"start":{"line":47,"column":8},"end":{"line":49,"column":11}},"38":{"start":{"line":48,"column":10},"end":{"line":48,"column":58}},"39":{"start":{"line":51,"column":6},"end":{"line":51,"column":19}},"40":{"start":{"line":54,"column":4},"end":{"line":56,"column":6}},"41":{"start":{"line":55,"column":6},"end":{"line":55,"column":102}},"42":{"start":{"line":58,"column":4},"end":{"line":58,"column":25}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":32},"end":{"line":5,"column":33}},"loc":{"start":{"line":5,"column":50},"end":{"line":5,"column":256}},"line":5},"1":{"name":"_interopRequireDefault","decl":{"start":{"line":13,"column":9},"end":{"line":13,"column":31}},"loc":{"start":{"line":13,"column":37},"end":{"line":13,"column":95}},"line":13},"2":{"name":"_classCallCheck","decl":{"start":{"line":15,"column":9},"end":{"line":15,"column":24}},"loc":{"start":{"line":15,"column":48},"end":{"line":15,"column":153}},"line":15},"3":{"name":"_possibleConstructorReturn","decl":{"start":{"line":17,"column":9},"end":{"line":17,"column":35}},"loc":{"start":{"line":17,"column":48},"end":{"line":17,"column":240}},"line":17},"4":{"name":"_inherits","decl":{"start":{"line":19,"column":9},"end":{"line":19,"column":18}},"loc":{"start":{"line":19,"column":41},"end":{"line":19,"column":494}},"line":19},"5":{"name":"feed","decl":{"start":{"line":21,"column":9},"end":{"line":21,"column":13}},"loc":{"start":{"line":21,"column":25},"end":{"line":60,"column":1}},"line":21},"6":{"name":"(anonymous_6)","decl":{"start":{"line":25,"column":9},"end":{"line":25,"column":10}},"loc":{"start":{"line":25,"column":37},"end":{"line":59,"column":3}},"line":25},"7":{"name":"feed","decl":{"start":{"line":28,"column":34},"end":{"line":28,"column":38}},"loc":{"start":{"line":28,"column":46},"end":{"line":33,"column":5}},"line":28},"8":{"name":"(anonymous_8)","decl":{"start":{"line":30,"column":52},"end":{"line":30,"column":53}},"loc":{"start":{"line":30,"column":65},"end":{"line":32,"column":7}},"line":30},"9":{"name":"FeedComponent","decl":{"start":{"line":35,"column":13},"end":{"line":35,"column":26}},"loc":{"start":{"line":35,"column":34},"end":{"line":52,"column":5}},"line":35},"10":{"name":"(anonymous_10)","decl":{"start":{"line":43,"column":24},"end":{"line":43,"column":25}},"loc":{"start":{"line":43,"column":36},"end":{"line":45,"column":9}},"line":43},"11":{"name":"(anonymous_11)","decl":{"start":{"line":47,"column":24},"end":{"line":47,"column":25}},"loc":{"start":{"line":47,"column":45},"end":{"line":49,"column":9}},"line":47},"12":{"name":"render","decl":{"start":{"line":54,"column":46},"end":{"line":54,"column":52}},"loc":{"start":{"line":54,"column":55},"end":{"line":56,"column":5}},"line":54}},"branchMap":{"0":{"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":256}},"type":"binary-expr","locations":[{"start":{"line":5,"column":15},"end":{"line":5,"column":28}},{"start":{"line":5,"column":32},"end":{"line":5,"column":256}}],"line":5},"1":{"loc":{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},"type":"if","locations":[{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},{"start":{"line":5,"column":150},"end":{"line":5,"column":235}}],"line":5},"2":{"loc":{"start":{"line":13,"column":46},"end":{"line":13,"column":92}},"type":"cond-expr","locations":[{"start":{"line":13,"column":70},"end":{"line":13,"column":73}},{"start":{"line":13,"column":76},"end":{"line":13,"column":92}}],"line":13},"3":{"loc":{"start":{"line":13,"column":46},"end":{"line":13,"column":67}},"type":"binary-expr","locations":[{"start":{"line":13,"column":46},"end":{"line":13,"column":49}},{"start":{"line":13,"column":53},"end":{"line":13,"column":67}}],"line":13},"4":{"loc":{"start":{"line":15,"column":50},"end":{"line":15,"column":151}},"type":"if","locations":[{"start":{"line":15,"column":50},"end":{"line":15,"column":151}},{"start":{"line":15,"column":50},"end":{"line":15,"column":151}}],"line":15},"5":{"loc":{"start":{"line":17,"column":50},"end":{"line":17,"column":151}},"type":"if","locations":[{"start":{"line":17,"column":50},"end":{"line":17,"column":151}},{"start":{"line":17,"column":50},"end":{"line":17,"column":151}}],"line":17},"6":{"loc":{"start":{"line":17,"column":159},"end":{"line":17,"column":237}},"type":"cond-expr","locations":[{"start":{"line":17,"column":226},"end":{"line":17,"column":230}},{"start":{"line":17,"column":233},"end":{"line":17,"column":237}}],"line":17},"7":{"loc":{"start":{"line":17,"column":159},"end":{"line":17,"column":223}},"type":"binary-expr","locations":[{"start":{"line":17,"column":159},"end":{"line":17,"column":163}},{"start":{"line":17,"column":168},"end":{"line":17,"column":192}},{"start":{"line":17,"column":196},"end":{"line":17,"column":222}}],"line":17},"8":{"loc":{"start":{"line":19,"column":43},"end":{"line":19,"column":208}},"type":"if","locations":[{"start":{"line":19,"column":43},"end":{"line":19,"column":208}},{"start":{"line":19,"column":43},"end":{"line":19,"column":208}}],"line":19},"9":{"loc":{"start":{"line":19,"column":47},"end":{"line":19,"column":102}},"type":"binary-expr","locations":[{"start":{"line":19,"column":47},"end":{"line":19,"column":79}},{"start":{"line":19,"column":83},"end":{"line":19,"column":102}}],"line":19},"10":{"loc":{"start":{"line":19,"column":244},"end":{"line":19,"column":278}},"type":"binary-expr","locations":[{"start":{"line":19,"column":244},"end":{"line":19,"column":254}},{"start":{"line":19,"column":258},"end":{"line":19,"column":278}}],"line":19},"11":{"loc":{"start":{"line":19,"column":374},"end":{"line":19,"column":492}},"type":"if","locations":[{"start":{"line":19,"column":374},"end":{"line":19,"column":492}},{"start":{"line":19,"column":374},"end":{"line":19,"column":492}}],"line":19},"12":{"loc":{"start":{"line":19,"column":390},"end":{"line":19,"column":491}},"type":"cond-expr","locations":[{"start":{"line":19,"column":414},"end":{"line":19,"column":457}},{"start":{"line":19,"column":460},"end":{"line":19,"column":491}}],"line":19},"13":{"loc":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"type":"if","locations":[{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},{"start":{"line":30,"column":6},"end":{"line":32,"column":9}}],"line":30},"14":{"loc":{"start":{"line":42,"column":6},"end":{"line":50,"column":7}},"type":"if","locations":[{"start":{"line":42,"column":6},"end":{"line":50,"column":7}},{"start":{"line":42,"column":6},"end":{"line":50,"column":7}}],"line":42}},"s":{"0":1,"1":1,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":1,"9":1,"10":1,"11":1,"12":6,"13":0,"14":6,"15":0,"16":6,"17":5,"18":0,"19":5,"20":5,"21":5,"22":5,"23":5,"24":5,"25":5,"26":5,"27":4,"28":4,"29":3,"30":4,"31":6,"32":6,"33":6,"34":6,"35":2,"36":2,"37":4,"38":2,"39":6,"40":5,"41":10,"42":5},"f":{"0":0,"1":1,"2":6,"3":6,"4":5,"5":5,"6":5,"7":4,"8":4,"9":6,"10":2,"11":2,"12":10},"b":{"0":[1,0],"1":[0,0],"2":[0,1],"3":[1,1],"4":[0,6],"5":[0,6],"6":[0,6],"7":[6,0,0],"8":[0,5],"9":[5,0],"10":[5,5],"11":[5,0],"12":[5,0],"13":[3,1],"14":[2,4]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"a9fc169f177461c0dd7b742d34cf45da172b93a7"},"/Users/krasimir/Work/Krasimir/hocbox/src/di.js":{"path":"/Users/krasimir/Work/Krasimir/hocbox/src/di.js","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}},"1":{"start":{"line":5,"column":15},"end":{"line":5,"column":256}},"2":{"start":{"line":5,"column":52},"end":{"line":5,"column":239}},"3":{"start":{"line":5,"column":110},"end":{"line":5,"column":122}},"4":{"start":{"line":5,"column":124},"end":{"line":5,"column":237}},"5":{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},"6":{"start":{"line":5,"column":207},"end":{"line":5,"column":233}},"7":{"start":{"line":5,"column":240},"end":{"line":5,"column":254}},"8":{"start":{"line":7,"column":0},"end":{"line":7,"column":22}},"9":{"start":{"line":8,"column":0},"end":{"line":8,"column":32}},"10":{"start":{"line":9,"column":0},"end":{"line":9,"column":28}},"11":{"start":{"line":10,"column":0},"end":{"line":10,"column":20}},"12":{"start":{"line":12,"column":13},"end":{"line":12,"column":29}},"13":{"start":{"line":14,"column":14},"end":{"line":14,"column":44}},"14":{"start":{"line":16,"column":39},"end":{"line":16,"column":93}},"15":{"start":{"line":18,"column":50},"end":{"line":18,"column":151}},"16":{"start":{"line":18,"column":92},"end":{"line":18,"column":149}},"17":{"start":{"line":20,"column":50},"end":{"line":20,"column":151}},"18":{"start":{"line":20,"column":63},"end":{"line":20,"column":149}},"19":{"start":{"line":20,"column":152},"end":{"line":20,"column":238}},"20":{"start":{"line":22,"column":43},"end":{"line":22,"column":208}},"21":{"start":{"line":22,"column":106},"end":{"line":22,"column":206}},"22":{"start":{"line":22,"column":209},"end":{"line":22,"column":373}},"23":{"start":{"line":22,"column":374},"end":{"line":22,"column":492}},"24":{"start":{"line":22,"column":390},"end":{"line":22,"column":492}},"25":{"start":{"line":24,"column":11},"end":{"line":24,"column":13}},"26":{"start":{"line":27,"column":13},"end":{"line":30,"column":4}},"27":{"start":{"line":28,"column":4},"end":{"line":28,"column":54}},"28":{"start":{"line":28,"column":28},"end":{"line":28,"column":54}},"29":{"start":{"line":29,"column":4},"end":{"line":29,"column":75}},"30":{"start":{"line":32,"column":2},"end":{"line":32,"column":36}},"31":{"start":{"line":35,"column":2},"end":{"line":35,"column":41}},"32":{"start":{"line":35,"column":22},"end":{"line":35,"column":41}},"33":{"start":{"line":36,"column":2},"end":{"line":36,"column":93}},"34":{"start":{"line":36,"column":48},"end":{"line":36,"column":93}},"35":{"start":{"line":37,"column":2},"end":{"line":37,"column":53}},"36":{"start":{"line":41,"column":2},"end":{"line":41,"column":12}},"37":{"start":{"line":45,"column":16},"end":{"line":45,"column":92}},"38":{"start":{"line":47,"column":2},"end":{"line":47,"column":41}},"39":{"start":{"line":47,"column":22},"end":{"line":47,"column":41}},"40":{"start":{"line":48,"column":2},"end":{"line":48,"column":93}},"41":{"start":{"line":48,"column":48},"end":{"line":48,"column":93}},"42":{"start":{"line":49,"column":2},"end":{"line":51,"column":5}},"43":{"start":{"line":50,"column":4},"end":{"line":50,"column":15}},"44":{"start":{"line":55,"column":16},"end":{"line":55,"column":92}},"45":{"start":{"line":57,"column":2},"end":{"line":57,"column":41}},"46":{"start":{"line":57,"column":22},"end":{"line":57,"column":41}},"47":{"start":{"line":58,"column":2},"end":{"line":60,"column":5}},"48":{"start":{"line":59,"column":4},"end":{"line":59,"column":50}},"49":{"start":{"line":64,"column":16},"end":{"line":64,"column":92}},"50":{"start":{"line":66,"column":22},"end":{"line":66,"column":85}},"51":{"start":{"line":69,"column":2},"end":{"line":71,"column":14}},"52":{"start":{"line":70,"column":4},"end":{"line":70,"column":36}},"53":{"start":{"line":73,"column":2},"end":{"line":93,"column":31}},"54":{"start":{"line":74,"column":4},"end":{"line":74,"column":45}},"55":{"start":{"line":77,"column":6},"end":{"line":77,"column":41}},"56":{"start":{"line":79,"column":18},"end":{"line":79,"column":86}},"57":{"start":{"line":81,"column":6},"end":{"line":81,"column":51}},"58":{"start":{"line":82,"column":6},"end":{"line":84,"column":8}},"59":{"start":{"line":83,"column":8},"end":{"line":83,"column":62}},"60":{"start":{"line":85,"column":6},"end":{"line":85,"column":19}},"61":{"start":{"line":88,"column":4},"end":{"line":90,"column":6}},"62":{"start":{"line":89,"column":6},"end":{"line":89,"column":102}},"63":{"start":{"line":92,"column":4},"end":{"line":92,"column":23}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":32},"end":{"line":5,"column":33}},"loc":{"start":{"line":5,"column":50},"end":{"line":5,"column":256}},"line":5},"1":{"name":"_interopRequireDefault","decl":{"start":{"line":16,"column":9},"end":{"line":16,"column":31}},"loc":{"start":{"line":16,"column":37},"end":{"line":16,"column":95}},"line":16},"2":{"name":"_classCallCheck","decl":{"start":{"line":18,"column":9},"end":{"line":18,"column":24}},"loc":{"start":{"line":18,"column":48},"end":{"line":18,"column":153}},"line":18},"3":{"name":"_possibleConstructorReturn","decl":{"start":{"line":20,"column":9},"end":{"line":20,"column":35}},"loc":{"start":{"line":20,"column":48},"end":{"line":20,"column":240}},"line":20},"4":{"name":"_inherits","decl":{"start":{"line":22,"column":9},"end":{"line":22,"column":18}},"loc":{"start":{"line":22,"column":41},"end":{"line":22,"column":494}},"line":22},"5":{"name":"dependenciesToProps","decl":{"start":{"line":26,"column":9},"end":{"line":26,"column":28}},"loc":{"start":{"line":26,"column":64},"end":{"line":33,"column":1}},"line":26},"6":{"name":"(anonymous_6)","decl":{"start":{"line":27,"column":30},"end":{"line":27,"column":31}},"loc":{"start":{"line":27,"column":45},"end":{"line":30,"column":3}},"line":27},"7":{"name":"registerDependenciesToPropsCallback","decl":{"start":{"line":34,"column":9},"end":{"line":34,"column":44}},"loc":{"start":{"line":34,"column":60},"end":{"line":38,"column":1}},"line":34},"8":{"name":"clear","decl":{"start":{"line":40,"column":9},"end":{"line":40,"column":14}},"loc":{"start":{"line":40,"column":17},"end":{"line":42,"column":1}},"line":40},"9":{"name":"invalidate","decl":{"start":{"line":44,"column":9},"end":{"line":44,"column":19}},"loc":{"start":{"line":44,"column":22},"end":{"line":52,"column":1}},"line":44},"10":{"name":"(anonymous_10)","decl":{"start":{"line":49,"column":50},"end":{"line":49,"column":51}},"loc":{"start":{"line":49,"column":63},"end":{"line":51,"column":3}},"line":49},"11":{"name":"register","decl":{"start":{"line":54,"column":9},"end":{"line":54,"column":17}},"loc":{"start":{"line":54,"column":32},"end":{"line":61,"column":1}},"line":54},"12":{"name":"(anonymous_12)","decl":{"start":{"line":58,"column":36},"end":{"line":58,"column":37}},"loc":{"start":{"line":58,"column":51},"end":{"line":60,"column":3}},"line":58},"13":{"name":"wire","decl":{"start":{"line":63,"column":9},"end":{"line":63,"column":13}},"loc":{"start":{"line":63,"column":51},"end":{"line":94,"column":1}},"line":63},"14":{"name":"(anonymous_14)","decl":{"start":{"line":69,"column":38},"end":{"line":69,"column":39}},"loc":{"start":{"line":69,"column":50},"end":{"line":71,"column":3}},"line":69},"15":{"name":"(anonymous_15)","decl":{"start":{"line":73,"column":9},"end":{"line":73,"column":10}},"loc":{"start":{"line":73,"column":37},"end":{"line":93,"column":3}},"line":73},"16":{"name":"DIComponent","decl":{"start":{"line":76,"column":13},"end":{"line":76,"column":24}},"loc":{"start":{"line":76,"column":32},"end":{"line":86,"column":5}},"line":76},"17":{"name":"_listener","decl":{"start":{"line":82,"column":27},"end":{"line":82,"column":36}},"loc":{"start":{"line":82,"column":39},"end":{"line":84,"column":7}},"line":82},"18":{"name":"render","decl":{"start":{"line":88,"column":44},"end":{"line":88,"column":50}},"loc":{"start":{"line":88,"column":53},"end":{"line":90,"column":5}},"line":88}},"branchMap":{"0":{"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":256}},"type":"binary-expr","locations":[{"start":{"line":5,"column":15},"end":{"line":5,"column":28}},{"start":{"line":5,"column":32},"end":{"line":5,"column":256}}],"line":5},"1":{"loc":{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},"type":"if","locations":[{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},{"start":{"line":5,"column":150},"end":{"line":5,"column":235}}],"line":5},"2":{"loc":{"start":{"line":16,"column":46},"end":{"line":16,"column":92}},"type":"cond-expr","locations":[{"start":{"line":16,"column":70},"end":{"line":16,"column":73}},{"start":{"line":16,"column":76},"end":{"line":16,"column":92}}],"line":16},"3":{"loc":{"start":{"line":16,"column":46},"end":{"line":16,"column":67}},"type":"binary-expr","locations":[{"start":{"line":16,"column":46},"end":{"line":16,"column":49}},{"start":{"line":16,"column":53},"end":{"line":16,"column":67}}],"line":16},"4":{"loc":{"start":{"line":18,"column":50},"end":{"line":18,"column":151}},"type":"if","locations":[{"start":{"line":18,"column":50},"end":{"line":18,"column":151}},{"start":{"line":18,"column":50},"end":{"line":18,"column":151}}],"line":18},"5":{"loc":{"start":{"line":20,"column":50},"end":{"line":20,"column":151}},"type":"if","locations":[{"start":{"line":20,"column":50},"end":{"line":20,"column":151}},{"start":{"line":20,"column":50},"end":{"line":20,"column":151}}],"line":20},"6":{"loc":{"start":{"line":20,"column":159},"end":{"line":20,"column":237}},"type":"cond-expr","locations":[{"start":{"line":20,"column":226},"end":{"line":20,"column":230}},{"start":{"line":20,"column":233},"end":{"line":20,"column":237}}],"line":20},"7":{"loc":{"start":{"line":20,"column":159},"end":{"line":20,"column":223}},"type":"binary-expr","locations":[{"start":{"line":20,"column":159},"end":{"line":20,"column":163}},{"start":{"line":20,"column":168},"end":{"line":20,"column":192}},{"start":{"line":20,"column":196},"end":{"line":20,"column":222}}],"line":20},"8":{"loc":{"start":{"line":22,"column":43},"end":{"line":22,"column":208}},"type":"if","locations":[{"start":{"line":22,"column":43},"end":{"line":22,"column":208}},{"start":{"line":22,"column":43},"end":{"line":22,"column":208}}],"line":22},"9":{"loc":{"start":{"line":22,"column":47},"end":{"line":22,"column":102}},"type":"binary-expr","locations":[{"start":{"line":22,"column":47},"end":{"line":22,"column":79}},{"start":{"line":22,"column":83},"end":{"line":22,"column":102}}],"line":22},"10":{"loc":{"start":{"line":22,"column":244},"end":{"line":22,"column":278}},"type":"binary-expr","locations":[{"start":{"line":22,"column":244},"end":{"line":22,"column":254}},{"start":{"line":22,"column":258},"end":{"line":22,"column":278}}],"line":22},"11":{"loc":{"start":{"line":22,"column":374},"end":{"line":22,"column":492}},"type":"if","locations":[{"start":{"line":22,"column":374},"end":{"line":22,"column":492}},{"start":{"line":22,"column":374},"end":{"line":22,"column":492}}],"line":22},"12":{"loc":{"start":{"line":22,"column":390},"end":{"line":22,"column":491}},"type":"cond-expr","locations":[{"start":{"line":22,"column":414},"end":{"line":22,"column":457}},{"start":{"line":22,"column":460},"end":{"line":22,"column":491}}],"line":22},"13":{"loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":54}},"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":28,"column":54}},{"start":{"line":28,"column":4},"end":{"line":28,"column":54}}],"line":28},"14":{"loc":{"start":{"line":35,"column":2},"end":{"line":35,"column":41}},"type":"if","locations":[{"start":{"line":35,"column":2},"end":{"line":35,"column":41}},{"start":{"line":35,"column":2},"end":{"line":35,"column":41}}],"line":35},"15":{"loc":{"start":{"line":36,"column":2},"end":{"line":36,"column":93}},"type":"if","locations":[{"start":{"line":36,"column":2},"end":{"line":36,"column":93}},{"start":{"line":36,"column":2},"end":{"line":36,"column":93}}],"line":36},"16":{"loc":{"start":{"line":45,"column":16},"end":{"line":45,"column":92}},"type":"cond-expr","locations":[{"start":{"line":45,"column":69},"end":{"line":45,"column":81}},{"start":{"line":45,"column":84},"end":{"line":45,"column":92}}],"line":45},"17":{"loc":{"start":{"line":45,"column":16},"end":{"line":45,"column":66}},"type":"binary-expr","locations":[{"start":{"line":45,"column":16},"end":{"line":45,"column":36}},{"start":{"line":45,"column":40},"end":{"line":45,"column":66}}],"line":45},"18":{"loc":{"start":{"line":47,"column":2},"end":{"line":47,"column":41}},"type":"if","locations":[{"start":{"line":47,"column":2},"end":{"line":47,"column":41}},{"start":{"line":47,"column":2},"end":{"line":47,"column":41}}],"line":47},"19":{"loc":{"start":{"line":48,"column":2},"end":{"line":48,"column":93}},"type":"if","locations":[{"start":{"line":48,"column":2},"end":{"line":48,"column":93}},{"start":{"line":48,"column":2},"end":{"line":48,"column":93}}],"line":48},"20":{"loc":{"start":{"line":55,"column":16},"end":{"line":55,"column":92}},"type":"cond-expr","locations":[{"start":{"line":55,"column":69},"end":{"line":55,"column":81}},{"start":{"line":55,"column":84},"end":{"line":55,"column":92}}],"line":55},"21":{"loc":{"start":{"line":55,"column":16},"end":{"line":55,"column":66}},"type":"binary-expr","locations":[{"start":{"line":55,"column":16},"end":{"line":55,"column":36}},{"start":{"line":55,"column":40},"end":{"line":55,"column":66}}],"line":55},"22":{"loc":{"start":{"line":57,"column":2},"end":{"line":57,"column":41}},"type":"if","locations":[{"start":{"line":57,"column":2},"end":{"line":57,"column":41}},{"start":{"line":57,"column":2},"end":{"line":57,"column":41}}],"line":57},"23":{"loc":{"start":{"line":64,"column":16},"end":{"line":64,"column":92}},"type":"cond-expr","locations":[{"start":{"line":64,"column":69},"end":{"line":64,"column":81}},{"start":{"line":64,"column":84},"end":{"line":64,"column":92}}],"line":64},"24":{"loc":{"start":{"line":64,"column":16},"end":{"line":64,"column":66}},"type":"binary-expr","locations":[{"start":{"line":64,"column":16},"end":{"line":64,"column":36}},{"start":{"line":64,"column":40},"end":{"line":64,"column":66}}],"line":64},"25":{"loc":{"start":{"line":70,"column":11},"end":{"line":70,"column":35}},"type":"binary-expr","locations":[{"start":{"line":70,"column":11},"end":{"line":70,"column":20}},{"start":{"line":70,"column":24},"end":{"line":70,"column":35}}],"line":70}},"s":{"0":1,"1":1,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":3,"16":0,"17":3,"18":0,"19":3,"20":3,"21":0,"22":3,"23":3,"24":3,"25":1,"26":4,"27":4,"28":4,"29":0,"30":4,"31":3,"32":0,"33":3,"34":3,"35":3,"36":2,"37":1,"38":1,"39":0,"40":1,"41":0,"42":1,"43":1,"44":3,"45":3,"46":3,"47":3,"48":3,"49":3,"50":3,"51":3,"52":1,"53":3,"54":3,"55":3,"56":3,"57":3,"58":3,"59":1,"60":3,"61":3,"62":4,"63":3},"f":{"0":0,"1":1,"2":3,"3":3,"4":3,"5":4,"6":4,"7":3,"8":2,"9":1,"10":1,"11":3,"12":3,"13":3,"14":1,"15":3,"16":3,"17":1,"18":4},"b":{"0":[1,0],"1":[0,0],"2":[0,1],"3":[1,1],"4":[0,3],"5":[0,3],"6":[0,3],"7":[3,0,0],"8":[0,3],"9":[3,0],"10":[3,3],"11":[3,0],"12":[3,0],"13":[4,0],"14":[0,3],"15":[3,0],"16":[0,1],"17":[1,0],"18":[0,1],"19":[0,1],"20":[1,2],"21":[3,1],"22":[3,0],"23":[1,2],"24":[3,1],"25":[1,1]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"caaeab62a4191a6a219a81c52c4abef50e6f5081"},"/Users/krasimir/Work/Krasimir/hocbox/src/signal.js":{"path":"/Users/krasimir/Work/Krasimir/hocbox/src/signal.js","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}},"1":{"start":{"line":5,"column":15},"end":{"line":5,"column":256}},"2":{"start":{"line":5,"column":52},"end":{"line":5,"column":239}},"3":{"start":{"line":5,"column":110},"end":{"line":5,"column":122}},"4":{"start":{"line":5,"column":124},"end":{"line":5,"column":237}},"5":{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},"6":{"start":{"line":5,"column":207},"end":{"line":5,"column":233}},"7":{"start":{"line":5,"column":240},"end":{"line":5,"column":254}},"8":{"start":{"line":7,"column":14},"end":{"line":7,"column":268}},"9":{"start":{"line":7,"column":101},"end":{"line":7,"column":119}},"10":{"start":{"line":7,"column":141},"end":{"line":7,"column":266}},"11":{"start":{"line":9,"column":0},"end":{"line":9,"column":24}},"12":{"start":{"line":10,"column":0},"end":{"line":10,"column":28}},"13":{"start":{"line":11,"column":0},"end":{"line":11,"column":28}},"14":{"start":{"line":12,"column":0},"end":{"line":12,"column":30}},"15":{"start":{"line":13,"column":0},"end":{"line":13,"column":34}},"16":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}},"17":{"start":{"line":16,"column":13},"end":{"line":16,"column":29}},"18":{"start":{"line":18,"column":14},"end":{"line":18,"column":44}},"19":{"start":{"line":20,"column":39},"end":{"line":20,"column":93}},"20":{"start":{"line":22,"column":50},"end":{"line":22,"column":151}},"21":{"start":{"line":22,"column":92},"end":{"line":22,"column":149}},"22":{"start":{"line":24,"column":50},"end":{"line":24,"column":151}},"23":{"start":{"line":24,"column":63},"end":{"line":24,"column":149}},"24":{"start":{"line":24,"column":152},"end":{"line":24,"column":238}},"25":{"start":{"line":26,"column":43},"end":{"line":26,"column":208}},"26":{"start":{"line":26,"column":106},"end":{"line":26,"column":206}},"27":{"start":{"line":26,"column":209},"end":{"line":26,"column":373}},"28":{"start":{"line":26,"column":374},"end":{"line":26,"column":492}},"29":{"start":{"line":26,"column":390},"end":{"line":26,"column":492}},"30":{"start":{"line":28,"column":20},"end":{"line":28,"column":22}},"31":{"start":{"line":29,"column":24},"end":{"line":29,"column":25}},"32":{"start":{"line":30,"column":16},"end":{"line":30,"column":18}},"33":{"start":{"line":33,"column":2},"end":{"line":33,"column":29}},"34":{"start":{"line":37,"column":2},"end":{"line":37,"column":19}},"35":{"start":{"line":41,"column":2},"end":{"line":41,"column":17}},"36":{"start":{"line":45,"column":2},"end":{"line":49,"column":5}},"37":{"start":{"line":50,"column":2},"end":{"line":54,"column":3}},"38":{"start":{"line":51,"column":4},"end":{"line":53,"column":7}},"39":{"start":{"line":52,"column":6},"end":{"line":52,"column":35}},"40":{"start":{"line":57,"column":2},"end":{"line":62,"column":3}},"41":{"start":{"line":58,"column":4},"end":{"line":60,"column":7}},"42":{"start":{"line":59,"column":6},"end":{"line":59,"column":34}},"43":{"start":{"line":61,"column":4},"end":{"line":61,"column":11}},"44":{"start":{"line":63,"column":2},"end":{"line":63,"column":51}},"45":{"start":{"line":63,"column":27},"end":{"line":63,"column":51}},"46":{"start":{"line":64,"column":2},"end":{"line":67,"column":3}},"47":{"start":{"line":65,"column":4},"end":{"line":65,"column":24}},"48":{"start":{"line":66,"column":4},"end":{"line":66,"column":26}},"49":{"start":{"line":68,"column":2},"end":{"line":70,"column":3}},"50":{"start":{"line":69,"column":4},"end":{"line":69,"column":44}},"51":{"start":{"line":73,"column":2},"end":{"line":79,"column":3}},"52":{"start":{"line":74,"column":4},"end":{"line":76,"column":7}},"53":{"start":{"line":75,"column":6},"end":{"line":75,"column":76}},"54":{"start":{"line":75,"column":40},"end":{"line":75,"column":76}},"55":{"start":{"line":78,"column":4},"end":{"line":78,"column":74}},"56":{"start":{"line":78,"column":38},"end":{"line":78,"column":74}},"57":{"start":{"line":83,"column":2},"end":{"line":139,"column":31}},"58":{"start":{"line":84,"column":4},"end":{"line":84,"column":49}},"59":{"start":{"line":87,"column":6},"end":{"line":87,"column":45}},"60":{"start":{"line":89,"column":18},"end":{"line":89,"column":86}},"61":{"start":{"line":91,"column":6},"end":{"line":91,"column":66}},"62":{"start":{"line":92,"column":6},"end":{"line":94,"column":8}},"63":{"start":{"line":93,"column":8},"end":{"line":93,"column":45}},"64":{"start":{"line":95,"column":6},"end":{"line":107,"column":8}},"65":{"start":{"line":96,"column":8},"end":{"line":98,"column":9}},"66":{"start":{"line":97,"column":10},"end":{"line":97,"column":39}},"67":{"start":{"line":100,"column":8},"end":{"line":106,"column":11}},"68":{"start":{"line":101,"column":10},"end":{"line":105,"column":13}},"69":{"start":{"line":104,"column":12},"end":{"line":104,"column":101}},"70":{"start":{"line":108,"column":6},"end":{"line":120,"column":8}},"71":{"start":{"line":109,"column":8},"end":{"line":111,"column":9}},"72":{"start":{"line":110,"column":10},"end":{"line":110,"column":41}},"73":{"start":{"line":113,"column":8},"end":{"line":116,"column":9}},"74":{"start":{"line":114,"column":10},"end":{"line":114,"column":45}},"75":{"start":{"line":115,"column":10},"end":{"line":115,"column":17}},"76":{"start":{"line":117,"column":8},"end":{"line":119,"column":11}},"77":{"start":{"line":118,"column":10},"end":{"line":118,"column":44}},"78":{"start":{"line":122,"column":6},"end":{"line":124,"column":9}},"79":{"start":{"line":123,"column":8},"end":{"line":123,"column":36}},"80":{"start":{"line":125,"column":6},"end":{"line":127,"column":9}},"81":{"start":{"line":126,"column":8},"end":{"line":126,"column":57}},"82":{"start":{"line":126,"column":34},"end":{"line":126,"column":57}},"83":{"start":{"line":128,"column":6},"end":{"line":128,"column":19}},"84":{"start":{"line":131,"column":4},"end":{"line":136,"column":6}},"85":{"start":{"line":132,"column":6},"end":{"line":135,"column":43}},"86":{"start":{"line":138,"column":4},"end":{"line":138,"column":27}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":32},"end":{"line":5,"column":33}},"loc":{"start":{"line":5,"column":50},"end":{"line":5,"column":256}},"line":5},"1":{"name":"(anonymous_1)","decl":{"start":{"line":7,"column":84},"end":{"line":7,"column":85}},"loc":{"start":{"line":7,"column":99},"end":{"line":7,"column":121}},"line":7},"2":{"name":"(anonymous_2)","decl":{"start":{"line":7,"column":124},"end":{"line":7,"column":125}},"loc":{"start":{"line":7,"column":139},"end":{"line":7,"column":268}},"line":7},"3":{"name":"_interopRequireDefault","decl":{"start":{"line":20,"column":9},"end":{"line":20,"column":31}},"loc":{"start":{"line":20,"column":37},"end":{"line":20,"column":95}},"line":20},"4":{"name":"_classCallCheck","decl":{"start":{"line":22,"column":9},"end":{"line":22,"column":24}},"loc":{"start":{"line":22,"column":48},"end":{"line":22,"column":153}},"line":22},"5":{"name":"_possibleConstructorReturn","decl":{"start":{"line":24,"column":9},"end":{"line":24,"column":35}},"loc":{"start":{"line":24,"column":48},"end":{"line":24,"column":240}},"line":24},"6":{"name":"_inherits","decl":{"start":{"line":26,"column":9},"end":{"line":26,"column":18}},"loc":{"start":{"line":26,"column":41},"end":{"line":26,"column":494}},"line":26},"7":{"name":"getNewId","decl":{"start":{"line":32,"column":9},"end":{"line":32,"column":17}},"loc":{"start":{"line":32,"column":20},"end":{"line":34,"column":1}},"line":32},"8":{"name":"getLog","decl":{"start":{"line":36,"column":9},"end":{"line":36,"column":15}},"loc":{"start":{"line":36,"column":18},"end":{"line":38,"column":1}},"line":36},"9":{"name":"clearLog","decl":{"start":{"line":40,"column":9},"end":{"line":40,"column":17}},"loc":{"start":{"line":40,"column":20},"end":{"line":42,"column":1}},"line":40},"10":{"name":"dispatch","decl":{"start":{"line":44,"column":9},"end":{"line":44,"column":17}},"loc":{"start":{"line":44,"column":37},"end":{"line":55,"column":1}},"line":44},"11":{"name":"(anonymous_11)","decl":{"start":{"line":51,"column":44},"end":{"line":51,"column":45}},"loc":{"start":{"line":51,"column":58},"end":{"line":53,"column":5}},"line":51},"12":{"name":"subscribe","decl":{"start":{"line":56,"column":9},"end":{"line":56,"column":18}},"loc":{"start":{"line":56,"column":44},"end":{"line":71,"column":1}},"line":56},"13":{"name":"(anonymous_13)","decl":{"start":{"line":58,"column":29},"end":{"line":58,"column":30}},"loc":{"start":{"line":58,"column":42},"end":{"line":60,"column":5}},"line":58},"14":{"name":"unsubscribe","decl":{"start":{"line":72,"column":9},"end":{"line":72,"column":20}},"loc":{"start":{"line":72,"column":36},"end":{"line":80,"column":1}},"line":72},"15":{"name":"(anonymous_15)","decl":{"start":{"line":74,"column":39},"end":{"line":74,"column":40}},"loc":{"start":{"line":74,"column":54},"end":{"line":76,"column":5}},"line":74},"16":{"name":"signal","decl":{"start":{"line":82,"column":9},"end":{"line":82,"column":15}},"loc":{"start":{"line":82,"column":40},"end":{"line":140,"column":1}},"line":82},"17":{"name":"(anonymous_17)","decl":{"start":{"line":83,"column":9},"end":{"line":83,"column":10}},"loc":{"start":{"line":83,"column":37},"end":{"line":139,"column":3}},"line":83},"18":{"name":"SignalComponent","decl":{"start":{"line":86,"column":13},"end":{"line":86,"column":28}},"loc":{"start":{"line":86,"column":36},"end":{"line":129,"column":5}},"line":86},"19":{"name":"(anonymous_19)","decl":{"start":{"line":92,"column":24},"end":{"line":92,"column":25}},"loc":{"start":{"line":92,"column":45},"end":{"line":94,"column":7}},"line":92},"20":{"name":"(anonymous_20)","decl":{"start":{"line":95,"column":25},"end":{"line":95,"column":26}},"loc":{"start":{"line":95,"column":37},"end":{"line":107,"column":7}},"line":95},"21":{"name":"(anonymous_21)","decl":{"start":{"line":100,"column":21},"end":{"line":100,"column":22}},"loc":{"start":{"line":100,"column":36},"end":{"line":106,"column":9}},"line":100},"22":{"name":"(anonymous_22)","decl":{"start":{"line":101,"column":42},"end":{"line":101,"column":43}},"loc":{"start":{"line":101,"column":58},"end":{"line":105,"column":11}},"line":101},"23":{"name":"(anonymous_23)","decl":{"start":{"line":108,"column":27},"end":{"line":108,"column":28}},"loc":{"start":{"line":108,"column":39},"end":{"line":120,"column":7}},"line":108},"24":{"name":"(anonymous_24)","decl":{"start":{"line":117,"column":21},"end":{"line":117,"column":22}},"loc":{"start":{"line":117,"column":36},"end":{"line":119,"column":9}},"line":117},"25":{"name":"(anonymous_25)","decl":{"start":{"line":122,"column":41},"end":{"line":122,"column":42}},"loc":{"start":{"line":122,"column":55},"end":{"line":124,"column":7}},"line":122},"26":{"name":"(anonymous_26)","decl":{"start":{"line":125,"column":33},"end":{"line":125,"column":34}},"loc":{"start":{"line":125,"column":49},"end":{"line":127,"column":7}},"line":125},"27":{"name":"render","decl":{"start":{"line":131,"column":48},"end":{"line":131,"column":54}},"loc":{"start":{"line":131,"column":57},"end":{"line":136,"column":5}},"line":131}},"branchMap":{"0":{"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":256}},"type":"binary-expr","locations":[{"start":{"line":5,"column":15},"end":{"line":5,"column":28}},{"start":{"line":5,"column":32},"end":{"line":5,"column":256}}],"line":5},"1":{"loc":{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},"type":"if","locations":[{"start":{"line":5,"column":150},"end":{"line":5,"column":235}},{"start":{"line":5,"column":150},"end":{"line":5,"column":235}}],"line":5},"2":{"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":268}},"type":"cond-expr","locations":[{"start":{"line":7,"column":84},"end":{"line":7,"column":121}},{"start":{"line":7,"column":124},"end":{"line":7,"column":268}}],"line":7},"3":{"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":81}},"type":"binary-expr","locations":[{"start":{"line":7,"column":14},"end":{"line":7,"column":42}},{"start":{"line":7,"column":46},"end":{"line":7,"column":81}}],"line":7},"4":{"loc":{"start":{"line":7,"column":148},"end":{"line":7,"column":265}},"type":"cond-expr","locations":[{"start":{"line":7,"column":244},"end":{"line":7,"column":252}},{"start":{"line":7,"column":255},"end":{"line":7,"column":265}}],"line":7},"5":{"loc":{"start":{"line":7,"column":148},"end":{"line":7,"column":241}},"type":"binary-expr","locations":[{"start":{"line":7,"column":148},"end":{"line":7,"column":151}},{"start":{"line":7,"column":155},"end":{"line":7,"column":183}},{"start":{"line":7,"column":187},"end":{"line":7,"column":213}},{"start":{"line":7,"column":217},"end":{"line":7,"column":241}}],"line":7},"6":{"loc":{"start":{"line":20,"column":46},"end":{"line":20,"column":92}},"type":"cond-expr","locations":[{"start":{"line":20,"column":70},"end":{"line":20,"column":73}},{"start":{"line":20,"column":76},"end":{"line":20,"column":92}}],"line":20},"7":{"loc":{"start":{"line":20,"column":46},"end":{"line":20,"column":67}},"type":"binary-expr","locations":[{"start":{"line":20,"column":46},"end":{"line":20,"column":49}},{"start":{"line":20,"column":53},"end":{"line":20,"column":67}}],"line":20},"8":{"loc":{"start":{"line":22,"column":50},"end":{"line":22,"column":151}},"type":"if","locations":[{"start":{"line":22,"column":50},"end":{"line":22,"column":151}},{"start":{"line":22,"column":50},"end":{"line":22,"column":151}}],"line":22},"9":{"loc":{"start":{"line":24,"column":50},"end":{"line":24,"column":151}},"type":"if","locations":[{"start":{"line":24,"column":50},"end":{"line":24,"column":151}},{"start":{"line":24,"column":50},"end":{"line":24,"column":151}}],"line":24},"10":{"loc":{"start":{"line":24,"column":159},"end":{"line":24,"column":237}},"type":"cond-expr","locations":[{"start":{"line":24,"column":226},"end":{"line":24,"column":230}},{"start":{"line":24,"column":233},"end":{"line":24,"column":237}}],"line":24},"11":{"loc":{"start":{"line":24,"column":159},"end":{"line":24,"column":223}},"type":"binary-expr","locations":[{"start":{"line":24,"column":159},"end":{"line":24,"column":163}},{"start":{"line":24,"column":168},"end":{"line":24,"column":192}},{"start":{"line":24,"column":196},"end":{"line":24,"column":222}}],"line":24},"12":{"loc":{"start":{"line":26,"column":43},"end":{"line":26,"column":208}},"type":"if","locations":[{"start":{"line":26,"column":43},"end":{"line":26,"column":208}},{"start":{"line":26,"column":43},"end":{"line":26,"column":208}}],"line":26},"13":{"loc":{"start":{"line":26,"column":47},"end":{"line":26,"column":102}},"type":"binary-expr","locations":[{"start":{"line":26,"column":47},"end":{"line":26,"column":79}},{"start":{"line":26,"column":83},"end":{"line":26,"column":102}}],"line":26},"14":{"loc":{"start":{"line":26,"column":244},"end":{"line":26,"column":278}},"type":"binary-expr","locations":[{"start":{"line":26,"column":244},"end":{"line":26,"column":254}},{"start":{"line":26,"column":258},"end":{"line":26,"column":278}}],"line":26},"15":{"loc":{"start":{"line":26,"column":374},"end":{"line":26,"column":492}},"type":"if","locations":[{"start":{"line":26,"column":374},"end":{"line":26,"column":492}},{"start":{"line":26,"column":374},"end":{"line":26,"column":492}}],"line":26},"16":{"loc":{"start":{"line":26,"column":390},"end":{"line":26,"column":491}},"type":"cond-expr","locations":[{"start":{"line":26,"column":414},"end":{"line":26,"column":457}},{"start":{"line":26,"column":460},"end":{"line":26,"column":491}}],"line":26},"17":{"loc":{"start":{"line":50,"column":2},"end":{"line":54,"column":3}},"type":"if","locations":[{"start":{"line":50,"column":2},"end":{"line":54,"column":3}},{"start":{"line":50,"column":2},"end":{"line":54,"column":3}}],"line":50},"18":{"loc":{"start":{"line":57,"column":2},"end":{"line":62,"column":3}},"type":"if","locations":[{"start":{"line":57,"column":2},"end":{"line":62,"column":3}},{"start":{"line":57,"column":2},"end":{"line":62,"column":3}}],"line":57},"19":{"loc":{"start":{"line":57,"column":7},"end":{"line":57,"column":62}},"type":"cond-expr","locations":[{"start":{"line":57,"column":36},"end":{"line":57,"column":47}},{"start":{"line":57,"column":50},"end":{"line":57,"column":62}}],"line":57},"20":{"loc":{"start":{"line":63,"column":2},"end":{"line":63,"column":51}},"type":"if","locations":[{"start":{"line":63,"column":2},"end":{"line":63,"column":51}},{"start":{"line":63,"column":2},"end":{"line":63,"column":51}}],"line":63},"21":{"loc":{"start":{"line":64,"column":2},"end":{"line":67,"column":3}},"type":"if","locations":[{"start":{"line":64,"column":2},"end":{"line":67,"column":3}},{"start":{"line":64,"column":2},"end":{"line":67,"column":3}}],"line":64},"22":{"loc":{"start":{"line":68,"column":2},"end":{"line":70,"column":3}},"type":"if","locations":[{"start":{"line":68,"column":2},"end":{"line":70,"column":3}},{"start":{"line":68,"column":2},"end":{"line":70,"column":3}}],"line":68},"23":{"loc":{"start":{"line":73,"column":2},"end":{"line":79,"column":3}},"type":"if","locations":[{"start":{"line":73,"column":2},"end":{"line":79,"column":3}},{"start":{"line":73,"column":2},"end":{"line":79,"column":3}}],"line":73},"24":{"loc":{"start":{"line":75,"column":6},"end":{"line":75,"column":76}},"type":"if","locations":[{"start":{"line":75,"column":6},"end":{"line":75,"column":76}},{"start":{"line":75,"column":6},"end":{"line":75,"column":76}}],"line":75},"25":{"loc":{"start":{"line":78,"column":4},"end":{"line":78,"column":74}},"type":"if","locations":[{"start":{"line":78,"column":4},"end":{"line":78,"column":74}},{"start":{"line":78,"column":4},"end":{"line":78,"column":74}}],"line":78},"26":{"loc":{"start":{"line":91,"column":25},"end":{"line":91,"column":45}},"type":"binary-expr","locations":[{"start":{"line":91,"column":25},"end":{"line":91,"column":39}},{"start":{"line":91,"column":43},"end":{"line":91,"column":45}}],"line":91},"27":{"loc":{"start":{"line":113,"column":8},"end":{"line":116,"column":9}},"type":"if","locations":[{"start":{"line":113,"column":8},"end":{"line":116,"column":9}},{"start":{"line":113,"column":8},"end":{"line":116,"column":9}}],"line":113},"28":{"loc":{"start":{"line":122,"column":6},"end":{"line":124,"column":8}},"type":"binary-expr","locations":[{"start":{"line":122,"column":6},"end":{"line":122,"column":17}},{"start":{"line":122,"column":21},"end":{"line":124,"column":8}}],"line":122},"29":{"loc":{"start":{"line":126,"column":8},"end":{"line":126,"column":57}},"type":"if","locations":[{"start":{"line":126,"column":8},"end":{"line":126,"column":57}},{"start":{"line":126,"column":8},"end":{"line":126,"column":57}}],"line":126}},"s":{"0":1,"1":1,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":1,"9":16,"10":0,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":9,"21":0,"22":9,"23":0,"24":9,"25":9,"26":0,"27":9,"28":9,"29":9,"30":1,"31":1,"32":1,"33":12,"34":1,"35":8,"36":18,"37":18,"38":16,"39":26,"40":16,"41":1,"42":2,"43":1,"44":15,"45":8,"46":15,"47":3,"48":3,"49":15,"50":15,"51":4,"52":1,"53":3,"54":2,"55":3,"56":1,"57":9,"58":9,"59":9,"60":9,"61":9,"62":9,"63":7,"64":9,"65":12,"66":12,"67":12,"68":12,"69":23,"70":9,"71":4,"72":3,"73":4,"74":1,"75":1,"76":3,"77":3,"78":9,"79":2,"80":9,"81":10,"82":10,"83":9,"84":9,"85":32,"86":9},"f":{"0":0,"1":16,"2":0,"3":1,"4":9,"5":9,"6":9,"7":12,"8":1,"9":8,"10":18,"11":26,"12":16,"13":2,"14":4,"15":3,"16":9,"17":9,"18":9,"19":7,"20":12,"21":12,"22":23,"23":4,"24":3,"25":2,"26":10,"27":32},"b":{"0":[1,0],"1":[0,0],"2":[1,0],"3":[1,1],"4":[0,0],"5":[0,0,0,0],"6":[0,1],"7":[1,1],"8":[0,9],"9":[0,9],"10":[0,9],"11":[9,0,0],"12":[0,9],"13":[9,0],"14":[9,9],"15":[9,0],"16":[9,0],"17":[16,2],"18":[1,15],"19":[0,16],"20":[8,7],"21":[3,12],"22":[15,0],"23":[1,3],"24":[2,1],"25":[1,2],"26":[9,6],"27":[1,3],"28":[9,1],"29":[10,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"5560e31bf1607e2afa0ff51e6ac36ae6ad61a53c"}} --------------------------------------------------------------------------------