avances en plantillas

This commit is contained in:
JACS 2026-05-01 18:15:40 -05:00
parent 0f84beacf1
commit da0530d79b
2062 changed files with 598814 additions and 22 deletions

View file

@ -0,0 +1 @@
14.15.1

View file

@ -0,0 +1,229 @@
# Changelog
### 2.3.0 - 2020-11-25
- **[Feature]** #682 Multiple word search
- **[Feature]** #683 Debounced keyup handler in search
- **[Improvement]** #679 Faster search
- **[Website]** #684 Add more documentation for automagical search and sort elements
### 2.1.0 - 2020-11-21
- **[Feature]** #634 Add item template function
- **[Feature]** #591 Support adding custom pagination item
- **[Bugfix]** #667 Fix `getAttribute` fallback method
- **[Bugfix]** #636 Aviod strange ie11 bug
- **[Bugfix]** #570 Don't empty original value array when adding items async
- **[Misc]** #637 Reuse iteration indices
### 2.0.0 - 2020-11-21 - Winter cleanup 🧹
- **[Breaking]** Drop support for IE6-8
- **[Misc]** Update dev dependencies to latest version: Webpack 3.12.0 -> 5.6.0, jest 23.3 -> 26.6.3, jquery 3.3.1 -> 3.5.1, Removed: jshint jshint-loader
- **[Misc]** Replace uglify-js with terser
- **[Misc]** Update Node for dev from 6.15 to 14.15.1
- **[Misc]** Prettier on everything
- **[Misc]** Make release script simpler
- **[Misc]** Rename History.md to CHANGELOG.md
- **[Misc]** Use `babal-loader` with `@babel/preset-env` for supporting IE9-11
- **[Misc]** Add source-maps to `/dist`
- **[Misc]** Added WISHLIST.md for feature requests to allow cleanup of issue list.
- **[Misc]** Update CircleCI from 1.0 to 2.0
- **[Website]** Update Jekyll to remove security warnings
- **[Website]** Fix all examples (sorry that they we're broken)
- **[Website]** Use https instead of http for listjs.com
- **[Website]** Update Contribute guidelines [See commit →](https://github.com/javve/list.js/commit/6242496de2ac5c07903fb1590a5cb5129f0887a7)
- **[Bugfix]** Use one event listener per pagination and select page via data attributes
[See commit →](https://github.com/javve/list.js/commit/7610c59039f3b39f52175cd1a200e935664869e8)
- **[Bugfix]** Don't break pagination if page=0
[See commit →](https://github.com/javve/list.js/commit/b3db0de731d436422e016b5e17f7ceab5941cd5d)
[See commit →](https://github.com/javve/list.js/commit/725bc188d7ba72c7d234bda1e09fc50b40661310)
### 2017-01-29 v1.5.0
- **[Feature]** Bundle fuzzySearch and pagination plugins into List.js
[See commit →](https://github.com/javve/list.js/commit/2f5322fd139ee6f30cef3bb5e15d382ff29f9489)
- **[Misc]** Switch from Grunt to Webpack and from Mocha to Jest
[See commit →](https://github.com/javve/list.js/commit/8376ef01b1da4b6e60a7457d628d97a803a82e14)
### 2017-01-19 v1.4.1
- **[Bugfix]** Move string-natural-compare to dependencies instead of devDependencies
[See commit →](https://github.com/javve/list.js/commit/c17162b26fd5093d3ddde01e11a3f748310d993c)
### 2017-01-15 v1.4.0
- **[Bugfix/Feature]** Change natural-sort library to support custom alphabets
and thereby handle JavaScripts unicode bugs like sorting ÅÄÖ in Swedish wrong.
[See commit →](https://github.com/javve/list.js/commit/81e1386bed88d1f932e729feca2b3649e489bdfe)
### 2016-10-23 v1.3.0
- **[Bugfix]** Make mkdir in build script OS agnostic
[See commit →](https://github.com/javve/list.js/commit/ba387125efddd7f5f4f8360bce516ae740cb5ae5)
- **[Bugfix]** Make it possible to reset search columns
[See commit →](https://github.com/javve/list.js/commit/37edc1b98bf63a684d633f29e2f52106c21eaf7d)
- **[Bugfix]** Allow empty list without template.
[See commit →](https://github.com/javve/list.js/commit/95329b945c64c0ad0693df120ef00547eac9b029)
- **[Bugfix]** Make it possible to use <tr> as string template
[See commit →](https://github.com/javve/list.js/commit/38583e097cb75e369779b46c6129e1b8b8324f24)
- **[Misc]** Update NaturalSort to 0.8.1
[See commit →](https://github.com/javve/list.js/commit/42d3db491801677c63238d5db3e0e9257087999a)
- **[Misc]** Use local Browserify
[See commit →](https://github.com/javve/list.js/commit/83f6502dcea428fa2de2513d19ac71f82905ecb8)
- **[Misc]** Add version to start of minified file
[See commit →](https://github.com/javve/list.js/commit/79daff8da51aa047aae5d31e0af12cb30b395048)
- **[Misc]** Switch to GitHub pages for listjs.com
[See commit →](https://github.com/javve/list.js/commit/1af94012de89fd6bcf8446c31305ad517507c44b)
### 2016-02-27: v1.2.0
It's been two years since the last update of List.js. That is absolutely not ok
and I'm very sorry that it has taken so long. I promise I'll do better in the future!
Anyways, this release introduces a bunch of bug fixes and improvements, but most
importantly: List.js now has support for data attributes PLUS all other attributes.
[See an example]() and [read the docs](https://www.listjs.com/docs#example-6).
Another noteworthy update is that I've left Component and moved back all utils
to the core lib. Instead I'm using Browserify as module handler.
I hope you'll like this update!
- **[Misc]** Move form Component to Browserify
[See commit →](https://github.com/javve/list.js/commit/58695c93849b78787d9cf78cbf9be20b01cdcc8a)
- **[Misc]** Add tests to make sure List.js works with require.js
[See commit →](https://github.com/javve/list.js/commit/360098a04b87e18afd1b09e293a01a8dc113a01e)
- **[Misc]** Update all dependencies to latest version
[See commit →](https://github.com/javve/list.js/commit/881991cd204a19af5ed3c62c1239c1206fa51e6c)
- **[Breaking]** set sort order with List.js not sort function.
[See commit →](https://github.com/javve/list.js/commit/81d1148489c99b8503e725805c2a6ce2bde47b11)
- **[Breaking]** set default page size to 10000 instead of 200 (because: page size is confusing for new users)
[See commit →](https://github.com/javve/list.js/commit/618565b203b61c34b868a9cb86eea899e75ea4b6)
- **[Breaking]** Rename list.helpers to list.utils
[See commit →](https://github.com/javve/list.js/commit/58695c93849b78787d9cf78cbf9be20b01cdcc8a)
- **[Feature]** Add support for data attributes and custom attributes ex. links and images. [See docs](https://listjs.com/).
[See commit →](https://github.com/javve/list.js/commit/a8e083dc0f642e90b7a3f3cc11b12f9bb353d3a0)
- **[Feature]** Add toJSON method.
[See commit →](https://github.com/javve/list.js/commit/570fd10e65fcf2e0d3d959ca42137625d9fd3b7c)
- **[Feature]** Add reIndex method that should be called if the html have been changed by something except List.js.
[See commit →](https://github.com/javve/list.js/commit/825b2b55d339de2bb78eb41145d56a8b27d3d888)
- **[Feature]** Add option searchColumns to defined default columns to search in.
[See commit →](https://github.com/javve/list.js/commit/b8b74f21f78c17f1c1842480084ffdb58edc26cd)
- **[Feature]** Support <tr> in options.item
[See commit →](https://github.com/javve/list.js/commit/9700858168811b6559983d2cb792014213b817a6)
- **[Feature]** Make it possble to add event handlers on init `new List('listId', { searchComplete: function(list) {} })`.
[See commit →](https://github.com/javve/list.js/commit/b8b74f21f78c17f1c1842480084ffdb58edc26cd)
- **[Bugfix]** Don't throw error if searching in a empty list.
[See commit →](https://github.com/javve/list.js/commit/d805494732922024bb99090fb6521021189861e9)
- **[Bugfix]** Make it possible to use item.visible() on items not yet templated.
[See commit →](https://github.com/javve/list.js/commit/8e898b0e55a7d47a77ee27f109602bdb63183fda)
- **[Bugfix]** Include reference to List when initializing plugins. Fix for require.js which don't have a global reference to List.
[See commit →](https://github.com/javve/list.js/commit/40d3c5e5f98cf3bcb9624a5717d4435a0b6f49f6)
- **[Bugfix]** Fix index async. Fix #268
[See commit →](https://github.com/javve/list.js/commit/27e2d6fdeee7090eb1342a108013db898fc29b96)
- **[Bugfix]** Fix add async
[See commit →](https://github.com/javve/list.js/commit/237f926d3ea0036ffb8b255dd0da42387b6a653a)
- **[Bugfix]** Don't add empty item if empty list is initated with empty array.
[See commit →](https://github.com/javve/list.js/commit/607a176c12b2219fb5204a789cd44ef367a0025f)
- **[Bugfix]** Make sort case insensitive by default for the automatic buttons
[See commit →](https://github.com/javve/list.js/commit/44260b862f74dccd248d08ca1f7df2b422c8f439)
- **[Bugfix]** Clear all values from source item. Case: list.add({}) should not
get same values as first item in list
[See commit →](https://github.com/javve/list.js/commit/3a4733d52cff25ef99ee8a1326c0b54be81d64ca)
### 2014-02-03: 1.1.1
- **[Bugfix]** Update `javve/events` version which fixes critical bugs in Safari
for PC and PhantomJS (which makes the command line tests work again).
- **[Bugfix]** Clear search when clicking in the HTML5 clear button.
- **[Misc]** Add History.md file for changelog instead of having it at Listjs.com.
### 2014-02-03: 1.1.0
- **[Breaking]** The sorting API is update so it looks like this
`listObj.sort('name', { order: "asc "})` and `listObj.sort('name', { order: "desc "})`
instead or `listObj.sort('name', { desc: true/false })`.
- **[Feature]** Added support for default sort function `new List('id', { sortFunction: function(itemA, itemB) { .. }})`
- **[Feature]** Adding `data-order="asc/desc"` to a sort button makes that button only sort `asc` or `desc`, ie no to
- **[Bugfix]** Fix `grunt watch` bug.
- **[Bugfix]** Remove sorting when searching and filtering.
- **[Bugfix]** Fix sorting and search when using pagiation plugin
### 2014-01-17: 1.0.2
- **[Bugfix]** Fix error that broke the lib in IE8.
### 2013-11-12: 1.0.0
- **[Feature]** Add more events and enable to add them on initialization.
- **[Feature]** Add support for Component.js, Bower, RequireJS and CommonJS
- **[Feature]** Make it possible to remove event handlers by `.off('event', handler)`
- **[Improvement]** Many new tests
- **[Improvement]** Paging plugin default classes and structure now correspons to <a href="https://twitter.github.com/bootstrap/components.html#pagination">Twitter Bootstraps pagination</a>.
- **[Improvement]** Make sorting case-insensitive (thanks @thomasklemm)
- **[Improvement]** Add item.\_values for direct access to a items values. Simplifies debugging. Note: Always use item.values() when interacting with the values.
- **[Bugfix]** `.add(items, callbak)` with `callback` set does no longer add an extra item.
- **[Bugfix]** `templater.set()` no longer is called twice in a `templater.get()` call.
- **[Bugfix]** Fix error when trying to sort `undefined,null,etc` values.
- **[Bugfix]** Fix error when trying to search `undefined,null,etc` values.
- **[Bugfix]** Fix issue #51, problems with filters/search + paging.
- **[Misc]** Almost completely rewritten codebase and started using <a href="https://github.com/component/component">Component</a>
- **[Misc]** Moved the website into another repo called <a href="https://github.com/javve/list-website">list-website</a>
- **[Misc]** Add documentation for searching in specific columns.
- **[Change]** `listObj.get('valueName', value)` does now always returns an array. Previously it return an object if only one item matched and null if no match was found.
- **[Change]** The default sort order is now `asc` instead of `desc`.
- **[Change]** Syntax for searching in specific columns are now `.search('val', [ 'columnName', 'columnName2' ])` instead of `.search('val', { columnName: true, columnName2: true })`.
- **[Change]** Move plugins into seperated repos: <a href="https://github.com/javve/list.pagination.js">github.com/javve/list.pagination.js</a> and <a href="https://github.com/javve/list.fuzzysearch.js">github.com/javve/list.fuzzysearch.js</a>
- **[Change]** Plugin initiation have changed. See <a href="/docs/plugins">getting started with plugins
### 2012-04-24: 0.2.1
- Fuzzy Search plugin, `.filter()` changes and bug fixes _[Read more »](http://jonnystromberg.com/listjs-0-2-1-release-notes/)_
### 2012-01-23: 0.2.0
- Lots of updates and interesting features. _[Read more »](http://jonnystromberg.com/listjs-0-2-0-plugins-paging/)_
### 2011-12-15: 0.1.4
- `.filters()`, `.sort()` and `.search()` now deped on each other. If the list is filtered and then there is a search, the items hidden by the filters will stay hidden etc.
- `.filter()` is the only way to reset filter. `.filter(false)` does not work anymore.
### 2011-11-29: 0.1.3 release
- Added function `.clear()` that removes all items from the list
- Changed the sort function to be based on `data-sort` instead of `rel`
- When sorting one category, all sort-related classes will be removed from the other sort buttons
- Updated `.sort(valueName, sortFunction)` to `.sort(valueName, options)`, se more info in the documentation
### 2011-11-16: 0.1.2 release
- Sorting is now indicated by class `asc` or `desc` at sorting buttons
- Added three new small helper functions `hasClass(element, class)`, ` addClass(element, class)`` and `removeClass(element, class)`</li>
### 2011-10-20: 0.1.1 release
- Added possibility to reverse sort the list
### 2011-10-18: 0.1 release
- Examples at Listjs.com works in IE7,8,9 (IE6 is not tested, should work)
- More documentation
- Misc bug fixes
### 2011-10-15 Final alpha 0.3 release
- More documentation
- Only show 200 items at same time, huge speed increase
- Misc bug fixes
### 2011-08-08 Alpha 0.2 release
- Added asynchronous item adding
- Added asynchronous list indexing
- Improved (but incomplete) documentation
- Bugfixes and improved helper functions
- Show helper functions non-minified
### 2011-07-25 Alpha 0.1 release

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2011-2018 Jonny Strömberg, jonnystromberg.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,94 @@
# List.js
Perfect library for adding **search**, **sort**, **filters** and **flexibility** to
**tables**, **lists** and various HTML elements. Built to be invisible and work on existing HTML.
Really simple and easy to use!
[![Donate](https://s3.amazonaws.com/listjs/donate-coffee.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=M7ZGHV75VSD2E)
[![npm version](https://badge.fury.io/js/list.js.svg)](https://badge.fury.io/js/list.js)
[![CircleCI](https://circleci.com/gh/javve/list.js/tree/master.svg?style=shield)](https://circleci.com/gh/javve/list.js/tree/master)
[![codecov](https://codecov.io/gh/javve/list.js/branch/master/graph/badge.svg)](https://codecov.io/gh/javve/list.js)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/list.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/list.js)
### Core idea
- Simple and invisible
- Easy to apply to existing HTML
- No dependencies
- Fast
- Small
- Handle thousands of items
### Features
- Works both lists, tables and almost anything else. E.g. `<div>`,`<ul>`,`<table>`, etc.
- Search [Read more ](https://listjs.com/docs/list-api#search)
- Sort [Read more ](https://listjs.com/docs/list-api#sort)
- Filter [Read more ](https://listjs.com/docs/list-api#filter)
- Simple templating system that adds possibility to add, edit, remove items [Read more ](https://listjs.com/docs/list-api#add)
- Support for Chrome, Safari, Firefox, IE9+
### Download / Install
##### Via NPM
```
npm install list.js
```
##### Via Bower
```
bower install list.js
```
##### Via CDNJS
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/2.3.0/list.min.js"></script>
```
##### Via Direct Download
- [Compressed list.js](https://raw.githubusercontent.com/javve/list.js/v2.3.0/dist/list.min.js)
- [Uncompressed list.js](https://raw.githubusercontent.com/javve/list.js/v2.3.0/dist/list.js)
### Questions / How to?
https://stackoverflow.com/questions/tagged/list.js
### Demo / Examples
- [Existing list](https://listjs.com/examples/existing-list)
- [Existing list + add](https://listjs.com/examples/existing-list-add)
- [New list](https://listjs.com/examples/new-list)
- [Add, get, remove](https://listjs.com/examples/add-get-remove)
- [Fuzzy search](https://listjs.com/examples/fuzzy-search)
- [Pagination](https://listjs.com/examples/pagination)
- [Search in specific column](https://codepen.io/javve/pen/GpZpow)
- [Filter in range](https://codepen.io/javve/pen/wKGKWL)
- [Show message filter/search results in 0 items](https://codepen.io/javve/pen/VvavzG)
- [Only show list after search/filter](https://codepen.io/javve/pen/YyqyRg)
## Documentation
- [Getting started](https://listjs.com/docs)
- [Options](https://listjs.com/docs/options)
- [List API](https://listjs.com/docs/list-api)
- [Item API](https://listjs.com/docs/item-api)
- [Changelog](https://github.com/javve/list.js/blob/master/CHANGELOG.md)
### Thanks to [all lovely contributors](https://github.com/javve/list.js/graphs/contributors)! Want to join them?
- Read more at [listjs.com/overview/contribute](https://listjs.com/overview/contribute)
### Creator
| | Jonny Strömberg [@javve](https://twitter.com/javve) |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ![Image of Jonny](http://1.gravatar.com/avatar/9f8130715cb4c452f1294eafa1b36290?size=80) | I hope you like the lib. Ive put a lot of hours into it! Feel free to follow me on [Twitter](http://twitter.com/javve) for news and [donate a coffee](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=M7ZGHV75VSD2E) for good karma ;) |
## License (MIT)
Copyright (c) 2011-2020 Jonny Strömberg <[jonny.stromberg@gmail.com](mailto:jonny.stromberg@gmail.com)>
[javve.com](https://javve.com)

View file

@ -0,0 +1,25 @@
{
"name": "list.js",
"main": "dist/list.js",
"homepage": "https://listjs.com",
"authors": [
"Jonny Strömberg <jonny.stromberg@gmail.com>"
],
"description": "The perfect library for lists. Supports search, sort, filters and flexibility. Built to be invisible and work on existing HTML",
"keywords": [
"list",
"search",
"sort",
"table",
"dom",
"html",
"ui"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"__test__",
"docs"
]
}

View file

@ -0,0 +1,864 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1610902297336" clover="3.2.0">
<project timestamp="1610902297336" name="All files">
<metrics statements="795" coveredstatements="742" conditionals="450" coveredconditionals="364" methods="118" coveredmethods="113" elements="1363" coveredelements="1219" complexity="0" loc="795" ncloc="795" packages="2" files="19" classes="19"/>
<package name="src">
<metrics statements="590" coveredstatements="577" conditionals="307" coveredconditionals="280" methods="92" coveredmethods="90"/>
<file name="add-async.js" path="/Users/javve/git/list.js/src/add-async.js">
<metrics statements="11" coveredstatements="11" conditionals="4" coveredconditionals="4" methods="3" coveredmethods="3"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="91" type="stmt"/>
<line num="3" count="3" type="stmt"/>
<line num="4" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="5" count="3" type="stmt"/>
<line num="6" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="7" count="1" type="stmt"/>
<line num="8" count="1" type="stmt"/>
<line num="11" count="2" type="stmt"/>
<line num="12" count="2" type="stmt"/>
<line num="15" count="91" type="stmt"/>
</file>
<file name="filter.js" path="/Users/javve/git/list.js/src/filter.js">
<metrics statements="19" coveredstatements="19" conditionals="8" coveredconditionals="8" methods="2" coveredmethods="2"/>
<line num="1" count="17" type="stmt"/>
<line num="3" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="4" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="6" count="90" type="stmt"/>
<line num="7" count="69" type="stmt"/>
<line num="8" count="69" type="stmt"/>
<line num="9" count="69" type="stmt"/>
<line num="10" count="69" type="cond" truecount="2" falsecount="0"/>
<line num="11" count="47" type="stmt"/>
<line num="13" count="22" type="stmt"/>
<line num="14" count="22" type="stmt"/>
<line num="15" count="22" type="stmt"/>
<line num="16" count="122" type="stmt"/>
<line num="17" count="122" type="cond" truecount="2" falsecount="0"/>
<line num="18" count="70" type="stmt"/>
<line num="20" count="52" type="stmt"/>
<line num="24" count="69" type="stmt"/>
<line num="25" count="69" type="stmt"/>
<line num="26" count="69" type="stmt"/>
</file>
<file name="fuzzy-search.js" path="/Users/javve/git/list.js/src/fuzzy-search.js">
<metrics statements="32" coveredstatements="32" conditionals="14" coveredconditionals="11" methods="6" coveredmethods="6"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="17" type="stmt"/>
<line num="3" count="17" type="stmt"/>
<line num="4" count="17" type="stmt"/>
<line num="5" count="17" type="stmt"/>
<line num="6" count="17" type="stmt"/>
<line num="8" count="17" type="stmt"/>
<line num="9" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="11" count="90" type="stmt"/>
<line num="22" count="90" type="stmt"/>
<line num="25" count="5" type="cond" truecount="1" falsecount="1"/>
<line num="27" count="5" type="stmt"/>
<line num="28" count="50" type="stmt"/>
<line num="32" count="50" type="stmt"/>
<line num="33" count="50" type="stmt"/>
<line num="34" count="60" type="stmt"/>
<line num="35" count="60" type="stmt"/>
<line num="36" count="60" type="cond" truecount="2" falsecount="0"/>
<line num="37" count="11" type="stmt"/>
<line num="40" count="60" type="cond" truecount="2" falsecount="0"/>
<line num="41" count="49" type="stmt"/>
<line num="44" count="50" type="stmt"/>
<line num="47" count="60" type="cond" truecount="1" falsecount="1"/>
<line num="48" count="60" type="stmt"/>
<line num="50" count="60" type="cond" truecount="2" falsecount="0"/>
<line num="51" count="11" type="stmt"/>
<line num="54" count="49" type="stmt"/>
<line num="58" count="90" type="stmt"/>
<line num="62" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="63" count="2" type="stmt"/>
<line num="67" count="90" type="stmt"/>
<line num="68" count="3" type="stmt"/>
</file>
<file name="index.js" path="/Users/javve/git/list.js/src/index.js">
<metrics statements="160" coveredstatements="158" conditionals="37" coveredconditionals="35" methods="19" coveredmethods="19"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="17" type="stmt"/>
<line num="3" count="17" type="stmt"/>
<line num="4" count="17" type="stmt"/>
<line num="5" count="17" type="stmt"/>
<line num="6" count="17" type="stmt"/>
<line num="7" count="17" type="stmt"/>
<line num="8" count="17" type="stmt"/>
<line num="9" count="17" type="stmt"/>
<line num="11" count="17" type="stmt"/>
<line num="12" count="91" type="stmt"/>
<line num="14" count="91" type="stmt"/>
<line num="15" count="91" type="stmt"/>
<line num="16" count="91" type="stmt"/>
<line num="18" count="91" type="stmt"/>
<line num="20" count="91" type="stmt"/>
<line num="21" count="91" type="stmt"/>
<line num="22" count="91" type="stmt"/>
<line num="23" count="91" type="stmt"/>
<line num="24" count="91" type="stmt"/>
<line num="25" count="91" type="stmt"/>
<line num="26" count="91" type="stmt"/>
<line num="27" count="91" type="stmt"/>
<line num="28" count="91" type="stmt"/>
<line num="29" count="91" type="stmt"/>
<line num="30" count="91" type="stmt"/>
<line num="31" count="91" type="stmt"/>
<line num="32" count="91" type="stmt"/>
<line num="33" count="91" type="stmt"/>
<line num="34" count="91" type="stmt"/>
<line num="46" count="91" type="stmt"/>
<line num="48" count="91" type="cond" truecount="2" falsecount="0"/>
<line num="49" count="91" type="cond" truecount="1" falsecount="1"/>
<line num="50" count="0" type="stmt"/>
<line num="52" count="91" type="stmt"/>
<line num="54" count="91" type="stmt"/>
<line num="55" count="91" type="stmt"/>
<line num="56" count="90" type="stmt"/>
<line num="57" count="90" type="stmt"/>
<line num="58" count="90" type="stmt"/>
<line num="59" count="90" type="stmt"/>
<line num="61" count="90" type="stmt"/>
<line num="62" count="90" type="stmt"/>
<line num="63" count="90" type="stmt"/>
<line num="65" count="90" type="stmt"/>
<line num="68" count="90" type="stmt"/>
<line num="69" count="720" type="cond" truecount="4" falsecount="0"/>
<line num="70" count="1" type="stmt"/>
<line num="75" count="90" type="stmt"/>
<line num="76" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="77" count="71" type="stmt"/>
<line num="81" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="82" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="83" count="1" type="stmt"/>
<line num="85" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="86" count="3" type="stmt"/>
<line num="88" count="4" type="stmt"/>
<line num="89" count="4" type="stmt"/>
<line num="98" count="91" type="stmt"/>
<line num="99" count="1" type="stmt"/>
<line num="100" count="1" type="stmt"/>
<line num="101" count="1" type="stmt"/>
<line num="102" count="1" type="stmt"/>
<line num="103" count="1" type="stmt"/>
<line num="104" count="1" type="stmt"/>
<line num="107" count="91" type="stmt"/>
<line num="108" count="2" type="stmt"/>
<line num="109" count="2" type="stmt"/>
<line num="110" count="8" type="stmt"/>
<line num="112" count="2" type="stmt"/>
<line num="118" count="91" type="stmt"/>
<line num="119" count="238" type="cond" truecount="1" falsecount="1"/>
<line num="120" count="0" type="stmt"/>
<line num="122" count="238" type="cond" truecount="2" falsecount="0"/>
<line num="123" count="2" type="stmt"/>
<line num="124" count="2" type="stmt"/>
<line num="126" count="236" type="stmt"/>
<line num="127" count="236" type="stmt"/>
<line num="128" count="236" type="cond" truecount="2" falsecount="0"/>
<line num="129" count="161" type="stmt"/>
<line num="131" count="236" type="stmt"/>
<line num="132" count="717" type="stmt"/>
<line num="133" count="717" type="cond" truecount="2" falsecount="0"/>
<line num="134" count="717" type="stmt"/>
<line num="135" count="717" type="stmt"/>
<line num="136" count="717" type="stmt"/>
<line num="138" count="236" type="stmt"/>
<line num="139" count="236" type="stmt"/>
<line num="142" count="91" type="stmt"/>
<line num="143" count="79" type="stmt"/>
<line num="144" count="79" type="stmt"/>
<line num="145" count="79" type="stmt"/>
<line num="146" count="79" type="stmt"/>
<line num="153" count="91" type="stmt"/>
<line num="154" count="5" type="stmt"/>
<line num="155" count="5" type="stmt"/>
<line num="156" count="20" type="cond" truecount="2" falsecount="0"/>
<line num="157" count="10" type="stmt"/>
<line num="158" count="10" type="stmt"/>
<line num="159" count="10" type="stmt"/>
<line num="160" count="10" type="stmt"/>
<line num="161" count="10" type="stmt"/>
<line num="164" count="5" type="stmt"/>
<line num="165" count="5" type="stmt"/>
<line num="171" count="91" type="stmt"/>
<line num="172" count="251" type="stmt"/>
<line num="173" count="251" type="stmt"/>
<line num="174" count="1482" type="stmt"/>
<line num="175" count="1482" type="cond" truecount="2" falsecount="0"/>
<line num="176" count="251" type="stmt"/>
<line num="179" count="251" type="stmt"/>
<line num="185" count="91" type="stmt"/>
<line num="186" count="139" type="stmt"/>
<line num="192" count="91" type="stmt"/>
<line num="193" count="37" type="stmt"/>
<line num="194" count="37" type="stmt"/>
<line num="195" count="37" type="stmt"/>
<line num="198" count="91" type="stmt"/>
<line num="199" count="213" type="stmt"/>
<line num="200" count="213" type="stmt"/>
<line num="203" count="91" type="stmt"/>
<line num="204" count="3" type="stmt"/>
<line num="205" count="3" type="stmt"/>
<line num="206" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="207" count="2" type="stmt"/>
<line num="209" count="3" type="stmt"/>
<line num="212" count="91" type="stmt"/>
<line num="213" count="937" type="stmt"/>
<line num="214" count="937" type="stmt"/>
<line num="215" count="198" type="stmt"/>
<line num="217" count="937" type="stmt"/>
<line num="220" count="91" type="stmt"/>
<line num="222" count="69" type="stmt"/>
<line num="223" count="69" type="stmt"/>
<line num="224" count="69" type="stmt"/>
<line num="225" count="329" type="stmt"/>
<line num="227" count="69" type="stmt"/>
<line num="230" count="25" type="stmt"/>
<line num="231" count="25" type="stmt"/>
<line num="232" count="25" type="stmt"/>
<line num="233" count="75" type="stmt"/>
<line num="235" count="25" type="stmt"/>
<line num="239" count="91" type="stmt"/>
<line num="240" count="587" type="stmt"/>
<line num="241" count="587" type="stmt"/>
<line num="243" count="587" type="stmt"/>
<line num="244" count="587" type="stmt"/>
<line num="245" count="587" type="stmt"/>
<line num="246" count="587" type="stmt"/>
<line num="247" count="3379" type="cond" truecount="5" falsecount="0"/>
<line num="248" count="2462" type="stmt"/>
<line num="249" count="2462" type="stmt"/>
<line num="250" count="2462" type="stmt"/>
<line num="251" count="917" type="cond" truecount="2" falsecount="0"/>
<line num="252" count="597" type="stmt"/>
<line num="253" count="597" type="stmt"/>
<line num="255" count="320" type="stmt"/>
<line num="258" count="587" type="stmt"/>
<line num="259" count="587" type="stmt"/>
<line num="262" count="91" type="stmt"/>
</file>
<file name="item.js" path="/Users/javve/git/list.js/src/item.js">
<metrics statements="30" coveredstatements="30" conditionals="24" coveredconditionals="24" methods="8" coveredmethods="8"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="182" type="stmt"/>
<line num="3" count="907" type="stmt"/>
<line num="5" count="907" type="stmt"/>
<line num="7" count="907" type="stmt"/>
<line num="8" count="907" type="stmt"/>
<line num="10" count="907" type="stmt"/>
<line num="11" count="907" type="cond" truecount="2" falsecount="0"/>
<line num="12" count="717" type="cond" truecount="2" falsecount="0"/>
<line num="13" count="60" type="stmt"/>
<line num="15" count="657" type="stmt"/>
<line num="18" count="190" type="stmt"/>
<line num="19" count="190" type="stmt"/>
<line num="20" count="190" type="stmt"/>
<line num="24" count="907" type="stmt"/>
<line num="25" count="6167" type="cond" truecount="2" falsecount="0"/>
<line num="26" count="1015" type="stmt"/>
<line num="27" count="1594" type="stmt"/>
<line num="29" count="1015" type="cond" truecount="2" falsecount="0"/>
<line num="30" count="955" type="stmt"/>
<line num="33" count="5152" type="stmt"/>
<line num="37" count="907" type="stmt"/>
<line num="38" count="2463" type="stmt"/>
<line num="41" count="907" type="stmt"/>
<line num="42" count="919" type="stmt"/>
<line num="45" count="907" type="stmt"/>
<line num="46" count="4350" type="stmt"/>
<line num="54" count="907" type="stmt"/>
<line num="55" count="92" type="cond" truecount="4" falsecount="0"/>
<line num="58" count="907" type="stmt"/>
</file>
<file name="pagination.js" path="/Users/javve/git/list.js/src/pagination.js">
<metrics statements="54" coveredstatements="49" conditionals="43" coveredconditionals="39" methods="12" coveredmethods="11"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="17" type="stmt"/>
<line num="3" count="17" type="stmt"/>
<line num="5" count="17" type="stmt"/>
<line num="6" count="91" type="stmt"/>
<line num="8" count="91" type="stmt"/>
<line num="9" count="26" type="cond" truecount="2" falsecount="0"/>
<line num="10" count="2" type="stmt"/>
<line num="11" count="2" type="stmt"/>
<line num="12" count="2" type="stmt"/>
<line num="13" count="24" type="cond" truecount="2" falsecount="0"/>
<line num="14" count="2" type="stmt"/>
<line num="18" count="24" type="stmt"/>
<line num="19" count="24" type="stmt"/>
<line num="20" count="24" type="stmt"/>
<line num="21" count="24" type="stmt"/>
<line num="22" count="24" type="stmt"/>
<line num="23" count="24" type="cond" truecount="2" falsecount="0"/>
<line num="24" count="24" type="cond" truecount="3" falsecount="0"/>
<line num="25" count="24" type="cond" truecount="3" falsecount="0"/>
<line num="27" count="24" type="stmt"/>
<line num="28" count="24" type="stmt"/>
<line num="29" count="24" type="stmt"/>
<line num="30" count="234" type="cond" truecount="2" falsecount="0"/>
<line num="34" count="234" type="cond" truecount="2" falsecount="0"/>
<line num="35" count="95" type="stmt"/>
<line num="39" count="95" type="cond" truecount="2" falsecount="0"/>
<line num="40" count="24" type="stmt"/>
<line num="42" count="95" type="stmt"/>
<line num="43" count="95" type="stmt"/>
<line num="44" count="139" type="cond" truecount="2" falsecount="0"/>
<line num="45" count="30" type="stmt"/>
<line num="49" count="30" type="stmt"/>
<line num="54" count="91" type="stmt"/>
<line num="56" count="234" type="cond" truecount="3" falsecount="0"/>
<line num="59" count="234" type="stmt"/>
<line num="62" count="249" type="stmt"/>
<line num="65" count="239" type="cond" truecount="2" falsecount="0"/>
<line num="68" count="139" type="stmt"/>
<line num="74" count="139" type="cond" truecount="3" falsecount="0"/>
<line num="77" count="124" type="cond" truecount="2" falsecount="0"/>
<line num="78" count="39" type="stmt"/>
<line num="80" count="85" type="cond" truecount="3" falsecount="0"/>
<line num="85" count="91" type="stmt"/>
<line num="86" count="4" type="stmt"/>
<line num="94" count="4" type="stmt"/>
<line num="95" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="96" count="0" type="stmt"/>
<line num="97" count="0" type="stmt"/>
<line num="98" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="99" count="0" type="stmt"/>
<line num="103" count="4" type="stmt"/>
<line num="104" count="22" type="stmt"/>
<line num="106" count="4" type="stmt"/>
</file>
<file name="parse.js" path="/Users/javve/git/list.js/src/parse.js">
<metrics statements="27" coveredstatements="27" conditionals="8" coveredconditionals="8" methods="6" coveredmethods="6"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="91" type="stmt"/>
<line num="4" count="91" type="stmt"/>
<line num="5" count="91" type="stmt"/>
<line num="6" count="91" type="stmt"/>
<line num="7" count="91" type="stmt"/>
<line num="9" count="312" type="cond" truecount="2" falsecount="0"/>
<line num="10" count="190" type="stmt"/>
<line num="13" count="91" type="stmt"/>
<line num="16" count="91" type="stmt"/>
<line num="17" count="94" type="stmt"/>
<line num="18" count="190" type="stmt"/>
<line num="21" count="91" type="stmt"/>
<line num="22" count="4" type="stmt"/>
<line num="23" count="4" type="stmt"/>
<line num="24" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="25" count="3" type="stmt"/>
<line num="26" count="3" type="stmt"/>
<line num="29" count="1" type="stmt"/>
<line num="30" count="1" type="stmt"/>
<line num="34" count="91" type="cond" truecount="2" falsecount="0"/>
<line num="36" count="91" type="stmt"/>
<line num="37" count="91" type="stmt"/>
<line num="38" count="91" type="stmt"/>
<line num="40" count="91" type="cond" truecount="2" falsecount="0"/>
<line num="41" count="1" type="stmt"/>
<line num="43" count="90" type="stmt"/>
</file>
<file name="search.js" path="/Users/javve/git/list.js/src/search.js">
<metrics statements="77" coveredstatements="74" conditionals="49" coveredconditionals="40" methods="11" coveredmethods="10"/>
<line num="1" count="17" type="stmt"/>
<line num="4" count="90" type="stmt"/>
<line num="6" count="72" type="stmt"/>
<line num="7" count="72" type="stmt"/>
<line num="8" count="72" type="stmt"/>
<line num="11" count="72" type="cond" truecount="4" falsecount="0"/>
<line num="12" count="6" type="stmt"/>
<line num="13" count="66" type="cond" truecount="4" falsecount="0"/>
<line num="14" count="3" type="stmt"/>
<line num="15" count="3" type="stmt"/>
<line num="16" count="63" type="cond" truecount="2" falsecount="0"/>
<line num="17" count="4" type="stmt"/>
<line num="18" count="4" type="stmt"/>
<line num="20" count="59" type="stmt"/>
<line num="24" count="72" type="cond" truecount="1" falsecount="1"/>
<line num="25" count="72" type="cond" truecount="2" falsecount="0"/>
<line num="26" count="65" type="cond" truecount="2" falsecount="0"/>
<line num="30" count="72" type="stmt"/>
<line num="31" count="72" type="stmt"/>
<line num="32" count="72" type="stmt"/>
<line num="35" count="63" type="stmt"/>
<line num="36" count="63" type="stmt"/>
<line num="37" count="138" type="stmt"/>
<line num="39" count="63" type="stmt"/>
<line num="42" count="90" type="stmt"/>
<line num="46" count="40" type="stmt"/>
<line num="48" count="40" type="stmt"/>
<line num="49" count="40" type="stmt"/>
<line num="50" count="2" type="stmt"/>
<line num="51" count="2" type="stmt"/>
<line num="54" count="40" type="stmt"/>
<line num="55" count="40" type="cond" truecount="2" falsecount="0"/>
<line num="56" count="40" type="stmt"/>
<line num="57" count="222" type="stmt"/>
<line num="58" count="222" type="stmt"/>
<line num="59" count="222" type="cond" truecount="1" falsecount="1"/>
<line num="60" count="222" type="stmt"/>
<line num="61" count="233" type="stmt"/>
<line num="62" count="233" type="stmt"/>
<line num="63" count="377" type="stmt"/>
<line num="64" count="377" type="stmt"/>
<line num="65" count="377" type="cond" truecount="5" falsecount="0"/>
<line num="66" count="363" type="cond" truecount="2" falsecount="0"/>
<line num="67" count="363" type="cond" truecount="2" falsecount="0"/>
<line num="69" count="67" type="stmt"/>
<line num="70" count="67" type="stmt"/>
<line num="75" count="233" type="cond" truecount="2" falsecount="0"/>
<line num="77" count="222" type="stmt"/>
<line num="82" count="25" type="stmt"/>
<line num="83" count="25" type="stmt"/>
<line num="87" count="90" type="stmt"/>
<line num="88" count="72" type="stmt"/>
<line num="90" count="72" type="stmt"/>
<line num="91" count="72" type="stmt"/>
<line num="92" count="72" type="stmt"/>
<line num="93" count="72" type="stmt"/>
<line num="95" count="72" type="cond" truecount="2" falsecount="0"/>
<line num="96" count="25" type="stmt"/>
<line num="98" count="47" type="stmt"/>
<line num="99" count="47" type="cond" truecount="2" falsecount="0"/>
<line num="100" count="7" type="stmt"/>
<line num="102" count="40" type="stmt"/>
<line num="106" count="72" type="stmt"/>
<line num="107" count="72" type="stmt"/>
<line num="108" count="72" type="stmt"/>
<line num="111" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="112" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="114" count="90" type="stmt"/>
<line num="118" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="119" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="120" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="122" count="2" type="stmt"/>
<line num="128" count="90" type="stmt"/>
<line num="129" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="130" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="131" count="0" type="stmt"/>
<line num="135" count="90" type="stmt"/>
</file>
<file name="sort.js" path="/Users/javve/git/list.js/src/sort.js">
<metrics statements="61" coveredstatements="59" conditionals="47" coveredconditionals="45" methods="8" coveredmethods="8"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="90" type="stmt"/>
<line num="5" count="174" type="stmt"/>
<line num="6" count="39" type="stmt"/>
<line num="7" count="39" type="stmt"/>
<line num="11" count="10" type="stmt"/>
<line num="12" count="10" type="cond" truecount="4" falsecount="0"/>
<line num="13" count="5" type="stmt"/>
<line num="14" count="5" type="cond" truecount="2" falsecount="0"/>
<line num="15" count="1" type="stmt"/>
<line num="16" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="17" count="1" type="stmt"/>
<line num="19" count="3" type="stmt"/>
<line num="23" count="10" type="stmt"/>
<line num="24" count="10" type="cond" truecount="1" falsecount="1"/>
<line num="25" count="0" type="stmt"/>
<line num="27" count="10" type="stmt"/>
<line num="31" count="33" type="stmt"/>
<line num="32" count="33" type="stmt"/>
<line num="33" count="33" type="cond" truecount="1" falsecount="1"/>
<line num="34" count="0" type="stmt"/>
<line num="36" count="33" type="stmt"/>
<line num="37" count="33" type="cond" truecount="4" falsecount="0"/>
<line num="38" count="22" type="cond" truecount="2" falsecount="0"/>
<line num="39" count="11" type="stmt"/>
<line num="42" count="11" type="stmt"/>
<line num="48" count="90" type="stmt"/>
<line num="49" count="33" type="stmt"/>
<line num="50" count="33" type="stmt"/>
<line num="52" count="33" type="cond" truecount="3" falsecount="0"/>
<line num="54" count="33" type="cond" truecount="2" falsecount="0"/>
<line num="55" count="10" type="stmt"/>
<line num="56" count="10" type="stmt"/>
<line num="57" count="10" type="stmt"/>
<line num="59" count="23" type="cond" truecount="2" falsecount="0"/>
<line num="60" count="23" type="stmt"/>
<line num="61" count="23" type="cond" truecount="2" falsecount="0"/>
<line num="62" count="23" type="cond" truecount="2" falsecount="0"/>
<line num="65" count="33" type="stmt"/>
<line num="66" count="33" type="stmt"/>
<line num="70" count="33" type="cond" truecount="3" falsecount="0"/>
<line num="71" count="33" type="cond" truecount="2" falsecount="0"/>
<line num="74" count="33" type="cond" truecount="2" falsecount="0"/>
<line num="75" count="3" type="stmt"/>
<line num="76" count="32" type="stmt"/>
<line num="79" count="30" type="stmt"/>
<line num="80" count="191" type="stmt"/>
<line num="81" count="191" type="cond" truecount="3" falsecount="0"/>
<line num="82" count="191" type="cond" truecount="4" falsecount="0"/>
<line num="83" count="144" type="stmt"/>
<line num="85" count="191" type="stmt"/>
<line num="89" count="33" type="stmt"/>
<line num="90" count="33" type="stmt"/>
<line num="91" count="33" type="stmt"/>
<line num="95" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="96" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="98" count="90" type="stmt"/>
<line num="99" count="90" type="stmt"/>
<line num="100" count="90" type="stmt"/>
<line num="101" count="90" type="stmt"/>
<line num="103" count="90" type="stmt"/>
</file>
<file name="templater.js" path="/Users/javve/git/list.js/src/templater.js">
<metrics statements="119" coveredstatements="118" conditionals="73" coveredconditionals="66" methods="17" coveredmethods="17"/>
<line num="1" count="17" type="stmt"/>
<line num="3" count="91" type="stmt"/>
<line num="5" count="91" type="stmt"/>
<line num="8" count="91" type="cond" truecount="2" falsecount="0"/>
<line num="9" count="1" type="stmt"/>
<line num="10" count="3" type="stmt"/>
<line num="11" count="3" type="stmt"/>
<line num="13" count="1" type="stmt"/>
<line num="16" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="17" count="74" type="cond" truecount="2" falsecount="0"/>
<line num="18" count="1" type="stmt"/>
<line num="20" count="73" type="stmt"/>
<line num="25" count="16" type="stmt"/>
<line num="28" count="90" type="cond" truecount="2" falsecount="0"/>
<line num="29" count="1" type="stmt"/>
<line num="32" count="89" type="stmt"/>
<line num="34" count="89" type="stmt"/>
<line num="35" count="680" type="stmt"/>
<line num="39" count="91" type="stmt"/>
<line num="40" count="89" type="stmt"/>
<line num="41" count="89" type="stmt"/>
<line num="43" count="89" type="stmt"/>
<line num="44" count="159" type="stmt"/>
<line num="45" count="159" type="stmt"/>
<line num="46" count="159" type="cond" truecount="2" falsecount="0"/>
<line num="47" count="2" type="stmt"/>
<line num="48" count="2" type="stmt"/>
<line num="50" count="157" type="cond" truecount="4" falsecount="0"/>
<line num="51" count="8" type="stmt"/>
<line num="52" count="8" type="cond" truecount="1" falsecount="1"/>
<line num="53" count="8" type="stmt"/>
<line num="56" count="149" type="stmt"/>
<line num="57" count="149" type="cond" truecount="2" falsecount="0"/>
<line num="58" count="100" type="stmt"/>
<line num="62" count="89" type="stmt"/>
<line num="65" count="91" type="stmt"/>
<line num="66" count="16" type="stmt"/>
<line num="68" count="16" type="stmt"/>
<line num="70" count="30" type="cond" truecount="2" falsecount="0"/>
<line num="71" count="15" type="stmt"/>
<line num="74" count="1" type="stmt"/>
<line num="77" count="91" type="stmt"/>
<line num="78" count="76" type="cond" truecount="1" falsecount="1"/>
<line num="79" count="76" type="cond" truecount="2" falsecount="0"/>
<line num="80" count="1" type="stmt"/>
<line num="81" count="1" type="stmt"/>
<line num="82" count="1" type="stmt"/>
<line num="83" count="75" type="cond" truecount="1" falsecount="1"/>
<line num="84" count="75" type="stmt"/>
<line num="85" count="75" type="stmt"/>
<line num="86" count="75" type="stmt"/>
<line num="88" count="0" type="stmt"/>
<line num="91" count="91" type="stmt"/>
<line num="92" count="1634" type="stmt"/>
<line num="93" count="2118" type="stmt"/>
<line num="94" count="2118" type="cond" truecount="2" falsecount="0"/>
<line num="95" count="25" type="stmt"/>
<line num="96" count="25" type="stmt"/>
<line num="97" count="25" type="cond" truecount="2" falsecount="0"/>
<line num="98" count="5" type="stmt"/>
<line num="101" count="2093" type="cond" truecount="5" falsecount="0"/>
<line num="102" count="20" type="stmt"/>
<line num="103" count="2073" type="cond" truecount="2" falsecount="0"/>
<line num="104" count="1359" type="stmt"/>
<line num="109" count="91" type="stmt"/>
<line num="110" count="1634" type="stmt"/>
<line num="111" count="1634" type="stmt"/>
<line num="112" count="1634" type="cond" truecount="2" falsecount="0"/>
<line num="113" count="1384" type="cond" truecount="2" falsecount="0"/>
<line num="114" count="5" type="stmt"/>
<line num="115" count="1379" type="cond" truecount="4" falsecount="0"/>
<line num="116" count="20" type="stmt"/>
<line num="117" count="20" type="cond" truecount="1" falsecount="1"/>
<line num="118" count="20" type="stmt"/>
<line num="121" count="1359" type="stmt"/>
<line num="122" count="1359" type="cond" truecount="2" falsecount="0"/>
<line num="123" count="1005" type="stmt"/>
<line num="128" count="91" type="stmt"/>
<line num="129" count="190" type="stmt"/>
<line num="130" count="190" type="stmt"/>
<line num="131" count="190" type="stmt"/>
<line num="132" count="236" type="stmt"/>
<line num="133" count="236" type="stmt"/>
<line num="134" count="236" type="cond" truecount="2" falsecount="0"/>
<line num="135" count="4" type="stmt"/>
<line num="136" count="4" type="stmt"/>
<line num="138" count="232" type="cond" truecount="4" falsecount="0"/>
<line num="139" count="16" type="stmt"/>
<line num="140" count="16" type="cond" truecount="1" falsecount="1"/>
<line num="142" count="216" type="stmt"/>
<line num="143" count="216" type="cond" truecount="1" falsecount="1"/>
<line num="146" count="190" type="stmt"/>
<line num="149" count="91" type="stmt"/>
<line num="150" count="1638" type="cond" truecount="2" falsecount="0"/>
<line num="151" count="981" type="stmt"/>
<line num="152" count="1634" type="cond" truecount="1" falsecount="1"/>
<line num="153" count="1634" type="stmt"/>
<line num="159" count="91" type="stmt"/>
<line num="160" count="4291" type="cond" truecount="2" falsecount="0"/>
<line num="161" count="3608" type="stmt"/>
<line num="163" count="683" type="stmt"/>
<line num="164" count="683" type="stmt"/>
<line num="165" count="683" type="stmt"/>
<line num="167" count="91" type="stmt"/>
<line num="168" count="10" type="cond" truecount="2" falsecount="0"/>
<line num="169" count="9" type="stmt"/>
<line num="172" count="91" type="stmt"/>
<line num="173" count="2463" type="stmt"/>
<line num="174" count="2463" type="stmt"/>
<line num="176" count="91" type="stmt"/>
<line num="177" count="919" type="cond" truecount="4" falsecount="0"/>
<line num="178" count="2" type="stmt"/>
<line num="181" count="91" type="stmt"/>
<line num="183" count="696" type="cond" truecount="2" falsecount="0"/>
<line num="184" count="493" type="stmt"/>
<line num="185" count="2311" type="stmt"/>
<line num="190" count="91" type="stmt"/>
<line num="193" count="17" type="stmt"/>
<line num="194" count="91" type="stmt"/>
</file>
</package>
<package name="src.utils">
<metrics statements="205" coveredstatements="165" conditionals="143" coveredconditionals="84" methods="26" coveredmethods="23"/>
<file name="classes.js" path="/Users/javve/git/list.js/src/utils/classes.js">
<metrics statements="50" coveredstatements="29" conditionals="30" coveredconditionals="10" methods="7" coveredmethods="7"/>
<line num="5" count="18" type="stmt"/>
<line num="11" count="18" type="stmt"/>
<line num="17" count="18" type="stmt"/>
<line num="27" count="18" type="stmt"/>
<line num="28" count="172" type="stmt"/>
<line num="39" count="172" type="cond" truecount="3" falsecount="1"/>
<line num="40" count="0" type="stmt"/>
<line num="42" count="172" type="stmt"/>
<line num="43" count="172" type="stmt"/>
<line num="54" count="18" type="stmt"/>
<line num="56" count="77" type="cond" truecount="1" falsecount="1"/>
<line num="57" count="77" type="stmt"/>
<line num="58" count="77" type="stmt"/>
<line num="62" count="0" type="stmt"/>
<line num="63" count="0" type="stmt"/>
<line num="64" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="65" count="0" type="stmt"/>
<line num="66" count="0" type="stmt"/>
<line num="79" count="18" type="stmt"/>
<line num="81" count="79" type="cond" truecount="1" falsecount="1"/>
<line num="82" count="79" type="stmt"/>
<line num="83" count="79" type="stmt"/>
<line num="87" count="0" type="stmt"/>
<line num="88" count="0" type="stmt"/>
<line num="89" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="90" count="0" type="stmt"/>
<line num="91" count="0" type="stmt"/>
<line num="106" count="18" type="stmt"/>
<line num="108" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="109" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="110" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="111" count="0" type="stmt"/>
<line num="114" count="2" type="stmt"/>
<line num="116" count="2" type="stmt"/>
<line num="120" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="121" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="122" count="0" type="stmt"/>
<line num="124" count="0" type="stmt"/>
<line num="127" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="128" count="0" type="stmt"/>
<line num="130" count="0" type="stmt"/>
<line num="134" count="0" type="stmt"/>
<line num="144" count="18" type="stmt"/>
<line num="145" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="146" count="1" type="stmt"/>
<line num="147" count="1" type="stmt"/>
<line num="148" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="149" count="1" type="stmt"/>
<line num="160" count="18" type="stmt"/>
<line num="161" count="13" type="cond" truecount="1" falsecount="1"/>
</file>
<file name="events.js" path="/Users/javve/git/list.js/src/utils/events.js">
<metrics statements="23" coveredstatements="11" conditionals="18" coveredconditionals="6" methods="5" coveredmethods="2"/>
<line num="1" count="17" type="cond" truecount="1" falsecount="1"/>
<line num="2" count="17" type="cond" truecount="1" falsecount="1"/>
<line num="3" count="17" type="cond" truecount="1" falsecount="1"/>
<line num="4" count="17" type="stmt"/>
<line num="16" count="17" type="stmt"/>
<line num="17" count="364" type="stmt"/>
<line num="18" count="364" type="stmt"/>
<line num="19" count="45" type="cond" truecount="2" falsecount="0"/>
<line num="33" count="17" type="stmt"/>
<line num="34" count="0" type="stmt"/>
<line num="35" count="0" type="stmt"/>
<line num="36" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="52" count="17" type="stmt"/>
<line num="54" count="180" type="cond" truecount="1" falsecount="1"/>
<line num="56" count="0" type="stmt"/>
<line num="57" count="0" type="stmt"/>
<line num="58" count="0" type="stmt"/>
<line num="59" count="0" type="stmt"/>
<line num="60" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="62" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="63" count="0" type="stmt"/>
<line num="64" count="0" type="stmt"/>
<line num="65" count="0" type="cond" truecount="0" falsecount="2"/>
</file>
<file name="extend.js" path="/Users/javve/git/list.js/src/utils/extend.js">
<metrics statements="7" coveredstatements="7" conditionals="2" coveredconditionals="1" methods="1" coveredmethods="1"/>
<line num="5" count="17" type="stmt"/>
<line num="7" count="181" type="stmt"/>
<line num="10" count="181" type="stmt"/>
<line num="11" count="181" type="cond" truecount="1" falsecount="1"/>
<line num="12" count="181" type="stmt"/>
<line num="13" count="188" type="stmt"/>
<line num="17" count="181" type="stmt"/>
</file>
<file name="fuzzy.js" path="/Users/javve/git/list.js/src/utils/fuzzy.js">
<metrics statements="59" coveredstatements="58" conditionals="32" coveredconditionals="24" methods="3" coveredmethods="3"/>
<line num="1" count="17" type="stmt"/>
<line num="3" count="60" type="cond" truecount="2" falsecount="0"/>
<line num="6" count="60" type="cond" truecount="1" falsecount="1"/>
<line num="9" count="60" type="cond" truecount="1" falsecount="1"/>
<line num="11" count="60" type="cond" truecount="1" falsecount="1"/>
<line num="12" count="60" type="cond" truecount="1" falsecount="1"/>
<line num="15" count="60" type="stmt"/>
<line num="16" count="60" type="stmt"/>
<line num="17" count="60" type="stmt"/>
<line num="20" count="60" type="stmt"/>
<line num="21" count="330" type="stmt"/>
<line num="24" count="60" type="stmt"/>
<line num="25" count="330" type="stmt"/>
<line num="28" count="60" type="stmt"/>
<line num="35" count="698" type="stmt"/>
<line num="36" count="698" type="stmt"/>
<line num="38" count="698" type="cond" truecount="1" falsecount="1"/>
<line num="40" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="42" count="698" type="stmt"/>
<line num="45" count="60" type="stmt"/>
<line num="46" count="60" type="stmt"/>
<line num="48" count="60" type="cond" truecount="2" falsecount="0"/>
<line num="49" count="9" type="stmt"/>
<line num="51" count="9" type="stmt"/>
<line num="53" count="9" type="cond" truecount="2" falsecount="0"/>
<line num="54" count="2" type="stmt"/>
<line num="59" count="60" type="stmt"/>
<line num="60" count="60" type="stmt"/>
<line num="63" count="60" type="stmt"/>
<line num="65" count="60" type="stmt"/>
<line num="69" count="161" type="stmt"/>
<line num="70" count="161" type="stmt"/>
<line num="71" count="161" type="stmt"/>
<line num="72" count="515" type="cond" truecount="2" falsecount="0"/>
<line num="73" count="277" type="stmt"/>
<line num="75" count="238" type="stmt"/>
<line num="77" count="515" type="stmt"/>
<line num="80" count="161" type="stmt"/>
<line num="81" count="161" type="stmt"/>
<line num="82" count="161" type="stmt"/>
<line num="84" count="161" type="stmt"/>
<line num="85" count="161" type="stmt"/>
<line num="86" count="161" type="stmt"/>
<line num="89" count="3104" type="stmt"/>
<line num="90" count="3104" type="cond" truecount="2" falsecount="0"/>
<line num="92" count="1225" type="stmt"/>
<line num="95" count="1879" type="stmt"/>
<line num="97" count="3104" type="cond" truecount="2" falsecount="0"/>
<line num="98" count="11" type="stmt"/>
<line num="101" count="11" type="cond" truecount="1" falsecount="1"/>
<line num="103" count="11" type="stmt"/>
<line num="104" count="11" type="stmt"/>
<line num="105" count="11" type="cond" truecount="2" falsecount="0"/>
<line num="107" count="9" type="stmt"/>
<line num="110" count="2" type="stmt"/>
<line num="116" count="161" type="cond" truecount="2" falsecount="0"/>
<line num="117" count="60" type="stmt"/>
<line num="119" count="101" type="stmt"/>
<line num="122" count="60" type="cond" truecount="2" falsecount="0"/>
</file>
<file name="get-attribute.js" path="/Users/javve/git/list.js/src/utils/get-attribute.js">
<metrics statements="10" coveredstatements="9" conditionals="9" coveredconditionals="7" methods="1" coveredmethods="1"/>
<line num="12" count="17" type="stmt"/>
<line num="13" count="116" type="cond" truecount="3" falsecount="0"/>
<line num="14" count="116" type="cond" truecount="2" falsecount="0"/>
<line num="15" count="26" type="stmt"/>
<line num="16" count="26" type="stmt"/>
<line num="17" count="26" type="stmt"/>
<line num="18" count="83" type="cond" truecount="1" falsecount="1"/>
<line num="19" count="83" type="cond" truecount="1" falsecount="1"/>
<line num="20" count="0" type="stmt"/>
<line num="25" count="116" type="stmt"/>
</file>
<file name="get-by-class.js" path="/Users/javve/git/list.js/src/utils/get-by-class.js">
<metrics statements="30" coveredstatements="28" conditionals="22" coveredconditionals="18" methods="5" coveredmethods="5"/>
<line num="15" count="18" type="stmt"/>
<line num="16" count="2220" type="cond" truecount="2" falsecount="0"/>
<line num="17" count="1859" type="stmt"/>
<line num="19" count="361" type="stmt"/>
<line num="23" count="18" type="stmt"/>
<line num="24" count="1" type="stmt"/>
<line num="25" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="26" count="0" type="stmt"/>
<line num="28" count="1" type="stmt"/>
<line num="32" count="18" type="stmt"/>
<line num="33" count="1" type="stmt"/>
<line num="34" count="1" type="stmt"/>
<line num="36" count="1" type="stmt"/>
<line num="37" count="1" type="stmt"/>
<line num="38" count="1" type="stmt"/>
<line num="39" count="1" type="stmt"/>
<line num="40" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="41" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="42" count="0" type="stmt"/>
<line num="44" count="1" type="stmt"/>
<line num="45" count="1" type="stmt"/>
<line num="49" count="1" type="stmt"/>
<line num="52" count="18" type="stmt"/>
<line num="53" count="18" type="stmt"/>
<line num="54" count="2222" type="cond" truecount="2" falsecount="0"/>
<line num="55" count="2222" type="cond" truecount="6" falsecount="0"/>
<line num="56" count="2220" type="stmt"/>
<line num="57" count="2" type="cond" truecount="5" falsecount="1"/>
<line num="58" count="1" type="stmt"/>
<line num="60" count="1" type="stmt"/>
</file>
<file name="index-of.js" path="/Users/javve/git/list.js/src/utils/index-of.js">
<metrics statements="6" coveredstatements="3" conditionals="4" coveredconditionals="1" methods="1" coveredmethods="1"/>
<line num="1" count="18" type="stmt"/>
<line num="3" count="18" type="stmt"/>
<line num="4" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="5" count="0" type="stmt"/>
<line num="6" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="8" count="0" type="stmt"/>
</file>
<file name="to-array.js" path="/Users/javve/git/list.js/src/utils/to-array.js">
<metrics statements="15" coveredstatements="15" conditionals="22" coveredconditionals="13" methods="2" coveredmethods="2"/>
<line num="12" count="17" type="stmt"/>
<line num="13" count="364" type="cond" truecount="1" falsecount="1"/>
<line num="14" count="364" type="cond" truecount="1" falsecount="1"/>
<line num="15" count="364" type="cond" truecount="1" falsecount="1"/>
<line num="16" count="364" type="cond" truecount="1" falsecount="1"/>
<line num="17" count="364" type="cond" truecount="1" falsecount="1"/>
<line num="18" count="364" type="cond" truecount="2" falsecount="0"/>
<line num="19" count="360" type="cond" truecount="2" falsecount="2"/>
<line num="21" count="360" type="stmt"/>
<line num="22" count="360" type="stmt"/>
<line num="23" count="41" type="cond" truecount="2" falsecount="2"/>
<line num="24" count="41" type="stmt"/>
<line num="27" count="360" type="cond" truecount="2" falsecount="0"/>
<line num="28" count="27" type="stmt"/>
<line num="32" count="364" type="stmt"/>
</file>
<file name="to-string.js" path="/Users/javve/git/list.js/src/utils/to-string.js">
<metrics statements="5" coveredstatements="5" conditionals="4" coveredconditionals="4" methods="1" coveredmethods="1"/>
<line num="1" count="17" type="stmt"/>
<line num="2" count="132" type="cond" truecount="2" falsecount="0"/>
<line num="3" count="132" type="cond" truecount="2" falsecount="0"/>
<line num="4" count="132" type="stmt"/>
<line num="5" count="132" type="stmt"/>
</file>
</package>
</project>
</coverage>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,224 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

View file

@ -0,0 +1,79 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selecter that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);

View file

@ -0,0 +1,194 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for events.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> events.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">68.75% </span>
<span class="quiet">Statements</span>
<span class='fraction'>11/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class='fraction'>5/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Lines</span>
<span class='fraction'>9/12</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">45x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var bind = window.addEventListener ? 'addEventListener' : <span class="branch-1 cbranch-no" title="branch not covered" >'attachEvent',</span>
unbind = window.removeEventListener ? 'removeEventListener' : <span class="branch-1 cbranch-no" title="branch not covered" >'detachEvent',</span>
prefix = bind !== 'addEventListener' ? <span class="branch-0 cbranch-no" title="branch not covered" >'on' </span>: '',
toArray = require('./to-array')
&nbsp;
/**
* Bind `el` event `type` to `fn`.
*
* @param {Element} el, NodeList, HTMLCollection or Array
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @api public
*/
&nbsp;
exports.bind = function(el, type, fn, capture){
el = toArray(el);
for ( var i = 0, il = el.length; i &lt; il; i++ ) {
el[i][bind](prefix + type, fn, capture || false);
}
}
&nbsp;
/**
* Unbind `el` event `type`'s callback `fn`.
*
* @param {Element} el, NodeList, HTMLCollection or Array
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @api public
*/
&nbsp;
exports.unbind = <span class="fstat-no" title="function not covered" >fu</span>nction(el, type, fn, capture){
<span class="cstat-no" title="statement not covered" > el = toArray(el);</span>
<span class="cstat-no" title="statement not covered" > for ( var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >el.length;</span> i &lt; il; i++ ) {</span>
<span class="cstat-no" title="statement not covered" > el[i][unbind](prefix + type, fn, capture || false);</span>
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 21 2020 22:28:41 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

View file

@ -0,0 +1,167 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for filter.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> filter.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>21/21</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>19/19</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">83x</span>
<span class="cline-any cline-yes">83x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">83x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">47x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">122x</span>
<span class="cline-any cline-yes">122x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
// Add handlers
list.handlers.filterStart = list.handlers.filterStart || []
list.handlers.filterComplete = list.handlers.filterComplete || []
&nbsp;
return function (filterFunction) {
list.trigger('filterStart')
&nbsp;
list.i = 1 // Reset paging
list.reset.filter()
if (filterFunction === undefined) {
list.filtered = false
} else {
list.filtered = true
var is = list.items
for (var i = 0, il = is.length; i &lt; il; i++) {
var item = is[i]
if (filterFunction(item)) {
item.filtered = true
} else {
item.filtered = false
}
}
}
list.update()
list.trigger('filterComplete')
return list.visibleItems
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 21 2020 15:35:43 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,449 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for fuzzy.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> fuzzy.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">95.24% </span>
<span class="quiet">Statements</span>
<span class='fraction'>60/63</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Branches</span>
<span class='fraction'>24/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">98.31% </span>
<span class="quiet">Lines</span>
<span class='fraction'>58/59</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">330x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">330x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">515x</span>
<span class="cline-any cline-yes">277x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">238x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">515x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3104x</span>
<span class="cline-any cline-yes">3104x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1225x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1879x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3104x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">101x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (text, pattern, options) {
// Aproximately where in the text is the pattern expected to be found?
var Match_Location = options.location || 0
&nbsp;
//Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is 'distance' characters away from the fuzzy location would score as a complete mismatch. A distance of '0' requires the match be at the exact location specified, a threshold of '1000' would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
var Match_Distance = options.distance || <span class="branch-1 cbranch-no" title="branch not covered" >100</span>
&nbsp;
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything.
var Match_Threshold = options.threshold || <span class="branch-1 cbranch-no" title="branch not covered" >0.4</span>
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (pattern === text) <span class="cstat-no" title="statement not covered" >return true </span>// Exact match
<span class="missing-if-branch" title="if path not taken" >I</span>if (pattern.length &gt; 32) <span class="cstat-no" title="statement not covered" >return false </span>// This algorithm cannot be used
&nbsp;
// Set starting location at beginning text and initialise the alphabet.
var loc = Match_Location,
s = (function () {
var q = {},
i
&nbsp;
for (i = 0; i &lt; pattern.length; i++) {
q[pattern.charAt(i)] = 0
}
&nbsp;
for (i = 0; i &lt; pattern.length; i++) {
q[pattern.charAt(i)] |= 1 &lt;&lt; (pattern.length - i - 1)
}
&nbsp;
return q
})()
&nbsp;
// Compute and return the score for a match with e errors and x location.
// Accesses loc and pattern through being a closure.
&nbsp;
function match_bitapScore_(e, x) {
var accuracy = e / pattern.length,
proximity = Math.abs(loc - x)
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!Match_Distance) {
// Dodge divide by zero error.
<span class="cstat-no" title="statement not covered" > return proximity ? 1.0 : accuracy</span>
}
return accuracy + proximity / Match_Distance
}
&nbsp;
var score_threshold = Match_Threshold, // Highest score beyond which we give up.
best_loc = text.indexOf(pattern, loc) // Is there a nearby exact match? (speedup)
&nbsp;
if (best_loc != -1) {
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)
// What about in the other direction? (speedup)
best_loc = text.lastIndexOf(pattern, loc + pattern.length)
&nbsp;
if (best_loc != -1) {
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)
}
}
&nbsp;
// Initialise the bit arrays.
var matchmask = 1 &lt;&lt; (pattern.length - 1)
best_loc = -1
&nbsp;
var bin_min, bin_mid
var bin_max = pattern.length + text.length
var last_rd
for (var d = 0; d &lt; pattern.length; d++) {
// Scan for the best match; each iteration allows for one more error.
// Run a binary search to determine how far from 'loc' we can stray at this
// error level.
bin_min = 0
bin_mid = bin_max
while (bin_min &lt; bin_mid) {
if (match_bitapScore_(d, loc + bin_mid) &lt;= score_threshold) {
bin_min = bin_mid
} else {
bin_max = bin_mid
}
bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min)
}
// Use the result from this iteration as the maximum for the next.
bin_max = bin_mid
var start = Math.max(1, loc - bin_mid + 1)
var finish = Math.min(loc + bin_mid, text.length) + pattern.length
&nbsp;
var rd = Array(finish + 2)
rd[finish + 1] = (1 &lt;&lt; d) - 1
for (var j = finish; j &gt;= start; j--) {
// The alphabet (s) is a sparse hash, so the following line generates
// warnings.
var charMatch = s[text.charAt(j - 1)]
if (d === 0) {
// First pass: exact match.
rd[j] = ((rd[j + 1] &lt;&lt; 1) | 1) &amp; charMatch
} else {
// Subsequent passes: fuzzy match.
rd[j] = (((rd[j + 1] &lt;&lt; 1) | 1) &amp; charMatch) | (((last_rd[j + 1] | last_rd[j]) &lt;&lt; 1) | 1) | last_rd[j + 1]
}
if (rd[j] &amp; matchmask) {
var score = match_bitapScore_(d, j - 1)
// This match will almost certainly be better than any existing match.
// But check anyway.
<span class="missing-if-branch" title="else path not taken" >E</span>if (score &lt;= score_threshold) {
// Told you so.
score_threshold = score
best_loc = j - 1
if (best_loc &gt; loc) {
// When passing loc, don't exceed our current distance from loc.
start = Math.max(1, 2 * loc - best_loc)
} else {
// Already passed loc, downhill from here on in.
break
}
}
}
}
// No hope for a (better) match at greater error levels.
if (match_bitapScore_(d + 1, loc) &gt; score_threshold) {
break
}
last_rd = rd
}
&nbsp;
return best_loc &lt; 0 ? false : true
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 21 2020 22:27:40 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,107 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for index-of.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> index-of.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">40% </span>
<span class="quiet">Statements</span>
<span class='fraction'>4/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">25% </span>
<span class="quiet">Branches</span>
<span class='fraction'>1/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Lines</span>
<span class='fraction'>3/6</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var indexOf = [].indexOf
&nbsp;
module.exports = function(arr, obj){
<span class="missing-if-branch" title="else path not taken" >E</span>if (indexOf) return arr.indexOf(obj);
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >arr.length;</span> i &lt; il; ++i) {</span>
<span class="cstat-no" title="statement not covered" > if (arr[i] === obj) <span class="cstat-no" title="statement not covered" >return i;</span></span>
}
<span class="cstat-no" title="statement not covered" > return -1</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 21 2020 22:28:41 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,126 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">91.48% </span>
<span class="quiet">Statements</span>
<span class='fraction'>805/880</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">80.89% </span>
<span class="quiet">Branches</span>
<span class='fraction'>364/450</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.76% </span>
<span class="quiet">Functions</span>
<span class='fraction'>113/118</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.33% </span>
<span class="quiet">Lines</span>
<span class='fraction'>742/795</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="src"><a href="src/index.html">src</a></td>
<td data-value="97.51" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 97%"></div><div class="cover-empty" style="width: 3%"></div></div>
</td>
<td data-value="97.51" class="pct high">97.51%</td>
<td data-value="643" class="abs high">627/643</td>
<td data-value="91.21" class="pct high">91.21%</td>
<td data-value="307" class="abs high">280/307</td>
<td data-value="97.83" class="pct high">97.83%</td>
<td data-value="92" class="abs high">90/92</td>
<td data-value="97.8" class="pct high">97.8%</td>
<td data-value="590" class="abs high">577/590</td>
</tr>
<tr>
<td class="file medium" data-value="src/utils"><a href="src/utils/index.html">src/utils</a></td>
<td data-value="75.11" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 75%"></div><div class="cover-empty" style="width: 25%"></div></div>
</td>
<td data-value="75.11" class="pct medium">75.11%</td>
<td data-value="237" class="abs medium">178/237</td>
<td data-value="58.74" class="pct medium">58.74%</td>
<td data-value="143" class="abs medium">84/143</td>
<td data-value="88.46" class="pct high">88.46%</td>
<td data-value="26" class="abs high">23/26</td>
<td data-value="80.49" class="pct high">80.49%</td>
<td data-value="205" class="abs high">165/205</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,203 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for item.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> item.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>23/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.45% </span>
<span class="quiet">Branches</span>
<span class='fraction'>21/22</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>21/21</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-yes">1011x</span>
<span class="cline-any cline-yes">1011x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-yes">5416x</span>
<span class="cline-any cline-yes">1121x</span>
<span class="cline-any cline-yes">1716x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1121x</span>
<span class="cline-any cline-yes">302x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4295x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-yes">4634x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1012x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">const templater = require('./templater')
&nbsp;
module.exports = function (initValues, { element, template } = {}) {
var item = this
&nbsp;
this._values = {}
&nbsp;
this.found = false
this.filtered = false
&nbsp;
var init = function (values, { element, template } = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> {
if (element) item.elm = element
if (!template) throw new Error('missing_item_template')
item.template = template
item.values(values)
}
&nbsp;
this.values = function (newValues) {
if (newValues !== undefined) {
for (var name in newValues) {
item._values[name] = newValues[name]
}
if (item.elm) {
templater.set(item.elm, item.values(), item.template.valueNames)
}
} else {
return item._values
}
}
&nbsp;
this.matching = function ({ searched, filtered }) {
return (
(filtered &amp;&amp; searched &amp;&amp; item.found &amp;&amp; item.filtered) ||
(filtered &amp;&amp; !searched &amp;&amp; item.filtered) ||
(!filtered &amp;&amp; searched &amp;&amp; item.found) ||
(!filtered &amp;&amp; !searched)
)
}
&nbsp;
init(initValues, { element, template })
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Thu Dec 17 2020 00:31:01 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,404 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for pagination.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> pagination.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">90.91% </span>
<span class="quiet">Statements</span>
<span class='fraction'>50/55</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.7% </span>
<span class="quiet">Branches</span>
<span class='fraction'>39/43</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">91.67% </span>
<span class="quiet">Functions</span>
<span class='fraction'>11/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.74% </span>
<span class="quiet">Lines</span>
<span class='fraction'>49/54</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">86x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">86x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-yes">139x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">86x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">249x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">239x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">139x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">139x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">124x</span>
<span class="cline-any cline-yes">39x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">85x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">86x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var classes = require('./utils/classes'),
events = require('./utils/events'),
List = require('./index')
&nbsp;
module.exports = function (list) {
var isHidden = false
&nbsp;
var refresh = function (pagingList, options) {
if (list.page &lt; 1) {
list.listContainer.style.display = 'none'
isHidden = true
return
} else if (isHidden) {
list.listContainer.style.display = 'block'
}
&nbsp;
var item,
l = list.matchingItems.length,
index = list.i,
page = list.page,
pages = Math.ceil(l / page),
currentPage = Math.ceil(index / page),
innerWindow = options.innerWindow || 2,
left = options.left || options.outerWindow || 0,
right = options.right || options.outerWindow || 0
&nbsp;
right = pages - right
pagingList.clear()
for (var i = 1; i &lt;= pages; i++) {
var className = currentPage === i ? 'active' : ''
&nbsp;
//console.log(i, left, right, currentPage, (currentPage - innerWindow), (currentPage + innerWindow), className);
&nbsp;
if (is.number(i, left, right, currentPage, innerWindow)) {
item = pagingList.add({
page: i,
dotted: false,
})[0]
if (className) {
classes(item.elm).add(className)
}
item.elm.firstChild.setAttribute('data-i', i)
item.elm.firstChild.setAttribute('data-page', page)
} else if (is.dotted(pagingList, i, left, right, currentPage, innerWindow, pagingList.size())) {
item = pagingList.add({
page: '...',
dotted: true,
})[0]
classes(item.elm).add('disabled')
}
}
}
&nbsp;
var is = {
number: function (i, left, right, currentPage, innerWindow) {
return this.left(i, left) || this.right(i, right) || this.innerWindow(i, currentPage, innerWindow)
},
left: function (i, left) {
return i &lt;= left
},
right: function (i, right) {
return i &gt; right
},
innerWindow: function (i, currentPage, innerWindow) {
return i &gt;= currentPage - innerWindow &amp;&amp; i &lt;= currentPage + innerWindow
},
dotted: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {
return (
this.dottedLeft(pagingList, i, left, right, currentPage, innerWindow) ||
this.dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem)
)
},
dottedLeft: function (pagingList, i, left, right, currentPage, innerWindow) {
return i == left + 1 &amp;&amp; !this.innerWindow(i, currentPage, innerWindow) &amp;&amp; !this.right(i, right)
},
dottedRight: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {
if (pagingList.items[currentPageItem - 1].values().dotted) {
return false
} else {
return i == right &amp;&amp; !this.innerWindow(i, currentPage, innerWindow) &amp;&amp; !this.right(i, right)
}
},
}
&nbsp;
return function (options) {
var pagingList = new List(list.listContainer.id, {
listClass: options.paginationClass || 'pagination',
item: options.item || "&lt;li&gt;&lt;a class='page' href='#'&gt;&lt;/a&gt;&lt;/li&gt;",
valueNames: ['page', 'dotted'],
searchClass: 'pagination-search-that-is-not-supposed-to-exist',
sortClass: 'pagination-sort-that-is-not-supposed-to-exist',
})
&nbsp;
events.bind(pagingList.listContainer, 'click', <span class="fstat-no" title="function not covered" >fu</span>nction (e) {
var target = <span class="cstat-no" title="statement not covered" >e.target || e.srcElement,</span>
page = <span class="cstat-no" title="statement not covered" >list.utils.getAttribute(target, 'data-page'),</span>
i = <span class="cstat-no" title="statement not covered" >list.utils.getAttribute(target, 'data-i')</span>
<span class="cstat-no" title="statement not covered" > if (i) {</span>
<span class="cstat-no" title="statement not covered" > list.show((i - 1) * page + 1, page)</span>
}
})
&nbsp;
list.on('updated', function () {
refresh(pagingList, options)
})
refresh(pagingList, options)
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 21 2020 23:03:57 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,221 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for parse.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> parse.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">21.88% </span>
<span class="quiet">Statements</span>
<span class='fraction'>7/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">25% </span>
<span class="quiet">Branches</span>
<span class='fraction'>2/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">16.67% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">25% </span>
<span class="quiet">Lines</span>
<span class='fraction'>7/28</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">93x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">93x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">93x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">93x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">93x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">93x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
var Item = require('./item')(list)
&nbsp;
var getChildren = <span class="fstat-no" title="function not covered" >fu</span>nction (parent) {
var nodes = <span class="cstat-no" title="statement not covered" >parent.childNodes,</span>
items = <span class="cstat-no" title="statement not covered" >[]</span>
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >nodes.length;</span> i &lt; il; i++) {</span>
// Only textnodes have a data attribute
<span class="cstat-no" title="statement not covered" > if (nodes[i].data === undefined) {</span>
<span class="cstat-no" title="statement not covered" > items.push(nodes[i])</span>
}
}
<span class="cstat-no" title="statement not covered" > return items</span>
}
&nbsp;
var parse = <span class="fstat-no" title="function not covered" >fu</span>nction (itemElements, valueNames) {
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >itemElements.length;</span> i &lt; il; i++) {</span>
var values = <span class="cstat-no" title="statement not covered" >list.templater.get(itemElements[i])</span>
<span class="cstat-no" title="statement not covered" > list.items.push(new Item(values, itemElements[i]))</span>
}
}
var parseAsync = <span class="fstat-no" title="function not covered" >fu</span>nction (itemElements, valueNames) {
var itemsToIndex = <span class="cstat-no" title="statement not covered" >itemElements.splice(0, 50) </span>// TODO: If &lt; 100 items, what happens in IE etc?
<span class="cstat-no" title="statement not covered" > parse(itemsToIndex, valueNames)</span>
<span class="cstat-no" title="statement not covered" > if (itemElements.length &gt; 0) {</span>
<span class="cstat-no" title="statement not covered" > setTimeout(<span class="fstat-no" title="function not covered" >fu</span>nction () {</span>
<span class="cstat-no" title="statement not covered" > parseAsync(itemElements, valueNames)</span>
}, 1)
} else {
<span class="cstat-no" title="statement not covered" > list.update()</span>
<span class="cstat-no" title="statement not covered" > list.trigger('parseComplete')</span>
}
}
&nbsp;
list.handlers.parseComplete = list.handlers.parseComplete || []
&nbsp;
return <span class="fstat-no" title="function not covered" >fu</span>nction () {
var itemsToIndex = <span class="cstat-no" title="statement not covered" >getChildren(list.list),</span>
valueNames = <span class="cstat-no" title="statement not covered" >list.valueNames</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (list.indexAsync) {</span>
<span class="cstat-no" title="statement not covered" > parseAsync(itemsToIndex, valueNames)</span>
} else {
<span class="cstat-no" title="statement not covered" > parse(itemsToIndex, valueNames)</span>
}
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 28 2020 19:06:38 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +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}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,488 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for search.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> search.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/87</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/49</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/77</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" >module.exports = <span class="fstat-no" title="function not covered" >fu</span>nction (list) {</span>
var item, text, columns, searchString, customSearch
&nbsp;
var prepare = <span class="cstat-no" title="statement not covered" >{</span>
resetList: <span class="fstat-no" title="function not covered" >fu</span>nction () {
<span class="cstat-no" title="statement not covered" > list.i = 1</span>
<span class="cstat-no" title="statement not covered" > list.templater.clear(list.list)</span>
<span class="cstat-no" title="statement not covered" > customSearch = undefined</span>
},
setOptions: <span class="fstat-no" title="function not covered" >fu</span>nction (args) {
<span class="cstat-no" title="statement not covered" > if (args.length == 2 &amp;&amp; args[1] instanceof Array) {</span>
<span class="cstat-no" title="statement not covered" > columns = args[1]</span>
} else <span class="cstat-no" title="statement not covered" >if (args.length == 2 &amp;&amp; typeof args[1] == 'function') {</span>
<span class="cstat-no" title="statement not covered" > columns = undefined</span>
<span class="cstat-no" title="statement not covered" > customSearch = args[1]</span>
} else <span class="cstat-no" title="statement not covered" >if (args.length == 3) {</span>
<span class="cstat-no" title="statement not covered" > columns = args[1]</span>
<span class="cstat-no" title="statement not covered" > customSearch = args[2]</span>
} else {
<span class="cstat-no" title="statement not covered" > columns = undefined</span>
}
},
setColumns: <span class="fstat-no" title="function not covered" >fu</span>nction () {
<span class="cstat-no" title="statement not covered" > if (list.items.length === 0) <span class="cstat-no" title="statement not covered" >return</span></span>
<span class="cstat-no" title="statement not covered" > if (columns === undefined) {</span>
<span class="cstat-no" title="statement not covered" > columns = list.searchColumns === undefined ? prepare.toArray(list.items[0].values()) : list.searchColumns</span>
}
},
setSearchString: <span class="fstat-no" title="function not covered" >fu</span>nction (s) {
<span class="cstat-no" title="statement not covered" > s = list.utils.toString(s).toLowerCase()</span>
<span class="cstat-no" title="statement not covered" > s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, '\\$&amp;') </span>// Escape regular expression characters
<span class="cstat-no" title="statement not covered" > searchString = s</span>
},
toArray: <span class="fstat-no" title="function not covered" >fu</span>nction (values) {
var tmpColumn = <span class="cstat-no" title="statement not covered" >[]</span>
<span class="cstat-no" title="statement not covered" > for (var name in values) {</span>
<span class="cstat-no" title="statement not covered" > tmpColumn.push(name)</span>
}
<span class="cstat-no" title="statement not covered" > return tmpColumn</span>
},
}
var search = <span class="cstat-no" title="statement not covered" >{</span>
list: <span class="fstat-no" title="function not covered" >fu</span>nction () {
// Extract quoted phrases "word1 word2" from original searchString
// searchString is converted to lowercase by List.js
var words = <span class="cstat-no" title="statement not covered" >[],</span>
phrase,
ss = <span class="cstat-no" title="statement not covered" >searchString</span>
<span class="cstat-no" title="statement not covered" > while ((phrase = ss.match(/"([^"]+)"/)) !== null) {</span>
<span class="cstat-no" title="statement not covered" > words.push(phrase[1])</span>
<span class="cstat-no" title="statement not covered" > ss = ss.substring(0, phrase.index) + ss.substring(phrase.index + phrase[0].length)</span>
}
// Get remaining space-separated words (if any)
<span class="cstat-no" title="statement not covered" > ss = ss.trim()</span>
<span class="cstat-no" title="statement not covered" > if (ss.length) <span class="cstat-no" title="statement not covered" >words = words.concat(ss.split(/\s+/))</span></span>
<span class="cstat-no" title="statement not covered" > for (var k = <span class="cstat-no" title="statement not covered" >0,</span> kl = <span class="cstat-no" title="statement not covered" >list.items.length;</span> k &lt; kl; k++) {</span>
var item = <span class="cstat-no" title="statement not covered" >list.items[k]</span>
<span class="cstat-no" title="statement not covered" > item.found = false</span>
<span class="cstat-no" title="statement not covered" > if (!words.length) <span class="cstat-no" title="statement not covered" >continue</span></span>
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >words.length;</span> i &lt; il; i++) {</span>
var word_found = <span class="cstat-no" title="statement not covered" >false</span>
<span class="cstat-no" title="statement not covered" > for (var j = <span class="cstat-no" title="statement not covered" >0,</span> jl = <span class="cstat-no" title="statement not covered" >columns.length;</span> j &lt; jl; j++) {</span>
var values = <span class="cstat-no" title="statement not covered" >item.values(),</span>
column = <span class="cstat-no" title="statement not covered" >columns[j]</span>
<span class="cstat-no" title="statement not covered" > if (values.hasOwnProperty(column) &amp;&amp; values[column] !== undefined &amp;&amp; values[column] !== null) {</span>
var text = <span class="cstat-no" title="statement not covered" >typeof values[column] !== 'string' ? values[column].toString() : values[column]</span>
<span class="cstat-no" title="statement not covered" > if (text.toLowerCase().indexOf(words[i]) !== -1) {</span>
// word found, so no need to check it against any other columns
<span class="cstat-no" title="statement not covered" > word_found = true</span>
<span class="cstat-no" title="statement not covered" > break</span>
}
}
}
// this word not found? no need to check any other words, the item cannot match
<span class="cstat-no" title="statement not covered" > if (!word_found) <span class="cstat-no" title="statement not covered" >break</span></span>
}
<span class="cstat-no" title="statement not covered" > item.found = word_found</span>
}
},
// Removed search.item() and search.values()
reset: <span class="fstat-no" title="function not covered" >fu</span>nction () {
<span class="cstat-no" title="statement not covered" > list.reset.search()</span>
<span class="cstat-no" title="statement not covered" > list.searched = false</span>
},
}
&nbsp;
var searchMethod = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >fu</span>nction (str) {</span>
<span class="cstat-no" title="statement not covered" > list.trigger('searchStart')</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > prepare.resetList()</span>
<span class="cstat-no" title="statement not covered" > prepare.setSearchString(str)</span>
<span class="cstat-no" title="statement not covered" > prepare.setOptions(arguments) </span>// str, cols|searchFunction, searchFunction
<span class="cstat-no" title="statement not covered" > prepare.setColumns()</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (searchString === '') {</span>
<span class="cstat-no" title="statement not covered" > search.reset()</span>
} else {
<span class="cstat-no" title="statement not covered" > list.searched = true</span>
<span class="cstat-no" title="statement not covered" > if (customSearch) {</span>
<span class="cstat-no" title="statement not covered" > customSearch(searchString, columns)</span>
} else {
<span class="cstat-no" title="statement not covered" > search.list()</span>
}
}
&nbsp;
<span class="cstat-no" title="statement not covered" > list.update()</span>
<span class="cstat-no" title="statement not covered" > list.trigger('searchComplete')</span>
<span class="cstat-no" title="statement not covered" > return list.visibleItems</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > list.handlers.searchStart = list.handlers.searchStart || []</span>
<span class="cstat-no" title="statement not covered" > list.handlers.searchComplete = list.handlers.searchComplete || []</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > list.utils.events.bind(</span>
list.utils.getByClass(list.listContainer, list.searchClass),
'keyup',
list.utils.events.debounce(<span class="fstat-no" title="function not covered" >fu</span>nction (e) {
var target = <span class="cstat-no" title="statement not covered" >e.target || e.srcElement,</span> // IE have srcElement
alreadyCleared = <span class="cstat-no" title="statement not covered" >target.value === '' &amp;&amp; !list.searched</span>
<span class="cstat-no" title="statement not covered" > if (!alreadyCleared) {</span>
// If oninput already have resetted the list, do nothing
<span class="cstat-no" title="statement not covered" > searchMethod(target.value)</span>
}
}, list.searchDelay)
)
&nbsp;
// Used to detect click on HTML5 clear button
<span class="cstat-no" title="statement not covered" > list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', <span class="fstat-no" title="function not covered" >fu</span>nction (e) {</span>
var target = <span class="cstat-no" title="statement not covered" >e.target || e.srcElement</span>
<span class="cstat-no" title="statement not covered" > if (target.value === '') {</span>
<span class="cstat-no" title="statement not covered" > searchMethod('')</span>
}
})
&nbsp;
<span class="cstat-no" title="statement not covered" > return searchMethod</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 28 2020 19:06:38 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

View file

@ -0,0 +1,305 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for sort-listener.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> sort-listener.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>56/56</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90% </span>
<span class="quiet">Branches</span>
<span class='fraction'>27/30</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>50/50</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">138x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">50x</span>
<span class="cline-any cline-yes">50x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">100x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var getAttribute = require('./utils/get-attribute')
var classes = require('./utils/classes')
var events = require('./utils/events')
var sorter = require('./sorter')
&nbsp;
var getInSensitive = function (btn) {
var insensitive = getAttribute(btn, 'data-insensitive')
if (insensitive === 'false') {
return false
} else {
return true
}
}
var getNextOrder = function (btn) {
var predefinedOrder = getAttribute(btn, 'data-order')
if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {
return predefinedOrder
} else if (classes(btn).has('desc')) {
return 'asc'
} else if (classes(btn).has('asc')) {
return 'desc'
} else {
return 'asc'
}
}
var clearOrder = function (els) {
for (var i = 0, il = els.length; i &lt; il; i++) {
classes(els[i]).remove('asc')
classes(els[i]).remove('desc')
}
}
var setOrder = function (els, valueName, order) {
for (var i = 0, il = els.length; i &lt; il; i++) {
var btn = els[i]
if (getAttribute(btn, 'data-sort') !== valueName) {
classes(btn).remove('asc')
classes(btn).remove('desc')
continue
}
var predefinedOrder = getAttribute(btn, 'data-order')
if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {
if (predefinedOrder == order) {
classes(btn).add(order)
classes(btn).remove(order === 'asc' ? 'desc' : 'asc')
} else {
classes(btn).remove('asc')
classes(btn).remove('desc')
}
} else {
classes(btn).add(order)
classes(btn).remove(order === 'asc' ? 'desc' : 'asc')
}
}
}
&nbsp;
var addSortListeners = function (elements, { items, sortFunction, alphabet, before, after } = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> {
events.bind(elements, 'click', function () {
if (before) before()
var target = arguments[0].currentTarget || <span class="branch-1 cbranch-no" title="branch not covered" >arguments[0].srcElement </span>|| <span class="branch-2 cbranch-no" title="branch not covered" >undefined</span>
var valueName = getAttribute(target, 'data-sort')
var order = getNextOrder(target)
var insensitive = getInSensitive(target)
var options = {
sortFunction,
insensitive,
alphabet,
order,
}
setOrder(elements, valueName, order)
sorter(items, valueName, options)
if (after) after()
})
}
&nbsp;
module.exports = { addSortListeners, getInSensitive, getNextOrder, setOrder, clearOrder }
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Thu Dec 17 2020 00:25:33 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,80 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for sort-listeners.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> sort-listeners.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/0</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Tue Dec 15 2020 22:16:56 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,410 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for sort.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> sort.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/65</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/47</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/61</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" >module.exports = <span class="fstat-no" title="function not covered" >fu</span>nction (list) {</span>
var buttons = <span class="cstat-no" title="statement not covered" >{</span>
els: undefined,
clear: <span class="fstat-no" title="function not covered" >fu</span>nction () {
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >buttons.els.length;</span> i &lt; il; i++) {</span>
<span class="cstat-no" title="statement not covered" > list.utils.classes(buttons.els[i]).remove('asc')</span>
<span class="cstat-no" title="statement not covered" > list.utils.classes(buttons.els[i]).remove('desc')</span>
}
},
getOrder: <span class="fstat-no" title="function not covered" >fu</span>nction (btn) {
var predefinedOrder = <span class="cstat-no" title="statement not covered" >list.utils.getAttribute(btn, 'data-order')</span>
<span class="cstat-no" title="statement not covered" > if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {</span>
<span class="cstat-no" title="statement not covered" > return predefinedOrder</span>
} else <span class="cstat-no" title="statement not covered" >if (list.utils.classes(btn).has('desc')) {</span>
<span class="cstat-no" title="statement not covered" > return 'asc'</span>
} else <span class="cstat-no" title="statement not covered" >if (list.utils.classes(btn).has('asc')) {</span>
<span class="cstat-no" title="statement not covered" > return 'desc'</span>
} else {
<span class="cstat-no" title="statement not covered" > return 'asc'</span>
}
},
getInSensitive: <span class="fstat-no" title="function not covered" >fu</span>nction (btn, options) {
var insensitive = <span class="cstat-no" title="statement not covered" >list.utils.getAttribute(btn, 'data-insensitive')</span>
<span class="cstat-no" title="statement not covered" > if (insensitive === 'false') {</span>
<span class="cstat-no" title="statement not covered" > options.insensitive = false</span>
} else {
<span class="cstat-no" title="statement not covered" > options.insensitive = true</span>
}
},
setOrder: <span class="fstat-no" title="function not covered" >fu</span>nction (options) {
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >buttons.els.length;</span> i &lt; il; i++) {</span>
var btn = <span class="cstat-no" title="statement not covered" >buttons.els[i]</span>
<span class="cstat-no" title="statement not covered" > if (list.utils.getAttribute(btn, 'data-sort') !== options.valueName) {</span>
<span class="cstat-no" title="statement not covered" > continue</span>
}
var predefinedOrder = <span class="cstat-no" title="statement not covered" >list.utils.getAttribute(btn, 'data-order')</span>
<span class="cstat-no" title="statement not covered" > if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {</span>
<span class="cstat-no" title="statement not covered" > if (predefinedOrder == options.order) {</span>
<span class="cstat-no" title="statement not covered" > list.utils.classes(btn).add(options.order)</span>
}
} else {
<span class="cstat-no" title="statement not covered" > list.utils.classes(btn).add(options.order)</span>
}
}
},
}
&nbsp;
var sort = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >fu</span>nction () {</span>
<span class="cstat-no" title="statement not covered" > list.trigger('sortStart')</span>
var options = <span class="cstat-no" title="statement not covered" >{}</span>
&nbsp;
var target = <span class="cstat-no" title="statement not covered" >arguments[0].currentTarget || arguments[0].srcElement || undefined</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (target) {</span>
<span class="cstat-no" title="statement not covered" > options.valueName = list.utils.getAttribute(target, 'data-sort')</span>
<span class="cstat-no" title="statement not covered" > buttons.getInSensitive(target, options)</span>
<span class="cstat-no" title="statement not covered" > options.order = buttons.getOrder(target)</span>
} else {
<span class="cstat-no" title="statement not covered" > options = arguments[1] || options</span>
<span class="cstat-no" title="statement not covered" > options.valueName = arguments[0]</span>
<span class="cstat-no" title="statement not covered" > options.order = options.order || 'asc'</span>
<span class="cstat-no" title="statement not covered" > options.insensitive = typeof options.insensitive == 'undefined' ? true : options.insensitive</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > buttons.clear()</span>
<span class="cstat-no" title="statement not covered" > buttons.setOrder(options)</span>
&nbsp;
// caseInsensitive
// alphabet
var customSortFunction = <span class="cstat-no" title="statement not covered" >options.sortFunction || list.sortFunction || null,</span>
multi = <span class="cstat-no" title="statement not covered" >options.order === 'desc' ? -1 : 1,</span>
sortFunction
&nbsp;
<span class="cstat-no" title="statement not covered" > if (customSortFunction) {</span>
<span class="cstat-no" title="statement not covered" > sortFunction = <span class="fstat-no" title="function not covered" >fu</span>nction (itemA, itemB) {</span>
<span class="cstat-no" title="statement not covered" > return customSortFunction(itemA, itemB, options) * multi</span>
}
} else {
<span class="cstat-no" title="statement not covered" > sortFunction = <span class="fstat-no" title="function not covered" >fu</span>nction (itemA, itemB) {</span>
var naturalSortOptions = <span class="cstat-no" title="statement not covered" >{}</span>
<span class="cstat-no" title="statement not covered" > naturalSortOptions.alphabet = list.alphabet || options.alphabet || undefined</span>
<span class="cstat-no" title="statement not covered" > if (!naturalSortOptions.alphabet &amp;&amp; options.insensitive) {</span>
<span class="cstat-no" title="statement not covered" > naturalSortOptions.caseInsensitive = true</span>
}
<span class="cstat-no" title="statement not covered" > return (</span>
list.utils.naturalSort(
'' + itemA.values()[options.valueName],
'' + itemB.values()[options.valueName],
naturalSortOptions
) * multi
)
}
}
&nbsp;
<span class="cstat-no" title="statement not covered" > list.items.sort(sortFunction)</span>
<span class="cstat-no" title="statement not covered" > list.update()</span>
<span class="cstat-no" title="statement not covered" > list.trigger('sortComplete')</span>
}
&nbsp;
// Add handlers
<span class="cstat-no" title="statement not covered" > list.handlers.sortStart = list.handlers.sortStart || []</span>
<span class="cstat-no" title="statement not covered" > list.handlers.sortComplete = list.handlers.sortComplete || []</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > buttons.els = list.utils.getByClass(list.listContainer, list.sortClass)</span>
<span class="cstat-no" title="statement not covered" > list.utils.events.bind(buttons.els, 'click', sort)</span>
<span class="cstat-no" title="statement not covered" > list.on('searchStart', buttons.clear)</span>
<span class="cstat-no" title="statement not covered" > list.on('filterStart', buttons.clear)</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > return sort</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Thu Dec 17 2020 00:01:06 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,170 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

View file

@ -0,0 +1,167 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for sorter.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> sorter.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>14/14</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>9/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>14/14</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">49x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">51x</span>
<span class="cline-any cline-yes">462x</span>
<span class="cline-any cline-yes">462x</span>
<span class="cline-any cline-yes">386x</span>
<span class="cline-any cline-yes">372x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">462x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var naturalSort = require('string-natural-compare')
&nbsp;
module.exports = (items, column, options = {}) =&gt; {
const { sortFunction, order, alphabet, insensitive } = options
const caseSensitive = insensitive !== false
const multi = order === 'desc' ? -1 : 1
&nbsp;
if (sortFunction) {
return items.sort(function (itemA, itemB) {
return (
sortFunction(itemA, itemB, {
valueName: column,
alphabet,
caseSensitive,
}) * multi
)
})
} else {
return items.sort(function (itemA, itemB) {
const options = { alphabet }
if (!alphabet) {
if (caseSensitive) {
options.caseInsensitive = true
}
}
return naturalSort('' + itemA.values()[column], '' + itemB.values()[column], options) * multi
})
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Thu Dec 17 2020 00:29:41 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,128 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/add-async.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> add-async.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>11/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>11/11</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
var addAsync = function (values, callback, items) {
var valuesToAdd = values.splice(0, 50)
items = items || []
items = items.concat(list.add(valuesToAdd))
if (values.length &gt; 0) {
setTimeout(function () {
addAsync(values, callback, items)
}, 1)
} else {
list.update()
callback(items)
}
}
return addAsync
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,164 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/filter.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> filter.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>21/21</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>19/19</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">47x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">122x</span>
<span class="cline-any cline-yes">122x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
// Add handlers
list.handlers.filterStart = list.handlers.filterStart || []
list.handlers.filterComplete = list.handlers.filterComplete || []
&nbsp;
return function (filterFunction) {
list.trigger('filterStart')
list.i = 1 // Reset paging
list.reset.filter()
if (filterFunction === undefined) {
list.filtered = false
} else {
list.filtered = true
var is = list.items
for (var i = 0, il = is.length; i &lt; il; i++) {
var item = is[i]
if (filterFunction(item)) {
item.filtered = true
} else {
item.filtered = false
}
}
}
list.update()
list.trigger('filterComplete')
return list.visibleItems
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,290 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/fuzzy-search.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> fuzzy-search.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>37/37</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">78.57% </span>
<span class="quiet">Branches</span>
<span class='fraction'>11/14</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>32/32</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">50x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">50x</span>
<span class="cline-any cline-yes">50x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">49x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">50x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var classes = require('./utils/classes'),
events = require('./utils/events'),
extend = require('./utils/extend'),
toString = require('./utils/to-string'),
getByClass = require('./utils/get-by-class'),
fuzzy = require('./utils/fuzzy')
&nbsp;
module.exports = function (list, options) {
options = options || {}
&nbsp;
options = extend(
{
location: 0,
distance: 100,
threshold: 0.4,
multiSearch: true,
searchClass: 'fuzzy-search',
},
options
)
&nbsp;
var fuzzySearch = {
search: function (searchString, columns) {
// Substract arguments from the searchString or put searchString as only argument
var searchArguments = options.multiSearch ? searchString.replace(/ +$/, '').split(/ +/) : <span class="branch-1 cbranch-no" title="branch not covered" >[searchString]</span>
&nbsp;
for (var k = 0, kl = list.items.length; k &lt; kl; k++) {
fuzzySearch.item(list.items[k], columns, searchArguments)
}
},
item: function (item, columns, searchArguments) {
var found = true
for (var i = 0; i &lt; searchArguments.length; i++) {
var foundArgument = false
for (var j = 0, jl = columns.length; j &lt; jl; j++) {
if (fuzzySearch.values(item.values(), columns[j], searchArguments[i])) {
foundArgument = true
}
}
if (!foundArgument) {
found = false
}
}
item.found = found
},
values: function (values, value, searchArgument) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (values.hasOwnProperty(value)) {
var text = toString(values[value]).toLowerCase()
&nbsp;
if (fuzzy(text, searchArgument, options)) {
return true
}
}
return false
},
}
&nbsp;
events.bind(
getByClass(list.listContainer, options.searchClass),
'keyup',
list.utils.events.debounce(function (e) {
var target = e.target || <span class="branch-1 cbranch-no" title="branch not covered" >e.srcElement </span>// IE have srcElement
list.search(target.value, fuzzySearch.search)
}, list.searchDelay)
)
&nbsp;
return function (str, columns) {
list.search(str, columns, fuzzySearch.search)
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,246 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> src</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">97.51% </span>
<span class="quiet">Statements</span>
<span class='fraction'>627/643</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">91.21% </span>
<span class="quiet">Branches</span>
<span class='fraction'>280/307</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">97.83% </span>
<span class="quiet">Functions</span>
<span class='fraction'>90/92</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">97.8% </span>
<span class="quiet">Lines</span>
<span class='fraction'>577/590</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="add-async.js"><a href="add-async.js.html">add-async.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="11" class="abs high">11/11</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="11" class="abs high">11/11</td>
</tr>
<tr>
<td class="file high" data-value="filter.js"><a href="filter.js.html">filter.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="21" class="abs high">21/21</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">8/8</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="19" class="abs high">19/19</td>
</tr>
<tr>
<td class="file high" data-value="fuzzy-search.js"><a href="fuzzy-search.js.html">fuzzy-search.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="37" class="abs high">37/37</td>
<td data-value="78.57" class="pct medium">78.57%</td>
<td data-value="14" class="abs medium">11/14</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="32" class="abs high">32/32</td>
</tr>
<tr>
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
<td data-value="98.83" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 98%"></div><div class="cover-empty" style="width: 2%"></div></div>
</td>
<td data-value="98.83" class="pct high">98.83%</td>
<td data-value="171" class="abs high">169/171</td>
<td data-value="94.59" class="pct high">94.59%</td>
<td data-value="37" class="abs high">35/37</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="19" class="abs high">19/19</td>
<td data-value="98.75" class="pct high">98.75%</td>
<td data-value="160" class="abs high">158/160</td>
</tr>
<tr>
<td class="file high" data-value="item.js"><a href="item.js.html">item.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="30" class="abs high">30/30</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="24" class="abs high">24/24</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">8/8</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="30" class="abs high">30/30</td>
</tr>
<tr>
<td class="file high" data-value="pagination.js"><a href="pagination.js.html">pagination.js</a></td>
<td data-value="90.91" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 90%"></div><div class="cover-empty" style="width: 10%"></div></div>
</td>
<td data-value="90.91" class="pct high">90.91%</td>
<td data-value="55" class="abs high">50/55</td>
<td data-value="90.7" class="pct high">90.7%</td>
<td data-value="43" class="abs high">39/43</td>
<td data-value="91.67" class="pct high">91.67%</td>
<td data-value="12" class="abs high">11/12</td>
<td data-value="90.74" class="pct high">90.74%</td>
<td data-value="54" class="abs high">49/54</td>
</tr>
<tr>
<td class="file high" data-value="parse.js"><a href="parse.js.html">parse.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="31" class="abs high">31/31</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">8/8</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="27" class="abs high">27/27</td>
</tr>
<tr>
<td class="file high" data-value="search.js"><a href="search.js.html">search.js</a></td>
<td data-value="94.25" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 94%"></div><div class="cover-empty" style="width: 6%"></div></div>
</td>
<td data-value="94.25" class="pct high">94.25%</td>
<td data-value="87" class="abs high">82/87</td>
<td data-value="81.63" class="pct high">81.63%</td>
<td data-value="49" class="abs high">40/49</td>
<td data-value="90.91" class="pct high">90.91%</td>
<td data-value="11" class="abs high">10/11</td>
<td data-value="96.1" class="pct high">96.1%</td>
<td data-value="77" class="abs high">74/77</td>
</tr>
<tr>
<td class="file high" data-value="sort.js"><a href="sort.js.html">sort.js</a></td>
<td data-value="96.92" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 96%"></div><div class="cover-empty" style="width: 4%"></div></div>
</td>
<td data-value="96.92" class="pct high">96.92%</td>
<td data-value="65" class="abs high">63/65</td>
<td data-value="95.74" class="pct high">95.74%</td>
<td data-value="47" class="abs high">45/47</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">8/8</td>
<td data-value="96.72" class="pct high">96.72%</td>
<td data-value="61" class="abs high">59/61</td>
</tr>
<tr>
<td class="file high" data-value="templater.js"><a href="templater.js.html">templater.js</a></td>
<td data-value="98.52" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 98%"></div><div class="cover-empty" style="width: 2%"></div></div>
</td>
<td data-value="98.52" class="pct high">98.52%</td>
<td data-value="135" class="abs high">133/135</td>
<td data-value="90.41" class="pct high">90.41%</td>
<td data-value="73" class="abs high">66/73</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
<td data-value="99.16" class="pct high">99.16%</td>
<td data-value="119" class="abs high">118/119</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,869 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/index.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> index.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">98.83% </span>
<span class="quiet">Statements</span>
<span class='fraction'>169/171</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.59% </span>
<span class="quiet">Branches</span>
<span class='fraction'>35/37</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>19/19</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">98.75% </span>
<span class="quiet">Lines</span>
<span class='fraction'>158/160</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a>
<a name='L230'></a><a href='#L230'>230</a>
<a name='L231'></a><a href='#L231'>231</a>
<a name='L232'></a><a href='#L232'>232</a>
<a name='L233'></a><a href='#L233'>233</a>
<a name='L234'></a><a href='#L234'>234</a>
<a name='L235'></a><a href='#L235'>235</a>
<a name='L236'></a><a href='#L236'>236</a>
<a name='L237'></a><a href='#L237'>237</a>
<a name='L238'></a><a href='#L238'>238</a>
<a name='L239'></a><a href='#L239'>239</a>
<a name='L240'></a><a href='#L240'>240</a>
<a name='L241'></a><a href='#L241'>241</a>
<a name='L242'></a><a href='#L242'>242</a>
<a name='L243'></a><a href='#L243'>243</a>
<a name='L244'></a><a href='#L244'>244</a>
<a name='L245'></a><a href='#L245'>245</a>
<a name='L246'></a><a href='#L246'>246</a>
<a name='L247'></a><a href='#L247'>247</a>
<a name='L248'></a><a href='#L248'>248</a>
<a name='L249'></a><a href='#L249'>249</a>
<a name='L250'></a><a href='#L250'>250</a>
<a name='L251'></a><a href='#L251'>251</a>
<a name='L252'></a><a href='#L252'>252</a>
<a name='L253'></a><a href='#L253'>253</a>
<a name='L254'></a><a href='#L254'>254</a>
<a name='L255'></a><a href='#L255'>255</a>
<a name='L256'></a><a href='#L256'>256</a>
<a name='L257'></a><a href='#L257'>257</a>
<a name='L258'></a><a href='#L258'>258</a>
<a name='L259'></a><a href='#L259'>259</a>
<a name='L260'></a><a href='#L260'>260</a>
<a name='L261'></a><a href='#L261'>261</a>
<a name='L262'></a><a href='#L262'>262</a>
<a name='L263'></a><a href='#L263'>263</a>
<a name='L264'></a><a href='#L264'>264</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">720x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">71x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">238x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">238x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">717x</span>
<span class="cline-any cline-yes">717x</span>
<span class="cline-any cline-yes">717x</span>
<span class="cline-any cline-yes">717x</span>
<span class="cline-any cline-yes">717x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">79x</span>
<span class="cline-any cline-yes">79x</span>
<span class="cline-any cline-yes">79x</span>
<span class="cline-any cline-yes">79x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">251x</span>
<span class="cline-any cline-yes">251x</span>
<span class="cline-any cline-yes">1482x</span>
<span class="cline-any cline-yes">1482x</span>
<span class="cline-any cline-yes">251x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">251x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">139x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">37x</span>
<span class="cline-any cline-yes">37x</span>
<span class="cline-any cline-yes">37x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">213x</span>
<span class="cline-any cline-yes">213x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">937x</span>
<span class="cline-any cline-yes">937x</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">937x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-yes">329x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">75x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-yes">3379x</span>
<span class="cline-any cline-yes">2462x</span>
<span class="cline-any cline-yes">2462x</span>
<span class="cline-any cline-yes">2462x</span>
<span class="cline-any cline-yes">917x</span>
<span class="cline-any cline-yes">597x</span>
<span class="cline-any cline-yes">597x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">320x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-yes">587x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var naturalSort = require('string-natural-compare'),
getByClass = require('./utils/get-by-class'),
extend = require('./utils/extend'),
indexOf = require('./utils/index-of'),
events = require('./utils/events'),
toString = require('./utils/to-string'),
classes = require('./utils/classes'),
getAttribute = require('./utils/get-attribute'),
toArray = require('./utils/to-array')
&nbsp;
module.exports = function (id, options, values) {
var self = this,
init,
Item = require('./item')(self),
addAsync = require('./add-async')(self),
initPagination = require('./pagination')(self)
&nbsp;
init = {
start: function () {
self.listClass = 'list'
self.searchClass = 'search'
self.sortClass = 'sort'
self.page = 10000
self.i = 1
self.items = []
self.visibleItems = []
self.matchingItems = []
self.searched = false
self.filtered = false
self.searchColumns = undefined
self.searchDelay = 0
self.handlers = { updated: [] }
self.valueNames = []
self.utils = {
getByClass: getByClass,
extend: extend,
indexOf: indexOf,
events: events,
toString: toString,
naturalSort: naturalSort,
classes: classes,
getAttribute: getAttribute,
toArray: toArray,
}
&nbsp;
self.utils.extend(self, options)
&nbsp;
self.listContainer = typeof id === 'string' ? document.getElementById(id) : id
<span class="missing-if-branch" title="if path not taken" >I</span>if (!self.listContainer) {
<span class="cstat-no" title="statement not covered" > return</span>
}
self.list = getByClass(self.listContainer, self.listClass, true)
&nbsp;
self.parse = require('./parse')(self)
self.templater = require('./templater')(self)
self.search = require('./search')(self)
self.filter = require('./filter')(self)
self.sort = require('./sort')(self)
self.fuzzySearch = require('./fuzzy-search')(self, options.fuzzySearch)
&nbsp;
this.handlers()
this.items()
this.pagination()
&nbsp;
self.update()
},
handlers: function () {
for (var handler in self.handlers) {
if (self[handler] &amp;&amp; self.handlers.hasOwnProperty(handler)) {
self.on(handler, self[handler])
}
}
},
items: function () {
self.parse(self.list)
if (values !== undefined) {
self.add(values)
}
},
pagination: function () {
if (options.pagination !== undefined) {
if (options.pagination === true) {
options.pagination = [{}]
}
if (options.pagination[0] === undefined) {
options.pagination = [options.pagination]
}
for (var i = 0, il = options.pagination.length; i &lt; il; i++) {
initPagination(options.pagination[i])
}
}
},
}
&nbsp;
/*
* Re-parse the List, use if html have changed
*/
this.reIndex = function () {
self.items = []
self.visibleItems = []
self.matchingItems = []
self.searched = false
self.filtered = false
self.parse(self.list)
}
&nbsp;
this.toJSON = function () {
var json = []
for (var i = 0, il = self.items.length; i &lt; il; i++) {
json.push(self.items[i].values())
}
return json
}
&nbsp;
/*
* Add object to list
*/
this.add = function (values, callback) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (values.length === 0) {
<span class="cstat-no" title="statement not covered" > return</span>
}
if (callback) {
addAsync(values.slice(0), callback)
return
}
var added = [],
notCreate = false
if (values[0] === undefined) {
values = [values]
}
for (var i = 0, il = values.length; i &lt; il; i++) {
var item = null
notCreate = self.items.length &gt; self.page ? true : false
item = new Item(values[i], undefined, notCreate)
self.items.push(item)
added.push(item)
}
self.update()
return added
}
&nbsp;
this.show = function (i, page) {
this.i = i
this.page = page
self.update()
return self
}
&nbsp;
/* Removes object from list.
* Loops through the list and removes objects where
* property "valuename" === value
*/
this.remove = function (valueName, value, options) {
var found = 0
for (var i = 0, il = self.items.length; i &lt; il; i++) {
if (self.items[i].values()[valueName] == value) {
self.templater.remove(self.items[i], options)
self.items.splice(i, 1)
il--
i--
found++
}
}
self.update()
return found
}
&nbsp;
/* Gets the objects in the list which
* property "valueName" === value
*/
this.get = function (valueName, value) {
var matchedItems = []
for (var i = 0, il = self.items.length; i &lt; il; i++) {
var item = self.items[i]
if (item.values()[valueName] == value) {
matchedItems.push(item)
}
}
return matchedItems
}
&nbsp;
/*
* Get size of the list
*/
this.size = function () {
return self.items.length
}
&nbsp;
/*
* Removes all items from the list
*/
this.clear = function () {
self.templater.clear()
self.items = []
return self
}
&nbsp;
this.on = function (event, callback) {
self.handlers[event].push(callback)
return self
}
&nbsp;
this.off = function (event, callback) {
var e = self.handlers[event]
var index = indexOf(e, callback)
if (index &gt; -1) {
e.splice(index, 1)
}
return self
}
&nbsp;
this.trigger = function (event) {
var i = self.handlers[event].length
while (i--) {
self.handlers[event][i](self)
}
return self
}
&nbsp;
this.reset = {
filter: function () {
var is = self.items,
il = is.length
while (il--) {
is[il].filtered = false
}
return self
},
search: function () {
var is = self.items,
il = is.length
while (il--) {
is[il].found = false
}
return self
},
}
&nbsp;
this.update = function () {
var is = self.items,
il = is.length
&nbsp;
self.visibleItems = []
self.matchingItems = []
self.templater.clear()
for (var i = 0; i &lt; il; i++) {
if (is[i].matching() &amp;&amp; self.matchingItems.length + 1 &gt;= self.i &amp;&amp; self.visibleItems.length &lt; self.page) {
is[i].show()
self.visibleItems.push(is[i])
self.matchingItems.push(is[i])
} else if (is[i].matching()) {
self.matchingItems.push(is[i])
is[i].hide()
} else {
is[i].hide()
}
}
self.trigger('updated')
return self
}
&nbsp;
init.start()
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,260 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/item.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> item.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>30/30</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>24/24</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>30/30</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">717x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">657x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">6167x</span>
<span class="cline-any cline-yes">1015x</span>
<span class="cline-any cline-yes">1594x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1015x</span>
<span class="cline-any cline-yes">955x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5152x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">2463x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">919x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">4350x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-yes">92x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">907x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
return function (initValues, element, notCreate) {
var item = this
&nbsp;
this._values = {}
&nbsp;
this.found = false // Show if list.searched == true and this.found == true
this.filtered = false // Show if list.filtered == true and this.filtered == true
&nbsp;
var init = function (initValues, element, notCreate) {
if (element === undefined) {
if (notCreate) {
item.values(initValues, notCreate)
} else {
item.values(initValues)
}
} else {
item.elm = element
var values = list.templater.get(item, initValues)
item.values(values)
}
}
&nbsp;
this.values = function (newValues, notCreate) {
if (newValues !== undefined) {
for (var name in newValues) {
item._values[name] = newValues[name]
}
if (notCreate !== true) {
list.templater.set(item, item.values())
}
} else {
return item._values
}
}
&nbsp;
this.show = function () {
list.templater.show(item)
}
&nbsp;
this.hide = function () {
list.templater.hide(item)
}
&nbsp;
this.matching = function () {
return (
(list.filtered &amp;&amp; list.searched &amp;&amp; item.found &amp;&amp; item.filtered) ||
(list.filtered &amp;&amp; !list.searched &amp;&amp; item.filtered) ||
(!list.filtered &amp;&amp; list.searched &amp;&amp; item.found) ||
(!list.filtered &amp;&amp; !list.searched)
)
}
&nbsp;
this.visible = function () {
return item.elm &amp;&amp; item.elm.parentNode == list.list ? true : false
}
&nbsp;
init(initValues, element, notCreate)
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,404 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/pagination.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> pagination.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">90.91% </span>
<span class="quiet">Statements</span>
<span class='fraction'>50/55</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.7% </span>
<span class="quiet">Branches</span>
<span class='fraction'>39/43</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">91.67% </span>
<span class="quiet">Functions</span>
<span class='fraction'>11/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.74% </span>
<span class="quiet">Lines</span>
<span class='fraction'>49/54</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-yes">95x</span>
<span class="cline-any cline-yes">139x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">234x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">249x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">239x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">139x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">139x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">124x</span>
<span class="cline-any cline-yes">39x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">85x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var classes = require('./utils/classes'),
events = require('./utils/events'),
List = require('./index')
&nbsp;
module.exports = function (list) {
var isHidden = false
&nbsp;
var refresh = function (pagingList, options) {
if (list.page &lt; 1) {
list.listContainer.style.display = 'none'
isHidden = true
return
} else if (isHidden) {
list.listContainer.style.display = 'block'
}
&nbsp;
var item,
l = list.matchingItems.length,
index = list.i,
page = list.page,
pages = Math.ceil(l / page),
currentPage = Math.ceil(index / page),
innerWindow = options.innerWindow || 2,
left = options.left || options.outerWindow || 0,
right = options.right || options.outerWindow || 0
&nbsp;
right = pages - right
pagingList.clear()
for (var i = 1; i &lt;= pages; i++) {
var className = currentPage === i ? 'active' : ''
&nbsp;
//console.log(i, left, right, currentPage, (currentPage - innerWindow), (currentPage + innerWindow), className);
&nbsp;
if (is.number(i, left, right, currentPage, innerWindow)) {
item = pagingList.add({
page: i,
dotted: false,
})[0]
if (className) {
classes(item.elm).add(className)
}
item.elm.firstChild.setAttribute('data-i', i)
item.elm.firstChild.setAttribute('data-page', page)
} else if (is.dotted(pagingList, i, left, right, currentPage, innerWindow, pagingList.size())) {
item = pagingList.add({
page: '...',
dotted: true,
})[0]
classes(item.elm).add('disabled')
}
}
}
&nbsp;
var is = {
number: function (i, left, right, currentPage, innerWindow) {
return this.left(i, left) || this.right(i, right) || this.innerWindow(i, currentPage, innerWindow)
},
left: function (i, left) {
return i &lt;= left
},
right: function (i, right) {
return i &gt; right
},
innerWindow: function (i, currentPage, innerWindow) {
return i &gt;= currentPage - innerWindow &amp;&amp; i &lt;= currentPage + innerWindow
},
dotted: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {
return (
this.dottedLeft(pagingList, i, left, right, currentPage, innerWindow) ||
this.dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem)
)
},
dottedLeft: function (pagingList, i, left, right, currentPage, innerWindow) {
return i == left + 1 &amp;&amp; !this.innerWindow(i, currentPage, innerWindow) &amp;&amp; !this.right(i, right)
},
dottedRight: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {
if (pagingList.items[currentPageItem - 1].values().dotted) {
return false
} else {
return i == right &amp;&amp; !this.innerWindow(i, currentPage, innerWindow) &amp;&amp; !this.right(i, right)
}
},
}
&nbsp;
return function (options) {
var pagingList = new List(list.listContainer.id, {
listClass: options.paginationClass || 'pagination',
item: options.item || "&lt;li&gt;&lt;a class='page' href='#'&gt;&lt;/a&gt;&lt;/li&gt;",
valueNames: ['page', 'dotted'],
searchClass: 'pagination-search-that-is-not-supposed-to-exist',
sortClass: 'pagination-sort-that-is-not-supposed-to-exist',
})
&nbsp;
events.bind(pagingList.listContainer, 'click', <span class="fstat-no" title="function not covered" >fu</span>nction (e) {
var target = <span class="cstat-no" title="statement not covered" >e.target || e.srcElement,</span>
page = <span class="cstat-no" title="statement not covered" >list.utils.getAttribute(target, 'data-page'),</span>
i = <span class="cstat-no" title="statement not covered" >list.utils.getAttribute(target, 'data-i')</span>
<span class="cstat-no" title="statement not covered" > if (i) {</span>
<span class="cstat-no" title="statement not covered" > list.show((i - 1) * page + 1, page)</span>
}
})
&nbsp;
list.on('updated', function () {
refresh(pagingList, options)
})
refresh(pagingList, options)
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,218 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/parse.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> parse.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>31/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>27/27</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">312x</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">94x</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
var Item = require('./item')(list)
&nbsp;
var getChildren = function (parent) {
var nodes = parent.childNodes,
items = []
for (var i = 0, il = nodes.length; i &lt; il; i++) {
// Only textnodes have a data attribute
if (nodes[i].data === undefined) {
items.push(nodes[i])
}
}
return items
}
&nbsp;
var parse = function (itemElements, valueNames) {
for (var i = 0, il = itemElements.length; i &lt; il; i++) {
list.items.push(new Item(valueNames, itemElements[i]))
}
}
var parseAsync = function (itemElements, valueNames) {
var itemsToIndex = itemElements.splice(0, 50) // TODO: If &lt; 100 items, what happens in IE etc?
parse(itemsToIndex, valueNames)
if (itemElements.length &gt; 0) {
setTimeout(function () {
parseAsync(itemElements, valueNames)
}, 1)
} else {
list.update()
list.trigger('parseComplete')
}
}
&nbsp;
list.handlers.parseComplete = list.handlers.parseComplete || []
&nbsp;
return function () {
var itemsToIndex = getChildren(list.list),
valueNames = list.valueNames
&nbsp;
if (list.indexAsync) {
parseAsync(itemsToIndex, valueNames)
} else {
parse(itemsToIndex, valueNames)
}
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,488 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/search.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> search.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">94.25% </span>
<span class="quiet">Statements</span>
<span class='fraction'>82/87</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">81.63% </span>
<span class="quiet">Branches</span>
<span class='fraction'>40/49</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.91% </span>
<span class="quiet">Functions</span>
<span class='fraction'>10/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.1% </span>
<span class="quiet">Lines</span>
<span class='fraction'>74/77</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">66x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">63x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">59x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">65x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">63x</span>
<span class="cline-any cline-yes">63x</span>
<span class="cline-any cline-yes">138x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">63x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">222x</span>
<span class="cline-any cline-yes">222x</span>
<span class="cline-any cline-yes">222x</span>
<span class="cline-any cline-yes">222x</span>
<span class="cline-any cline-yes">233x</span>
<span class="cline-any cline-yes">233x</span>
<span class="cline-any cline-yes">377x</span>
<span class="cline-any cline-yes">377x</span>
<span class="cline-any cline-yes">377x</span>
<span class="cline-any cline-yes">363x</span>
<span class="cline-any cline-yes">363x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">67x</span>
<span class="cline-any cline-yes">67x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">233x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">222x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">47x</span>
<span class="cline-any cline-yes">47x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-yes">72x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
var item, text, columns, searchString, customSearch
&nbsp;
var prepare = {
resetList: function () {
list.i = 1
list.templater.clear()
customSearch = undefined
},
setOptions: function (args) {
if (args.length == 2 &amp;&amp; args[1] instanceof Array) {
columns = args[1]
} else if (args.length == 2 &amp;&amp; typeof args[1] == 'function') {
columns = undefined
customSearch = args[1]
} else if (args.length == 3) {
columns = args[1]
customSearch = args[2]
} else {
columns = undefined
}
},
setColumns: function () {
<span class="missing-if-branch" title="if path not taken" >I</span>if (list.items.length === 0) <span class="cstat-no" title="statement not covered" >return</span>
if (columns === undefined) {
columns = list.searchColumns === undefined ? prepare.toArray(list.items[0].values()) : list.searchColumns
}
},
setSearchString: function (s) {
s = list.utils.toString(s).toLowerCase()
s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, '\\$&amp;') // Escape regular expression characters
searchString = s
},
toArray: function (values) {
var tmpColumn = []
for (var name in values) {
tmpColumn.push(name)
}
return tmpColumn
},
}
var search = {
list: function () {
// Extract quoted phrases "word1 word2" from original searchString
// searchString is converted to lowercase by List.js
var words = [],
phrase,
ss = searchString
while ((phrase = ss.match(/"([^"]+)"/)) !== null) {
words.push(phrase[1])
ss = ss.substring(0, phrase.index) + ss.substring(phrase.index + phrase[0].length)
}
// Get remaining space-separated words (if any)
ss = ss.trim()
if (ss.length) words = words.concat(ss.split(/\s+/))
for (var k = 0, kl = list.items.length; k &lt; kl; k++) {
var item = list.items[k]
item.found = false
<span class="missing-if-branch" title="if path not taken" >I</span>if (!words.length) <span class="cstat-no" title="statement not covered" >continue</span>
for (var i = 0, il = words.length; i &lt; il; i++) {
var word_found = false
for (var j = 0, jl = columns.length; j &lt; jl; j++) {
var values = item.values(),
column = columns[j]
if (values.hasOwnProperty(column) &amp;&amp; values[column] !== undefined &amp;&amp; values[column] !== null) {
var text = typeof values[column] !== 'string' ? values[column].toString() : values[column]
if (text.toLowerCase().indexOf(words[i]) !== -1) {
// word found, so no need to check it against any other columns
word_found = true
break
}
}
}
// this word not found? no need to check any other words, the item cannot match
if (!word_found) break
}
item.found = word_found
}
},
// Removed search.item() and search.values()
reset: function () {
list.reset.search()
list.searched = false
},
}
&nbsp;
var searchMethod = function (str) {
list.trigger('searchStart')
&nbsp;
prepare.resetList()
prepare.setSearchString(str)
prepare.setOptions(arguments) // str, cols|searchFunction, searchFunction
prepare.setColumns()
&nbsp;
if (searchString === '') {
search.reset()
} else {
list.searched = true
if (customSearch) {
customSearch(searchString, columns)
} else {
search.list()
}
}
&nbsp;
list.update()
list.trigger('searchComplete')
return list.visibleItems
}
&nbsp;
list.handlers.searchStart = list.handlers.searchStart || []
list.handlers.searchComplete = list.handlers.searchComplete || []
&nbsp;
list.utils.events.bind(
list.utils.getByClass(list.listContainer, list.searchClass),
'keyup',
list.utils.events.debounce(function (e) {
var target = e.target || <span class="branch-1 cbranch-no" title="branch not covered" >e.srcElement,</span> // IE have srcElement
alreadyCleared = target.value === '' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >!list.searched</span>
<span class="missing-if-branch" title="else path not taken" >E</span>if (!alreadyCleared) {
// If oninput already have resetted the list, do nothing
searchMethod(target.value)
}
}, list.searchDelay)
)
&nbsp;
// Used to detect click on HTML5 clear button
list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', <span class="fstat-no" title="function not covered" >fu</span>nction (e) {
var target = <span class="cstat-no" title="statement not covered" >e.target || e.srcElement</span>
<span class="cstat-no" title="statement not covered" > if (target.value === '') {</span>
<span class="cstat-no" title="statement not covered" > searchMethod('')</span>
}
})
&nbsp;
return searchMethod
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,392 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/sort.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> sort.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96.92% </span>
<span class="quiet">Statements</span>
<span class='fraction'>63/65</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.74% </span>
<span class="quiet">Branches</span>
<span class='fraction'>45/47</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.72% </span>
<span class="quiet">Lines</span>
<span class='fraction'>59/61</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">174x</span>
<span class="cline-any cline-yes">39x</span>
<span class="cline-any cline-yes">39x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">32x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">191x</span>
<span class="cline-any cline-yes">191x</span>
<span class="cline-any cline-yes">191x</span>
<span class="cline-any cline-yes">144x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">191x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (list) {
var buttons = {
els: undefined,
clear: function () {
for (var i = 0, il = buttons.els.length; i &lt; il; i++) {
list.utils.classes(buttons.els[i]).remove('asc')
list.utils.classes(buttons.els[i]).remove('desc')
}
},
getOrder: function (btn) {
var predefinedOrder = list.utils.getAttribute(btn, 'data-order')
if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {
return predefinedOrder
} else if (list.utils.classes(btn).has('desc')) {
return 'asc'
} else if (list.utils.classes(btn).has('asc')) {
return 'desc'
} else {
return 'asc'
}
},
getInSensitive: function (btn, options) {
var insensitive = list.utils.getAttribute(btn, 'data-insensitive')
<span class="missing-if-branch" title="if path not taken" >I</span>if (insensitive === 'false') {
<span class="cstat-no" title="statement not covered" > options.insensitive = false</span>
} else {
options.insensitive = true
}
},
setOrder: function (options) {
for (var i = 0, il = buttons.els.length; i &lt; il; i++) {
var btn = buttons.els[i]
<span class="missing-if-branch" title="if path not taken" >I</span>if (list.utils.getAttribute(btn, 'data-sort') !== options.valueName) {
<span class="cstat-no" title="statement not covered" > continue</span>
}
var predefinedOrder = list.utils.getAttribute(btn, 'data-order')
if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {
if (predefinedOrder == options.order) {
list.utils.classes(btn).add(options.order)
}
} else {
list.utils.classes(btn).add(options.order)
}
}
},
}
&nbsp;
var sort = function () {
list.trigger('sortStart')
var options = {}
&nbsp;
var target = arguments[0].currentTarget || arguments[0].srcElement || undefined
&nbsp;
if (target) {
options.valueName = list.utils.getAttribute(target, 'data-sort')
buttons.getInSensitive(target, options)
options.order = buttons.getOrder(target)
} else {
options = arguments[1] || options
options.valueName = arguments[0]
options.order = options.order || 'asc'
options.insensitive = typeof options.insensitive == 'undefined' ? true : options.insensitive
}
&nbsp;
buttons.clear()
buttons.setOrder(options)
&nbsp;
// caseInsensitive
// alphabet
var customSortFunction = options.sortFunction || list.sortFunction || null,
multi = options.order === 'desc' ? -1 : 1,
sortFunction
&nbsp;
if (customSortFunction) {
sortFunction = function (itemA, itemB) {
return customSortFunction(itemA, itemB, options) * multi
}
} else {
sortFunction = function (itemA, itemB) {
var sort = list.utils.naturalSort
sort.alphabet = list.alphabet || options.alphabet || undefined
if (!sort.alphabet &amp;&amp; options.insensitive) {
sort = list.utils.naturalSort.caseInsensitive
}
return sort(itemA.values()[options.valueName], itemB.values()[options.valueName]) * multi
}
}
&nbsp;
list.items.sort(sortFunction)
list.update()
list.trigger('sortComplete')
}
&nbsp;
// Add handlers
list.handlers.sortStart = list.handlers.sortStart || []
list.handlers.sortComplete = list.handlers.sortComplete || []
&nbsp;
buttons.els = list.utils.getByClass(list.listContainer, list.sortClass)
list.utils.events.bind(buttons.els, 'click', sort)
list.on('searchStart', buttons.clear)
list.on('filterStart', buttons.clear)
&nbsp;
return sort
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,170 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/sorter.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> sorter.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>15/15</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>9/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>15/15</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">239x</span>
<span class="cline-any cline-yes">239x</span>
<span class="cline-any cline-yes">34x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">205x</span>
<span class="cline-any cline-yes">202x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">239x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var naturalSort = require('string-natural-compare')
&nbsp;
module.exports = (items, column, options = {}) =&gt; {
const { sortFunction, order, alphabet, insensitive } = options
const caseSensitive = insensitive !== false
const multi = order === 'desc' ? -1 : 1
&nbsp;
if (sortFunction) {
return items.sort(function (itemA, itemB) {
return (
sortFunction(itemA, itemB, column, {
alphabet,
caseSensitive,
}) * multi
)
})
} else {
return items.sort(function (itemA, itemB) {
let sort = naturalSort
if (alphabet) {
sort.alphabet = alphabet
} else {
if (caseSensitive) {
sort = naturalSort.caseInsensitive
}
}
return sort(itemA.values()[column], itemB.values()[column]) * multi
})
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Dec 02 2020 12:55:03 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,665 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/templater.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> templater.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">98.52% </span>
<span class="quiet">Statements</span>
<span class='fraction'>133/135</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.41% </span>
<span class="quiet">Branches</span>
<span class='fraction'>66/73</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>17/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">99.16% </span>
<span class="quiet">Lines</span>
<span class='fraction'>118/119</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">74x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">73x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">90x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">89x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">89x</span>
<span class="cline-any cline-yes">680x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">89x</span>
<span class="cline-any cline-yes">89x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">89x</span>
<span class="cline-any cline-yes">159x</span>
<span class="cline-any cline-yes">159x</span>
<span class="cline-any cline-yes">159x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">157x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">149x</span>
<span class="cline-any cline-yes">149x</span>
<span class="cline-any cline-yes">100x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">89x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">76x</span>
<span class="cline-any cline-yes">76x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">75x</span>
<span class="cline-any cline-yes">75x</span>
<span class="cline-any cline-yes">75x</span>
<span class="cline-any cline-yes">75x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">1634x</span>
<span class="cline-any cline-yes">2118x</span>
<span class="cline-any cline-yes">2118x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2093x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">2073x</span>
<span class="cline-any cline-yes">1359x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">1634x</span>
<span class="cline-any cline-yes">1634x</span>
<span class="cline-any cline-yes">1634x</span>
<span class="cline-any cline-yes">1384x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">1379x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1359x</span>
<span class="cline-any cline-yes">1359x</span>
<span class="cline-any cline-yes">1005x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">236x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">232x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">216x</span>
<span class="cline-any cline-yes">216x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">190x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">1638x</span>
<span class="cline-any cline-yes">981x</span>
<span class="cline-any cline-yes">1634x</span>
<span class="cline-any cline-yes">1634x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">4291x</span>
<span class="cline-any cline-yes">3608x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">683x</span>
<span class="cline-any cline-yes">683x</span>
<span class="cline-any cline-yes">683x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">2463x</span>
<span class="cline-any cline-yes">2463x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-yes">919x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">696x</span>
<span class="cline-any cline-yes">493x</span>
<span class="cline-any cline-yes">2311x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">91x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var Templater = function (list) {
var createItem,
templater = this
&nbsp;
var init = function () {
var itemSource
&nbsp;
if (typeof list.item === 'function') {
createItem = function (values) {
var item = list.item(values)
return getItemSource(item)
}
return
}
&nbsp;
if (typeof list.item === 'string') {
if (list.item.indexOf('&lt;') === -1) {
itemSource = document.getElementById(list.item)
} else {
itemSource = getItemSource(list.item)
}
} else {
/* If item source does not exists, use the first item in list as
source for new items */
itemSource = getFirstListItem()
}
&nbsp;
if (!itemSource) {
throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.")
}
&nbsp;
itemSource = createCleanTemplateItem(itemSource, list.valueNames)
&nbsp;
createItem = function () {
return itemSource.cloneNode(true)
}
}
&nbsp;
var createCleanTemplateItem = function (templateNode, valueNames) {
var el = templateNode.cloneNode(true)
el.removeAttribute('id')
&nbsp;
for (var i = 0, il = valueNames.length; i &lt; il; i++) {
var elm = undefined,
valueName = valueNames[i]
if (valueName.data) {
for (var j = 0, jl = valueName.data.length; j &lt; jl; j++) {
el.setAttribute('data-' + valueName.data[j], '')
}
} else if (valueName.attr &amp;&amp; valueName.name) {
elm = list.utils.getByClass(el, valueName.name, true)
<span class="missing-if-branch" title="else path not taken" >E</span>if (elm) {
elm.setAttribute(valueName.attr, '')
}
} else {
elm = list.utils.getByClass(el, valueName, true)
if (elm) {
elm.innerHTML = ''
}
}
}
return el
}
&nbsp;
var getFirstListItem = function () {
var nodes = list.list.childNodes
&nbsp;
for (var i = 0, il = nodes.length; i &lt; il; i++) {
// Only textnodes have a data attribute
if (nodes[i].data === undefined) {
return nodes[i].cloneNode(true)
}
}
return undefined
}
&nbsp;
var getItemSource = function (itemHTML) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof itemHTML !== 'string') <span class="cstat-no" title="statement not covered" >return undefined</span>
if (/&lt;tr[\s&gt;]/g.exec(itemHTML)) {
var tbody = document.createElement('tbody')
tbody.innerHTML = itemHTML
return tbody.firstElementChild
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (itemHTML.indexOf('&lt;') !== -1) {
var div = document.createElement('div')
div.innerHTML = itemHTML
return div.firstElementChild
}
<span class="cstat-no" title="statement not covered" > return undefined</span>
}
&nbsp;
var getValueName = function (name) {
for (var i = 0, il = list.valueNames.length; i &lt; il; i++) {
var valueName = list.valueNames[i]
if (valueName.data) {
var data = valueName.data
for (var j = 0, jl = data.length; j &lt; jl; j++) {
if (data[j] === name) {
return { data: name }
}
}
} else if (valueName.attr &amp;&amp; valueName.name &amp;&amp; valueName.name == name) {
return valueName
} else if (valueName === name) {
return name
}
}
}
&nbsp;
var setValue = function (item, name, value) {
var elm = undefined,
valueName = getValueName(name)
if (!valueName) return
if (valueName.data) {
item.elm.setAttribute('data-' + valueName.data, value)
} else if (valueName.attr &amp;&amp; valueName.name) {
elm = list.utils.getByClass(item.elm, valueName.name, true)
<span class="missing-if-branch" title="else path not taken" >E</span>if (elm) {
elm.setAttribute(valueName.attr, value)
}
} else {
elm = list.utils.getByClass(item.elm, valueName, true)
if (elm) {
elm.innerHTML = value
}
}
}
&nbsp;
this.get = function (item, valueNames) {
templater.create(item)
var values = {}
for (var i = 0, il = valueNames.length; i &lt; il; i++) {
var elm = undefined,
valueName = valueNames[i]
if (valueName.data) {
for (var j = 0, jl = valueName.data.length; j &lt; jl; j++) {
values[valueName.data[j]] = list.utils.getAttribute(item.elm, 'data-' + valueName.data[j])
}
} else if (valueName.attr &amp;&amp; valueName.name) {
elm = list.utils.getByClass(item.elm, valueName.name, true)
values[valueName.name] = elm ? list.utils.getAttribute(elm, valueName.attr) : <span class="branch-1 cbranch-no" title="branch not covered" >''</span>
} else {
elm = list.utils.getByClass(item.elm, valueName, true)
values[valueName] = elm ? elm.innerHTML : <span class="branch-1 cbranch-no" title="branch not covered" >''</span>
}
}
return values
}
&nbsp;
this.set = function (item, values) {
if (!templater.create(item)) {
for (var v in values) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (values.hasOwnProperty(v)) {
setValue(item, v, values[v])
}
}
}
}
&nbsp;
this.create = function (item) {
if (item.elm !== undefined) {
return false
}
item.elm = createItem(item.values())
templater.set(item, item.values())
return true
}
this.remove = function (item) {
if (item.elm.parentNode === list.list) {
list.list.removeChild(item.elm)
}
}
this.show = function (item) {
templater.create(item)
list.list.appendChild(item.elm)
}
this.hide = function (item) {
if (item.elm !== undefined &amp;&amp; item.elm.parentNode === list.list) {
list.list.removeChild(item.elm)
}
}
this.clear = function () {
/* .innerHTML = ''; fucks up IE */
if (list.list.hasChildNodes()) {
while (list.list.childNodes.length &gt;= 1) {
list.list.removeChild(list.list.firstChild)
}
}
}
&nbsp;
init()
}
&nbsp;
module.exports = function (list) {
return new Templater(list)
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,566 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/classes.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> classes.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">54.72% </span>
<span class="quiet">Statements</span>
<span class='fraction'>29/53</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">33.33% </span>
<span class="quiet">Branches</span>
<span class='fraction'>10/30</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>7/7</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">58% </span>
<span class="quiet">Lines</span>
<span class='fraction'>29/50</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">172x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">172x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">172x</span>
<span class="cline-any cline-yes">172x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">79x</span>
<span class="cline-any cline-yes">79x</span>
<span class="cline-any cline-yes">79x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">13x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* Module dependencies.
*/
&nbsp;
var index = require('./index-of')
&nbsp;
/**
* Whitespace regexp.
*/
&nbsp;
var re = /\s+/
&nbsp;
/**
* toString reference.
*/
&nbsp;
var toString = Object.prototype.toString
&nbsp;
/**
* Wrap `el` in a `ClassList`.
*
* @param {Element} el
* @return {ClassList}
* @api public
*/
&nbsp;
module.exports = function (el) {
return new ClassList(el)
}
&nbsp;
/**
* Initialize a new ClassList for `el`.
*
* @param {Element} el
* @api private
*/
&nbsp;
function ClassList(el) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!el || !el.nodeType) {
<span class="cstat-no" title="statement not covered" > throw new Error('A DOM element reference is required')</span>
}
this.el = el
this.list = el.classList
}
&nbsp;
/**
* Add class `name` if not already present.
*
* @param {String} name
* @return {ClassList}
* @api public
*/
&nbsp;
ClassList.prototype.add = function (name) {
// classList
<span class="missing-if-branch" title="else path not taken" >E</span>if (this.list) {
this.list.add(name)
return this
}
&nbsp;
// fallback
var arr = <span class="cstat-no" title="statement not covered" >this.array()</span>
var i = <span class="cstat-no" title="statement not covered" >index(arr, name)</span>
<span class="cstat-no" title="statement not covered" > if (!~i) <span class="cstat-no" title="statement not covered" >arr.push(name)</span></span>
<span class="cstat-no" title="statement not covered" > this.el.className = arr.join(' ')</span>
<span class="cstat-no" title="statement not covered" > return this</span>
}
&nbsp;
/**
* Remove class `name` when present, or
* pass a regular expression to remove
* any which match.
*
* @param {String|RegExp} name
* @return {ClassList}
* @api public
*/
&nbsp;
ClassList.prototype.remove = function (name) {
// classList
<span class="missing-if-branch" title="else path not taken" >E</span>if (this.list) {
this.list.remove(name)
return this
}
&nbsp;
// fallback
var arr = <span class="cstat-no" title="statement not covered" >this.array()</span>
var i = <span class="cstat-no" title="statement not covered" >index(arr, name)</span>
<span class="cstat-no" title="statement not covered" > if (~i) <span class="cstat-no" title="statement not covered" >arr.splice(i, 1)</span></span>
<span class="cstat-no" title="statement not covered" > this.el.className = arr.join(' ')</span>
<span class="cstat-no" title="statement not covered" > return this</span>
}
&nbsp;
/**
* Toggle class `name`, can force state via `force`.
*
* For browsers that support classList, but do not support `force` yet,
* the mistake will be detected and corrected.
*
* @param {String} name
* @param {Boolean} force
* @return {ClassList}
* @api public
*/
&nbsp;
ClassList.prototype.toggle = function (name, force) {
// classList
<span class="missing-if-branch" title="else path not taken" >E</span>if (this.list) {
<span class="missing-if-branch" title="if path not taken" >I</span>if ('undefined' !== typeof force) {
<span class="cstat-no" title="statement not covered" > if (force !== this.list.toggle(name, force)) {</span>
<span class="cstat-no" title="statement not covered" > this.list.toggle(name) </span>// toggle again to correct
}
} else {
this.list.toggle(name)
}
return this
}
&nbsp;
// fallback
<span class="cstat-no" title="statement not covered" > if ('undefined' !== typeof force) {</span>
<span class="cstat-no" title="statement not covered" > if (!force) {</span>
<span class="cstat-no" title="statement not covered" > this.remove(name)</span>
} else {
<span class="cstat-no" title="statement not covered" > this.add(name)</span>
}
} else {
<span class="cstat-no" title="statement not covered" > if (this.has(name)) {</span>
<span class="cstat-no" title="statement not covered" > this.remove(name)</span>
} else {
<span class="cstat-no" title="statement not covered" > this.add(name)</span>
}
}
&nbsp;
<span class="cstat-no" title="statement not covered" > return this</span>
}
&nbsp;
/**
* Return an array of classes.
*
* @return {Array}
* @api public
*/
&nbsp;
ClassList.prototype.array = function () {
var className = this.el.getAttribute('class') || <span class="branch-1 cbranch-no" title="branch not covered" >''</span>
var str = className.replace(/^\s+|\s+$/g, '')
var arr = str.split(re)
<span class="missing-if-branch" title="if path not taken" >I</span>if ('' === arr[0]) <span class="cstat-no" title="statement not covered" >arr.shift()</span>
return arr
}
&nbsp;
/**
* Check if class `name` is present.
*
* @param {String} name
* @return {ClassList}
* @api public
*/
&nbsp;
ClassList.prototype.has = ClassList.prototype.contains = function (name) {
return this.list ? this.list.contains(name) : <span class="branch-1 cbranch-no" title="branch not covered" >!!~index(this.array(), name)</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,284 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/events.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> events.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">44.83% </span>
<span class="quiet">Statements</span>
<span class='fraction'>13/29</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">33.33% </span>
<span class="quiet">Branches</span>
<span class='fraction'>6/18</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">40% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">47.83% </span>
<span class="quiet">Lines</span>
<span class='fraction'>11/23</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">45x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">180x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var bind = window.addEventListener ? 'addEventListener' : <span class="branch-1 cbranch-no" title="branch not covered" >'attachEvent',</span>
unbind = window.removeEventListener ? 'removeEventListener' : <span class="branch-1 cbranch-no" title="branch not covered" >'detachEvent',</span>
prefix = bind !== 'addEventListener' ? <span class="branch-0 cbranch-no" title="branch not covered" >'on' </span>: '',
toArray = require('./to-array')
&nbsp;
/**
* Bind `el` event `type` to `fn`.
*
* @param {Element} el, NodeList, HTMLCollection or Array
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @api public
*/
&nbsp;
exports.bind = function (el, type, fn, capture) {
el = toArray(el)
for (var i = 0, il = el.length; i &lt; il; i++) {
el[i][bind](prefix + type, fn, capture || false)
}
}
&nbsp;
/**
* Unbind `el` event `type`'s callback `fn`.
*
* @param {Element} el, NodeList, HTMLCollection or Array
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @api public
*/
&nbsp;
exports.unbind = <span class="fstat-no" title="function not covered" >fu</span>nction (el, type, fn, capture) {
<span class="cstat-no" title="statement not covered" > el = toArray(el)</span>
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >el.length;</span> i &lt; il; i++) {</span>
<span class="cstat-no" title="statement not covered" > el[i][unbind](prefix + type, fn, capture || false)</span>
}
}
&nbsp;
/**
* Returns a function, that, as long as it continues to be invoked, will not
* be triggered. The function will be called after it stops being called for
* `wait` milliseconds. If `immediate` is true, trigger the function on the
* leading edge, instead of the trailing.
*
* @param {Function} fn
* @param {Integer} wait
* @param {Boolean} immediate
* @api public
*/
&nbsp;
exports.debounce = function (fn, wait, immediate) {
var timeout
return wait
? <span class="fstat-no" title="function not covered" ><span class="branch-0 cbranch-no" title="branch not covered" >fu</span>nction () {</span>
var context = <span class="cstat-no" title="statement not covered" >this,</span>
args = <span class="cstat-no" title="statement not covered" >arguments</span>
var later = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >fu</span>nction () {</span>
<span class="cstat-no" title="statement not covered" > timeout = null</span>
<span class="cstat-no" title="statement not covered" > if (!immediate) <span class="cstat-no" title="statement not covered" >fn.apply(context, args)</span></span>
}
var callNow = <span class="cstat-no" title="statement not covered" >immediate &amp;&amp; !timeout</span>
<span class="cstat-no" title="statement not covered" > clearTimeout(timeout)</span>
<span class="cstat-no" title="statement not covered" > timeout = setTimeout(later, wait)</span>
<span class="cstat-no" title="statement not covered" > if (callNow) <span class="cstat-no" title="statement not covered" >fn.apply(context, args)</span></span>
}
: fn
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,134 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/extend.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> extend.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">88.89% </span>
<span class="quiet">Statements</span>
<span class='fraction'>8/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class='fraction'>1/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>7/7</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">181x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">181x</span>
<span class="cline-any cline-yes">181x</span>
<span class="cline-any cline-yes">181x</span>
<span class="cline-any cline-yes">188x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">181x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/*
* Source: https://github.com/segmentio/extend
*/
&nbsp;
module.exports = function extend(object) {
// Takes an unlimited number of extenders.
var args = Array.prototype.slice.call(arguments, 1)
&nbsp;
// For each extender, copy their properties on our object.
for (var i = 0, source; (source = args[i]); i++) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!source) <span class="cstat-no" title="statement not covered" >continue</span>
for (var property in source) {
object[property] = source[property]
}
}
&nbsp;
return object
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,449 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/fuzzy.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> fuzzy.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">95.24% </span>
<span class="quiet">Statements</span>
<span class='fraction'>60/63</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Branches</span>
<span class='fraction'>24/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">98.31% </span>
<span class="quiet">Lines</span>
<span class='fraction'>58/59</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">330x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">330x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">698x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">515x</span>
<span class="cline-any cline-yes">277x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">238x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">515x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3104x</span>
<span class="cline-any cline-yes">3104x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1225x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1879x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3104x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-yes">11x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161x</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">101x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">60x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (text, pattern, options) {
// Aproximately where in the text is the pattern expected to be found?
var Match_Location = options.location || 0
&nbsp;
//Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is 'distance' characters away from the fuzzy location would score as a complete mismatch. A distance of '0' requires the match be at the exact location specified, a threshold of '1000' would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
var Match_Distance = options.distance || <span class="branch-1 cbranch-no" title="branch not covered" >100</span>
&nbsp;
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything.
var Match_Threshold = options.threshold || <span class="branch-1 cbranch-no" title="branch not covered" >0.4</span>
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (pattern === text) <span class="cstat-no" title="statement not covered" >return true </span>// Exact match
<span class="missing-if-branch" title="if path not taken" >I</span>if (pattern.length &gt; 32) <span class="cstat-no" title="statement not covered" >return false </span>// This algorithm cannot be used
&nbsp;
// Set starting location at beginning text and initialise the alphabet.
var loc = Match_Location,
s = (function () {
var q = {},
i
&nbsp;
for (i = 0; i &lt; pattern.length; i++) {
q[pattern.charAt(i)] = 0
}
&nbsp;
for (i = 0; i &lt; pattern.length; i++) {
q[pattern.charAt(i)] |= 1 &lt;&lt; (pattern.length - i - 1)
}
&nbsp;
return q
})()
&nbsp;
// Compute and return the score for a match with e errors and x location.
// Accesses loc and pattern through being a closure.
&nbsp;
function match_bitapScore_(e, x) {
var accuracy = e / pattern.length,
proximity = Math.abs(loc - x)
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!Match_Distance) {
// Dodge divide by zero error.
<span class="cstat-no" title="statement not covered" > return proximity ? 1.0 : accuracy</span>
}
return accuracy + proximity / Match_Distance
}
&nbsp;
var score_threshold = Match_Threshold, // Highest score beyond which we give up.
best_loc = text.indexOf(pattern, loc) // Is there a nearby exact match? (speedup)
&nbsp;
if (best_loc != -1) {
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)
// What about in the other direction? (speedup)
best_loc = text.lastIndexOf(pattern, loc + pattern.length)
&nbsp;
if (best_loc != -1) {
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)
}
}
&nbsp;
// Initialise the bit arrays.
var matchmask = 1 &lt;&lt; (pattern.length - 1)
best_loc = -1
&nbsp;
var bin_min, bin_mid
var bin_max = pattern.length + text.length
var last_rd
for (var d = 0; d &lt; pattern.length; d++) {
// Scan for the best match; each iteration allows for one more error.
// Run a binary search to determine how far from 'loc' we can stray at this
// error level.
bin_min = 0
bin_mid = bin_max
while (bin_min &lt; bin_mid) {
if (match_bitapScore_(d, loc + bin_mid) &lt;= score_threshold) {
bin_min = bin_mid
} else {
bin_max = bin_mid
}
bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min)
}
// Use the result from this iteration as the maximum for the next.
bin_max = bin_mid
var start = Math.max(1, loc - bin_mid + 1)
var finish = Math.min(loc + bin_mid, text.length) + pattern.length
&nbsp;
var rd = Array(finish + 2)
rd[finish + 1] = (1 &lt;&lt; d) - 1
for (var j = finish; j &gt;= start; j--) {
// The alphabet (s) is a sparse hash, so the following line generates
// warnings.
var charMatch = s[text.charAt(j - 1)]
if (d === 0) {
// First pass: exact match.
rd[j] = ((rd[j + 1] &lt;&lt; 1) | 1) &amp; charMatch
} else {
// Subsequent passes: fuzzy match.
rd[j] = (((rd[j + 1] &lt;&lt; 1) | 1) &amp; charMatch) | (((last_rd[j + 1] | last_rd[j]) &lt;&lt; 1) | 1) | last_rd[j + 1]
}
if (rd[j] &amp; matchmask) {
var score = match_bitapScore_(d, j - 1)
// This match will almost certainly be better than any existing match.
// But check anyway.
<span class="missing-if-branch" title="else path not taken" >E</span>if (score &lt;= score_threshold) {
// Told you so.
score_threshold = score
best_loc = j - 1
if (best_loc &gt; loc) {
// When passing loc, don't exceed our current distance from loc.
start = Math.max(1, 2 * loc - best_loc)
} else {
// Already passed loc, downhill from here on in.
break
}
}
}
}
// No hope for a (better) match at greater error levels.
if (match_bitapScore_(d + 1, loc) &gt; score_threshold) {
break
}
last_rd = rd
}
&nbsp;
return best_loc &lt; 0 ? false : true
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,158 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/get-attribute.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> get-attribute.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">90.91% </span>
<span class="quiet">Statements</span>
<span class='fraction'>10/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">77.78% </span>
<span class="quiet">Branches</span>
<span class='fraction'>7/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90% </span>
<span class="quiet">Lines</span>
<span class='fraction'>9/10</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">116x</span>
<span class="cline-any cline-yes">116x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">83x</span>
<span class="cline-any cline-yes">83x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">116x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* A cross-browser implementation of getAttribute.
* Source found here: http://stackoverflow.com/a/3755343/361337 written by Vivin Paliath
*
* Return the value for `attr` at `element`.
*
* @param {Element} el
* @param {String} attr
* @api public
*/
&nbsp;
module.exports = function (el, attr) {
var result = (el.getAttribute &amp;&amp; el.getAttribute(attr)) || null
if (!result) {
var attrs = el.attributes
var length = attrs.length
for (var i = 0; i &lt; length; i++) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (attrs[i] !== undefined) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (attrs[i].nodeName === attr) {
<span class="cstat-no" title="statement not covered" > result = attrs[i].nodeValue</span>
}
}
}
}
return result
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,269 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/get-by-class.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> get-by-class.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">93.75% </span>
<span class="quiet">Statements</span>
<span class='fraction'>30/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">81.82% </span>
<span class="quiet">Branches</span>
<span class='fraction'>18/22</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>5/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.33% </span>
<span class="quiet">Lines</span>
<span class='fraction'>28/30</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">2220x</span>
<span class="cline-any cline-yes">1859x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">361x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">2222x</span>
<span class="cline-any cline-yes">2222x</span>
<span class="cline-any cline-yes">2220x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* A cross-browser implementation of getElementsByClass.
* Heavily based on Dustin Diaz's function: http://dustindiaz.com/getelementsbyclass.
*
* Find all elements with class `className` inside `container`.
* Use `single = true` to increase performance in older browsers
* when only one element is needed.
*
* @param {String} className
* @param {Element} container
* @param {Boolean} single
* @api public
*/
&nbsp;
var getElementsByClassName = function (container, className, single) {
if (single) {
return container.getElementsByClassName(className)[0]
} else {
return container.getElementsByClassName(className)
}
}
&nbsp;
var querySelector = function (container, className, single) {
className = '.' + className
<span class="missing-if-branch" title="if path not taken" >I</span>if (single) {
<span class="cstat-no" title="statement not covered" > return container.querySelector(className)</span>
} else {
return container.querySelectorAll(className)
}
}
&nbsp;
var polyfill = function (container, className, single) {
var classElements = [],
tag = '*'
&nbsp;
var els = container.getElementsByTagName(tag)
var elsLen = els.length
var pattern = new RegExp('(^|\\s)' + className + '(\\s|$)')
for (var i = 0, j = 0; i &lt; elsLen; i++) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (pattern.test(els[i].className)) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (single) {
<span class="cstat-no" title="statement not covered" > return els[i]</span>
} else {
classElements[j] = els[i]
j++
}
}
}
return classElements
}
&nbsp;
module.exports = (function () {
return function (container, className, single, options) {
options = options || {}
if ((options.test &amp;&amp; options.getElementsByClassName) || (!options.test &amp;&amp; document.getElementsByClassName)) {
return getElementsByClassName(container, className, single)
} else if ((options.test &amp;&amp; options.querySelector) || (!options.test &amp;&amp; <span class="branch-3 cbranch-no" title="branch not covered" >document.querySelector)</span>) {
return querySelector(container, className, single)
} else {
return polyfill(container, className, single)
}
}
})()
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,107 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/index-of.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> index-of.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">40% </span>
<span class="quiet">Statements</span>
<span class='fraction'>4/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">25% </span>
<span class="quiet">Branches</span>
<span class='fraction'>1/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Lines</span>
<span class='fraction'>3/6</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var indexOf = [].indexOf
&nbsp;
module.exports = function(arr, obj){
<span class="missing-if-branch" title="else path not taken" >E</span>if (indexOf) return arr.indexOf(obj);
<span class="cstat-no" title="statement not covered" > for (var i = <span class="cstat-no" title="statement not covered" >0,</span> il = <span class="cstat-no" title="statement not covered" >arr.length;</span> i &lt; il; ++i) {</span>
<span class="cstat-no" title="statement not covered" > if (arr[i] === obj) <span class="cstat-no" title="statement not covered" >return i;</span></span>
}
<span class="cstat-no" title="statement not covered" > return -1</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,231 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> src/utils</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">75.11% </span>
<span class="quiet">Statements</span>
<span class='fraction'>178/237</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">58.74% </span>
<span class="quiet">Branches</span>
<span class='fraction'>84/143</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.46% </span>
<span class="quiet">Functions</span>
<span class='fraction'>23/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">80.49% </span>
<span class="quiet">Lines</span>
<span class='fraction'>165/205</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="classes.js"><a href="classes.js.html">classes.js</a></td>
<td data-value="54.72" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 54%"></div><div class="cover-empty" style="width: 46%"></div></div>
</td>
<td data-value="54.72" class="pct medium">54.72%</td>
<td data-value="53" class="abs medium">29/53</td>
<td data-value="33.33" class="pct low">33.33%</td>
<td data-value="30" class="abs low">10/30</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">7/7</td>
<td data-value="58" class="pct medium">58%</td>
<td data-value="50" class="abs medium">29/50</td>
</tr>
<tr>
<td class="file low" data-value="events.js"><a href="events.js.html">events.js</a></td>
<td data-value="44.83" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 44%"></div><div class="cover-empty" style="width: 56%"></div></div>
</td>
<td data-value="44.83" class="pct low">44.83%</td>
<td data-value="29" class="abs low">13/29</td>
<td data-value="33.33" class="pct low">33.33%</td>
<td data-value="18" class="abs low">6/18</td>
<td data-value="40" class="pct low">40%</td>
<td data-value="5" class="abs low">2/5</td>
<td data-value="47.83" class="pct low">47.83%</td>
<td data-value="23" class="abs low">11/23</td>
</tr>
<tr>
<td class="file high" data-value="extend.js"><a href="extend.js.html">extend.js</a></td>
<td data-value="88.89" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 88%"></div><div class="cover-empty" style="width: 12%"></div></div>
</td>
<td data-value="88.89" class="pct high">88.89%</td>
<td data-value="9" class="abs high">8/9</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="2" class="abs medium">1/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">7/7</td>
</tr>
<tr>
<td class="file high" data-value="fuzzy.js"><a href="fuzzy.js.html">fuzzy.js</a></td>
<td data-value="95.24" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
</td>
<td data-value="95.24" class="pct high">95.24%</td>
<td data-value="63" class="abs high">60/63</td>
<td data-value="75" class="pct medium">75%</td>
<td data-value="32" class="abs medium">24/32</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="98.31" class="pct high">98.31%</td>
<td data-value="59" class="abs high">58/59</td>
</tr>
<tr>
<td class="file high" data-value="get-attribute.js"><a href="get-attribute.js.html">get-attribute.js</a></td>
<td data-value="90.91" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 90%"></div><div class="cover-empty" style="width: 10%"></div></div>
</td>
<td data-value="90.91" class="pct high">90.91%</td>
<td data-value="11" class="abs high">10/11</td>
<td data-value="77.78" class="pct medium">77.78%</td>
<td data-value="9" class="abs medium">7/9</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="90" class="pct high">90%</td>
<td data-value="10" class="abs high">9/10</td>
</tr>
<tr>
<td class="file high" data-value="get-by-class.js"><a href="get-by-class.js.html">get-by-class.js</a></td>
<td data-value="93.75" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 93%"></div><div class="cover-empty" style="width: 7%"></div></div>
</td>
<td data-value="93.75" class="pct high">93.75%</td>
<td data-value="32" class="abs high">30/32</td>
<td data-value="81.82" class="pct high">81.82%</td>
<td data-value="22" class="abs high">18/22</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="5" class="abs high">5/5</td>
<td data-value="93.33" class="pct high">93.33%</td>
<td data-value="30" class="abs high">28/30</td>
</tr>
<tr>
<td class="file low" data-value="index-of.js"><a href="index-of.js.html">index-of.js</a></td>
<td data-value="40" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 40%"></div><div class="cover-empty" style="width: 60%"></div></div>
</td>
<td data-value="40" class="pct low">40%</td>
<td data-value="10" class="abs low">4/10</td>
<td data-value="25" class="pct low">25%</td>
<td data-value="4" class="abs low">1/4</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="6" class="abs medium">3/6</td>
</tr>
<tr>
<td class="file medium" data-value="to-array.js"><a href="to-array.js.html">to-array.js</a></td>
<td data-value="76" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 76%"></div><div class="cover-empty" style="width: 24%"></div></div>
</td>
<td data-value="76" class="pct medium">76%</td>
<td data-value="25" class="abs medium">19/25</td>
<td data-value="59.09" class="pct medium">59.09%</td>
<td data-value="22" class="abs medium">13/22</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="15" class="abs high">15/15</td>
</tr>
<tr>
<td class="file high" data-value="to-string.js"><a href="to-string.js.html">to-string.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="5" class="abs high">5/5</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="5" class="abs high">5/5</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/to-array.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> to-array.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">76% </span>
<span class="quiet">Statements</span>
<span class='fraction'>19/25</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">59.09% </span>
<span class="quiet">Branches</span>
<span class='fraction'>13/22</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>15/15</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-yes">360x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">360x</span>
<span class="cline-any cline-yes">360x</span>
<span class="cline-any cline-yes">41x</span>
<span class="cline-any cline-yes">41x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">360x</span>
<span class="cline-any cline-yes">27x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">364x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* Source: https://github.com/timoxley/to-array
*
* Convert an array-like object into an `Array`.
* If `collection` is already an `Array`, then will return a clone of `collection`.
*
* @param {Array | Mixed} collection An `Array` or array-like object to convert e.g. `arguments` or `NodeList`
* @return {Array} Naive conversion of `collection` to a new `Array`.
* @api public
*/
&nbsp;
module.exports = function toArray(collection) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof collection === 'undefined') <span class="cstat-no" title="statement not covered" >return []</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (collection === null) <span class="cstat-no" title="statement not covered" >return [null]</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (collection === window) <span class="cstat-no" title="statement not covered" >return [window]</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof collection === 'string') <span class="cstat-no" title="statement not covered" >return [collection]</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (isArray(collection)) <span class="cstat-no" title="statement not covered" >return collection</span>
if (typeof collection.length != 'number') return [collection]
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof collection === 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >collection instanceof Function)</span> <span class="cstat-no" title="statement not covered" >return [collection]</span>
&nbsp;
var arr = [];
for (var i = 0, il = collection.length; i &lt; il; i++) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (Object.prototype.hasOwnProperty.call(collection, i) || <span class="branch-1 cbranch-no" title="branch not covered" >i in collection)</span> {
arr.push(collection[i])
}
}
if (!arr.length) return []
return arr
}
&nbsp;
function isArray(arr) {
return Object.prototype.toString.call(arr) === '[object Array]'
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,98 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/to-string.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> to-string.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>5/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>5/5</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">132x</span>
<span class="cline-any cline-yes">132x</span>
<span class="cline-any cline-yes">132x</span>
<span class="cline-any cline-yes">132x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function (s) {
s = s === undefined ? '' : s
s = s === null ? '' : s
s = s.toString()
return s
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sun Jan 17 2021 17:51:37 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,197 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils/value-names.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> value-names.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">65.63% </span>
<span class="quiet">Statements</span>
<span class='fraction'>21/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">47.83% </span>
<span class="quiet">Branches</span>
<span class='fraction'>11/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.67% </span>
<span class="quiet">Lines</span>
<span class='fraction'>18/27</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-yes">209x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-yes">421x</span>
<span class="cline-any cline-yes">209x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">209x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">209x</span>
<span class="cline-any cline-yes">209x</span>
<span class="cline-any cline-yes">209x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var getByClass = require('./get-by-class')
&nbsp;
const getDefinitionFromName = (name, valueNames) =&gt; {
for (var i = 0, il = valueNames.length; i &lt; il; i++) {
var valueName = valueNames[i]
<span class="missing-if-branch" title="if path not taken" >I</span>if (valueName.data) {
var data = <span class="cstat-no" title="statement not covered" >valueName.data</span>
<span class="cstat-no" title="statement not covered" > for (var j = <span class="cstat-no" title="statement not covered" >0,</span> jl = <span class="cstat-no" title="statement not covered" >data.length;</span> j &lt; jl; j++) {</span>
<span class="cstat-no" title="statement not covered" > if (data[j] === name) {</span>
<span class="cstat-no" title="statement not covered" > return { data: name }</span>
}
}
} else <span class="missing-if-branch" title="if path not taken" >I</span>if (valueName.attr &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >valueName.name </span>&amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >valueName.name == name)</span> {
<span class="cstat-no" title="statement not covered" > return valueName</span>
} else if (valueName === name) {
return name
}
}
}
const set = (el, name, value, valueNames) =&gt; {
var elm = undefined,
valueName = getDefinitionFromName(name, valueNames)
if (!valueName) return
<span class="missing-if-branch" title="if path not taken" >I</span>if (valueName.data) {
<span class="cstat-no" title="statement not covered" > el.setAttribute('data-' + valueName.data, value)</span>
} else <span class="missing-if-branch" title="if path not taken" >I</span>if (valueName.attr &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >valueName.name)</span> {
<span class="cstat-no" title="statement not covered" > elm = getByClass(el, valueName.name, true)</span>
<span class="cstat-no" title="statement not covered" > if (elm) {</span>
<span class="cstat-no" title="statement not covered" > elm.setAttribute(valueName.attr, value)</span>
}
} else {
elm = getByClass(el, valueName, true)
<span class="missing-if-branch" title="else path not taken" >E</span>if (elm) {
elm.innerHTML = value
}
}
}
&nbsp;
module.exports = { getDefinitionFromName, set }
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Dec 02 2020 12:55:03 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,491 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for templater.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> templater.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">97.85% </span>
<span class="quiet">Statements</span>
<span class='fraction'>91/93</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.36% </span>
<span class="quiet">Branches</span>
<span class='fraction'>38/44</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>11/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">98.78% </span>
<span class="quiet">Lines</span>
<span class='fraction'>81/82</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-yes">199x</span>
<span class="cline-any cline-yes">199x</span>
<span class="cline-any cline-yes">199x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">196x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">184x</span>
<span class="cline-any cline-yes">184x</span>
<span class="cline-any cline-yes">134x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">106x</span>
<span class="cline-any cline-yes">106x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">103x</span>
<span class="cline-any cline-yes">103x</span>
<span class="cline-any cline-yes">103x</span>
<span class="cline-any cline-yes">103x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">124x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">120x</span>
<span class="cline-any cline-yes">102x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">100x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">34x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">120x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">589x</span>
<span class="cline-any cline-yes">589x</span>
<span class="cline-any cline-yes">589x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">192x</span>
<span class="cline-any cline-yes">192x</span>
<span class="cline-any cline-yes">244x</span>
<span class="cline-any cline-yes">244x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">239x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">219x</span>
<span class="cline-any cline-yes">219x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">192x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">892x</span>
<span class="cline-any cline-yes">1550x</span>
<span class="cline-any cline-yes">1550x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">591x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">1192x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">2204x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">704x</span>
<span class="cline-any cline-yes">497x</span>
<span class="cline-any cline-yes">2062x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var getByClass = require('./utils/get-by-class')
var getAttribute = require('./utils/get-attribute')
var valueNamesUtils = require('./utils/value-names')
&nbsp;
var createCleanTemplateItem = function (templateNode, valueNames) {
var el = templateNode.cloneNode(true)
el.removeAttribute('id')
for (var i = 0, il = valueNames.length; i &lt; il; i++) {
var elm = undefined,
valueName = valueNames[i]
if (valueName.data) {
for (var j = 0, jl = valueName.data.length; j &lt; jl; j++) {
el.setAttribute('data-' + valueName.data[j], '')
}
} else if (valueName.attr &amp;&amp; valueName.name) {
elm = getByClass(el, valueName.name, true)
<span class="missing-if-branch" title="else path not taken" >E</span>if (elm) {
elm.setAttribute(valueName.attr, '')
}
} else {
elm = getByClass(el, valueName, true)
if (elm) {
elm.innerHTML = ''
}
}
}
return el
}
&nbsp;
var stringToDOMElement = function (itemHTML) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof itemHTML !== 'string') <span class="cstat-no" title="statement not covered" >return undefined</span>
if (/&lt;tr[\s&gt;]/g.exec(itemHTML)) {
var tbody = document.createElement('tbody')
tbody.innerHTML = itemHTML
return tbody.firstElementChild
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (itemHTML.indexOf('&lt;') !== -1) {
var div = document.createElement('div')
div.innerHTML = itemHTML
return div.firstElementChild
}
<span class="cstat-no" title="statement not covered" > return undefined</span>
}
&nbsp;
var templater = {}
&nbsp;
templater.getTemplate = function ({ valueNames, parentEl, template }) {
if (typeof template === 'function') {
return {
valueNames,
type: 'dynamic',
render: function (values) {
var item = template(values)
return stringToDOMElement(item)
},
}
}
&nbsp;
var itemSource
if (typeof template === 'string') {
if (template.indexOf('&lt;') === -1) {
itemSource = document.getElementById(template)
} else {
itemSource = stringToDOMElement(template)
}
} else {
var nodes = parentEl.childNodes
for (var i = 0, il = nodes.length; i &lt; il; i++) {
// Only textnodes have a data attribute
if (nodes[i].data === undefined) {
itemSource = nodes[i].cloneNode(true)
break
}
}
}
if (!itemSource)
throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.")
&nbsp;
itemSource = createCleanTemplateItem(itemSource, valueNames)
&nbsp;
return {
valueNames,
render: function (values) {
var el = itemSource.cloneNode(true)
templater.set(el, values, valueNames)
return el
},
}
}
&nbsp;
templater.get = function (el, valueNames) {
var values = {}
for (var i = 0, il = valueNames.length; i &lt; il; i++) {
var valueName = valueNames[i]
if (valueName.data) {
for (var j = 0, jl = valueName.data.length; j &lt; jl; j++) {
values[valueName.data[j]] = getAttribute(el, 'data-' + valueName.data[j])
}
} else if (valueName.attr &amp;&amp; valueName.name) {
var elm = getByClass(el, valueName.name, true)
values[valueName.name] = elm ? getAttribute(elm, valueName.attr) : <span class="branch-1 cbranch-no" title="branch not covered" >''</span>
} else {
var elm = getByClass(el, valueName, true)
values[valueName] = elm ? elm.innerHTML : <span class="branch-1 cbranch-no" title="branch not covered" >''</span>
}
}
return values
}
&nbsp;
templater.set = function (el, values, valueNames) {
for (var v in values) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (values.hasOwnProperty(v)) {
valueNamesUtils.set(el, v, values[v], valueNames)
}
}
}
&nbsp;
templater.create = function (values, template) {
return template.render(values)
}
templater.remove = function (el, parentEl) {
if (el !== undefined &amp;&amp; el.parentNode === parentEl) {
parentEl.removeChild(el)
}
}
templater.show = function (el, parentEl) {
parentEl.appendChild(el)
}
templater.clear = function (parentEl) {
/* .innerHTML = ''; fucks up IE */
if (parentEl.hasChildNodes()) {
while (parentEl.childNodes.length &gt;= 1) {
parentEl.removeChild(parentEl.firstChild)
}
}
}
&nbsp;
module.exports = templater
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Thu Dec 17 2020 00:31:01 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for to-array.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> to-array.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">76% </span>
<span class="quiet">Statements</span>
<span class='fraction'>19/25</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">59.09% </span>
<span class="quiet">Branches</span>
<span class='fraction'>13/22</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>15/15</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-yes">340x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">340x</span>
<span class="cline-any cline-yes">340x</span>
<span class="cline-any cline-yes">41x</span>
<span class="cline-any cline-yes">41x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">340x</span>
<span class="cline-any cline-yes">27x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">344x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* Source: https://github.com/timoxley/to-array
*
* Convert an array-like object into an `Array`.
* If `collection` is already an `Array`, then will return a clone of `collection`.
*
* @param {Array | Mixed} collection An `Array` or array-like object to convert e.g. `arguments` or `NodeList`
* @return {Array} Naive conversion of `collection` to a new `Array`.
* @api public
*/
&nbsp;
module.exports = function toArray(collection) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof collection === 'undefined') <span class="cstat-no" title="statement not covered" >return []</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (collection === null) <span class="cstat-no" title="statement not covered" >return [null]</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (collection === window) <span class="cstat-no" title="statement not covered" >return [window]</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof collection === 'string') <span class="cstat-no" title="statement not covered" >return [collection]</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (isArray(collection)) <span class="cstat-no" title="statement not covered" >return collection</span>
if (typeof collection.length != 'number') return [collection]
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof collection === 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >collection instanceof Function)</span> <span class="cstat-no" title="statement not covered" >return [collection]</span>
&nbsp;
var arr = [];
for (var i = 0, il = collection.length; i &lt; il; i++) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (Object.prototype.hasOwnProperty.call(collection, i) || <span class="branch-1 cbranch-no" title="branch not covered" >i in collection)</span> {
arr.push(collection[i])
}
}
if (!arr.length) return []
return arr
}
&nbsp;
function isArray(arr) {
return Object.prototype.toString.call(arr) === '[object Array]'
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Sat Nov 21 2020 22:28:41 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"version":3,"file":"list.min.js","sources":["webpack://List/list.min.js"],"mappings":"AAAA","sourceRoot":""}

View file

@ -0,0 +1,69 @@
{
"name": "list.js",
"version": "2.3.1",
"description": "The perfect library for lists. Supports search, sort, filters and flexibility. Built to be invisible and work on existing HTML",
"keywords": [
"list",
"search",
"sort",
"table",
"dom",
"html",
"ui"
],
"author": {
"name": "Jonny Strömberg",
"email": "jonny.stromberg@gmail.com",
"url": "https://javve.com"
},
"homepage": "https://listjs.com",
"repository": "git://github.com/javve/list.js.git",
"license": "MIT",
"bugs": {
"url": "https://github.com/javve/list.js/issues"
},
"dependencies": {
"string-natural-compare": "^2.0.2"
},
"devDependencies": {
"@babel/core": "^7.12.7",
"@babel/preset-env": "^7.12.7",
"babel-loader": "^8.2.1",
"jest": "^26.6.3",
"jquery": "^3.5.1",
"prettier": "^2.2.0",
"webpack": "^5.6.0",
"webpack-cli": "^4.2.0"
},
"main": "src/index",
"engines": {
"node": "^6.0 || ^8.0 || ^10.0 || ^12.0 || >=14"
},
"scripts": {
"test": "npx jest",
"build": "npx webpack",
"watch": "npx webpack --watch",
"watch-test": "npx jest --watch",
"preversion": "npm test && npm run build && cp dist/list.min.js docs/assets/javascripts/list.min.js && cp dist/list.min.js.map docs/assets/javascripts/list.min.js.map && git add dist && git add docs/assets/javascripts",
"postversion": "git push --follow-tags origin master && cp package.json docs/_data/pkg.json && git add docs/_data/pkg.json && git commit -m \"pkg.json update\""
},
"npmName": "list.js",
"npmFileMap": [
{
"basePath": "/dist/",
"files": [
"*.js",
"*.js.map"
]
}
],
"jest": {
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"collectCoverageFrom": [
"src/*.js",
"src/utils/*.js"
],
"testURL": "http://localhost/"
}
}

View file

@ -0,0 +1,16 @@
module.exports = function (list) {
var addAsync = function (values, callback, items) {
var valuesToAdd = values.splice(0, 50)
items = items || []
items = items.concat(list.add(valuesToAdd))
if (values.length > 0) {
setTimeout(function () {
addAsync(values, callback, items)
}, 1)
} else {
list.update()
callback(items)
}
}
return addAsync
}

View file

@ -0,0 +1,28 @@
module.exports = function (list) {
// Add handlers
list.handlers.filterStart = list.handlers.filterStart || []
list.handlers.filterComplete = list.handlers.filterComplete || []
return function (filterFunction) {
list.trigger('filterStart')
list.i = 1 // Reset paging
list.reset.filter()
if (filterFunction === undefined) {
list.filtered = false
} else {
list.filtered = true
var is = list.items
for (var i = 0, il = is.length; i < il; i++) {
var item = is[i]
if (filterFunction(item)) {
item.filtered = true
} else {
item.filtered = false
}
}
}
list.update()
list.trigger('filterComplete')
return list.visibleItems
}
}

View file

@ -0,0 +1,70 @@
var classes = require('./utils/classes'),
events = require('./utils/events'),
extend = require('./utils/extend'),
toString = require('./utils/to-string'),
getByClass = require('./utils/get-by-class'),
fuzzy = require('./utils/fuzzy')
module.exports = function (list, options) {
options = options || {}
options = extend(
{
location: 0,
distance: 100,
threshold: 0.4,
multiSearch: true,
searchClass: 'fuzzy-search',
},
options
)
var fuzzySearch = {
search: function (searchString, columns) {
// Substract arguments from the searchString or put searchString as only argument
var searchArguments = options.multiSearch ? searchString.replace(/ +$/, '').split(/ +/) : [searchString]
for (var k = 0, kl = list.items.length; k < kl; k++) {
fuzzySearch.item(list.items[k], columns, searchArguments)
}
},
item: function (item, columns, searchArguments) {
var found = true
for (var i = 0; i < searchArguments.length; i++) {
var foundArgument = false
for (var j = 0, jl = columns.length; j < jl; j++) {
if (fuzzySearch.values(item.values(), columns[j], searchArguments[i])) {
foundArgument = true
}
}
if (!foundArgument) {
found = false
}
}
item.found = found
},
values: function (values, value, searchArgument) {
if (values.hasOwnProperty(value)) {
var text = toString(values[value]).toLowerCase()
if (fuzzy(text, searchArgument, options)) {
return true
}
}
return false
},
}
events.bind(
getByClass(list.listContainer, options.searchClass),
'keyup',
list.utils.events.debounce(function (e) {
var target = e.target || e.srcElement // IE have srcElement
list.search(target.value, fuzzySearch.search)
}, list.searchDelay)
)
return function (str, columns) {
list.search(str, columns, fuzzySearch.search)
}
}

263
storage/public/dist/libs/list.js/src/index.js vendored Executable file
View file

@ -0,0 +1,263 @@
var naturalSort = require('string-natural-compare'),
getByClass = require('./utils/get-by-class'),
extend = require('./utils/extend'),
indexOf = require('./utils/index-of'),
events = require('./utils/events'),
toString = require('./utils/to-string'),
classes = require('./utils/classes'),
getAttribute = require('./utils/get-attribute'),
toArray = require('./utils/to-array')
module.exports = function (id, options, values) {
var self = this,
init,
Item = require('./item')(self),
addAsync = require('./add-async')(self),
initPagination = require('./pagination')(self)
init = {
start: function () {
self.listClass = 'list'
self.searchClass = 'search'
self.sortClass = 'sort'
self.page = 10000
self.i = 1
self.items = []
self.visibleItems = []
self.matchingItems = []
self.searched = false
self.filtered = false
self.searchColumns = undefined
self.searchDelay = 0
self.handlers = { updated: [] }
self.valueNames = []
self.utils = {
getByClass: getByClass,
extend: extend,
indexOf: indexOf,
events: events,
toString: toString,
naturalSort: naturalSort,
classes: classes,
getAttribute: getAttribute,
toArray: toArray,
}
self.utils.extend(self, options)
self.listContainer = typeof id === 'string' ? document.getElementById(id) : id
if (!self.listContainer) {
return
}
self.list = getByClass(self.listContainer, self.listClass, true)
self.parse = require('./parse')(self)
self.templater = require('./templater')(self)
self.search = require('./search')(self)
self.filter = require('./filter')(self)
self.sort = require('./sort')(self)
self.fuzzySearch = require('./fuzzy-search')(self, options.fuzzySearch)
this.handlers()
this.items()
this.pagination()
self.update()
},
handlers: function () {
for (var handler in self.handlers) {
if (self[handler] && self.handlers.hasOwnProperty(handler)) {
self.on(handler, self[handler])
}
}
},
items: function () {
self.parse(self.list)
if (values !== undefined) {
self.add(values)
}
},
pagination: function () {
if (options.pagination !== undefined) {
if (options.pagination === true) {
options.pagination = [{}]
}
if (options.pagination[0] === undefined) {
options.pagination = [options.pagination]
}
for (var i = 0, il = options.pagination.length; i < il; i++) {
initPagination(options.pagination[i])
}
}
},
}
/*
* Re-parse the List, use if html have changed
*/
this.reIndex = function () {
self.items = []
self.visibleItems = []
self.matchingItems = []
self.searched = false
self.filtered = false
self.parse(self.list)
}
this.toJSON = function () {
var json = []
for (var i = 0, il = self.items.length; i < il; i++) {
json.push(self.items[i].values())
}
return json
}
/*
* Add object to list
*/
this.add = function (values, callback) {
if (values.length === 0) {
return
}
if (callback) {
addAsync(values.slice(0), callback)
return
}
var added = [],
notCreate = false
if (values[0] === undefined) {
values = [values]
}
for (var i = 0, il = values.length; i < il; i++) {
var item = null
notCreate = self.items.length > self.page ? true : false
item = new Item(values[i], undefined, notCreate)
self.items.push(item)
added.push(item)
}
self.update()
return added
}
this.show = function (i, page) {
this.i = i
this.page = page
self.update()
return self
}
/* Removes object from list.
* Loops through the list and removes objects where
* property "valuename" === value
*/
this.remove = function (valueName, value, options) {
var found = 0
for (var i = 0, il = self.items.length; i < il; i++) {
if (self.items[i].values()[valueName] == value) {
self.templater.remove(self.items[i], options)
self.items.splice(i, 1)
il--
i--
found++
}
}
self.update()
return found
}
/* Gets the objects in the list which
* property "valueName" === value
*/
this.get = function (valueName, value) {
var matchedItems = []
for (var i = 0, il = self.items.length; i < il; i++) {
var item = self.items[i]
if (item.values()[valueName] == value) {
matchedItems.push(item)
}
}
return matchedItems
}
/*
* Get size of the list
*/
this.size = function () {
return self.items.length
}
/*
* Removes all items from the list
*/
this.clear = function () {
self.templater.clear()
self.items = []
return self
}
this.on = function (event, callback) {
self.handlers[event].push(callback)
return self
}
this.off = function (event, callback) {
var e = self.handlers[event]
var index = indexOf(e, callback)
if (index > -1) {
e.splice(index, 1)
}
return self
}
this.trigger = function (event) {
var i = self.handlers[event].length
while (i--) {
self.handlers[event][i](self)
}
return self
}
this.reset = {
filter: function () {
var is = self.items,
il = is.length
while (il--) {
is[il].filtered = false
}
return self
},
search: function () {
var is = self.items,
il = is.length
while (il--) {
is[il].found = false
}
return self
},
}
this.update = function () {
var is = self.items,
il = is.length
self.visibleItems = []
self.matchingItems = []
self.templater.clear()
for (var i = 0; i < il; i++) {
if (is[i].matching() && self.matchingItems.length + 1 >= self.i && self.visibleItems.length < self.page) {
is[i].show()
self.visibleItems.push(is[i])
self.matchingItems.push(is[i])
} else if (is[i].matching()) {
self.matchingItems.push(is[i])
is[i].hide()
} else {
is[i].hide()
}
}
self.trigger('updated')
return self
}
init.start()
}

View file

@ -0,0 +1,60 @@
module.exports = function (list) {
return function (initValues, element, notCreate) {
var item = this
this._values = {}
this.found = false // Show if list.searched == true and this.found == true
this.filtered = false // Show if list.filtered == true and this.filtered == true
var init = function (initValues, element, notCreate) {
if (element === undefined) {
if (notCreate) {
item.values(initValues, notCreate)
} else {
item.values(initValues)
}
} else {
item.elm = element
var values = list.templater.get(item, initValues)
item.values(values)
}
}
this.values = function (newValues, notCreate) {
if (newValues !== undefined) {
for (var name in newValues) {
item._values[name] = newValues[name]
}
if (notCreate !== true) {
list.templater.set(item, item.values())
}
} else {
return item._values
}
}
this.show = function () {
list.templater.show(item)
}
this.hide = function () {
list.templater.hide(item)
}
this.matching = function () {
return (
(list.filtered && list.searched && item.found && item.filtered) ||
(list.filtered && !list.searched && item.filtered) ||
(!list.filtered && list.searched && item.found) ||
(!list.filtered && !list.searched)
)
}
this.visible = function () {
return item.elm && item.elm.parentNode == list.list ? true : false
}
init(initValues, element, notCreate)
}
}

View file

@ -0,0 +1,108 @@
var classes = require('./utils/classes'),
events = require('./utils/events'),
List = require('./index')
module.exports = function (list) {
var isHidden = false
var refresh = function (pagingList, options) {
if (list.page < 1) {
list.listContainer.style.display = 'none'
isHidden = true
return
} else if (isHidden) {
list.listContainer.style.display = 'block'
}
var item,
l = list.matchingItems.length,
index = list.i,
page = list.page,
pages = Math.ceil(l / page),
currentPage = Math.ceil(index / page),
innerWindow = options.innerWindow || 2,
left = options.left || options.outerWindow || 0,
right = options.right || options.outerWindow || 0
right = pages - right
pagingList.clear()
for (var i = 1; i <= pages; i++) {
var className = currentPage === i ? 'active' : ''
//console.log(i, left, right, currentPage, (currentPage - innerWindow), (currentPage + innerWindow), className);
if (is.number(i, left, right, currentPage, innerWindow)) {
item = pagingList.add({
page: i,
dotted: false,
})[0]
if (className) {
classes(item.elm).add(className)
}
item.elm.firstChild.setAttribute('data-i', i)
item.elm.firstChild.setAttribute('data-page', page)
} else if (is.dotted(pagingList, i, left, right, currentPage, innerWindow, pagingList.size())) {
item = pagingList.add({
page: '...',
dotted: true,
})[0]
classes(item.elm).add('disabled')
}
}
}
var is = {
number: function (i, left, right, currentPage, innerWindow) {
return this.left(i, left) || this.right(i, right) || this.innerWindow(i, currentPage, innerWindow)
},
left: function (i, left) {
return i <= left
},
right: function (i, right) {
return i > right
},
innerWindow: function (i, currentPage, innerWindow) {
return i >= currentPage - innerWindow && i <= currentPage + innerWindow
},
dotted: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {
return (
this.dottedLeft(pagingList, i, left, right, currentPage, innerWindow) ||
this.dottedRight(pagingList, i, left, right, currentPage, innerWindow, currentPageItem)
)
},
dottedLeft: function (pagingList, i, left, right, currentPage, innerWindow) {
return i == left + 1 && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right)
},
dottedRight: function (pagingList, i, left, right, currentPage, innerWindow, currentPageItem) {
if (pagingList.items[currentPageItem - 1].values().dotted) {
return false
} else {
return i == right && !this.innerWindow(i, currentPage, innerWindow) && !this.right(i, right)
}
},
}
return function (options) {
var pagingList = new List(list.listContainer.id, {
listClass: options.paginationClass || 'pagination',
item: options.item || "<li><a class='page' href='#'></a></li>",
valueNames: ['page', 'dotted'],
searchClass: 'pagination-search-that-is-not-supposed-to-exist',
sortClass: 'pagination-sort-that-is-not-supposed-to-exist',
})
events.bind(pagingList.listContainer, 'click', function (e) {
var target = e.target || e.srcElement,
page = list.utils.getAttribute(target, 'data-page'),
i = list.utils.getAttribute(target, 'data-i')
if (i) {
list.show((i - 1) * page + 1, page)
}
})
list.on('updated', function () {
refresh(pagingList, options)
})
refresh(pagingList, options)
}
}

View file

@ -0,0 +1,46 @@
module.exports = function (list) {
var Item = require('./item')(list)
var getChildren = function (parent) {
var nodes = parent.childNodes,
items = []
for (var i = 0, il = nodes.length; i < il; i++) {
// Only textnodes have a data attribute
if (nodes[i].data === undefined) {
items.push(nodes[i])
}
}
return items
}
var parse = function (itemElements, valueNames) {
for (var i = 0, il = itemElements.length; i < il; i++) {
list.items.push(new Item(valueNames, itemElements[i]))
}
}
var parseAsync = function (itemElements, valueNames) {
var itemsToIndex = itemElements.splice(0, 50) // TODO: If < 100 items, what happens in IE etc?
parse(itemsToIndex, valueNames)
if (itemElements.length > 0) {
setTimeout(function () {
parseAsync(itemElements, valueNames)
}, 1)
} else {
list.update()
list.trigger('parseComplete')
}
}
list.handlers.parseComplete = list.handlers.parseComplete || []
return function () {
var itemsToIndex = getChildren(list.list),
valueNames = list.valueNames
if (list.indexAsync) {
parseAsync(itemsToIndex, valueNames)
} else {
parse(itemsToIndex, valueNames)
}
}
}

136
storage/public/dist/libs/list.js/src/search.js vendored Executable file
View file

@ -0,0 +1,136 @@
module.exports = function (list) {
var item, text, columns, searchString, customSearch
var prepare = {
resetList: function () {
list.i = 1
list.templater.clear()
customSearch = undefined
},
setOptions: function (args) {
if (args.length == 2 && args[1] instanceof Array) {
columns = args[1]
} else if (args.length == 2 && typeof args[1] == 'function') {
columns = undefined
customSearch = args[1]
} else if (args.length == 3) {
columns = args[1]
customSearch = args[2]
} else {
columns = undefined
}
},
setColumns: function () {
if (list.items.length === 0) return
if (columns === undefined) {
columns = list.searchColumns === undefined ? prepare.toArray(list.items[0].values()) : list.searchColumns
}
},
setSearchString: function (s) {
s = list.utils.toString(s).toLowerCase()
s = s.replace(/[-[\]{}()*+?.,\\^$|#]/g, '\\$&') // Escape regular expression characters
searchString = s
},
toArray: function (values) {
var tmpColumn = []
for (var name in values) {
tmpColumn.push(name)
}
return tmpColumn
},
}
var search = {
list: function () {
// Extract quoted phrases "word1 word2" from original searchString
// searchString is converted to lowercase by List.js
var words = [],
phrase,
ss = searchString
while ((phrase = ss.match(/"([^"]+)"/)) !== null) {
words.push(phrase[1])
ss = ss.substring(0, phrase.index) + ss.substring(phrase.index + phrase[0].length)
}
// Get remaining space-separated words (if any)
ss = ss.trim()
if (ss.length) words = words.concat(ss.split(/\s+/))
for (var k = 0, kl = list.items.length; k < kl; k++) {
var item = list.items[k]
item.found = false
if (!words.length) continue
for (var i = 0, il = words.length; i < il; i++) {
var word_found = false
for (var j = 0, jl = columns.length; j < jl; j++) {
var values = item.values(),
column = columns[j]
if (values.hasOwnProperty(column) && values[column] !== undefined && values[column] !== null) {
var text = typeof values[column] !== 'string' ? values[column].toString() : values[column]
if (text.toLowerCase().indexOf(words[i]) !== -1) {
// word found, so no need to check it against any other columns
word_found = true
break
}
}
}
// this word not found? no need to check any other words, the item cannot match
if (!word_found) break
}
item.found = word_found
}
},
// Removed search.item() and search.values()
reset: function () {
list.reset.search()
list.searched = false
},
}
var searchMethod = function (str) {
list.trigger('searchStart')
prepare.resetList()
prepare.setSearchString(str)
prepare.setOptions(arguments) // str, cols|searchFunction, searchFunction
prepare.setColumns()
if (searchString === '') {
search.reset()
} else {
list.searched = true
if (customSearch) {
customSearch(searchString, columns)
} else {
search.list()
}
}
list.update()
list.trigger('searchComplete')
return list.visibleItems
}
list.handlers.searchStart = list.handlers.searchStart || []
list.handlers.searchComplete = list.handlers.searchComplete || []
list.utils.events.bind(
list.utils.getByClass(list.listContainer, list.searchClass),
'keyup',
list.utils.events.debounce(function (e) {
var target = e.target || e.srcElement, // IE have srcElement
alreadyCleared = target.value === '' && !list.searched
if (!alreadyCleared) {
// If oninput already have resetted the list, do nothing
searchMethod(target.value)
}
}, list.searchDelay)
)
// Used to detect click on HTML5 clear button
list.utils.events.bind(list.utils.getByClass(list.listContainer, list.searchClass), 'input', function (e) {
var target = e.target || e.srcElement
if (target.value === '') {
searchMethod('')
}
})
return searchMethod
}

View file

@ -0,0 +1,104 @@
module.exports = function (list) {
var buttons = {
els: undefined,
clear: function () {
for (var i = 0, il = buttons.els.length; i < il; i++) {
list.utils.classes(buttons.els[i]).remove('asc')
list.utils.classes(buttons.els[i]).remove('desc')
}
},
getOrder: function (btn) {
var predefinedOrder = list.utils.getAttribute(btn, 'data-order')
if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {
return predefinedOrder
} else if (list.utils.classes(btn).has('desc')) {
return 'asc'
} else if (list.utils.classes(btn).has('asc')) {
return 'desc'
} else {
return 'asc'
}
},
getInSensitive: function (btn, options) {
var insensitive = list.utils.getAttribute(btn, 'data-insensitive')
if (insensitive === 'false') {
options.insensitive = false
} else {
options.insensitive = true
}
},
setOrder: function (options) {
for (var i = 0, il = buttons.els.length; i < il; i++) {
var btn = buttons.els[i]
if (list.utils.getAttribute(btn, 'data-sort') !== options.valueName) {
continue
}
var predefinedOrder = list.utils.getAttribute(btn, 'data-order')
if (predefinedOrder == 'asc' || predefinedOrder == 'desc') {
if (predefinedOrder == options.order) {
list.utils.classes(btn).add(options.order)
}
} else {
list.utils.classes(btn).add(options.order)
}
}
},
}
var sort = function () {
list.trigger('sortStart')
var options = {}
var target = arguments[0].currentTarget || arguments[0].srcElement || undefined
if (target) {
options.valueName = list.utils.getAttribute(target, 'data-sort')
buttons.getInSensitive(target, options)
options.order = buttons.getOrder(target)
} else {
options = arguments[1] || options
options.valueName = arguments[0]
options.order = options.order || 'asc'
options.insensitive = typeof options.insensitive == 'undefined' ? true : options.insensitive
}
buttons.clear()
buttons.setOrder(options)
// caseInsensitive
// alphabet
var customSortFunction = options.sortFunction || list.sortFunction || null,
multi = options.order === 'desc' ? -1 : 1,
sortFunction
if (customSortFunction) {
sortFunction = function (itemA, itemB) {
return customSortFunction(itemA, itemB, options) * multi
}
} else {
sortFunction = function (itemA, itemB) {
var sort = list.utils.naturalSort
sort.alphabet = list.alphabet || options.alphabet || undefined
if (!sort.alphabet && options.insensitive) {
sort = list.utils.naturalSort.caseInsensitive
}
return sort(itemA.values()[options.valueName], itemB.values()[options.valueName]) * multi
}
}
list.items.sort(sortFunction)
list.update()
list.trigger('sortComplete')
}
// Add handlers
list.handlers.sortStart = list.handlers.sortStart || []
list.handlers.sortComplete = list.handlers.sortComplete || []
buttons.els = list.utils.getByClass(list.listContainer, list.sortClass)
list.utils.events.bind(buttons.els, 'click', sort)
list.on('searchStart', buttons.clear)
list.on('filterStart', buttons.clear)
return sort
}

View file

@ -0,0 +1,195 @@
var Templater = function (list) {
var createItem,
templater = this
var init = function () {
var itemSource
if (typeof list.item === 'function') {
createItem = function (values) {
var item = list.item(values)
return getItemSource(item)
}
return
}
if (typeof list.item === 'string') {
if (list.item.indexOf('<') === -1) {
itemSource = document.getElementById(list.item)
} else {
itemSource = getItemSource(list.item)
}
} else {
/* If item source does not exists, use the first item in list as
source for new items */
itemSource = getFirstListItem()
}
if (!itemSource) {
throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.")
}
itemSource = createCleanTemplateItem(itemSource, list.valueNames)
createItem = function () {
return itemSource.cloneNode(true)
}
}
var createCleanTemplateItem = function (templateNode, valueNames) {
var el = templateNode.cloneNode(true)
el.removeAttribute('id')
for (var i = 0, il = valueNames.length; i < il; i++) {
var elm = undefined,
valueName = valueNames[i]
if (valueName.data) {
for (var j = 0, jl = valueName.data.length; j < jl; j++) {
el.setAttribute('data-' + valueName.data[j], '')
}
} else if (valueName.attr && valueName.name) {
elm = list.utils.getByClass(el, valueName.name, true)
if (elm) {
elm.setAttribute(valueName.attr, '')
}
} else {
elm = list.utils.getByClass(el, valueName, true)
if (elm) {
elm.innerHTML = ''
}
}
}
return el
}
var getFirstListItem = function () {
var nodes = list.list.childNodes
for (var i = 0, il = nodes.length; i < il; i++) {
// Only textnodes have a data attribute
if (nodes[i].data === undefined) {
return nodes[i].cloneNode(true)
}
}
return undefined
}
var getItemSource = function (itemHTML) {
if (typeof itemHTML !== 'string') return undefined
if (/<tr[\s>]/g.exec(itemHTML)) {
var tbody = document.createElement('tbody')
tbody.innerHTML = itemHTML
return tbody.firstElementChild
} else if (itemHTML.indexOf('<') !== -1) {
var div = document.createElement('div')
div.innerHTML = itemHTML
return div.firstElementChild
}
return undefined
}
var getValueName = function (name) {
for (var i = 0, il = list.valueNames.length; i < il; i++) {
var valueName = list.valueNames[i]
if (valueName.data) {
var data = valueName.data
for (var j = 0, jl = data.length; j < jl; j++) {
if (data[j] === name) {
return { data: name }
}
}
} else if (valueName.attr && valueName.name && valueName.name == name) {
return valueName
} else if (valueName === name) {
return name
}
}
}
var setValue = function (item, name, value) {
var elm = undefined,
valueName = getValueName(name)
if (!valueName) return
if (valueName.data) {
item.elm.setAttribute('data-' + valueName.data, value)
} else if (valueName.attr && valueName.name) {
elm = list.utils.getByClass(item.elm, valueName.name, true)
if (elm) {
elm.setAttribute(valueName.attr, value)
}
} else {
elm = list.utils.getByClass(item.elm, valueName, true)
if (elm) {
elm.innerHTML = value
}
}
}
this.get = function (item, valueNames) {
templater.create(item)
var values = {}
for (var i = 0, il = valueNames.length; i < il; i++) {
var elm = undefined,
valueName = valueNames[i]
if (valueName.data) {
for (var j = 0, jl = valueName.data.length; j < jl; j++) {
values[valueName.data[j]] = list.utils.getAttribute(item.elm, 'data-' + valueName.data[j])
}
} else if (valueName.attr && valueName.name) {
elm = list.utils.getByClass(item.elm, valueName.name, true)
values[valueName.name] = elm ? list.utils.getAttribute(elm, valueName.attr) : ''
} else {
elm = list.utils.getByClass(item.elm, valueName, true)
values[valueName] = elm ? elm.innerHTML : ''
}
}
return values
}
this.set = function (item, values) {
if (!templater.create(item)) {
for (var v in values) {
if (values.hasOwnProperty(v)) {
setValue(item, v, values[v])
}
}
}
}
this.create = function (item) {
if (item.elm !== undefined) {
return false
}
item.elm = createItem(item.values())
templater.set(item, item.values())
return true
}
this.remove = function (item) {
if (item.elm.parentNode === list.list) {
list.list.removeChild(item.elm)
}
}
this.show = function (item) {
templater.create(item)
list.list.appendChild(item.elm)
}
this.hide = function (item) {
if (item.elm !== undefined && item.elm.parentNode === list.list) {
list.list.removeChild(item.elm)
}
}
this.clear = function () {
/* .innerHTML = ''; fucks up IE */
if (list.list.hasChildNodes()) {
while (list.list.childNodes.length >= 1) {
list.list.removeChild(list.list.firstChild)
}
}
}
init()
}
module.exports = function (list) {
return new Templater(list)
}

View file

@ -0,0 +1,162 @@
/**
* Module dependencies.
*/
var index = require('./index-of')
/**
* Whitespace regexp.
*/
var re = /\s+/
/**
* toString reference.
*/
var toString = Object.prototype.toString
/**
* Wrap `el` in a `ClassList`.
*
* @param {Element} el
* @return {ClassList}
* @api public
*/
module.exports = function (el) {
return new ClassList(el)
}
/**
* Initialize a new ClassList for `el`.
*
* @param {Element} el
* @api private
*/
function ClassList(el) {
if (!el || !el.nodeType) {
throw new Error('A DOM element reference is required')
}
this.el = el
this.list = el.classList
}
/**
* Add class `name` if not already present.
*
* @param {String} name
* @return {ClassList}
* @api public
*/
ClassList.prototype.add = function (name) {
// classList
if (this.list) {
this.list.add(name)
return this
}
// fallback
var arr = this.array()
var i = index(arr, name)
if (!~i) arr.push(name)
this.el.className = arr.join(' ')
return this
}
/**
* Remove class `name` when present, or
* pass a regular expression to remove
* any which match.
*
* @param {String|RegExp} name
* @return {ClassList}
* @api public
*/
ClassList.prototype.remove = function (name) {
// classList
if (this.list) {
this.list.remove(name)
return this
}
// fallback
var arr = this.array()
var i = index(arr, name)
if (~i) arr.splice(i, 1)
this.el.className = arr.join(' ')
return this
}
/**
* Toggle class `name`, can force state via `force`.
*
* For browsers that support classList, but do not support `force` yet,
* the mistake will be detected and corrected.
*
* @param {String} name
* @param {Boolean} force
* @return {ClassList}
* @api public
*/
ClassList.prototype.toggle = function (name, force) {
// classList
if (this.list) {
if ('undefined' !== typeof force) {
if (force !== this.list.toggle(name, force)) {
this.list.toggle(name) // toggle again to correct
}
} else {
this.list.toggle(name)
}
return this
}
// fallback
if ('undefined' !== typeof force) {
if (!force) {
this.remove(name)
} else {
this.add(name)
}
} else {
if (this.has(name)) {
this.remove(name)
} else {
this.add(name)
}
}
return this
}
/**
* Return an array of classes.
*
* @return {Array}
* @api public
*/
ClassList.prototype.array = function () {
var className = this.el.getAttribute('class') || ''
var str = className.replace(/^\s+|\s+$/g, '')
var arr = str.split(re)
if ('' === arr[0]) arr.shift()
return arr
}
/**
* Check if class `name` is present.
*
* @param {String} name
* @return {ClassList}
* @api public
*/
ClassList.prototype.has = ClassList.prototype.contains = function (name) {
return this.list ? this.list.contains(name) : !!~index(this.array(), name)
}

View file

@ -0,0 +1,68 @@
var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
prefix = bind !== 'addEventListener' ? 'on' : '',
toArray = require('./to-array')
/**
* Bind `el` event `type` to `fn`.
*
* @param {Element} el, NodeList, HTMLCollection or Array
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @api public
*/
exports.bind = function (el, type, fn, capture) {
el = toArray(el)
for (var i = 0, il = el.length; i < il; i++) {
el[i][bind](prefix + type, fn, capture || false)
}
}
/**
* Unbind `el` event `type`'s callback `fn`.
*
* @param {Element} el, NodeList, HTMLCollection or Array
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @api public
*/
exports.unbind = function (el, type, fn, capture) {
el = toArray(el)
for (var i = 0, il = el.length; i < il; i++) {
el[i][unbind](prefix + type, fn, capture || false)
}
}
/**
* Returns a function, that, as long as it continues to be invoked, will not
* be triggered. The function will be called after it stops being called for
* `wait` milliseconds. If `immediate` is true, trigger the function on the
* leading edge, instead of the trailing.
*
* @param {Function} fn
* @param {Integer} wait
* @param {Boolean} immediate
* @api public
*/
exports.debounce = function (fn, wait, immediate) {
var timeout
return wait
? function () {
var context = this,
args = arguments
var later = function () {
timeout = null
if (!immediate) fn.apply(context, args)
}
var callNow = immediate && !timeout
clearTimeout(timeout)
timeout = setTimeout(later, wait)
if (callNow) fn.apply(context, args)
}
: fn
}

View file

@ -0,0 +1,18 @@
/*
* Source: https://github.com/segmentio/extend
*/
module.exports = function extend(object) {
// Takes an unlimited number of extenders.
var args = Array.prototype.slice.call(arguments, 1)
// For each extender, copy their properties on our object.
for (var i = 0, source; (source = args[i]); i++) {
if (!source) continue
for (var property in source) {
object[property] = source[property]
}
}
return object
}

View file

@ -0,0 +1,123 @@
module.exports = function (text, pattern, options) {
// Aproximately where in the text is the pattern expected to be found?
var Match_Location = options.location || 0
//Determines how close the match must be to the fuzzy location (specified above). An exact letter match which is 'distance' characters away from the fuzzy location would score as a complete mismatch. A distance of '0' requires the match be at the exact location specified, a threshold of '1000' would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
var Match_Distance = options.distance || 100
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything.
var Match_Threshold = options.threshold || 0.4
if (pattern === text) return true // Exact match
if (pattern.length > 32) return false // This algorithm cannot be used
// Set starting location at beginning text and initialise the alphabet.
var loc = Match_Location,
s = (function () {
var q = {},
i
for (i = 0; i < pattern.length; i++) {
q[pattern.charAt(i)] = 0
}
for (i = 0; i < pattern.length; i++) {
q[pattern.charAt(i)] |= 1 << (pattern.length - i - 1)
}
return q
})()
// Compute and return the score for a match with e errors and x location.
// Accesses loc and pattern through being a closure.
function match_bitapScore_(e, x) {
var accuracy = e / pattern.length,
proximity = Math.abs(loc - x)
if (!Match_Distance) {
// Dodge divide by zero error.
return proximity ? 1.0 : accuracy
}
return accuracy + proximity / Match_Distance
}
var score_threshold = Match_Threshold, // Highest score beyond which we give up.
best_loc = text.indexOf(pattern, loc) // Is there a nearby exact match? (speedup)
if (best_loc != -1) {
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)
// What about in the other direction? (speedup)
best_loc = text.lastIndexOf(pattern, loc + pattern.length)
if (best_loc != -1) {
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold)
}
}
// Initialise the bit arrays.
var matchmask = 1 << (pattern.length - 1)
best_loc = -1
var bin_min, bin_mid
var bin_max = pattern.length + text.length
var last_rd
for (var d = 0; d < pattern.length; d++) {
// Scan for the best match; each iteration allows for one more error.
// Run a binary search to determine how far from 'loc' we can stray at this
// error level.
bin_min = 0
bin_mid = bin_max
while (bin_min < bin_mid) {
if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {
bin_min = bin_mid
} else {
bin_max = bin_mid
}
bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min)
}
// Use the result from this iteration as the maximum for the next.
bin_max = bin_mid
var start = Math.max(1, loc - bin_mid + 1)
var finish = Math.min(loc + bin_mid, text.length) + pattern.length
var rd = Array(finish + 2)
rd[finish + 1] = (1 << d) - 1
for (var j = finish; j >= start; j--) {
// The alphabet (s) is a sparse hash, so the following line generates
// warnings.
var charMatch = s[text.charAt(j - 1)]
if (d === 0) {
// First pass: exact match.
rd[j] = ((rd[j + 1] << 1) | 1) & charMatch
} else {
// Subsequent passes: fuzzy match.
rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) | (((last_rd[j + 1] | last_rd[j]) << 1) | 1) | last_rd[j + 1]
}
if (rd[j] & matchmask) {
var score = match_bitapScore_(d, j - 1)
// This match will almost certainly be better than any existing match.
// But check anyway.
if (score <= score_threshold) {
// Told you so.
score_threshold = score
best_loc = j - 1
if (best_loc > loc) {
// When passing loc, don't exceed our current distance from loc.
start = Math.max(1, 2 * loc - best_loc)
} else {
// Already passed loc, downhill from here on in.
break
}
}
}
}
// No hope for a (better) match at greater error levels.
if (match_bitapScore_(d + 1, loc) > score_threshold) {
break
}
last_rd = rd
}
return best_loc < 0 ? false : true
}

View file

@ -0,0 +1,26 @@
/**
* A cross-browser implementation of getAttribute.
* Source found here: http://stackoverflow.com/a/3755343/361337 written by Vivin Paliath
*
* Return the value for `attr` at `element`.
*
* @param {Element} el
* @param {String} attr
* @api public
*/
module.exports = function (el, attr) {
var result = (el.getAttribute && el.getAttribute(attr)) || null
if (!result) {
var attrs = el.attributes
var length = attrs.length
for (var i = 0; i < length; i++) {
if (attrs[i] !== undefined) {
if (attrs[i].nodeName === attr) {
result = attrs[i].nodeValue
}
}
}
}
return result
}

View file

@ -0,0 +1,63 @@
/**
* A cross-browser implementation of getElementsByClass.
* Heavily based on Dustin Diaz's function: http://dustindiaz.com/getelementsbyclass.
*
* Find all elements with class `className` inside `container`.
* Use `single = true` to increase performance in older browsers
* when only one element is needed.
*
* @param {String} className
* @param {Element} container
* @param {Boolean} single
* @api public
*/
var getElementsByClassName = function (container, className, single) {
if (single) {
return container.getElementsByClassName(className)[0]
} else {
return container.getElementsByClassName(className)
}
}
var querySelector = function (container, className, single) {
className = '.' + className
if (single) {
return container.querySelector(className)
} else {
return container.querySelectorAll(className)
}
}
var polyfill = function (container, className, single) {
var classElements = [],
tag = '*'
var els = container.getElementsByTagName(tag)
var elsLen = els.length
var pattern = new RegExp('(^|\\s)' + className + '(\\s|$)')
for (var i = 0, j = 0; i < elsLen; i++) {
if (pattern.test(els[i].className)) {
if (single) {
return els[i]
} else {
classElements[j] = els[i]
j++
}
}
}
return classElements
}
module.exports = (function () {
return function (container, className, single, options) {
options = options || {}
if ((options.test && options.getElementsByClassName) || (!options.test && document.getElementsByClassName)) {
return getElementsByClassName(container, className, single)
} else if ((options.test && options.querySelector) || (!options.test && document.querySelector)) {
return querySelector(container, className, single)
} else {
return polyfill(container, className, single)
}
}
})()

View file

@ -0,0 +1,9 @@
var indexOf = [].indexOf
module.exports = function(arr, obj){
if (indexOf) return arr.indexOf(obj);
for (var i = 0, il = arr.length; i < il; ++i) {
if (arr[i] === obj) return i;
}
return -1
}

View file

@ -0,0 +1,33 @@
/**
* Source: https://github.com/timoxley/to-array
*
* Convert an array-like object into an `Array`.
* If `collection` is already an `Array`, then will return a clone of `collection`.
*
* @param {Array | Mixed} collection An `Array` or array-like object to convert e.g. `arguments` or `NodeList`
* @return {Array} Naive conversion of `collection` to a new `Array`.
* @api public
*/
module.exports = function toArray(collection) {
if (typeof collection === 'undefined') return []
if (collection === null) return [null]
if (collection === window) return [window]
if (typeof collection === 'string') return [collection]
if (isArray(collection)) return collection
if (typeof collection.length != 'number') return [collection]
if (typeof collection === 'function' && collection instanceof Function) return [collection]
var arr = [];
for (var i = 0, il = collection.length; i < il; i++) {
if (Object.prototype.hasOwnProperty.call(collection, i) || i in collection) {
arr.push(collection[i])
}
}
if (!arr.length) return []
return arr
}
function isArray(arr) {
return Object.prototype.toString.call(arr) === '[object Array]'
}

View file

@ -0,0 +1,6 @@
module.exports = function (s) {
s = s === undefined ? '' : s
s = s === null ? '' : s
s = s.toString()
return s
}