index.js.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <title>Code coverage report for humanize-byte/index.js</title>
  5. <meta charset="utf-8">
  6. <link rel="stylesheet" href="../prettify.css">
  7. <style>
  8. body, html {
  9. margin:0; padding: 0;
  10. }
  11. body {
  12. font-family: Helvetica Neue, Helvetica,Arial;
  13. font-size: 10pt;
  14. }
  15. div.header, div.footer {
  16. background: #eee;
  17. padding: 1em;
  18. }
  19. div.header {
  20. z-index: 100;
  21. position: fixed;
  22. top: 0;
  23. border-bottom: 1px solid #666;
  24. width: 100%;
  25. }
  26. div.footer {
  27. border-top: 1px solid #666;
  28. }
  29. div.body {
  30. margin-top: 10em;
  31. }
  32. div.meta {
  33. font-size: 90%;
  34. text-align: center;
  35. }
  36. h1, h2, h3 {
  37. font-weight: normal;
  38. }
  39. h1 {
  40. font-size: 12pt;
  41. }
  42. h2 {
  43. font-size: 10pt;
  44. }
  45. pre {
  46. font-family: Consolas, Menlo, Monaco, monospace;
  47. margin: 0;
  48. padding: 0;
  49. line-height: 14px;
  50. font-size: 14px;
  51. -moz-tab-size: 2;
  52. -o-tab-size: 2;
  53. tab-size: 2;
  54. }
  55. div.path { font-size: 110%; }
  56. div.path a:link, div.path a:visited { color: #000; }
  57. table.coverage { border-collapse: collapse; margin:0; padding: 0 }
  58. table.coverage td {
  59. margin: 0;
  60. padding: 0;
  61. color: #111;
  62. vertical-align: top;
  63. }
  64. table.coverage td.line-count {
  65. width: 50px;
  66. text-align: right;
  67. padding-right: 5px;
  68. }
  69. table.coverage td.line-coverage {
  70. color: #777 !important;
  71. text-align: right;
  72. border-left: 1px solid #666;
  73. border-right: 1px solid #666;
  74. }
  75. table.coverage td.text {
  76. }
  77. table.coverage td span.cline-any {
  78. display: inline-block;
  79. padding: 0 5px;
  80. width: 40px;
  81. }
  82. table.coverage td span.cline-neutral {
  83. background: #eee;
  84. }
  85. table.coverage td span.cline-yes {
  86. background: #b5d592;
  87. color: #999;
  88. }
  89. table.coverage td span.cline-no {
  90. background: #fc8c84;
  91. }
  92. .cstat-yes { color: #111; }
  93. .cstat-no { background: #fc8c84; color: #111; }
  94. .fstat-no { background: #ffc520; color: #111 !important; }
  95. .cbranch-no { background: yellow !important; color: #111; }
  96. .cstat-skip { background: #ddd; color: #111; }
  97. .fstat-skip { background: #ddd; color: #111 !important; }
  98. .cbranch-skip { background: #ddd !important; color: #111; }
  99. .missing-if-branch {
  100. display: inline-block;
  101. margin-right: 10px;
  102. position: relative;
  103. padding: 0 4px;
  104. background: black;
  105. color: yellow;
  106. }
  107. .skip-if-branch {
  108. display: none;
  109. margin-right: 10px;
  110. position: relative;
  111. padding: 0 4px;
  112. background: #ccc;
  113. color: white;
  114. }
  115. .missing-if-branch .typ, .skip-if-branch .typ {
  116. color: inherit !important;
  117. }
  118. .entity, .metric { font-weight: bold; }
  119. .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
  120. .metric small { font-size: 80%; font-weight: normal; color: #666; }
  121. div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
  122. div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
  123. div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
  124. div.coverage-summary th.file { border-right: none !important; }
  125. div.coverage-summary th.pic { border-left: none !important; text-align: right; }
  126. div.coverage-summary th.pct { border-right: none !important; }
  127. div.coverage-summary th.abs { border-left: none !important; text-align: right; }
  128. div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
  129. div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
  130. div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; }
  131. div.coverage-summary td.pic { min-width: 120px !important; }
  132. div.coverage-summary a:link { text-decoration: none; color: #000; }
  133. div.coverage-summary a:visited { text-decoration: none; color: #333; }
  134. div.coverage-summary a:hover { text-decoration: underline; }
  135. div.coverage-summary tfoot td { border-top: 1px solid #666; }
  136. div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator {
  137. height: 10px;
  138. width: 7px;
  139. display: inline-block;
  140. margin-left: 0.5em;
  141. }
  142. div.coverage-summary .yui3-datatable-sort-indicator {
  143. background: url("https://yui-s.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent;
  144. }
  145. div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator {
  146. background-position: 0 -20px;
  147. }
  148. div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator {
  149. background-position: 0 -10px;
  150. }
  151. .high { background: #b5d592 !important; }
  152. .medium { background: #ffe87c !important; }
  153. .low { background: #fc8c84 !important; }
  154. span.cover-fill, span.cover-empty {
  155. display:inline-block;
  156. border:1px solid #444;
  157. background: white;
  158. height: 12px;
  159. }
  160. span.cover-fill {
  161. background: #ccc;
  162. border-right: 1px solid #444;
  163. }
  164. span.cover-empty {
  165. background: white;
  166. border-left: none;
  167. }
  168. span.cover-full {
  169. border-right: none !important;
  170. }
  171. pre.prettyprint {
  172. border: none !important;
  173. padding: 0 !important;
  174. margin: 0 !important;
  175. }
  176. .com { color: #999 !important; }
  177. .ignore-none { color: #999; font-weight: normal; }
  178. </style>
  179. </head>
  180. <body>
  181. <div class="header high">
  182. <h1>Code coverage report for <span class="entity">humanize-byte/index.js</span></h1>
  183. <h2>
  184. Statements: <span class="metric">100% <small>(5 / 5)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
  185. Branches: <span class="metric">100% <small>(2 / 2)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
  186. Functions: <span class="metric">100% <small>(1 / 1)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
  187. Lines: <span class="metric">100% <small>(5 / 5)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
  188. Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
  189. </h2>
  190. <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">humanize-byte/</a> &#187; index.js</div>
  191. </div>
  192. <div class="body">
  193. <pre><table class="coverage">
  194. <tr><td class="line-count">1
  195. 2
  196. 3
  197. 4
  198. 5
  199. 6
  200. 7
  201. 8
  202. 9
  203. 10
  204. 11
  205. 12
  206. 13
  207. 14
  208. 15
  209. 16
  210. 17
  211. 18
  212. 19
  213. 20
  214. 21
  215. 22</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
  216. <span class="cline-any cline-neutral">&nbsp;</span>
  217. <span class="cline-any cline-neutral">&nbsp;</span>
  218. <span class="cline-any cline-neutral">&nbsp;</span>
  219. <span class="cline-any cline-neutral">&nbsp;</span>
  220. <span class="cline-any cline-neutral">&nbsp;</span>
  221. <span class="cline-any cline-neutral">&nbsp;</span>
  222. <span class="cline-any cline-neutral">&nbsp;</span>
  223. <span class="cline-any cline-neutral">&nbsp;</span>
  224. <span class="cline-any cline-neutral">&nbsp;</span>
  225. <span class="cline-any cline-neutral">&nbsp;</span>
  226. <span class="cline-any cline-neutral">&nbsp;</span>
  227. <span class="cline-any cline-yes">1</span>
  228. <span class="cline-any cline-neutral">&nbsp;</span>
  229. <span class="cline-any cline-yes">1</span>
  230. <span class="cline-any cline-yes">2</span>
  231. <span class="cline-any cline-yes">1</span>
  232. <span class="cline-any cline-neutral">&nbsp;</span>
  233. <span class="cline-any cline-neutral">&nbsp;</span>
  234. <span class="cline-any cline-yes">1</span>
  235. <span class="cline-any cline-neutral">&nbsp;</span>
  236. <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/*!
  237. * humanize-byte - index.js
  238. * Copyright(c) 2014 dead_horse &lt;dead_horse@qq.com&gt;
  239. * MIT Licensed
  240. */
  241. &nbsp;
  242. 'use strict';
  243. &nbsp;
  244. /**
  245. * Module dependencies.
  246. */
  247. &nbsp;
  248. var bytes = require('bytes');
  249. &nbsp;
  250. module.exports = function (size) {
  251. if (typeof size === 'number') {
  252. return size;
  253. }
  254. &nbsp;
  255. return bytes(size);
  256. }
  257. &nbsp;</pre></td></tr>
  258. </table></pre>
  259. </div>
  260. <div class="footer">
  261. <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Aug 28 2014 13:41:57 GMT+0800 (CST)</div>
  262. </div>
  263. <script src="../prettify.js"></script>
  264. <script src="https://yui-s.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
  265. <script>
  266. YUI().use('datatable', function (Y) {
  267. var formatters = {
  268. pct: function (o) {
  269. o.className += o.record.get('classes')[o.column.key];
  270. try {
  271. return o.value.toFixed(2) + '%';
  272. } catch (ex) { return o.value + '%'; }
  273. },
  274. html: function (o) {
  275. o.className += o.record.get('classes')[o.column.key];
  276. return o.record.get(o.column.key + '_html');
  277. }
  278. },
  279. defaultFormatter = function (o) {
  280. o.className += o.record.get('classes')[o.column.key];
  281. return o.value;
  282. };
  283. function getColumns(theadNode) {
  284. var colNodes = theadNode.all('tr th'),
  285. cols = [],
  286. col;
  287. colNodes.each(function (colNode) {
  288. col = {
  289. key: colNode.getAttribute('data-col'),
  290. label: colNode.get('innerHTML') || ' ',
  291. sortable: !colNode.getAttribute('data-nosort'),
  292. className: colNode.getAttribute('class'),
  293. type: colNode.getAttribute('data-type'),
  294. allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html'
  295. };
  296. col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter;
  297. cols.push(col);
  298. });
  299. return cols;
  300. }
  301. function getRowData(trNode, cols) {
  302. var tdNodes = trNode.all('td'),
  303. i,
  304. row = { classes: {} },
  305. node,
  306. name;
  307. for (i = 0; i < cols.length; i += 1) {
  308. name = cols[i].key;
  309. node = tdNodes.item(i);
  310. row[name] = node.getAttribute('data-value') || node.get('innerHTML');
  311. row[name + '_html'] = node.get('innerHTML');
  312. row.classes[name] = node.getAttribute('class');
  313. //Y.log('Name: ' + name + '; Value: ' + row[name]);
  314. if (cols[i].type === 'number') { row[name] = row[name] * 1; }
  315. }
  316. //Y.log(row);
  317. return row;
  318. }
  319. function getData(tbodyNode, cols) {
  320. var data = [];
  321. tbodyNode.all('tr').each(function (trNode) {
  322. data.push(getRowData(trNode, cols));
  323. });
  324. return data;
  325. }
  326. function replaceTable(node) {
  327. if (!node) { return; }
  328. var cols = getColumns(node.one('thead')),
  329. data = getData(node.one('tbody'), cols),
  330. table,
  331. parent = node.get('parentNode');
  332. table = new Y.DataTable({
  333. columns: cols,
  334. data: data,
  335. sortBy: 'file'
  336. });
  337. parent.set('innerHTML', '');
  338. table.render(parent);
  339. }
  340. Y.on('domready', function () {
  341. replaceTable(Y.one('div.coverage-summary table'));
  342. if (typeof prettyPrint === 'function') {
  343. prettyPrint();
  344. }
  345. });
  346. });
  347. </script>
  348. </body>
  349. </html>