From a57b11b4519755338bb35e62cf75f069daef471a Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 27 Jun 2026 20:46:09 +0200 Subject: [PATCH] feat: math docs --- coverage/base.css | 224 --- coverage/block-navigation.js | 87 - coverage/clover.xml | 261 --- coverage/coverage-final.json | 13 - coverage/favicon.png | Bin 445 -> 0 bytes coverage/index.html | 161 -- coverage/prettify.css | 1 - coverage/prettify.js | 2 - coverage/sort-arrow-sprite.png | Bin 138 -> 0 bytes coverage/sorter.js | 210 -- coverage/src/base/index.html | 146 -- coverage/src/base/index.ts.html | 217 --- coverage/src/base/mixin.ts.html | 259 --- coverage/src/index.html | 146 -- coverage/src/index.ts.html | 100 - coverage/src/internal.ts.html | 262 --- coverage/src/mixin/array.ts.html | 2383 ----------------------- coverage/src/mixin/awaited.ts.html | 493 ----- coverage/src/mixin/base.ts.html | 343 ---- coverage/src/mixin/index.html | 176 -- coverage/src/mixin/math.ts.html | 1150 ----------- coverage/src/mixin/math/index.html | 116 -- coverage/src/mixin/math/swizzle.ts.html | 1054 ---------- coverage/src/mixin/optional.ts.html | 946 --------- coverage/src/registry.ts.html | 172 -- src/mixin/math.ts | 399 +++- 26 files changed, 390 insertions(+), 8931 deletions(-) delete mode 100644 coverage/base.css delete mode 100644 coverage/block-navigation.js delete mode 100644 coverage/clover.xml delete mode 100644 coverage/coverage-final.json delete mode 100644 coverage/favicon.png delete mode 100644 coverage/index.html delete mode 100644 coverage/prettify.css delete mode 100644 coverage/prettify.js delete mode 100644 coverage/sort-arrow-sprite.png delete mode 100644 coverage/sorter.js delete mode 100644 coverage/src/base/index.html delete mode 100644 coverage/src/base/index.ts.html delete mode 100644 coverage/src/base/mixin.ts.html delete mode 100644 coverage/src/index.html delete mode 100644 coverage/src/index.ts.html delete mode 100644 coverage/src/internal.ts.html delete mode 100644 coverage/src/mixin/array.ts.html delete mode 100644 coverage/src/mixin/awaited.ts.html delete mode 100644 coverage/src/mixin/base.ts.html delete mode 100644 coverage/src/mixin/index.html delete mode 100644 coverage/src/mixin/math.ts.html delete mode 100644 coverage/src/mixin/math/index.html delete mode 100644 coverage/src/mixin/math/swizzle.ts.html delete mode 100644 coverage/src/mixin/optional.ts.html delete mode 100644 coverage/src/registry.ts.html diff --git a/coverage/base.css b/coverage/base.css deleted file mode 100644 index f418035..0000000 --- a/coverage/base.css +++ /dev/null @@ -1,224 +0,0 @@ -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; -} diff --git a/coverage/block-navigation.js b/coverage/block-navigation.js deleted file mode 100644 index 530d1ed..0000000 --- a/coverage/block-navigation.js +++ /dev/null @@ -1,87 +0,0 @@ -/* 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) > ` - - // Selector 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) { - if ( - document.getElementById('fileSearch') === document.activeElement && - document.activeElement != null - ) { - // if we're currently focused on the search input, we don't want to navigate - return; - } - - 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); diff --git a/coverage/clover.xml b/coverage/clover.xml deleted file mode 100644 index d7c98ac..0000000 --- a/coverage/clover.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json deleted file mode 100644 index cd48553..0000000 --- a/coverage/coverage-final.json +++ /dev/null @@ -1,13 +0,0 @@ -{"/home/anton/Projects/fluent/src/index.ts": {"path":"/home/anton/Projects/fluent/src/index.ts","statementMap":{"0":{"start":{"line":4,"column":13},"end":{"line":4,"column":null}},"1":{"start":{"line":5,"column":17},"end":{"line":5,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":3,"1":3},"f":{},"b":{},"meta":{"lastBranch":0,"lastFunction":0,"lastStatement":2,"seen":{"s:4:13:4:Infinity":0,"s:5:17:5:Infinity":1},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/internal.ts": {"path":"/home/anton/Projects/fluent/src/internal.ts","statementMap":{"0":{"start":{"line":8,"column":21},"end":{"line":8,"column":null}},"1":{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},"2":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"3":{"start":{"line":23,"column":1},"end":{"line":28,"column":null}},"4":{"start":{"line":24,"column":2},"end":{"line":28,"column":null}},"5":{"start":{"line":26,"column":19},"end":{"line":26,"column":34}}},"fnMap":{"0":{"name":"constructor","decl":{"start":{"line":13,"column":1},"end":{"line":13,"column":8}},"loc":{"start":{"line":13,"column":34},"end":{"line":16,"column":null}},"line":13},"1":{"name":"assert","decl":{"start":{"line":19,"column":16},"end":{"line":19,"column":null}},"loc":{"start":{"line":22,"column":21},"end":{"line":29,"column":null}},"line":22},"2":{"name":"(anonymous_2)","decl":{"start":{"line":26,"column":5},"end":{"line":26,"column":13}},"loc":{"start":{"line":26,"column":19},"end":{"line":26,"column":34}},"line":26},"3":{"name":"assertType","decl":{"start":{"line":32,"column":16},"end":{"line":32,"column":30}},"loc":{"start":{"line":32,"column":60},"end":{"line":34,"column":null}},"line":32}},"branchMap":{"0":{"loc":{"start":{"line":23,"column":1},"end":{"line":28,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":1},"end":{"line":28,"column":null}},{"start":{},"end":{}}],"line":23}},"s":{"0":9,"1":2,"2":2,"3":57,"4":2,"5":4},"f":{"0":2,"1":57,"2":4,"3":402},"b":{"0":[2,55]},"meta":{"lastBranch":1,"lastFunction":4,"lastStatement":6,"seen":{"s:8:21:8:Infinity":0,"f:13:1:13:8":0,"s:14:2:14:Infinity":1,"s:15:2:15:Infinity":2,"f:19:16:19:Infinity":1,"b:23:1:28:Infinity:undefined:undefined:undefined:undefined":0,"s:23:1:28:Infinity":3,"s:24:2:28:Infinity":4,"f:26:5:26:13":2,"s:26:19:26:34":5,"f:32:16:32:30":3},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/registry.ts": {"path":"/home/anton/Projects/fluent/src/registry.ts","statementMap":{"0":{"start":{"line":10,"column":32},"end":{"line":16,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":3},"f":{},"b":{},"meta":{"lastBranch":0,"lastFunction":0,"lastStatement":1,"seen":{"s:10:32:16:Infinity":0},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/base/hkt.ts": {"path":"/home/anton/Projects/fluent/src/base/hkt.ts","statementMap":{},"fnMap":{},"branchMap":{},"s":{},"f":{},"b":{},"meta":{"lastBranch":0,"lastFunction":0,"lastStatement":0,"seen":{},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/base/index.ts": {"path":"/home/anton/Projects/fluent/src/base/index.ts","statementMap":{"0":{"start":{"line":31,"column":7},"end":{"line":41,"column":null}},"1":{"start":{"line":33,"column":12},"end":{"line":33,"column":null}},"2":{"start":{"line":35,"column":2},"end":{"line":38,"column":null}},"3":{"start":{"line":37,"column":3},"end":{"line":37,"column":null}},"4":{"start":{"line":40,"column":2},"end":{"line":40,"column":null}},"5":{"start":{"line":43,"column":1},"end":{"line":43,"column":null}}},"fnMap":{"0":{"name":"makeFluent","decl":{"start":{"line":28,"column":16},"end":{"line":28,"column":null}},"loc":{"start":{"line":30,"column":2},"end":{"line":44,"column":null}},"line":30},"1":{"name":"(anonymous_1)","decl":{"start":{"line":31,"column":7},"end":{"line":31,"column":26}},"loc":{"start":{"line":31,"column":39},"end":{"line":41,"column":null}},"line":31}},"branchMap":{},"s":{"0":9,"1":251,"2":251,"3":416,"4":251,"5":9},"f":{"0":9,"1":251},"b":{},"meta":{"lastBranch":0,"lastFunction":2,"lastStatement":6,"seen":{"f:28:16:28:Infinity":0,"s:31:7:41:Infinity":0,"f:31:7:31:26":1,"s:33:12:33:Infinity":1,"s:35:2:38:Infinity":2,"s:37:3:37:Infinity":3,"s:40:2:40:Infinity":4,"s:43:1:43:Infinity":5},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/base/mixin.ts": {"path":"/home/anton/Projects/fluent/src/base/mixin.ts","statementMap":{"0":{"start":{"line":24,"column":1},"end":{"line":27,"column":null}}},"fnMap":{"0":{"name":"Mixin","decl":{"start":{"line":23,"column":16},"end":{"line":23,"column":42}},"loc":{"start":{"line":23,"column":65},"end":{"line":28,"column":null}},"line":23}},"branchMap":{},"s":{"0":22},"f":{"0":22},"b":{},"meta":{"lastBranch":0,"lastFunction":1,"lastStatement":1,"seen":{"f:23:16:23:42":0,"s:24:1:27:Infinity":0},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/mixin/array.ts": {"path":"/home/anton/Projects/fluent/src/mixin/array.ts","statementMap":{"0":{"start":{"line":133,"column":1},"end":{"line":133,"column":null}},"1":{"start":{"line":467,"column":13},"end":{"line":569,"column":null}},"2":{"start":{"line":468,"column":1},"end":{"line":468,"column":null}},"3":{"start":{"line":468,"column":22},"end":{"line":468,"column":null}},"4":{"start":{"line":470,"column":1},"end":{"line":472,"column":null}},"5":{"start":{"line":471,"column":2},"end":{"line":471,"column":null}},"6":{"start":{"line":474,"column":1},"end":{"line":477,"column":null}},"7":{"start":{"line":475,"column":2},"end":{"line":475,"column":null}},"8":{"start":{"line":476,"column":2},"end":{"line":476,"column":null}},"9":{"start":{"line":479,"column":1},"end":{"line":487,"column":null}},"10":{"start":{"line":480,"column":2},"end":{"line":480,"column":null}},"11":{"start":{"line":481,"column":2},"end":{"line":481,"column":null}},"12":{"start":{"line":481,"column":19},"end":{"line":481,"column":null}},"13":{"start":{"line":482,"column":2},"end":{"line":486,"column":null}},"14":{"start":{"line":489,"column":1},"end":{"line":491,"column":null}},"15":{"start":{"line":490,"column":2},"end":{"line":490,"column":null}},"16":{"start":{"line":493,"column":1},"end":{"line":495,"column":null}},"17":{"start":{"line":494,"column":2},"end":{"line":494,"column":null}},"18":{"start":{"line":496,"column":1},"end":{"line":496,"column":null}},"19":{"start":{"line":497,"column":1},"end":{"line":503,"column":null}},"20":{"start":{"line":499,"column":3},"end":{"line":501,"column":null}},"21":{"start":{"line":500,"column":24},"end":{"line":500,"column":53}},"22":{"start":{"line":505,"column":1},"end":{"line":510,"column":null}},"23":{"start":{"line":509,"column":2},"end":{"line":509,"column":null}},"24":{"start":{"line":511,"column":1},"end":{"line":511,"column":null}},"25":{"start":{"line":512,"column":1},"end":{"line":519,"column":null}},"26":{"start":{"line":517,"column":3},"end":{"line":517,"column":null}},"27":{"start":{"line":521,"column":1},"end":{"line":523,"column":null}},"28":{"start":{"line":522,"column":2},"end":{"line":522,"column":null}},"29":{"start":{"line":525,"column":1},"end":{"line":535,"column":null}},"30":{"start":{"line":532,"column":2},"end":{"line":534,"column":null}},"31":{"start":{"line":533,"column":28},"end":{"line":533,"column":49}},"32":{"start":{"line":536,"column":1},"end":{"line":536,"column":null}},"33":{"start":{"line":537,"column":1},"end":{"line":564,"column":null}},"34":{"start":{"line":539,"column":34},"end":{"line":541,"column":null}},"35":{"start":{"line":544,"column":3},"end":{"line":546,"column":null}},"36":{"start":{"line":545,"column":30},"end":{"line":545,"column":55}},"37":{"start":{"line":549,"column":34},"end":{"line":551,"column":null}},"38":{"start":{"line":554,"column":3},"end":{"line":554,"column":null}},"39":{"start":{"line":554,"column":42},"end":{"line":554,"column":57}},"40":{"start":{"line":557,"column":34},"end":{"line":559,"column":null}},"41":{"start":{"line":562,"column":3},"end":{"line":562,"column":null}},"42":{"start":{"line":562,"column":42},"end":{"line":562,"column":57}},"43":{"start":{"line":566,"column":1},"end":{"line":568,"column":null}},"44":{"start":{"line":567,"column":2},"end":{"line":567,"column":null}}},"fnMap":{"0":{"name":"isArray","decl":{"start":{"line":132,"column":9},"end":{"line":132,"column":17}},"loc":{"start":{"line":132,"column":54},"end":{"line":134,"column":null}},"line":132},"1":{"name":"(anonymous_1)","decl":{"start":{"line":467,"column":21},"end":{"line":467,"column":35}},"loc":{"start":{"line":467,"column":56},"end":{"line":569,"column":1}},"line":467},"2":{"name":"(anonymous_2)","decl":{"start":{"line":470,"column":3},"end":{"line":470,"column":9}},"loc":{"start":{"line":470,"column":27},"end":{"line":472,"column":null}},"line":470},"3":{"name":"(anonymous_3)","decl":{"start":{"line":474,"column":3},"end":{"line":474,"column":11}},"loc":{"start":{"line":474,"column":53},"end":{"line":477,"column":null}},"line":474},"4":{"name":"(anonymous_4)","decl":{"start":{"line":479,"column":3},"end":{"line":479,"column":13}},"loc":{"start":{"line":479,"column":31},"end":{"line":487,"column":null}},"line":479},"5":{"name":"(anonymous_5)","decl":{"start":{"line":489,"column":3},"end":{"line":489,"column":10}},"loc":{"start":{"line":489,"column":55},"end":{"line":491,"column":null}},"line":489},"6":{"name":"(anonymous_6)","decl":{"start":{"line":493,"column":3},"end":{"line":493,"column":13}},"loc":{"start":{"line":493,"column":58},"end":{"line":495,"column":null}},"line":493},"7":{"name":"(anonymous_7)","decl":{"start":{"line":498,"column":2},"end":{"line":498,"column":14}},"loc":{"start":{"line":498,"column":14},"end":{"line":502,"column":null}},"line":498},"8":{"name":"(anonymous_8)","decl":{"start":{"line":500,"column":10},"end":{"line":500,"column":18}},"loc":{"start":{"line":500,"column":24},"end":{"line":500,"column":53}},"line":500},"9":{"name":"(anonymous_9)","decl":{"start":{"line":505,"column":3},"end":{"line":505,"column":null}},"loc":{"start":{"line":508,"column":6},"end":{"line":510,"column":null}},"line":508},"10":{"name":"(anonymous_10)","decl":{"start":{"line":513,"column":2},"end":{"line":513,"column":null}},"loc":{"start":{"line":516,"column":7},"end":{"line":518,"column":null}},"line":516},"11":{"name":"(anonymous_11)","decl":{"start":{"line":521,"column":3},"end":{"line":521,"column":18}},"loc":{"start":{"line":521,"column":18},"end":{"line":523,"column":null}},"line":521},"12":{"name":"(anonymous_12)","decl":{"start":{"line":525,"column":3},"end":{"line":525,"column":null}},"loc":{"start":{"line":531,"column":6},"end":{"line":535,"column":null}},"line":531},"13":{"name":"(anonymous_13)","decl":{"start":{"line":533,"column":9},"end":{"line":533,"column":19}},"loc":{"start":{"line":533,"column":28},"end":{"line":533,"column":49}},"line":533},"14":{"name":"(anonymous_14)","decl":{"start":{"line":538,"column":2},"end":{"line":538,"column":null}},"loc":{"start":{"line":543,"column":7},"end":{"line":547,"column":null}},"line":543},"15":{"name":"(anonymous_15)","decl":{"start":{"line":539,"column":3},"end":{"line":539,"column":34}},"loc":{"start":{"line":539,"column":34},"end":{"line":541,"column":null}},"line":539},"16":{"name":"(anonymous_16)","decl":{"start":{"line":545,"column":10},"end":{"line":545,"column":20}},"loc":{"start":{"line":545,"column":30},"end":{"line":545,"column":55}},"line":545},"17":{"name":"(anonymous_17)","decl":{"start":{"line":548,"column":2},"end":{"line":548,"column":null}},"loc":{"start":{"line":553,"column":7},"end":{"line":555,"column":null}},"line":553},"18":{"name":"(anonymous_18)","decl":{"start":{"line":549,"column":3},"end":{"line":549,"column":34}},"loc":{"start":{"line":549,"column":34},"end":{"line":551,"column":null}},"line":549},"19":{"name":"(anonymous_19)","decl":{"start":{"line":554,"column":23},"end":{"line":554,"column":33}},"loc":{"start":{"line":554,"column":42},"end":{"line":554,"column":57}},"line":554},"20":{"name":"(anonymous_20)","decl":{"start":{"line":556,"column":2},"end":{"line":556,"column":null}},"loc":{"start":{"line":561,"column":7},"end":{"line":563,"column":null}},"line":561},"21":{"name":"(anonymous_21)","decl":{"start":{"line":557,"column":3},"end":{"line":557,"column":34}},"loc":{"start":{"line":557,"column":34},"end":{"line":559,"column":null}},"line":557},"22":{"name":"(anonymous_22)","decl":{"start":{"line":562,"column":23},"end":{"line":562,"column":33}},"loc":{"start":{"line":562,"column":42},"end":{"line":562,"column":57}},"line":562},"23":{"name":"(anonymous_23)","decl":{"start":{"line":566,"column":3},"end":{"line":566,"column":19}},"loc":{"start":{"line":566,"column":19},"end":{"line":568,"column":null}},"line":566}},"branchMap":{"0":{"loc":{"start":{"line":133,"column":8},"end":{"line":133,"column":null}},"type":"binary-expr","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":33}},{"start":{"line":133,"column":33},"end":{"line":133,"column":null}}],"line":133},"1":{"loc":{"start":{"line":468,"column":1},"end":{"line":468,"column":null}},"type":"if","locations":[{"start":{"line":468,"column":1},"end":{"line":468,"column":null}},{"start":{},"end":{}}],"line":468},"2":{"loc":{"start":{"line":481,"column":2},"end":{"line":481,"column":null}},"type":"if","locations":[{"start":{"line":481,"column":2},"end":{"line":481,"column":null}},{"start":{},"end":{}}],"line":481},"3":{"loc":{"start":{"line":500,"column":24},"end":{"line":500,"column":53}},"type":"binary-expr","locations":[{"start":{"line":500,"column":24},"end":{"line":500,"column":38}},{"start":{"line":500,"column":38},"end":{"line":500,"column":53}}],"line":500},"4":{"loc":{"start":{"line":539,"column":3},"end":{"line":541,"column":null}},"type":"default-arg","locations":[{"start":{"line":539,"column":3},"end":{"line":541,"column":null}}],"line":539},"5":{"loc":{"start":{"line":545,"column":30},"end":{"line":545,"column":55}},"type":"cond-expr","locations":[{"start":{"line":545,"column":48},"end":{"line":545,"column":53}},{"start":{"line":545,"column":53},"end":{"line":545,"column":55}}],"line":545},"6":{"loc":{"start":{"line":549,"column":3},"end":{"line":551,"column":null}},"type":"default-arg","locations":[{"start":{"line":549,"column":3},"end":{"line":551,"column":null}}],"line":549},"7":{"loc":{"start":{"line":557,"column":3},"end":{"line":559,"column":null}},"type":"default-arg","locations":[{"start":{"line":557,"column":3},"end":{"line":559,"column":null}}],"line":557}},"s":{"0":80,"1":4,"2":80,"3":28,"4":52,"5":8,"6":52,"7":2,"8":2,"9":52,"10":3,"11":3,"12":1,"13":2,"14":52,"15":2,"16":52,"17":2,"18":52,"19":52,"20":2,"21":8,"22":52,"23":2,"24":52,"25":52,"26":2,"27":52,"28":2,"29":52,"30":2,"31":23,"32":52,"33":52,"34":16,"35":1,"36":8,"37":18,"38":2,"39":11,"40":16,"41":2,"42":10,"43":52,"44":1},"f":{"0":80,"1":80,"2":8,"3":2,"4":3,"5":2,"6":2,"7":2,"8":8,"9":2,"10":2,"11":2,"12":2,"13":23,"14":1,"15":16,"16":8,"17":2,"18":18,"19":11,"20":2,"21":16,"22":10,"23":1},"b":{"0":[80,54],"1":[28,52],"2":[1,2],"3":[8,7],"4":[16],"5":[3,5],"6":[18],"7":[16]},"meta":{"lastBranch":8,"lastFunction":24,"lastStatement":45,"seen":{"f:132:9:132:17":0,"s:133:1:133:Infinity":0,"b:133:8:133:33:133:33:133:Infinity":0,"s:467:13:569:Infinity":1,"f:467:21:467:35":1,"b:468:1:468:Infinity:undefined:undefined:undefined:undefined":1,"s:468:1:468:Infinity":2,"s:468:22:468:Infinity":3,"s:470:1:472:Infinity":4,"f:470:3:470:9":2,"s:471:2:471:Infinity":5,"s:474:1:477:Infinity":6,"f:474:3:474:11":3,"s:475:2:475:Infinity":7,"s:476:2:476:Infinity":8,"s:479:1:487:Infinity":9,"f:479:3:479:13":4,"s:480:2:480:Infinity":10,"b:481:2:481:Infinity:undefined:undefined:undefined:undefined":2,"s:481:2:481:Infinity":11,"s:481:19:481:Infinity":12,"s:482:2:486:Infinity":13,"s:489:1:491:Infinity":14,"f:489:3:489:10":5,"s:490:2:490:Infinity":15,"s:493:1:495:Infinity":16,"f:493:3:493:13":6,"s:494:2:494:Infinity":17,"s:496:1:496:Infinity":18,"s:497:1:503:Infinity":19,"f:498:2:498:14":7,"s:499:3:501:Infinity":20,"f:500:10:500:18":8,"s:500:24:500:53":21,"b:500:24:500:38:500:38:500:53":3,"s:505:1:510:Infinity":22,"f:505:3:505:Infinity":9,"s:509:2:509:Infinity":23,"s:511:1:511:Infinity":24,"s:512:1:519:Infinity":25,"f:513:2:513:Infinity":10,"s:517:3:517:Infinity":26,"s:521:1:523:Infinity":27,"f:521:3:521:18":11,"s:522:2:522:Infinity":28,"s:525:1:535:Infinity":29,"f:525:3:525:Infinity":12,"s:532:2:534:Infinity":30,"f:533:9:533:19":13,"s:533:28:533:49":31,"s:536:1:536:Infinity":32,"s:537:1:564:Infinity":33,"f:538:2:538:Infinity":14,"b:539:3:541:Infinity":4,"f:539:3:539:34":15,"s:539:34:541:Infinity":34,"s:544:3:546:Infinity":35,"f:545:10:545:20":16,"s:545:30:545:55":36,"b:545:48:545:53:545:53:545:55":5,"f:548:2:548:Infinity":17,"b:549:3:551:Infinity":6,"f:549:3:549:34":18,"s:549:34:551:Infinity":37,"s:554:3:554:Infinity":38,"f:554:23:554:33":19,"s:554:42:554:57":39,"f:556:2:556:Infinity":20,"b:557:3:559:Infinity":7,"f:557:3:557:34":21,"s:557:34:559:Infinity":40,"s:562:3:562:Infinity":41,"f:562:23:562:33":22,"s:562:42:562:57":42,"s:566:1:568:Infinity":43,"f:566:3:566:19":23,"s:567:2:567:Infinity":44},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/mixin/awaited.ts": {"path":"/home/anton/Projects/fluent/src/mixin/awaited.ts","statementMap":{"0":{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},"1":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"2":{"start":{"line":48,"column":13},"end":{"line":103,"column":null}},"3":{"start":{"line":49,"column":1},"end":{"line":49,"column":null}},"4":{"start":{"line":49,"column":34},"end":{"line":49,"column":null}},"5":{"start":{"line":51,"column":1},"end":{"line":53,"column":null}},"6":{"start":{"line":52,"column":2},"end":{"line":52,"column":null}},"7":{"start":{"line":55,"column":1},"end":{"line":102,"column":null}},"8":{"start":{"line":58,"column":41},"end":{"line":60,"column":null}},"9":{"start":{"line":59,"column":4},"end":{"line":59,"column":null}},"10":{"start":{"line":62,"column":31},"end":{"line":62,"column":null}},"11":{"start":{"line":64,"column":17},"end":{"line":98,"column":null}},"12":{"start":{"line":64,"column":49},"end":{"line":64,"column":56}},"13":{"start":{"line":66,"column":5},"end":{"line":67,"column":null}},"14":{"start":{"line":67,"column":6},"end":{"line":67,"column":null}},"15":{"start":{"line":67,"column":27},"end":{"line":67,"column":34}},"16":{"start":{"line":68,"column":5},"end":{"line":68,"column":null}},"17":{"start":{"line":69,"column":5},"end":{"line":69,"column":null}},"18":{"start":{"line":72,"column":5},"end":{"line":95,"column":null}},"19":{"start":{"line":73,"column":25},"end":{"line":73,"column":null}},"20":{"start":{"line":74,"column":6},"end":{"line":85,"column":null}},"21":{"start":{"line":75,"column":7},"end":{"line":79,"column":null}},"22":{"start":{"line":80,"column":7},"end":{"line":82,"column":null}},"23":{"start":{"line":84,"column":7},"end":{"line":84,"column":null}},"24":{"start":{"line":87,"column":6},"end":{"line":87,"column":null}},"25":{"start":{"line":88,"column":6},"end":{"line":92,"column":null}},"26":{"start":{"line":94,"column":6},"end":{"line":94,"column":null}},"27":{"start":{"line":96,"column":5},"end":{"line":96,"column":null}},"28":{"start":{"line":100,"column":3},"end":{"line":100,"column":null}}},"fnMap":{"0":{"name":"constructor","decl":{"start":{"line":13,"column":1},"end":{"line":13,"column":8}},"loc":{"start":{"line":13,"column":30},"end":{"line":15,"column":null}},"line":13},"1":{"name":"(anonymous_1)","decl":{"start":{"line":17,"column":13},"end":{"line":17,"column":21}},"loc":{"start":{"line":17,"column":21},"end":{"line":23,"column":null}},"line":17},"2":{"name":"(anonymous_2)","decl":{"start":{"line":48,"column":26},"end":{"line":48,"column":45}},"loc":{"start":{"line":48,"column":66},"end":{"line":103,"column":1}},"line":48},"3":{"name":"(anonymous_3)","decl":{"start":{"line":51,"column":3},"end":{"line":51,"column":11}},"loc":{"start":{"line":51,"column":53},"end":{"line":53,"column":null}},"line":51},"4":{"name":"get","decl":{"start":{"line":57,"column":2},"end":{"line":57,"column":8}},"loc":{"start":{"line":57,"column":8},"end":{"line":101,"column":null}},"line":57},"5":{"name":"(anonymous_5)","decl":{"start":{"line":58,"column":47},"end":{"line":58,"column":53}},"loc":{"start":{"line":59,"column":4},"end":{"line":59,"column":null}},"line":59},"6":{"name":"(anonymous_6)","decl":{"start":{"line":64,"column":21},"end":{"line":64,"column":28}},"loc":{"start":{"line":64,"column":49},"end":{"line":64,"column":56}},"line":64},"7":{"name":"(anonymous_7)","decl":{"start":{"line":65,"column":4},"end":{"line":65,"column":10}},"loc":{"start":{"line":65,"column":21},"end":{"line":70,"column":null}},"line":65},"8":{"name":"(anonymous_8)","decl":{"start":{"line":67,"column":15},"end":{"line":67,"column":21}},"loc":{"start":{"line":67,"column":27},"end":{"line":67,"column":34}},"line":67},"9":{"name":"(anonymous_9)","decl":{"start":{"line":71,"column":4},"end":{"line":71,"column":12}},"loc":{"start":{"line":71,"column":49},"end":{"line":97,"column":null}},"line":71},"10":{"name":"(anonymous_10)","decl":{"start":{"line":72,"column":11},"end":{"line":72,"column":17}},"loc":{"start":{"line":72,"column":23},"end":{"line":95,"column":6}},"line":72}},"branchMap":{"0":{"loc":{"start":{"line":49,"column":1},"end":{"line":49,"column":null}},"type":"if","locations":[{"start":{"line":49,"column":1},"end":{"line":49,"column":null}},{"start":{},"end":{}}],"line":49},"1":{"loc":{"start":{"line":66,"column":5},"end":{"line":67,"column":null}},"type":"if","locations":[{"start":{"line":66,"column":5},"end":{"line":67,"column":null}},{"start":{},"end":{}}],"line":66},"2":{"loc":{"start":{"line":76,"column":8},"end":{"line":78,"column":null}},"type":"binary-expr","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":null}},{"start":{"line":77,"column":9},"end":{"line":77,"column":null}},{"start":{"line":78,"column":9},"end":{"line":78,"column":null}}],"line":76}},"s":{"0":0,"1":0,"2":4,"3":45,"4":42,"5":3,"6":1,"7":3,"8":1,"9":1,"10":1,"11":1,"12":1,"13":2,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1},"f":{"0":0,"1":0,"2":45,"3":1,"4":1,"5":1,"6":1,"7":2,"8":1,"9":1,"10":1},"b":{"0":[42,3],"1":[1,1],"2":[1,1,1]},"meta":{"lastBranch":3,"lastFunction":11,"lastStatement":29,"seen":{"f:13:1:13:8":0,"s:14:2:14:Infinity":0,"f:17:13:17:21":1,"s:18:2:18:Infinity":1,"s:48:13:103:Infinity":2,"f:48:26:48:45":2,"b:49:1:49:Infinity:undefined:undefined:undefined:undefined":0,"s:49:1:49:Infinity":3,"s:49:34:49:Infinity":4,"s:51:1:53:Infinity":5,"f:51:3:51:11":3,"s:52:2:52:Infinity":6,"s:55:1:102:Infinity":7,"f:57:2:57:8":4,"s:58:41:60:Infinity":8,"f:58:47:58:53":5,"s:59:4:59:Infinity":9,"s:62:31:62:Infinity":10,"s:64:17:98:Infinity":11,"f:64:21:64:28":6,"s:64:49:64:56":12,"f:65:4:65:10":7,"b:66:5:67:Infinity:undefined:undefined:undefined:undefined":1,"s:66:5:67:Infinity":13,"s:67:6:67:Infinity":14,"f:67:15:67:21":8,"s:67:27:67:34":15,"s:68:5:68:Infinity":16,"s:69:5:69:Infinity":17,"f:71:4:71:12":9,"s:72:5:95:Infinity":18,"f:72:11:72:17":10,"s:73:25:73:Infinity":19,"s:74:6:85:Infinity":20,"s:75:7:79:Infinity":21,"b:76:8:76:Infinity:77:9:77:Infinity:78:9:78:Infinity":2,"s:80:7:82:Infinity":22,"s:84:7:84:Infinity":23,"s:87:6:87:Infinity":24,"s:88:6:92:Infinity":25,"s:94:6:94:Infinity":26,"s:96:5:96:Infinity":27,"s:100:3:100:Infinity":28},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/mixin/base.ts": {"path":"/home/anton/Projects/fluent/src/mixin/base.ts","statementMap":{"0":{"start":{"line":47,"column":13},"end":{"line":56,"column":null}},"1":{"start":{"line":48,"column":1},"end":{"line":51,"column":null}},"2":{"start":{"line":49,"column":2},"end":{"line":49,"column":null}},"3":{"start":{"line":50,"column":2},"end":{"line":50,"column":null}},"4":{"start":{"line":53,"column":1},"end":{"line":55,"column":null}},"5":{"start":{"line":54,"column":2},"end":{"line":54,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":47,"column":20},"end":{"line":47,"column":33}},"loc":{"start":{"line":47,"column":54},"end":{"line":56,"column":1}},"line":47},"1":{"name":"(anonymous_1)","decl":{"start":{"line":48,"column":3},"end":{"line":48,"column":10}},"loc":{"start":{"line":48,"column":49},"end":{"line":51,"column":null}},"line":48},"2":{"name":"(anonymous_2)","decl":{"start":{"line":53,"column":3},"end":{"line":53,"column":16}},"loc":{"start":{"line":53,"column":58},"end":{"line":55,"column":null}},"line":53}},"branchMap":{},"s":{"0":5,"1":52,"2":2,"3":2,"4":52,"5":5},"f":{"0":52,"1":2,"2":5},"b":{},"meta":{"lastBranch":0,"lastFunction":3,"lastStatement":6,"seen":{"s:47:13:56:Infinity":0,"f:47:20:47:33":0,"s:48:1:51:Infinity":1,"f:48:3:48:10":1,"s:49:2:49:Infinity":2,"s:50:2:50:Infinity":3,"s:53:1:55:Infinity":4,"f:53:3:53:16":2,"s:54:2:54:Infinity":5},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/mixin/math.ts": {"path":"/home/anton/Projects/fluent/src/mixin/math.ts","statementMap":{"0":{"start":{"line":138,"column":10},"end":{"line":138,"column":null}},"1":{"start":{"line":140,"column":13},"end":{"line":213,"column":null}},"2":{"start":{"line":141,"column":1},"end":{"line":212,"column":null}},"3":{"start":{"line":142,"column":2},"end":{"line":142,"column":null}},"4":{"start":{"line":142,"column":29},"end":{"line":142,"column":null}},"5":{"start":{"line":143,"column":2},"end":{"line":143,"column":null}},"6":{"start":{"line":143,"column":34},"end":{"line":143,"column":null}},"7":{"start":{"line":144,"column":2},"end":{"line":144,"column":null}},"8":{"start":{"line":144,"column":35},"end":{"line":144,"column":null}},"9":{"start":{"line":145,"column":2},"end":{"line":145,"column":null}},"10":{"start":{"line":145,"column":32},"end":{"line":145,"column":null}},"11":{"start":{"line":146,"column":2},"end":{"line":146,"column":null}},"12":{"start":{"line":146,"column":17},"end":{"line":146,"column":null}},"13":{"start":{"line":147,"column":2},"end":{"line":147,"column":null}},"14":{"start":{"line":147,"column":34},"end":{"line":147,"column":null}},"15":{"start":{"line":148,"column":2},"end":{"line":148,"column":null}},"16":{"start":{"line":148,"column":31},"end":{"line":148,"column":null}},"17":{"start":{"line":149,"column":2},"end":{"line":153,"column":null}},"18":{"start":{"line":150,"column":3},"end":{"line":151,"column":null}},"19":{"start":{"line":151,"column":4},"end":{"line":151,"column":null}},"20":{"start":{"line":152,"column":3},"end":{"line":152,"column":null}},"21":{"start":{"line":155,"column":2},"end":{"line":160,"column":null}},"22":{"start":{"line":159,"column":3},"end":{"line":159,"column":null}},"23":{"start":{"line":162,"column":2},"end":{"line":162,"column":null}},"24":{"start":{"line":162,"column":18},"end":{"line":162,"column":null}},"25":{"start":{"line":163,"column":2},"end":{"line":163,"column":null}},"26":{"start":{"line":163,"column":17},"end":{"line":163,"column":null}},"27":{"start":{"line":164,"column":2},"end":{"line":164,"column":null}},"28":{"start":{"line":164,"column":18},"end":{"line":164,"column":null}},"29":{"start":{"line":165,"column":2},"end":{"line":165,"column":null}},"30":{"start":{"line":165,"column":19},"end":{"line":165,"column":null}},"31":{"start":{"line":167,"column":2},"end":{"line":167,"column":null}},"32":{"start":{"line":167,"column":16},"end":{"line":167,"column":null}},"33":{"start":{"line":168,"column":2},"end":{"line":168,"column":null}},"34":{"start":{"line":168,"column":19},"end":{"line":168,"column":null}},"35":{"start":{"line":169,"column":2},"end":{"line":169,"column":null}},"36":{"start":{"line":169,"column":17},"end":{"line":169,"column":null}},"37":{"start":{"line":171,"column":2},"end":{"line":172,"column":null}},"38":{"start":{"line":172,"column":3},"end":{"line":172,"column":null}},"39":{"start":{"line":173,"column":2},"end":{"line":174,"column":null}},"40":{"start":{"line":174,"column":3},"end":{"line":174,"column":null}},"41":{"start":{"line":175,"column":2},"end":{"line":176,"column":null}},"42":{"start":{"line":176,"column":3},"end":{"line":176,"column":null}},"43":{"start":{"line":177,"column":2},"end":{"line":178,"column":null}},"44":{"start":{"line":178,"column":3},"end":{"line":178,"column":null}},"45":{"start":{"line":180,"column":2},"end":{"line":181,"column":null}},"46":{"start":{"line":181,"column":3},"end":{"line":181,"column":null}},"47":{"start":{"line":183,"column":2},"end":{"line":183,"column":null}},"48":{"start":{"line":183,"column":16},"end":{"line":183,"column":null}},"49":{"start":{"line":184,"column":2},"end":{"line":184,"column":null}},"50":{"start":{"line":184,"column":17},"end":{"line":184,"column":null}},"51":{"start":{"line":185,"column":2},"end":{"line":185,"column":null}},"52":{"start":{"line":185,"column":16},"end":{"line":185,"column":null}},"53":{"start":{"line":186,"column":2},"end":{"line":186,"column":null}},"54":{"start":{"line":186,"column":17},"end":{"line":186,"column":null}},"55":{"start":{"line":187,"column":2},"end":{"line":187,"column":null}},"56":{"start":{"line":187,"column":16},"end":{"line":187,"column":null}},"57":{"start":{"line":188,"column":2},"end":{"line":188,"column":null}},"58":{"start":{"line":188,"column":17},"end":{"line":188,"column":null}},"59":{"start":{"line":189,"column":2},"end":{"line":189,"column":null}},"60":{"start":{"line":189,"column":27},"end":{"line":189,"column":null}},"61":{"start":{"line":191,"column":2},"end":{"line":191,"column":null}},"62":{"start":{"line":191,"column":17},"end":{"line":191,"column":null}},"63":{"start":{"line":192,"column":2},"end":{"line":192,"column":null}},"64":{"start":{"line":192,"column":18},"end":{"line":192,"column":null}},"65":{"start":{"line":193,"column":2},"end":{"line":193,"column":null}},"66":{"start":{"line":193,"column":17},"end":{"line":193,"column":null}},"67":{"start":{"line":194,"column":2},"end":{"line":194,"column":null}},"68":{"start":{"line":194,"column":18},"end":{"line":194,"column":null}},"69":{"start":{"line":195,"column":2},"end":{"line":195,"column":null}},"70":{"start":{"line":195,"column":17},"end":{"line":195,"column":null}},"71":{"start":{"line":196,"column":2},"end":{"line":196,"column":null}},"72":{"start":{"line":196,"column":18},"end":{"line":196,"column":null}},"73":{"start":{"line":198,"column":21},"end":{"line":198,"column":null}},"74":{"start":{"line":199,"column":21},"end":{"line":199,"column":null}},"75":{"start":{"line":201,"column":2},"end":{"line":201,"column":null}},"76":{"start":{"line":202,"column":2},"end":{"line":202,"column":null}},"77":{"start":{"line":203,"column":2},"end":{"line":206,"column":null}},"78":{"start":{"line":204,"column":18},"end":{"line":204,"column":null}},"79":{"start":{"line":205,"column":18},"end":{"line":205,"column":null}},"80":{"start":{"line":207,"column":8},"end":{"line":212,"column":null}},"81":{"start":{"line":209,"column":21},"end":{"line":209,"column":42}},"82":{"start":{"line":211,"column":2},"end":{"line":211,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":140,"column":20},"end":{"line":140,"column":33}},"loc":{"start":{"line":140,"column":54},"end":{"line":213,"column":1}},"line":140},"1":{"name":"(anonymous_1)","decl":{"start":{"line":142,"column":4},"end":{"line":142,"column":11}},"loc":{"start":{"line":142,"column":29},"end":{"line":142,"column":null}},"line":142},"2":{"name":"(anonymous_2)","decl":{"start":{"line":143,"column":4},"end":{"line":143,"column":16}},"loc":{"start":{"line":143,"column":34},"end":{"line":143,"column":null}},"line":143},"3":{"name":"(anonymous_3)","decl":{"start":{"line":144,"column":4},"end":{"line":144,"column":16}},"loc":{"start":{"line":144,"column":35},"end":{"line":144,"column":null}},"line":144},"4":{"name":"(anonymous_4)","decl":{"start":{"line":145,"column":4},"end":{"line":145,"column":11}},"loc":{"start":{"line":145,"column":32},"end":{"line":145,"column":null}},"line":145},"5":{"name":"(anonymous_5)","decl":{"start":{"line":146,"column":4},"end":{"line":146,"column":17}},"loc":{"start":{"line":146,"column":17},"end":{"line":146,"column":null}},"line":146},"6":{"name":"(anonymous_6)","decl":{"start":{"line":147,"column":4},"end":{"line":147,"column":14}},"loc":{"start":{"line":147,"column":34},"end":{"line":147,"column":null}},"line":147},"7":{"name":"(anonymous_7)","decl":{"start":{"line":148,"column":4},"end":{"line":148,"column":11}},"loc":{"start":{"line":148,"column":31},"end":{"line":148,"column":null}},"line":148},"8":{"name":"(anonymous_8)","decl":{"start":{"line":149,"column":4},"end":{"line":149,"column":11}},"loc":{"start":{"line":149,"column":29},"end":{"line":153,"column":null}},"line":149},"9":{"name":"(anonymous_9)","decl":{"start":{"line":155,"column":4},"end":{"line":155,"column":null}},"loc":{"start":{"line":158,"column":7},"end":{"line":160,"column":null}},"line":158},"10":{"name":"(anonymous_10)","decl":{"start":{"line":162,"column":4},"end":{"line":162,"column":18}},"loc":{"start":{"line":162,"column":18},"end":{"line":162,"column":null}},"line":162},"11":{"name":"(anonymous_11)","decl":{"start":{"line":163,"column":4},"end":{"line":163,"column":17}},"loc":{"start":{"line":163,"column":17},"end":{"line":163,"column":null}},"line":163},"12":{"name":"(anonymous_12)","decl":{"start":{"line":164,"column":4},"end":{"line":164,"column":18}},"loc":{"start":{"line":164,"column":18},"end":{"line":164,"column":null}},"line":164},"13":{"name":"(anonymous_13)","decl":{"start":{"line":165,"column":4},"end":{"line":165,"column":19}},"loc":{"start":{"line":165,"column":19},"end":{"line":165,"column":null}},"line":165},"14":{"name":"(anonymous_14)","decl":{"start":{"line":167,"column":4},"end":{"line":167,"column":16}},"loc":{"start":{"line":167,"column":16},"end":{"line":167,"column":null}},"line":167},"15":{"name":"(anonymous_15)","decl":{"start":{"line":168,"column":4},"end":{"line":168,"column":19}},"loc":{"start":{"line":168,"column":19},"end":{"line":168,"column":null}},"line":168},"16":{"name":"(anonymous_16)","decl":{"start":{"line":169,"column":4},"end":{"line":169,"column":17}},"loc":{"start":{"line":169,"column":17},"end":{"line":169,"column":null}},"line":169},"17":{"name":"(anonymous_17)","decl":{"start":{"line":171,"column":4},"end":{"line":171,"column":11}},"loc":{"start":{"line":172,"column":3},"end":{"line":172,"column":null}},"line":172},"18":{"name":"(anonymous_18)","decl":{"start":{"line":173,"column":4},"end":{"line":173,"column":11}},"loc":{"start":{"line":174,"column":3},"end":{"line":174,"column":null}},"line":174},"19":{"name":"(anonymous_19)","decl":{"start":{"line":175,"column":4},"end":{"line":175,"column":13}},"loc":{"start":{"line":176,"column":3},"end":{"line":176,"column":null}},"line":176},"20":{"name":"(anonymous_20)","decl":{"start":{"line":177,"column":4},"end":{"line":177,"column":15}},"loc":{"start":{"line":178,"column":3},"end":{"line":178,"column":null}},"line":178},"21":{"name":"(anonymous_21)","decl":{"start":{"line":180,"column":4},"end":{"line":180,"column":12}},"loc":{"start":{"line":181,"column":3},"end":{"line":181,"column":null}},"line":181},"22":{"name":"(anonymous_22)","decl":{"start":{"line":183,"column":4},"end":{"line":183,"column":16}},"loc":{"start":{"line":183,"column":16},"end":{"line":183,"column":null}},"line":183},"23":{"name":"(anonymous_23)","decl":{"start":{"line":184,"column":4},"end":{"line":184,"column":17}},"loc":{"start":{"line":184,"column":17},"end":{"line":184,"column":null}},"line":184},"24":{"name":"(anonymous_24)","decl":{"start":{"line":185,"column":4},"end":{"line":185,"column":16}},"loc":{"start":{"line":185,"column":16},"end":{"line":185,"column":null}},"line":185},"25":{"name":"(anonymous_25)","decl":{"start":{"line":186,"column":4},"end":{"line":186,"column":17}},"loc":{"start":{"line":186,"column":17},"end":{"line":186,"column":null}},"line":186},"26":{"name":"(anonymous_26)","decl":{"start":{"line":187,"column":4},"end":{"line":187,"column":16}},"loc":{"start":{"line":187,"column":16},"end":{"line":187,"column":null}},"line":187},"27":{"name":"(anonymous_27)","decl":{"start":{"line":188,"column":4},"end":{"line":188,"column":17}},"loc":{"start":{"line":188,"column":17},"end":{"line":188,"column":null}},"line":188},"28":{"name":"(anonymous_28)","decl":{"start":{"line":189,"column":4},"end":{"line":189,"column":13}},"loc":{"start":{"line":189,"column":27},"end":{"line":189,"column":null}},"line":189},"29":{"name":"(anonymous_29)","decl":{"start":{"line":191,"column":4},"end":{"line":191,"column":17}},"loc":{"start":{"line":191,"column":17},"end":{"line":191,"column":null}},"line":191},"30":{"name":"(anonymous_30)","decl":{"start":{"line":192,"column":4},"end":{"line":192,"column":18}},"loc":{"start":{"line":192,"column":18},"end":{"line":192,"column":null}},"line":192},"31":{"name":"(anonymous_31)","decl":{"start":{"line":193,"column":4},"end":{"line":193,"column":17}},"loc":{"start":{"line":193,"column":17},"end":{"line":193,"column":null}},"line":193},"32":{"name":"(anonymous_32)","decl":{"start":{"line":194,"column":4},"end":{"line":194,"column":18}},"loc":{"start":{"line":194,"column":18},"end":{"line":194,"column":null}},"line":194},"33":{"name":"(anonymous_33)","decl":{"start":{"line":195,"column":4},"end":{"line":195,"column":17}},"loc":{"start":{"line":195,"column":17},"end":{"line":195,"column":null}},"line":195},"34":{"name":"(anonymous_34)","decl":{"start":{"line":196,"column":4},"end":{"line":196,"column":18}},"loc":{"start":{"line":196,"column":18},"end":{"line":196,"column":null}},"line":196},"35":{"name":"(anonymous_35)","decl":{"start":{"line":204,"column":3},"end":{"line":204,"column":18}},"loc":{"start":{"line":204,"column":18},"end":{"line":204,"column":null}},"line":204},"36":{"name":"(anonymous_36)","decl":{"start":{"line":205,"column":3},"end":{"line":205,"column":18}},"loc":{"start":{"line":205,"column":18},"end":{"line":205,"column":null}},"line":205},"37":{"name":"(anonymous_37)","decl":{"start":{"line":209,"column":8},"end":{"line":209,"column":15}},"loc":{"start":{"line":209,"column":21},"end":{"line":209,"column":42}},"line":209}},"branchMap":{"0":{"loc":{"start":{"line":141,"column":1},"end":{"line":212,"column":null}},"type":"if","locations":[{"start":{"line":141,"column":1},"end":{"line":212,"column":null}},{"start":{"line":207,"column":8},"end":{"line":212,"column":null}}],"line":141},"1":{"loc":{"start":{"line":150,"column":3},"end":{"line":151,"column":null}},"type":"if","locations":[{"start":{"line":150,"column":3},"end":{"line":151,"column":null}},{"start":{},"end":{}}],"line":150},"2":{"loc":{"start":{"line":157,"column":3},"end":{"line":157,"column":null}},"type":"default-arg","locations":[{"start":{"line":157,"column":19},"end":{"line":157,"column":null}}],"line":157},"3":{"loc":{"start":{"line":207,"column":8},"end":{"line":212,"column":null}},"type":"if","locations":[{"start":{"line":207,"column":8},"end":{"line":212,"column":null}},{"start":{},"end":{}}],"line":207},"4":{"loc":{"start":{"line":208,"column":2},"end":{"line":209,"column":null}},"type":"binary-expr","locations":[{"start":{"line":208,"column":2},"end":{"line":208,"column":null}},{"start":{"line":209,"column":2},"end":{"line":209,"column":null}}],"line":208}},"s":{"0":5,"1":5,"2":181,"3":128,"4":1,"5":128,"6":1,"7":128,"8":1,"9":128,"10":1,"11":128,"12":1,"13":128,"14":0,"15":128,"16":1,"17":128,"18":2,"19":1,"20":1,"21":128,"22":3,"23":128,"24":4,"25":128,"26":4,"27":128,"28":4,"29":128,"30":1,"31":128,"32":2,"33":128,"34":5,"35":128,"36":3,"37":128,"38":1,"39":128,"40":1,"41":128,"42":3,"43":128,"44":1,"45":128,"46":5,"47":128,"48":1,"49":128,"50":0,"51":128,"52":1,"53":128,"54":1,"55":128,"56":1,"57":128,"58":1,"59":128,"60":1,"61":128,"62":1,"63":128,"64":1,"65":128,"66":1,"67":128,"68":1,"69":128,"70":1,"71":128,"72":1,"73":128,"74":128,"75":128,"76":128,"77":128,"78":1,"79":1,"80":53,"81":118,"82":31},"f":{"0":181,"1":1,"2":1,"3":1,"4":1,"5":1,"6":0,"7":1,"8":2,"9":3,"10":4,"11":4,"12":4,"13":1,"14":2,"15":5,"16":3,"17":1,"18":1,"19":3,"20":1,"21":5,"22":1,"23":0,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"37":118},"b":{"0":[128,53],"1":[1,1],"2":[3],"3":[31,22],"4":[53,39]},"meta":{"lastBranch":5,"lastFunction":38,"lastStatement":83,"seen":{"s:138:10:138:Infinity":0,"s:140:13:213:Infinity":1,"f:140:20:140:33":0,"b:141:1:212:Infinity:207:8:212:Infinity":0,"s:141:1:212:Infinity":2,"s:142:2:142:Infinity":3,"f:142:4:142:11":1,"s:142:29:142:Infinity":4,"s:143:2:143:Infinity":5,"f:143:4:143:16":2,"s:143:34:143:Infinity":6,"s:144:2:144:Infinity":7,"f:144:4:144:16":3,"s:144:35:144:Infinity":8,"s:145:2:145:Infinity":9,"f:145:4:145:11":4,"s:145:32:145:Infinity":10,"s:146:2:146:Infinity":11,"f:146:4:146:17":5,"s:146:17:146:Infinity":12,"s:147:2:147:Infinity":13,"f:147:4:147:14":6,"s:147:34:147:Infinity":14,"s:148:2:148:Infinity":15,"f:148:4:148:11":7,"s:148:31:148:Infinity":16,"s:149:2:153:Infinity":17,"f:149:4:149:11":8,"b:150:3:151:Infinity:undefined:undefined:undefined:undefined":1,"s:150:3:151:Infinity":18,"s:151:4:151:Infinity":19,"s:152:3:152:Infinity":20,"s:155:2:160:Infinity":21,"f:155:4:155:Infinity":9,"b:157:19:157:Infinity":2,"s:159:3:159:Infinity":22,"s:162:2:162:Infinity":23,"f:162:4:162:18":10,"s:162:18:162:Infinity":24,"s:163:2:163:Infinity":25,"f:163:4:163:17":11,"s:163:17:163:Infinity":26,"s:164:2:164:Infinity":27,"f:164:4:164:18":12,"s:164:18:164:Infinity":28,"s:165:2:165:Infinity":29,"f:165:4:165:19":13,"s:165:19:165:Infinity":30,"s:167:2:167:Infinity":31,"f:167:4:167:16":14,"s:167:16:167:Infinity":32,"s:168:2:168:Infinity":33,"f:168:4:168:19":15,"s:168:19:168:Infinity":34,"s:169:2:169:Infinity":35,"f:169:4:169:17":16,"s:169:17:169:Infinity":36,"s:171:2:172:Infinity":37,"f:171:4:171:11":17,"s:172:3:172:Infinity":38,"s:173:2:174:Infinity":39,"f:173:4:173:11":18,"s:174:3:174:Infinity":40,"s:175:2:176:Infinity":41,"f:175:4:175:13":19,"s:176:3:176:Infinity":42,"s:177:2:178:Infinity":43,"f:177:4:177:15":20,"s:178:3:178:Infinity":44,"s:180:2:181:Infinity":45,"f:180:4:180:12":21,"s:181:3:181:Infinity":46,"s:183:2:183:Infinity":47,"f:183:4:183:16":22,"s:183:16:183:Infinity":48,"s:184:2:184:Infinity":49,"f:184:4:184:17":23,"s:184:17:184:Infinity":50,"s:185:2:185:Infinity":51,"f:185:4:185:16":24,"s:185:16:185:Infinity":52,"s:186:2:186:Infinity":53,"f:186:4:186:17":25,"s:186:17:186:Infinity":54,"s:187:2:187:Infinity":55,"f:187:4:187:16":26,"s:187:16:187:Infinity":56,"s:188:2:188:Infinity":57,"f:188:4:188:17":27,"s:188:17:188:Infinity":58,"s:189:2:189:Infinity":59,"f:189:4:189:13":28,"s:189:27:189:Infinity":60,"s:191:2:191:Infinity":61,"f:191:4:191:17":29,"s:191:17:191:Infinity":62,"s:192:2:192:Infinity":63,"f:192:4:192:18":30,"s:192:18:192:Infinity":64,"s:193:2:193:Infinity":65,"f:193:4:193:17":31,"s:193:17:193:Infinity":66,"s:194:2:194:Infinity":67,"f:194:4:194:18":32,"s:194:18:194:Infinity":68,"s:195:2:195:Infinity":69,"f:195:4:195:17":33,"s:195:17:195:Infinity":70,"s:196:2:196:Infinity":71,"f:196:4:196:18":34,"s:196:18:196:Infinity":72,"s:198:21:198:Infinity":73,"s:199:21:199:Infinity":74,"s:201:2:201:Infinity":75,"s:202:2:202:Infinity":76,"s:203:2:206:Infinity":77,"f:204:3:204:18":35,"s:204:18:204:Infinity":78,"f:205:3:205:18":36,"s:205:18:205:Infinity":79,"b:207:8:212:Infinity:undefined:undefined:undefined:undefined":3,"s:207:8:212:Infinity":80,"b:208:2:208:Infinity:209:2:209:Infinity":4,"f:209:8:209:15":37,"s:209:21:209:42":81,"s:211:2:211:Infinity":82},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/mixin/optional.ts": {"path":"/home/anton/Projects/fluent/src/mixin/optional.ts","statementMap":{"0":{"start":{"line":16,"column":1},"end":{"line":16,"column":null}},"1":{"start":{"line":164,"column":13},"end":{"line":223,"column":null}},"2":{"start":{"line":165,"column":1},"end":{"line":214,"column":null}},"3":{"start":{"line":166,"column":2},"end":{"line":168,"column":null}},"4":{"start":{"line":167,"column":3},"end":{"line":167,"column":null}},"5":{"start":{"line":170,"column":2},"end":{"line":172,"column":null}},"6":{"start":{"line":171,"column":3},"end":{"line":171,"column":null}},"7":{"start":{"line":173,"column":2},"end":{"line":173,"column":null}},"8":{"start":{"line":174,"column":2},"end":{"line":178,"column":null}},"9":{"start":{"line":176,"column":4},"end":{"line":176,"column":null}},"10":{"start":{"line":180,"column":2},"end":{"line":182,"column":null}},"11":{"start":{"line":181,"column":3},"end":{"line":181,"column":null}},"12":{"start":{"line":183,"column":2},"end":{"line":183,"column":null}},"13":{"start":{"line":184,"column":2},"end":{"line":188,"column":null}},"14":{"start":{"line":186,"column":4},"end":{"line":186,"column":null}},"15":{"start":{"line":190,"column":2},"end":{"line":192,"column":null}},"16":{"start":{"line":191,"column":3},"end":{"line":191,"column":null}},"17":{"start":{"line":194,"column":2},"end":{"line":196,"column":null}},"18":{"start":{"line":195,"column":3},"end":{"line":195,"column":null}},"19":{"start":{"line":198,"column":2},"end":{"line":198,"column":null}},"20":{"start":{"line":199,"column":2},"end":{"line":203,"column":null}},"21":{"start":{"line":201,"column":4},"end":{"line":201,"column":null}},"22":{"start":{"line":205,"column":2},"end":{"line":207,"column":null}},"23":{"start":{"line":206,"column":3},"end":{"line":206,"column":null}},"24":{"start":{"line":208,"column":2},"end":{"line":208,"column":null}},"25":{"start":{"line":209,"column":2},"end":{"line":213,"column":null}},"26":{"start":{"line":211,"column":4},"end":{"line":211,"column":null}},"27":{"start":{"line":216,"column":1},"end":{"line":222,"column":null}},"28":{"start":{"line":220,"column":2},"end":{"line":220,"column":null}},"29":{"start":{"line":220,"column":23},"end":{"line":220,"column":null}},"30":{"start":{"line":221,"column":2},"end":{"line":221,"column":null}}},"fnMap":{"0":{"name":"isNone","decl":{"start":{"line":15,"column":9},"end":{"line":15,"column":19}},"loc":{"start":{"line":15,"column":39},"end":{"line":17,"column":null}},"line":15},"1":{"name":"(anonymous_1)","decl":{"start":{"line":164,"column":24},"end":{"line":164,"column":41}},"loc":{"start":{"line":164,"column":62},"end":{"line":223,"column":1}},"line":164},"2":{"name":"(anonymous_2)","decl":{"start":{"line":166,"column":4},"end":{"line":166,"column":16}},"loc":{"start":{"line":166,"column":16},"end":{"line":168,"column":null}},"line":166},"3":{"name":"(anonymous_3)","decl":{"start":{"line":170,"column":4},"end":{"line":170,"column":10}},"loc":{"start":{"line":170,"column":32},"end":{"line":172,"column":null}},"line":170},"4":{"name":"(anonymous_4)","decl":{"start":{"line":175,"column":3},"end":{"line":175,"column":10}},"loc":{"start":{"line":175,"column":48},"end":{"line":177,"column":null}},"line":175},"5":{"name":"(anonymous_5)","decl":{"start":{"line":180,"column":4},"end":{"line":180,"column":14}},"loc":{"start":{"line":180,"column":31},"end":{"line":182,"column":null}},"line":180},"6":{"name":"(anonymous_6)","decl":{"start":{"line":185,"column":3},"end":{"line":185,"column":15}},"loc":{"start":{"line":185,"column":15},"end":{"line":187,"column":null}},"line":185},"7":{"name":"(anonymous_7)","decl":{"start":{"line":190,"column":4},"end":{"line":190,"column":11}},"loc":{"start":{"line":190,"column":49},"end":{"line":192,"column":null}},"line":190},"8":{"name":"(anonymous_8)","decl":{"start":{"line":194,"column":4},"end":{"line":194,"column":15}},"loc":{"start":{"line":194,"column":15},"end":{"line":196,"column":null}},"line":194},"9":{"name":"(anonymous_9)","decl":{"start":{"line":200,"column":3},"end":{"line":200,"column":15}},"loc":{"start":{"line":200,"column":15},"end":{"line":202,"column":null}},"line":200},"10":{"name":"(anonymous_10)","decl":{"start":{"line":205,"column":4},"end":{"line":205,"column":19}},"loc":{"start":{"line":205,"column":19},"end":{"line":207,"column":null}},"line":205},"11":{"name":"(anonymous_11)","decl":{"start":{"line":210,"column":3},"end":{"line":210,"column":10}},"loc":{"start":{"line":210,"column":27},"end":{"line":212,"column":null}},"line":210},"12":{"name":"(anonymous_12)","decl":{"start":{"line":216,"column":3},"end":{"line":216,"column":null}},"loc":{"start":{"line":219,"column":6},"end":{"line":222,"column":null}},"line":219}},"branchMap":{"0":{"loc":{"start":{"line":16,"column":8},"end":{"line":16,"column":null}},"type":"binary-expr","locations":[{"start":{"line":16,"column":8},"end":{"line":16,"column":22}},{"start":{"line":16,"column":22},"end":{"line":16,"column":null}}],"line":16},"1":{"loc":{"start":{"line":165,"column":1},"end":{"line":214,"column":null}},"type":"if","locations":[{"start":{"line":165,"column":1},"end":{"line":214,"column":null}},{"start":{"line":189,"column":8},"end":{"line":214,"column":null}}],"line":165},"2":{"loc":{"start":{"line":218,"column":2},"end":{"line":218,"column":null}},"type":"default-arg","locations":[{"start":{"line":218,"column":13},"end":{"line":218,"column":null}}],"line":218},"3":{"loc":{"start":{"line":220,"column":2},"end":{"line":220,"column":null}},"type":"if","locations":[{"start":{"line":220,"column":2},"end":{"line":220,"column":null}},{"start":{},"end":{}}],"line":220}},"s":{"0":58,"1":4,"2":58,"3":10,"4":1,"5":10,"6":1,"7":10,"8":10,"9":2,"10":10,"11":1,"12":10,"13":10,"14":1,"15":48,"16":1,"17":48,"18":1,"19":48,"20":48,"21":2,"22":48,"23":1,"24":48,"25":48,"26":1,"27":58,"28":3,"29":1,"30":2},"f":{"0":58,"1":58,"2":1,"3":1,"4":2,"5":1,"6":1,"7":1,"8":1,"9":2,"10":1,"11":1,"12":3},"b":{"0":[58,52],"1":[10,48],"2":[3],"3":[1,2]},"meta":{"lastBranch":4,"lastFunction":13,"lastStatement":31,"seen":{"f:15:9:15:19":0,"s:16:1:16:Infinity":0,"b:16:8:16:22:16:22:16:Infinity":0,"s:164:13:223:Infinity":1,"f:164:24:164:41":1,"b:165:1:214:Infinity:189:8:214:Infinity":1,"s:165:1:214:Infinity":2,"s:166:2:168:Infinity":3,"f:166:4:166:16":2,"s:167:3:167:Infinity":4,"s:170:2:172:Infinity":5,"f:170:4:170:10":3,"s:171:3:171:Infinity":6,"s:173:2:173:Infinity":7,"s:174:2:178:Infinity":8,"f:175:3:175:10":4,"s:176:4:176:Infinity":9,"s:180:2:182:Infinity":10,"f:180:4:180:14":5,"s:181:3:181:Infinity":11,"s:183:2:183:Infinity":12,"s:184:2:188:Infinity":13,"f:185:3:185:15":6,"s:186:4:186:Infinity":14,"s:190:2:192:Infinity":15,"f:190:4:190:11":7,"s:191:3:191:Infinity":16,"s:194:2:196:Infinity":17,"f:194:4:194:15":8,"s:195:3:195:Infinity":18,"s:198:2:198:Infinity":19,"s:199:2:203:Infinity":20,"f:200:3:200:15":9,"s:201:4:201:Infinity":21,"s:205:2:207:Infinity":22,"f:205:4:205:19":10,"s:206:3:206:Infinity":23,"s:208:2:208:Infinity":24,"s:209:2:213:Infinity":25,"f:210:3:210:10":11,"s:211:4:211:Infinity":26,"s:216:1:222:Infinity":27,"f:216:3:216:Infinity":12,"b:218:13:218:Infinity":2,"b:220:2:220:Infinity:undefined:undefined:undefined:undefined":3,"s:220:2:220:Infinity":28,"s:220:23:220:Infinity":29,"s:221:2:221:Infinity":30},"fnNames":{}}} -,"/home/anton/Projects/fluent/src/mixin/math/swizzle.ts": {"path":"/home/anton/Projects/fluent/src/mixin/math/swizzle.ts","statementMap":{"0":{"start":{"line":156,"column":13},"end":{"line":156,"column":null}},"1":{"start":{"line":163,"column":16},"end":{"line":163,"column":null}},"2":{"start":{"line":164,"column":15},"end":{"line":164,"column":null}},"3":{"start":{"line":166,"column":1},"end":{"line":196,"column":null}},"4":{"start":{"line":166,"column":7},"end":{"line":196,"column":null}},"5":{"start":{"line":167,"column":2},"end":{"line":171,"column":null}},"6":{"start":{"line":167,"column":15},"end":{"line":167,"column":18}},"7":{"start":{"line":168,"column":3},"end":{"line":168,"column":null}},"8":{"start":{"line":169,"column":3},"end":{"line":170,"column":null}},"9":{"start":{"line":169,"column":27},"end":{"line":169,"column":null}},"10":{"start":{"line":170,"column":8},"end":{"line":170,"column":null}},"11":{"start":{"line":173,"column":21},"end":{"line":173,"column":null}},"12":{"start":{"line":174,"column":2},"end":{"line":180,"column":null}},"13":{"start":{"line":175,"column":3},"end":{"line":179,"column":null}},"14":{"start":{"line":176,"column":4},"end":{"line":176,"column":null}},"15":{"start":{"line":177,"column":10},"end":{"line":179,"column":null}},"16":{"start":{"line":178,"column":4},"end":{"line":178,"column":null}},"17":{"start":{"line":182,"column":14},"end":{"line":185,"column":null}},"18":{"start":{"line":183,"column":18},"end":{"line":183,"column":26}},"19":{"start":{"line":184,"column":15},"end":{"line":184,"column":22}},"20":{"start":{"line":186,"column":2},"end":{"line":186,"column":null}},"21":{"start":{"line":186,"column":35},"end":{"line":186,"column":null}},"22":{"start":{"line":187,"column":22},"end":{"line":189,"column":null}},"23":{"start":{"line":188,"column":18},"end":{"line":188,"column":26}},"24":{"start":{"line":189,"column":15},"end":{"line":189,"column":23}},"25":{"start":{"line":190,"column":2},"end":{"line":195,"column":null}},"26":{"start":{"line":193,"column":4},"end":{"line":193,"column":null}},"27":{"start":{"line":196,"column":28},"end":{"line":196,"column":36}},"28":{"start":{"line":198,"column":1},"end":{"line":202,"column":null}},"29":{"start":{"line":200,"column":3},"end":{"line":200,"column":null}},"30":{"start":{"line":203,"column":1},"end":{"line":207,"column":null}},"31":{"start":{"line":205,"column":3},"end":{"line":205,"column":null}},"32":{"start":{"line":208,"column":1},"end":{"line":212,"column":null}},"33":{"start":{"line":210,"column":3},"end":{"line":210,"column":null}},"34":{"start":{"line":213,"column":1},"end":{"line":217,"column":null}},"35":{"start":{"line":215,"column":3},"end":{"line":215,"column":null}}},"fnMap":{"0":{"name":"applySwizzle","decl":{"start":{"line":158,"column":16},"end":{"line":158,"column":null}},"loc":{"start":{"line":162,"column":2},"end":{"line":218,"column":null}},"line":162},"1":{"name":"(anonymous_1)","decl":{"start":{"line":183,"column":4},"end":{"line":183,"column":12}},"loc":{"start":{"line":183,"column":18},"end":{"line":183,"column":26}},"line":183},"2":{"name":"(anonymous_2)","decl":{"start":{"line":184,"column":4},"end":{"line":184,"column":9}},"loc":{"start":{"line":184,"column":15},"end":{"line":184,"column":22}},"line":184},"3":{"name":"(anonymous_3)","decl":{"start":{"line":188,"column":4},"end":{"line":188,"column":12}},"loc":{"start":{"line":188,"column":18},"end":{"line":188,"column":26}},"line":188},"4":{"name":"(anonymous_4)","decl":{"start":{"line":189,"column":4},"end":{"line":189,"column":9}},"loc":{"start":{"line":189,"column":15},"end":{"line":189,"column":23}},"line":189},"5":{"name":"(anonymous_5)","decl":{"start":{"line":191,"column":3},"end":{"line":191,"column":14}},"loc":{"start":{"line":191,"column":14},"end":{"line":194,"column":null}},"line":191},"6":{"name":"(anonymous_6)","decl":{"start":{"line":196,"column":16},"end":{"line":196,"column":22}},"loc":{"start":{"line":196,"column":28},"end":{"line":196,"column":36}},"line":196},"7":{"name":"(anonymous_7)","decl":{"start":{"line":199,"column":2},"end":{"line":199,"column":13}},"loc":{"start":{"line":199,"column":13},"end":{"line":201,"column":null}},"line":199},"8":{"name":"(anonymous_8)","decl":{"start":{"line":204,"column":2},"end":{"line":204,"column":13}},"loc":{"start":{"line":204,"column":13},"end":{"line":206,"column":null}},"line":204},"9":{"name":"(anonymous_9)","decl":{"start":{"line":209,"column":2},"end":{"line":209,"column":13}},"loc":{"start":{"line":209,"column":13},"end":{"line":211,"column":null}},"line":209},"10":{"name":"(anonymous_10)","decl":{"start":{"line":214,"column":2},"end":{"line":214,"column":13}},"loc":{"start":{"line":214,"column":13},"end":{"line":216,"column":null}},"line":214}},"branchMap":{"0":{"loc":{"start":{"line":169,"column":3},"end":{"line":170,"column":null}},"type":"if","locations":[{"start":{"line":169,"column":3},"end":{"line":170,"column":null}},{"start":{"line":170,"column":8},"end":{"line":170,"column":null}}],"line":169},"1":{"loc":{"start":{"line":175,"column":3},"end":{"line":179,"column":null}},"type":"if","locations":[{"start":{"line":175,"column":3},"end":{"line":179,"column":null}},{"start":{"line":177,"column":10},"end":{"line":179,"column":null}}],"line":175},"2":{"loc":{"start":{"line":177,"column":10},"end":{"line":179,"column":null}},"type":"if","locations":[{"start":{"line":177,"column":10},"end":{"line":179,"column":null}},{"start":{},"end":{}}],"line":177},"3":{"loc":{"start":{"line":186,"column":2},"end":{"line":186,"column":null}},"type":"if","locations":[{"start":{"line":186,"column":2},"end":{"line":186,"column":null}},{"start":{},"end":{}}],"line":186},"4":{"loc":{"start":{"line":186,"column":6},"end":{"line":186,"column":35}},"type":"binary-expr","locations":[{"start":{"line":186,"column":6},"end":{"line":186,"column":25}},{"start":{"line":186,"column":25},"end":{"line":186,"column":35}}],"line":186}},"s":{"0":5,"1":31,"2":31,"3":31,"4":31,"5":10964,"6":10964,"7":13706,"8":13706,"9":2773,"10":10933,"11":10964,"12":10964,"13":38284,"14":7715,"15":30569,"16":4942,"17":6022,"18":23796,"19":21783,"20":6022,"21":130,"22":5892,"23":23352,"24":21684,"25":5892,"26":8,"27":13706,"28":31,"29":1,"30":31,"31":1,"32":31,"33":1,"34":31,"35":1},"f":{"0":31,"1":23796,"2":21783,"3":23352,"4":21684,"5":8,"6":13706,"7":1,"8":1,"9":1,"10":1},"b":{"0":[2773,10933],"1":[7715,30569],"2":[4942,25627],"3":[130,5892],"4":[6022,5892]},"meta":{"lastBranch":5,"lastFunction":11,"lastStatement":36,"seen":{"s:156:13:156:Infinity":0,"f:158:16:158:Infinity":0,"s:163:16:163:Infinity":1,"s:164:15:164:Infinity":2,"s:166:1:196:Infinity":3,"s:166:7:196:Infinity":4,"s:167:2:171:Infinity":5,"s:167:15:167:18":6,"s:168:3:168:Infinity":7,"b:169:3:170:Infinity:170:8:170:Infinity":0,"s:169:3:170:Infinity":8,"s:169:27:169:Infinity":9,"s:170:8:170:Infinity":10,"s:173:21:173:Infinity":11,"s:174:2:180:Infinity":12,"b:175:3:179:Infinity:177:10:179:Infinity":1,"s:175:3:179:Infinity":13,"s:176:4:176:Infinity":14,"b:177:10:179:Infinity:undefined:undefined:undefined:undefined":2,"s:177:10:179:Infinity":15,"s:178:4:178:Infinity":16,"s:182:14:185:Infinity":17,"f:183:4:183:12":1,"s:183:18:183:26":18,"f:184:4:184:9":2,"s:184:15:184:22":19,"b:186:2:186:Infinity:undefined:undefined:undefined:undefined":3,"s:186:2:186:Infinity":20,"b:186:6:186:25:186:25:186:35":4,"s:186:35:186:Infinity":21,"s:187:22:189:Infinity":22,"f:188:4:188:12":3,"s:188:18:188:26":23,"f:189:4:189:9":4,"s:189:15:189:23":24,"s:190:2:195:Infinity":25,"f:191:3:191:14":5,"s:193:4:193:Infinity":26,"f:196:16:196:22":6,"s:196:28:196:36":27,"s:198:1:202:Infinity":28,"f:199:2:199:13":7,"s:200:3:200:Infinity":29,"s:203:1:207:Infinity":30,"f:204:2:204:13":8,"s:205:3:205:Infinity":31,"s:208:1:212:Infinity":32,"f:209:2:209:13":9,"s:210:3:210:Infinity":33,"s:213:1:217:Infinity":34,"f:214:2:214:13":10,"s:215:3:215:Infinity":35},"fnNames":{}}} -} diff --git a/coverage/favicon.png b/coverage/favicon.png deleted file mode 100644 index c1525b811a167671e9de1fa78aab9f5c0b61cef7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 445 zcmV;u0Yd(XP))rP{nL}Ln%S7`m{0DjX9TLF* zFCb$4Oi7vyLOydb!7n&^ItCzb-%BoB`=x@N2jll2Nj`kauio%aw_@fe&*}LqlFT43 z8doAAe))z_%=P%v^@JHp3Hjhj^6*Kr_h|g_Gr?ZAa&y>wxHE99Gk>A)2MplWz2xdG zy8VD2J|Uf#EAw*bo5O*PO_}X2Tob{%bUoO2G~T`@%S6qPyc}VkhV}UifBuRk>%5v( z)x7B{I~z*k<7dv#5tC+m{km(D087J4O%+<<;K|qwefb6@GSX45wCK}Sn*> - - - - Code coverage report for All files - - - - - - - - - -
-
-

All files

-
- -
- 98.37% - Statements - 242/246 -
- - -
- 100% - Branches - 48/48 -
- - -
- 96.26% - Functions - 103/107 -
- - -
- 99.03% - Lines - 205/207 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
src -
-
100%9/9100%2/2100%4/4100%9/9
src/base -
-
100%7/7100%0/0100%3/3100%7/7
src/mixin -
-
97.93%190/194100%36/3695.5%85/8998.74%157/159
src/mixin/math -
-
100%36/36100%10/10100%11/11100%32/32
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/prettify.css b/coverage/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.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} diff --git a/coverage/prettify.js b/coverage/prettify.js deleted file mode 100644 index b322523..0000000 --- a/coverage/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png deleted file mode 100644 index 6ed68316eb3f65dec9063332d2f69bf3093bbfab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qh}Z>jv*C{$p!i!8j}?a+@3A= zIAGwzjijN=FBi!|L1t?LM;Q;gkwn>2cAy-KV{dn nf0J1DIvEHQu*n~6U}x}qyky7vi4|9XhBJ7&`njxgN@xNA8m%nc diff --git a/coverage/sorter.js b/coverage/sorter.js deleted file mode 100644 index 4ed70ae..0000000 --- a/coverage/sorter.js +++ /dev/null @@ -1,210 +0,0 @@ -/* 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]; - } - - function onFilterInput() { - const searchValue = document.getElementById('fileSearch').value; - const rows = document.getElementsByTagName('tbody')[0].children; - - // Try to create a RegExp from the searchValue. If it fails (invalid regex), - // it will be treated as a plain text search - let searchRegex; - try { - searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive - } catch (error) { - searchRegex = null; - } - - for (let i = 0; i < rows.length; i++) { - const row = rows[i]; - let isMatch = false; - - if (searchRegex) { - // If a valid regex was created, use it for matching - isMatch = searchRegex.test(row.textContent); - } else { - // Otherwise, fall back to the original plain text search - isMatch = row.textContent - .toLowerCase() - .includes(searchValue.toLowerCase()); - } - - row.style.display = isMatch ? '' : 'none'; - } - } - - // loads the search box - function addSearchBox() { - var template = document.getElementById('filterTemplate'); - var templateClone = template.content.cloneNode(true); - templateClone.getElementById('fileSearch').oninput = onFilterInput; - template.parentElement.appendChild(templateClone); - } - - // 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 + ''; - } - } - 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(); - addSearchBox(); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/coverage/src/base/index.html b/coverage/src/base/index.html deleted file mode 100644 index 02a3dd1..0000000 --- a/coverage/src/base/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Code coverage report for src/base - - - - - - - - - -
-
-

All files src/base

-
- -
- 100% - Statements - 7/7 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 3/3 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
hkt.ts -
-
0%0/00%0/00%0/00%0/0
index.ts -
-
100%6/6100%0/0100%2/2100%6/6
mixin.ts -
-
100%1/1100%0/0100%1/1100%1/1
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/base/index.ts.html b/coverage/src/base/index.ts.html deleted file mode 100644 index 6b0cc15..0000000 --- a/coverage/src/base/index.ts.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - Code coverage report for src/base/index.ts - - - - - - - - - -
-
-

All files / src/base index.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -9x -  -251x -  -251x -  -416x -  -  -251x -  -  -9x -  - 
import type { DefaultRegistry, Methods, Registry } from "../registry";
-import type { shim } from "./mixin";
- 
-export type Base<T> = T extends { [shim]: { value: infer U } }
-	? { readonly value: U }
-	: {
-			readonly value: T;
-		};
- 
-export type Fluent<
-	T,
-	Reg extends Registry = DefaultRegistry,
-> = Base<T> & Methods<T, Reg> extends infer U
-	? U &
-			Pick<
-				{
-					/**
-					 * Immediate casts and conversions to other types.
-					 */
-					to: unknown;
- 
-					[K: PropertyKey]: unknown;
-				},
-				keyof U
-			>
-	: never;
- 
-export function makeFluent<const Reg extends Registry>(
-	registry: Reg,
-) {
-	const fluent = <const T>(value: T) => {
-		// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
-		const f = { value } as unknown as Fluent<T, Reg>;
- 
-		for (const mixin of registry) {
-			// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
-			mixin.fn(value, f, fluent as (value: unknown) => never);
-		}
- 
-		return f;
-	};
- 
-	return fluent;
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/base/mixin.ts.html b/coverage/src/base/mixin.ts.html deleted file mode 100644 index e3804da..0000000 --- a/coverage/src/base/mixin.ts.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - Code coverage report for src/base/mixin.ts - - - - - - - - - -
-
-

All files / src/base mixin.ts

-
- -
- 100% - Statements - 1/1 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 1/1 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import type { Fluent } from ".";
-import { never } from "../internal";
-import type { Registry } from "../registry";
-import type { HKT } from "./hkt";
- 
-export interface Props {
-	readonly value: unknown;
-	readonly meta: { registry: Registry };
-}
- 
-type MixinHKT = HKT<Props>;
-type MixinFn = (
-	value: unknown,
-	fluent: Record<PropertyKey, unknown>,
-	callback: (value: unknown) => never,
-) => void;
- 
-export interface Mixin<T extends MixinHKT = MixinHKT> {
-	hkt: T;
-	fn: MixinFn;
-}
- 
-export function Mixin<T extends MixinHKT>(fn: MixinFn): Mixin<T> {
-	return {
-		hkt: never,
-		fn,
-	};
-}
- 
-export namespace Mixin {
-	export type HKT = MixinHKT;
-	export type Function = MixinFn;
-}
- 
-export declare const shim: unique symbol;
-export interface Shim {
-	input?: unknown;
-	output?: HKT;
-	value?: unknown;
-}
- 
-export type Input<P extends Props> = P["value"] extends infer T
-	? T extends { [shim]: { input: infer I } }
-		? I
-		: T
-	: never;
-export type Return<T, P extends Props> = Fluent<
-	P["value"] extends { [shim]: { output: infer U extends HKT } }
-		? HKT.Apply<U, T>
-		: T,
-	P["meta"]["registry"]
->;
- 
-export type Instansiate<
-	M extends Mixin,
-	T,
-	Reg extends Registry,
-> = HKT.Apply<M["hkt"], { value: T; meta: { registry: Reg } }>;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/index.html b/coverage/src/index.html deleted file mode 100644 index 80474dd..0000000 --- a/coverage/src/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Code coverage report for src - - - - - - - - - -
-
-

All files src

-
- -
- 100% - Statements - 9/9 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 4/4 -
- - -
- 100% - Lines - 9/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.ts -
-
100%2/2100%0/0100%0/0100%2/2
internal.ts -
-
100%6/6100%2/2100%4/4100%6/6
registry.ts -
-
100%1/1100%0/0100%0/0100%1/1
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/index.ts.html b/coverage/src/index.ts.html deleted file mode 100644 index a791ff9..0000000 --- a/coverage/src/index.ts.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Code coverage report for src/index.ts - - - - - - - - - -
-
-

All files / src index.ts

-
- -
- 100% - Statements - 2/2 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 2/2 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6  -  -  -3x -3x - 
import { makeFluent } from "./base";
-import { DEFAULT_REGISTRY } from "./registry";
- 
-export const fluent = makeFluent(DEFAULT_REGISTRY);
-export const $ = fluent;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/internal.ts.html b/coverage/src/internal.ts.html deleted file mode 100644 index 17c6fea..0000000 --- a/coverage/src/internal.ts.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - Code coverage report for src/internal.ts - - - - - - - - - -
-
-

All files / src internal.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 4/4 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60  -  -  -  -  -  -  -9x -  -  -  -  -  -2x -2x -  -  -  -  -  -  -  -57x -2x -  -4x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import type { HKT } from "./base/hkt";
- 
-export interface Identity extends HKT {
-	new: (t: HKT.T<this>) => typeof t;
-}
- 
-// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
-export const never = undefined as never;
- 
-export type MaxDepth = 20;
- 
-export class AssertionError extends Error {
-	public constructor(msg?: string) {
-		super(msg);
-		this.name = "AssertionError";
-	}
-}
- 
-export function assert(
-	condition: unknown,
-	msg?: string,
-): asserts condition {
-	if (!Boolean(condition))
-		throw new AssertionError(
-			["Assertion error", msg]
-				.filter((v) => v !== undefined)
-				.join(": "),
-		);
-}
- 
-// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters, @typescript-eslint/no-unused-vars
-export function assertType<T>(_v: unknown): asserts _v is T {
-	/* empty */
-}
- 
-// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
-type FunctionProto = Function;
-export interface HidePrototype {
-	/** @deprecated */
-	apply: FunctionProto["apply"];
-	/** @deprecated */
-	arguments: FunctionProto["arguments"];
-	/** @deprecated */
-	bind: FunctionProto["bind"];
-	/** @deprecated */
-	call: FunctionProto["call"];
-	/** @deprecated */
-	caller: FunctionProto["caller"];
-	/** @deprecated */
-	length: FunctionProto["length"];
-	/** @deprecated */
-	name: FunctionProto["name"];
-	/** @deprecated */
-	prototype: FunctionProto["prototype"];
-	/** @deprecated */
-	toString: FunctionProto["toString"];
-	/** @deprecated */
-	Symbol: SymbolConstructor;
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/array.ts.html b/coverage/src/mixin/array.ts.html deleted file mode 100644 index 482b5c8..0000000 --- a/coverage/src/mixin/array.ts.html +++ /dev/null @@ -1,2383 +0,0 @@ - - - - - - Code coverage report for src/mixin/array.ts - - - - - - - - - -
-
-

All files / src/mixin array.ts

-
- -
- 100% - Statements - 45/45 -
- - -
- 100% - Branches - 13/13 -
- - -
- 100% - Functions - 24/24 -
- - -
- 100% - Lines - 41/41 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -80x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -4x -80x -  -52x -8x -  -  -52x -2x -2x -  -  -52x -3x -3x -2x -  -  -  -  -  -  -52x -2x -  -  -52x -2x -  -52x -52x -  -2x -8x -  -  -  -  -52x -  -  -  -2x -  -52x -52x -  -  -  -  -2x -  -  -  -52x -2x -  -  -52x -  -  -  -  -  -  -2x -23x -  -  -52x -52x -  -16x -  -  -  -  -1x -8x -  -  -  -18x -  -  -  -  -11x -  -  -16x -  -  -  -  -10x -  -  -  -52x -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { makeFluent } from "../base";
-import type { HKT } from "../base/hkt";
-import { Mixin, type Input, type Return } from "../base/mixin";
-import { assert, assertType, type HidePrototype } from "../internal";
- 
-type IterArgs<T extends readonly unknown[] = unknown[]> = [
-	element: T[number],
-	idx: number,
-	array: Readonly<T>,
-];
- 
-type MaxDepth = 20;
- 
-type Unordered<T extends readonly unknown[]> = T extends unknown[]
-	? T[number][]
-	: readonly T[number][];
- 
-type Map<
-	T extends readonly unknown[],
-	U,
-	TOut extends U[] = [],
-> = TOut["length"] extends MaxDepth
-	? U[]
-	: T extends readonly [infer T, ...infer TRest extends unknown[]]
-		? Map<TRest, U, [...TOut, U]>
-		: T extends readonly []
-			? TOut
-			: U[];
- 
-type Reverse<
-	T extends readonly unknown[],
-	TOut extends readonly T[number][] = [],
-> = TOut["length"] extends MaxDepth
-	? T[number][]
-	: T extends readonly [...infer TRest extends unknown[], infer T]
-		? Reverse<TRest, [...TOut, T]>
-		: T extends readonly []
-			? TOut
-			: T[number][];
- 
-namespace At {
-	export type Dec<N extends number> = [
-		-1,
-		0,
-		1,
-		2,
-		3,
-		4,
-		5,
-		6,
-		7,
-		8,
-		9,
-		10,
-		11,
-		12,
-		13,
-		14,
-		15,
-		16,
-		17,
-		18,
-		19,
-		20,
-		21,
-	][N];
- 
-	export type Select<
-		T extends readonly unknown[],
-		Skip extends number,
-	> = Skip extends 0
-		? T extends readonly [...unknown[], infer T]
-			? T
-			: undefined
-		: T extends readonly [...infer TRest, unknown]
-			? Select<TRest, Dec<Skip>>
-			: undefined;
-}
- 
-type At<
-	T extends readonly unknown[],
-	K extends keyof T & number,
-> = number extends T["length"]
-	? T[K] | undefined
-	: `${K}` extends `-${infer N extends number}`
-		? At.Select<T, At.Dec<N>>
-		: T[K];
- 
-type Repeat<
-	T extends readonly unknown[],
-	N extends number,
-	Acc extends null[] = [],
-	TOut extends readonly T[number][] = [],
-> = Acc["length"] extends N
-	? [...TOut, ...T]
-	: Acc["length"] extends MaxDepth
-		? T[number][]
-		: Repeat<T, N, [...Acc, null], [...TOut, ...T]>;
- 
-namespace Flat {
-	type Inc<
-		N extends number,
-		Acc extends unknown[] = [],
-	> = Acc["length"] extends N
-		? [...Acc, null]["length"]
-		: Inc<N, [...Acc, null]>;
- 
-	export type Leaves<
-		T,
-		Depth extends number = 0,
-	> = Depth extends MaxDepth
-		? T
-		: T extends readonly unknown[]
-			? Leaves<T[number], Inc<Depth>>
-			: T;
- 
-	export type Rebuild<
-		T extends readonly unknown[],
-		Depth extends number = 0,
-	> = Depth extends MaxDepth
-		? T
-		: T extends readonly [infer H, ...infer R]
-			? H extends readonly unknown[]
-				? [...Rebuild<H, Inc<Depth>>, ...Rebuild<R, Depth>]
-				: [H, ...Rebuild<R, Depth>]
-			: [];
-}
- 
-export type Flat<T extends readonly unknown[]> =
-	number extends T["length"] ? Flat.Leaves<T>[] : Flat.Rebuild<T>;
- 
-function isArray(v: unknown): v is readonly unknown[] {
-	return typeof v === "object" && globalThis.Array.isArray(v);
-}
- 
-export interface Array extends Mixin.HKT {
-	new: (t: HKT.T<this>) => Input<typeof t> extends infer T
-		? T extends readonly (infer Item)[]
-			? {
-					/**
-					 * Index the array using the specified zero-based index.
-					 * Negative indexes start at the end of the array.
-					 * @param index Zero-based index
-					 * @from {@link Array `Array`}
-					 * @example
-					 * ```ts
-					 * const array = ["first", "middle", "last"] as const;
-					 *
-					 * const first = $(array).at(0).value;
-					 * const middle = $(array).at(1).value;
-					 * const last = $(array).at(-1).value;
-					 *
-					 * expect(first).toBe("first");
-					 * expect(middle).toBe("middle");
-					 * expect(last).toBe("last");
-					 *
-					 * const oob = $(array).at(10).value;
-					 * expect(oob).toBe(undefined);
-					 * ```
-					 */
-					at: <const K extends keyof T & number>(
-						/** Zero-based index */
-						index: K,
-					) => Return<At<T, K>, typeof t>;
-					/**
-					 * Interospect each item of the array using the specified
-					 * callback
-					 * @param callback Function called with each element of the array
-					 * @from {@link Array `Array`}
-					 * @example
-					 * ```ts
-					 * const array = [4, 5, 6] as const;
-					 *
-					 * let sum = 0;
-					 * const v = $(array).each((n) => { sum += n }).value;
-					 *
-					 * expect(sum).toBe(15);
-					 * expect(v).toMatchObject(array);
-					 * ```
-					 */
-					each: (
-						/**
-						 * Predicate to run on every element
-						 * @param element The current element
-						 * @param index The index of the current element in the array
-						 * @param array The array being iterated
-						 */
-						callback: (...args: IterArgs<T>) => void,
-					) => Return<T, typeof t>;
-					/**
-					 * Transform each item of the array using the specified callback
-					 * @param callback Predicate to compute each new value with
-					 * @from {@link Array `Array`}
-					 * @example
-					 * ```ts
-					 * const chars = ["h", "e", "l", "l", "o"] as const;
-					 *
-					 * const v = $(chars).map(ch => ch.toUpperCase()).value;
-					 * expect(v).toMatchObject(["H", "E", "L", "L", "O"]);
-					 * ```
-					 */
-					map: <U>(
-						/**
-						 * Predicate to compute each new value of the array
-						 * @param element The current element
-						 * @param index The index of the current element in the array
-						 * @param array The array being iterated
-						 * @return The new value to use for this element
-						 */
-						callback: (...args: IterArgs<T>) => U,
-					) => Return<Map<T, U>, typeof t>;
-					/**
-					 * Extend the array by repeating its current contents n times
-					 * @param count The amount of repetitions to extend the array by
-					 * @from {@link Array `Array`}
-					 * @example
-					 * ```ts
-					 * const array = [1, 2];
-					 *
-					 * const v = $(array).extend(2).value;
-					 * expect(v).toMatchObject([1, 2, 1, 2, 1, 2]);
-					 * ```
-					 */
-					extend: <const N extends number>(
-						/** The amount of repetitions to extend the array by */
-						count: N,
-					) => Return<Repeat<T, N>, typeof t>;
-					/**
-					 * Filter the array to contain only items satisfying the
-					 * specified callback conditional
-					 * @param callback Predicate determining whether each element should be kept in the array
-					 * @from {@link Array `Array`}
-					 * @example
-					 * ```ts
-					 * const dirty = [-2, 4, 1, -5, -6] as const;
-					 *
-					 * const v = $(dirty).filter(v => v >= 0).value;
-					 * expect(v).toMatchObject([4, 1]);
-					 * ```
-					 */
-					filter: ((
-						/**
-						 * Predicate to compute filtering with
-						 * @param element The current element
-						 * @param index The index of the current element in the array
-						 * @param array The array being iterated
-						 * @return `true` if the value should be kept and `false` if it should not
-						 */
-						callback: (...args: IterArgs<T>) => boolean,
-					) => Return<Unordered<T>, typeof t>) & {
-						/**
-						 * Filter the array to only contain items which are not
-						 * `null` or `undefined`.
-						 * @from {@link Array `Array`}
-						 * @example
-						 * ```ts
-						 * const array = new Array(5);
-						 *
-						 * array[0] = 1;
-						 * array[1] = 5;
-						 * array[2] = 2;
-						 *
-						 * const v = $(array).filter.some().value;
-						 * expect(v).toMatchObject([1, 5, 2]);
-						 * ```
-						 */
-						some: () => Return<
-							T extends unknown[]
-								? Exclude<
-										T[number],
-										null | undefined
-									>[]
-								: readonly Exclude<
-										T[number],
-										null | undefined
-									>[],
-							typeof t
-						>;
-					} & HidePrototype;
-					/**
-					 * Collapse array into one value using the specified accumulator callback
-					 * @param initial The initial value of the accumulator
-					 * @param callback Predicate used to compute the new value of the accumulator with each element
-					 * @from {@link Array `Array`}
-					 * @example
-					 * ```ts
-					 * const data = [-5, -4, -2, 1, 2, 3, 5] as const;
-					 *
-					 * const sum = $(data)
-					 * 	.reduce(0, (total, value) => total + value)
-					 * 	.value;
-					 * expect(sum).toBe(0);
-					 * ```
-					 */
-					reduce: (<U>(
-						/**
-						 * Initial value to use for the accumulator
-						 */
-						initial: U,
-						/**
-						 * Predicate to compute the new accumulator value
-						 * @param value The current status of the accumulator
-						 * @param element The current element
-						 * @param index The index of the current element in the array
-						 * @param array The array being iterated
-						 */
-						callback: (
-							value: U,
-							...args: IterArgs<T>
-						) => U,
-					) => Return<U, typeof t>) & {
-						/**
-						 * Collapse the array using the specified accumulator function, starting from the right.
-						 * @param initial The initial value of the accumulator
-						 * @param callback Predicate used to compute the new value of the accumulator with each element
-						 * @see `.reduce()`
-						 * @example
-						 * ```ts
-						 * const path = ["a", "b", "c"] as const;
-						 *
-						 * const v = $(path)
-						 * 	.reduce.right({}, (obj, key) => ({ [key]: obj }))
-						 * 	.value;
-						 * expect(v).toMatchObject({ a: { b: { c: { } } } });
-						 * ```
-						 */
-						right: <U>(
-							/**
-							 * Initial value to use for the accumulator
-							 */
-							initial: U,
-							/**
-							 * Predicate to compute the new accumulator value
-							 * @param value The current status of the accumulator
-							 * @param element The current element
-							 * @param index The index of the current element in the array
-							 * @param array The array being iterated
-							 */
-							callback: (
-								value: U,
-								...args: IterArgs<T>
-							) => U,
-						) => Return<U, typeof t>;
-					} & HidePrototype;
-					/**
-					 * Get the number of items in the array
-					 * @example
-					 * ```ts
-					 * const apples = ["red", "green", "yellow"];
-					 *
-					 * const count = $(apples).length().value;
-					 * expect(count).toBe(3);
-					 * ```
-					 */
-					length: () => Return<T["length"], typeof t>;
- 
-					/**
-					 * Rearrange the items in the array in accordance to the
-					 * specified sorting function
-					 * @param sort The sorting algorithm function to determine the correct order of elements
-					 * @see Nested properties for various pre-made sorting algorithms.
-					 * @from {@link Array `Array`}
-					 * @example
-					 * ```ts
-					 * const unordered = [7, 2, 4, 6, 3, 5, 1];
-					 *
-					 * const ordered = $(unordered)
-					 * 	.sort((a, b) => a - b)
-					 * 	.value;
-					 * expect(ordered).toMatchObject([1, 2, 3, 4, 5, 6, 7]);
-					 * ```
-					 */
-					sort: ((
-						/**
-						 * Predicate used to compare and determine the ordering
-						 * between any 2 elements of the array
-						 * @param a One element of the array to comapare
-						 * @param b Another element of the array to compare against
-						 * @param arr A view of the array being sorted
-						 * @return A negative value if `a` should come before
-						 * `b`, a positive value if `a` should come after `b`,
-						 * and `0` if `a` and `b` are considered the same.
-						 */
-						callback: (
-							a: Item,
-							b: Item,
-							arr: Readonly<T>,
-						) => number,
-					) => Return<Unordered<T>, typeof t>) &
-						([Item] extends [string]
-							? {
-									/**
-									 * @param via A callback to compute a
-									 * representation of each element to use for
-									 * sorting
-									 */
-									alpha: (
-										/**
-										 * @param v The current element
-										 * @return A string representation of `v`
-										 */
-										via?: (v: Item) => string,
-									) => Return<
-										Unordered<T>,
-										typeof t
-									>;
-								}
-							: {
-									/**
-									 * @param via A callback to map each element
-									 * of the array to a string that is used for
-									 * sorting
-									 */
-									alpha: (
-										/**
-										 * @param v The current element
-										 * @return The string representation of `v`
-										 */
-										via: (v: Item) => string,
-									) => Return<
-										Unordered<T>,
-										typeof t
-									>;
-								}) &
-						([Item] extends [number]
-							? {
-									ascending: () => Return<
-										Unordered<T>,
-										typeof t
-									>;
-									descending: () => Return<
-										Unordered<T>,
-										typeof t
-									>;
-								}
-							: {
-									ascending: (
-										via: (v: Item) => number,
-									) => Return<
-										Unordered<T>,
-										typeof t
-									>;
-									descending: (
-										via: (v: Item) => number,
-									) => Return<
-										Unordered<T>,
-										typeof t
-									>;
-								}) & {
-							/**
-							 * Sort alphabetically (A-Z) by Unicode code points
-							 * @example
-							 * const names = ["Johnny", "Anna", "Bart", "Xavier", "Java"];
-							 *
-							 * const sorted = $(names).sort.alpha().value;
-							 * expect(sorted).toMatchObject([
-							 * 	"Anna", "Bart", "Java", "Johnny", "Xavier"
-							 * ])
-							 */
-							alpha: unknown;
-						} & HidePrototype;
-					reverse: () => Return<Reverse<T>, typeof t>;
-				}
-			: unknown
-		: never;
-}
-export const Array = Mixin<Array>((value, $, fluent) => {
-	if (!isArray(value)) return;
- 
-	$.at = (index: number) => {
-		return fluent(value.at(index));
-	};
- 
-	$.each = (callback: (...args: IterArgs) => void) => {
-		value.forEach(callback);
-		return fluent(value);
-	};
- 
-	$.extend = (count: number) => {
-		assert(count >= 0);
-		if (count === 0) return fluent(value);
-		return fluent(
-			value.concat(
-				...new globalThis.Array<unknown>(count).fill(value),
-			),
-		);
-	};
- 
-	$.map = (callback: (...args: IterArgs) => unknown) => {
-		return fluent(value.map(callback));
-	};
- 
-	$.filter = (callback: (...args: IterArgs) => boolean) => {
-		return fluent(value.filter(callback));
-	};
-	assertType<object>($.filter);
-	Object.assign($.filter, {
-		some: () => {
-			return fluent(
-				value.filter((v) => v !== null && v !== undefined),
-			);
-		},
-	});
- 
-	$.reduce = (
-		initial: unknown,
-		callback: (value: unknown, ...args: IterArgs) => unknown,
-	) => {
-		return fluent(value.reduce(callback, initial));
-	};
-	assertType<object>($.reduce);
-	Object.assign($.reduce, {
-		right: (
-			initial: unknown,
-			callback: (value: unknown, ...args: IterArgs) => unknown,
-		) => {
-			return fluent(value.reduceRight(callback, initial));
-		},
-	});
- 
-	$.length = () => {
-		return fluent(value.length);
-	};
- 
-	$.sort = (
-		callback: (
-			a: unknown,
-			b: unknown,
-			arr: readonly unknown[],
-		) => number,
-	) => {
-		return fluent(
-			value.toSorted((a, b) => callback(a, b, value)),
-		);
-	};
-	assertType<object>($.sort);
-	Object.assign($.sort, {
-		alpha: (
-			via: (v: unknown) => string = (v) => (
-				assert(typeof v === "string"),
-				v
-			),
-		) => {
-			return fluent(
-				value.toSorted((a, b) => (via(a) < via(b) ? -1 : 1)),
-			);
-		},
-		ascending: (
-			via: (v: unknown) => number = (v) => (
-				assert(typeof v === "number"),
-				v
-			),
-		) => {
-			return fluent(value.toSorted((a, b) => via(a) - via(b)));
-		},
-		descending: (
-			via: (v: unknown) => number = (v) => (
-				assert(typeof v === "number"),
-				v
-			),
-		) => {
-			return fluent(value.toSorted((a, b) => via(b) - via(a)));
-		},
-	});
- 
-	$.reverse = () => {
-		return fluent(value.toReversed());
-	};
-});
- 
-if (import.meta.vitest) {
-	const { test, expect, expectTypeOf, vi } = import.meta.vitest;
- 
-	const registry = [Array] as const;
-	const $ = makeFluent(registry);
- 
-	test("at()", () => {
-		const arr = [1, 2, 3] as const;
- 
-		const first = $(arr).at(0).value;
-		expect(first).toBe(arr[0]);
-		expectTypeOf(first).toEqualTypeOf(arr[0]);
- 
-		expect($(arr).at(5).value).toBe(undefined);
- 
-		const last = $(arr).at(-1).value;
-		expect(last).toBe(arr[arr.length - 1]);
-		expectTypeOf(last).toEqualTypeOf<
-			typeof arr extends readonly [...unknown[], infer Last]
-				? Last
-				: never
-		>();
- 
-		expect($(arr).at(-5).value).toBe(undefined);
-	});
- 
-	test("each()", () => {
-		const arr = [5, 7, 1] as const;
-		const callback = vi.fn();
- 
-		const result = $(arr).each(callback).value;
- 
-		expect(result).toMatchObject(arr);
- 
-		for (let i = 0; i < arr.length; i++)
-			expect(callback).toHaveBeenNthCalledWith(
-				i + 1,
-				arr[i],
-				i,
-				arr,
-			);
-	});
- 
-	test("extend()", () => {
-		const arr = [1, 2] as const;
- 
-		const copies = 2 as const;
-		const expected: number[] = new globalThis.Array<number[]>(
-			copies + 1,
-		)
-			.fill([...arr])
-			.flat(1);
- 
-		expect($(arr).extend(copies).value).toMatchObject(expected);
-		expect($(arr).extend(0).value).toBe(arr);
-	});
- 
-	test("map()", () => {
-		const arr = [1, 2, 3, 4, 5] as const;
-		const isEven = vi.fn((v: number) => v % 2 === 0);
- 
-		const v = $(arr).map(isEven).value;
-		expect(v).toMatchObject(arr.map(isEven));
-		expectTypeOf(v).toExtend<boolean[]>();
-		expectTypeOf(v).not.toEqualTypeOf<boolean[]>();
- 
-		for (let i = 0; i < arr.length; i++)
-			expect(isEven).toHaveBeenNthCalledWith(
-				i + 1,
-				arr[i],
-				i,
-				arr,
-			);
-	});
- 
-	test("filter()", () => {
-		const arr = [5, 4, 3, 2, 1] as const;
-		const isEven = vi.fn((v: number) => v % 2 === 0);
- 
-		const v = $(arr).filter(isEven).value;
-		expect(v).toMatchObject(arr.filter(isEven));
-		expectTypeOf(v).toExtend<readonly number[]>();
-		expectTypeOf(v).not.toEqualTypeOf<readonly number[]>();
- 
-		for (let i = 0; i < arr.length; i++)
-			expect(isEven).toHaveBeenNthCalledWith(
-				i + 1,
-				arr[i],
-				i,
-				arr,
-			);
- 
-		const dirty = [1, null, 6, undefined, 2] as const;
-		const clean = $(dirty).filter.some().value;
-		expect(clean).toMatchObject(
-			dirty.filter((v) => v !== null && v !== undefined),
-		);
-		expectTypeOf(clean).toExtend<readonly number[]>();
-		expectTypeOf(clean).not.toEqualTypeOf<readonly number[]>();
-	});
- 
-	test("reduce()", () => {
-		const arr = [5, 5, 5, 5, 5] as const;
- 
-		const callback = vi.fn((a: number, b: number) => a + b);
-		const expected = arr.reduce(callback, 0);
- 
-		callback.mockClear();
- 
-		expect($(arr).reduce(0, callback).value).toBe(expected);
- 
-		let sum = 0;
-		for (let i = 0; i < arr.length; i++) {
-			expect(callback).toHaveBeenNthCalledWith(
-				i + 1,
-				sum,
-				arr[i],
-				i,
-				arr,
-			);
- 
-			sum += arr[i];
-		}
- 
-		callback.mockClear();
- 
-		expect($(arr).reduce.right(0, callback).value).toBe(expected);
- 
-		sum = 0;
-		for (let i: number = arr.length; i > 0; i--) {
-			expect(callback).toHaveBeenNthCalledWith(
-				arr.length - i + 1,
-				sum,
-				arr[i - 1],
-				i - 1,
-				arr,
-			);
-			sum += arr[i - 1];
-		}
-	});
- 
-	test("length()", () => {
-		const arr = [3, 3, 3] as const;
- 
-		const v = $(arr).length().value;
-		expect(v).toBe(arr.length);
-		expectTypeOf(v).toEqualTypeOf(arr.length);
-	});
- 
-	test("sort()", () => {
-		const numbers = [1, 5, 3, 4, 2] as const;
- 
-		const callback = (a: number) => (a % 2 === 0 ? -1 : 1);
- 
-		const v = $(numbers).sort(callback).value;
-		expect(v).toMatchObject(numbers.toSorted(callback));
-		expectTypeOf(v).toExtend<readonly number[]>();
-		expectTypeOf(v).not.toEqualTypeOf<readonly number[]>();
- 
-		expect($(numbers).sort.ascending().value).toMatchObject(
-			numbers.toSorted((a, b) => a - b),
-		);
-		expect($(numbers).sort.descending().value).toMatchObject(
-			numbers.toSorted((a, b) => b - a),
-		);
- 
-		const boxed = [{ v: 3 }, { v: 2 }, { v: 1 }];
-		expect(
-			$(boxed).sort.ascending((v) => v.v).value,
-		).toMatchObject(boxed.toSorted((a, b) => a.v - b.v));
-		expect(
-			$(boxed).sort.descending((v) => v.v).value,
-		).toMatchObject(boxed.toSorted((a, b) => b.v - a.v));
- 
-		const strings = [
-			"beta",
-			"alpha",
-			"bart",
-			"apple",
-			"charlie",
-		] as const;
- 
-		expect($(strings).sort.alpha().value).toMatchObject(
-			strings.toSorted(),
-		);
-	});
- 
-	test("reverse()", () => {
-		const array = [1, 2, 3, 4, 5] as const;
- 
-		const v = $(array).reverse().value;
-		expect(v).toMatchObject(array.toReversed());
-		expectTypeOf(v).toExtend<readonly number[]>();
-		expectTypeOf(v).not.toEqualTypeOf<readonly number[]>();
-	});
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/awaited.ts.html b/coverage/src/mixin/awaited.ts.html deleted file mode 100644 index cf88424..0000000 --- a/coverage/src/mixin/awaited.ts.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - - Code coverage report for src/mixin/awaited.ts - - - - - - - - - -
-
-

All files / src/mixin awaited.ts

-
- -
- 93.1% - Statements - 27/29 -
- - -
- 100% - Branches - 7/7 -
- - -
- 81.81% - Functions - 9/11 -
- - -
- 92.3% - Lines - 24/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -4x -45x -  -3x -1x -  -  -3x -  -  -1x -1x -  -  -1x -  -1x -  -2x -1x -1x -1x -  -  -1x -1x -1x -1x -  -  -  -  -1x -  -  -  -1x -  -  -1x -1x -  -  -  -  -  -1x -  -1x -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { makeFluent } from "../base";
-import type { HKT } from "../base/hkt";
-import { Mixin, shim, type Input, type Return } from "../base/mixin";
-import { assert, assertType, never } from "../internal";
-import { Base } from "./base";
- 
-interface AwaitedIdentitity extends HKT {
-	new: (t: HKT.T<this>) => Awaited<Promise<typeof t>>;
-}
- 
-class Awaited<T extends Promise<unknown>> {
-	public value: T;
-	public constructor(value: T) {
-		this.value = value;
-	}
- 
-	public get [shim]() {
-		return never as {
-			input: T extends Promise<infer U> ? U : never;
-			output: AwaitedIdentitity;
-			value: T;
-		};
-	}
-}
- 
-export interface AsyncMixin extends Mixin.HKT {
-	new: (t: HKT.T<this>) => Input<typeof t> extends infer T
-		? T extends Promise<unknown>
-			? {
-					readonly awaited: Return<Awaited<T>, typeof t>;
-					then: <U>(
-						callback: (
-							value: T extends Promise<infer T>
-								? T
-								: never,
-						) => U,
-					) => Return<Promise<U>, typeof t>;
-				}
-			: unknown
-		: never;
-}
- 
-interface BaseFluent<T> {
-	value: T;
-	[K: PropertyKey]: unknown;
-}
- 
-export const AsyncMixin = Mixin<AsyncMixin>((value, $, fluent) => {
-	if (!(value instanceof Promise)) return;
- 
-	$.then = (callback: (value: unknown) => unknown) => {
-		return fluent(value.then(callback));
-	};
- 
-	Object.defineProperty($, "awaited", {
-		enumerable: true,
-		get() {
-			let v: Promise<BaseFluent<unknown>> = value.then((v) =>
-				fluent(v),
-			);
- 
-			const path: PropertyKey[] = [];
-			// eslint-disable-next-line no-empty-pattern
-			const proxy = new Proxy((...[]: unknown[]) => proxy, {
-				get: (_, key) => {
-					if (key === "value")
-						return v.then((v) => v.value);
-					path.push(key);
-					return proxy;
-				},
-				apply: (target, thisArg, args: unknown[]) => {
-					v = v.then((v) => {
-						let obj: unknown = v;
-						for (const node of path) {
-							assert(
-								typeof obj === "object" &&
-									obj !== null &&
-									node in obj,
-							);
-							assertType<Record<PropertyKey, unknown>>(
-								obj,
-							);
- 
-							obj = obj[node];
-						}
- 
-						assert(typeof obj === "function");
-						assertType<
-							(
-								...args: unknown[]
-							) => BaseFluent<unknown>
-						>(obj);
- 
-						return obj(...args);
-					});
-					return target.apply(thisArg, args);
-				},
-			});
- 
-			return proxy;
-		},
-	});
-});
- 
-if (import.meta.vitest) {
-	const { test, expect } = import.meta.vitest;
- 
-	const registry = [Base, AsyncMixin] as const;
-	const $ = makeFluent(registry);
- 
-	test(".awaited", async () => {
-		const value = 10 as const;
-		const promise = new Promise<number>((r) => {
-			r(value);
-		});
- 
-		const increment = (n: number) => n + 1;
- 
-		const result = $(promise).awaited.transform(increment).value;
- 
-		expect(await result).toBe(increment(value));
-	});
- 
-	test("then()", async () => {
-		const value = 10;
-		const promise = new Promise<number>((r) => {
-			r(value);
-		});
- 
-		const increment = (n: number) => n + 1;
- 
-		const result = $(promise).then(increment).value;
- 
-		expect(await result).toBe(increment(value));
-	});
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/base.ts.html b/coverage/src/mixin/base.ts.html deleted file mode 100644 index 0494f46..0000000 --- a/coverage/src/mixin/base.ts.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - Code coverage report for src/mixin/base.ts - - - - - - - - - -
-
-

All files / src/mixin base.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 3/3 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -5x -52x -2x -2x -  -  -52x -5x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { makeFluent } from "../base";
-import type { HKT } from "../base/hkt";
-import { Mixin, type Input, type Return } from "../base/mixin";
- 
-export interface Base extends Mixin.HKT {
-	new: (t: HKT.T<this>) => Input<typeof t> extends infer T
-		? {
-				/**
-				 * Interospect value using the specified `callback` without
-				 * modifying the value.
-				 * @param callback The interospective callback
-				 * @see `transform` to modify
-				 * @from {@link Base `Base`}
-				 * @example
-				 * ```ts
-				 * let x;
-				 * const value = $(10).tap(v => { x = ++v }).value;
-				 *
-				 * expect(x).toBe(11);
-				 * expect(value).toBe(10);
-				 * ```
-				 */
-				tap(
-					callback: (value: Readonly<T>) => void,
-				): Return<T, typeof t>;
-				/**
-				 * Put value through or pipe value through the specified
-				 * `callback` using the outputted return value as a new value.
-				 * A.K.A., _transform_ the current value using a callback
-				 * @param callback The transformative callback
-				 * @from {@link Base `Base`}
-				 * @example
-				 * ```ts
-				 * const value = $("Hello")
-				 * 	.transform(v => v.toUpperCase())
-				 * 	.value;
-				 * expect(value).toBe("HELLO");
-				 * ```
-				 */
-				transform<U>(
-					callback: (value: T) => U,
-				): Return<U, typeof t>;
-			}
-		: never;
-}
- 
-export const Base = Mixin<Base>((value, $, fluent) => {
-	$.tap = (callback: (value: unknown) => void) => {
-		callback(value);
-		return fluent(value);
-	};
- 
-	$.transform = (callback: (value: unknown) => unknown) => {
-		return fluent(callback(value));
-	};
-});
- 
-if (import.meta.vitest) {
-	const { test, expect } = import.meta.vitest;
- 
-	const registry = [Base] as const;
-	const $ = makeFluent(registry);
- 
-	test("tap()", () => {
-		const value = 5;
-		let out = 0;
- 
-		const result = $(value).tap((v) => (out = v)).value;
- 
-		expect(result).toBe(value);
-		expect(out).toBe(value);
-	});
- 
-	test("transform()", () => {
-		const value = 5;
-		const increment = (v: number) => v + 1;
- 
-		expect($(value).transform(increment).value).toBe(
-			increment(value),
-		);
- 
-		expect(
-			$(value).transform(increment).transform(increment).value,
-		).toBe(increment(increment(value)));
-	});
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/index.html b/coverage/src/mixin/index.html deleted file mode 100644 index 9651d3c..0000000 --- a/coverage/src/mixin/index.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - Code coverage report for src/mixin - - - - - - - - - -
-
-

All files src/mixin

-
- -
- 97.93% - Statements - 190/194 -
- - -
- 100% - Branches - 36/36 -
- - -
- 95.5% - Functions - 85/89 -
- - -
- 98.74% - Lines - 157/159 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
array.ts -
-
100%45/45100%13/13100%24/24100%41/41
awaited.ts -
-
93.1%27/29100%7/781.81%9/1192.3%24/26
base.ts -
-
100%6/6100%0/0100%3/3100%6/6
math.ts -
-
97.59%81/83100%9/994.73%36/38100%56/56
optional.ts -
-
100%31/31100%7/7100%13/13100%30/30
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/math.ts.html b/coverage/src/mixin/math.ts.html deleted file mode 100644 index 67d059b..0000000 --- a/coverage/src/mixin/math.ts.html +++ /dev/null @@ -1,1150 +0,0 @@ - - - - - - Code coverage report for src/mixin/math.ts - - - - - - - - - -
-
-

All files / src/mixin math.ts

-
- -
- 97.59% - Statements - 81/83 -
- - -
- 100% - Branches - 9/9 -
- - -
- 94.73% - Functions - 36/38 -
- - -
- 100% - Lines - 56/56 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -5x -  -5x -181x -128x -128x -128x -128x -128x -128x -128x -128x -2x -1x -1x -  -  -128x -  -  -  -3x -  -  -128x -128x -128x -128x -  -128x -128x -128x -  -128x -1x -128x -1x -128x -3x -128x -1x -  -128x -5x -  -128x -128x -128x -128x -128x -128x -128x -  -128x -128x -128x -128x -128x -128x -  -128x -128x -  -128x -128x -128x -1x -1x -  -53x -  -118x -  -31x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { makeFluent } from "../base";
-import type { HKT } from "../base/hkt";
-import {
-	Mixin,
-	type Input,
-	type Props,
-	type Return,
-} from "../base/mixin";
-import { assertType, type MaxDepth } from "../internal";
-import { applySwizzle, type Swizzle } from "./math/swizzle";
- 
-type Vec<
-	T,
-	N extends number,
-	TOut extends T[] = [],
-> = TOut["length"] extends N
-	? TOut
-	: TOut["length"] extends MaxDepth
-		? T[]
-		: Vec<T, N, [...TOut, T]>;
- 
-type Inc<N extends number> = [...Vec<null, N>, null]["length"];
- 
-type Sign<T extends number> = T extends 0
-	? 0
-	: `${T}` extends `-${number}`
-		? -1
-		: 1;
- 
-type Negate<T extends number> = T extends 0
-	? 0
-	: `${T}` extends `-${infer N extends number}`
-		? N
-		: `-${T}` extends `${infer N extends number}`
-			? N
-			: number;
- 
-type Floor<T extends number> =
-	`${T}` extends `${infer N extends number}.${number}` ? N : T;
-type Ceil<T extends number> =
-	`${T}` extends `${infer N extends number}.${number}` ? Inc<N> : T;
-type Round<T extends number> =
-	`${T}` extends `${infer N extends number}.${0 | 1 | 2 | 3 | 4}${number | ""}`
-		? N
-		: Ceil<T>;
- 
-export interface Math extends Mixin.HKT {
-	new: (t: HKT.T<this>) => Input<typeof t> extends infer T
-		? T extends number
-			? {
-					add: (other: number) => Return<number, typeof t>;
-					subtract: (
-						other: number,
-					) => Return<number, typeof t>;
-					multiply: (
-						factor: number,
-					) => Return<number, typeof t>;
-					pow: (
-						exponent: number,
-					) => Return<number, typeof t>;
-					sqrt: () => Return<number, typeof t>;
-					divide: (
-						divisor: number,
-					) => Return<number, typeof t>;
-					mod: (
-						divisor: number,
-					) => Return<number, typeof t>;
-					log: (base?: number) => Return<number, typeof t>;
- 
-					comparesTo: (
-						other: number,
-						delta?: number,
-					) => Return<boolean, typeof t>;
- 
-					floor: () => Return<Floor<T>, typeof t>;
-					ceil: () => Return<Ceil<T>, typeof t>;
-					round: () => Return<Round<T>, typeof t>;
-					fround: () => Return<number, typeof t>;
- 
-					abs: () => Return<
-						`${T}` extends `-${infer N extends number}`
-							? N
-							: T,
-						typeof t
-					>;
-					negate: () => Return<Negate<T>, typeof t>;
-					sign: () => Return<Sign<T>, typeof t>;
- 
-					min: (
-						...others: number[]
-					) => Return<number, typeof t>;
-					max: (
-						...others: number[]
-					) => Return<number, typeof t>;
-					clamp: (
-						min: number,
-						max: number,
-					) => Return<number, typeof t>;
-					snapped: (
-						multiple: number,
-					) => Return<number, typeof t>;
- 
-					lerp: typeof t extends infer TProps extends Props
-						? (
-								b: number,
-								t: number,
-							) => Return<number, TProps>
-						: never;
- 
-					sin: () => Return<number, typeof t>;
-					asin: () => Return<number, typeof t>;
-					cos: () => Return<number, typeof t>;
-					acos: () => Return<number, typeof t>;
-					tan: () => Return<number, typeof t>;
-					atan: () => Return<number, typeof t>;
-					atan2: (y: number) => Return<number, typeof t>;
- 
-					sinh: () => Return<number, typeof t>;
-					asinh: () => Return<number, typeof t>;
-					cosh: () => Return<number, typeof t>;
-					acosh: () => Return<number, typeof t>;
-					tanh: () => Return<number, typeof t>;
-					atanh: () => Return<number, typeof t>;
- 
-					to: {
-						radians: () => Return<number, typeof t>;
-						degrees: () => Return<number, typeof t>;
-					};
-				}
-			: T extends readonly number[]
-				? Swizzle<T, typeof t> & {
-						sum: () => Return<number, typeof t>;
-					}
-				: unknown
-		: never;
-}
- 
-const M = globalThis.Math;
- 
-export const Math = Mixin<Math>((value, $, fluent) => {
-	if (typeof value === "number") {
-		$.add = (other: number) => fluent(value + other);
-		$.subtract = (other: number) => fluent(value - other);
-		$.multiply = (factor: number) => fluent(value * factor);
-		$.pow = (exponent: number) => fluent(M.pow(value, exponent));
-		$.sqrt = () => fluent(M.sqrt(value));
-		$.divide = (divisor: number) => fluent(value / divisor);
-		$.mod = (divisor: number) => fluent(value % divisor);
-		$.log = (base?: number) => {
-			if (base !== undefined)
-				return fluent(M.log(value) / M.log(base));
-			return fluent(M.log(value));
-		};
- 
-		$.comparesTo = (
-			other: number,
-			delta: number = Number.EPSILON,
-		) => {
-			return fluent(M.abs(value - other) < delta);
-		};
- 
-		$.floor = () => fluent(M.floor(value));
-		$.ceil = () => fluent(M.ceil(value));
-		$.round = () => fluent(M.round(value));
-		$.fround = () => fluent(M.fround(value));
- 
-		$.abs = () => fluent(M.abs(value));
-		$.negate = () => fluent(-value);
-		$.sign = () => fluent(M.sign(value));
- 
-		$.min = (...others: number[]) =>
-			fluent(M.min(value, ...others));
-		$.max = (...others: number[]) =>
-			fluent(M.max(value, ...others));
-		$.clamp = (min: number, max: number) =>
-			fluent(M.min(M.max(value, min), max));
-		$.snapped = (multiple: number) =>
-			fluent(M.round(value / multiple) * multiple);
- 
-		$.lerp = (b: number, t: number) =>
-			fluent(value * (1 - t) + b * t);
- 
-		$.sin = () => fluent(M.sin(value));
-		$.asin = () => fluent(M.asin(value));
-		$.cos = () => fluent(M.cos(value));
-		$.acos = () => fluent(M.acos(value));
-		$.tan = () => fluent(M.tan(value));
-		$.atan = () => fluent(M.atan(value));
-		$.atan2 = (y: number) => fluent(M.atan2(y, value));
- 
-		$.sinh = () => fluent(M.sinh(value));
-		$.asinh = () => fluent(M.asinh(value));
-		$.cosh = () => fluent(M.cosh(value));
-		$.acosh = () => fluent(M.acosh(value));
-		$.tanh = () => fluent(M.tanh(value));
-		$.atanh = () => fluent(M.atanh(value));
- 
-		const DEG_TO_RAD = M.PI / 180;
-		const RAD_TO_DEG = 180 / M.PI;
- 
-		$.to ??= {};
-		assertType<object>($.to);
-		Object.assign($.to, {
-			radians: () => fluent(value * DEG_TO_RAD),
-			degrees: () => fluent(value * RAD_TO_DEG),
-		});
-	} else if (
-		Array.isArray(value) &&
-		value.every((x) => typeof x === "number")
-	) {
-		applySwizzle(value, $, fluent);
-	}
-});
- 
-if (import.meta.vitest) {
-	const { test, expect, expectTypeOf } = import.meta.vitest;
- 
-	const registry = [Math] as const;
-	const $ = makeFluent(registry);
- 
-	const t = (f: string, a: number, ...args: unknown[]) => {
-		test(f + "()", () => {
-			// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
-			expect(($(a) as any)[f](...args.slice(0, -1)).value).toBe(
-				args[args.length - 1],
-			);
-		});
-	};
- 
-	t("add", 4, 5, 4 + 5);
-	t("subtract", 7, 2, 7 - 2);
-	t("multiply", 3, 3, 3 * 3);
-	t("pow", 2, 4, 2 ** 4);
-	t("sqrt", 121, M.sqrt(121));
-	t("mod", 8, 3, 8 % 3);
-	test("log()", () => {
-		expect($(M.E).log().value).toBe(1);
-		expect($(1000).log(10).value).toBeCloseTo(M.log10(1000));
-	});
- 
-	test("comparesTo()", () => {
-		const a = 0.1 + 0.2;
-		const target = 0.3;
- 
-		expect($(a).comparesTo(target).value).toBe(true);
- 
-		expect($(a).comparesTo(1, 1).value).toBe(true);
- 
-		expect(
-			$(a).comparesTo(target + Number.EPSILON * 2).value,
-		).toBe(false);
-	});
- 
-	test("floor()", () => {
-		expect($(1).floor().value).toBe(1);
-		expect($(1.7).floor().value).toBe(1);
- 
-		expectTypeOf($(5.8).floor().value).toEqualTypeOf<5>();
-		expectTypeOf($(5).floor().value).toEqualTypeOf<5>();
-	});
-	test("ceil()", () => {
-		expect($(1).ceil().value).toBe(1);
-		expect($(1.7).ceil().value).toBe(2);
- 
-		expectTypeOf($(5).ceil().value).toEqualTypeOf<5>();
-		expectTypeOf($(5.8).ceil().value).toEqualTypeOf<6>();
-	});
-	test("round()", () => {
-		expect($(1.3).round().value).toBe(1);
-		expect($(4.5).round().value).toBe(5);
- 
-		expectTypeOf($(1.3).round().value).toEqualTypeOf<1>();
-		expectTypeOf($(4.5).round().value).toEqualTypeOf<5>();
-	});
-	t("fround", 6.45, M.fround(6.45));
- 
-	test("abs()", () => {
-		const positive = 4 as const;
-		const negative = -4 as const;
- 
-		const a = $(positive).abs().value;
-		expect(a).toBe(positive);
-		expectTypeOf(a).toEqualTypeOf(positive);
- 
-		const b = $(negative).abs().value;
-		expect(b).toBe(positive);
-		expectTypeOf(b).toEqualTypeOf(positive);
-	});
-	test("negate()", () => {
-		const v = 7 as const;
- 
-		expect($(v).negate().value).toBe(-v);
-		expect($(v).negate().negate().value).toBe(v);
- 
-		expectTypeOf($(4).negate().value).toEqualTypeOf<-4>();
-		expectTypeOf($(-4).negate().value).toEqualTypeOf<4>();
-	});
-	test("sign()", () => {
-		expect($(-4).sign().value).toBe(-1);
-		expect($(0).sign().value).toBe(0);
-		expect($(6).sign().value).toBe(1);
-	});
- 
-	t("min", 3, 1, 2, 1);
-	t("max", 3, 1, 2, 3);
-	test("clamp()", () => {
-		const min = 1;
-		const max = 4;
- 
-		const v = 3;
- 
-		expect($(min - 4).clamp(min, max).value).toBe(min);
-		expect($(v).clamp(min, max).value).toBe(v);
-		expect($(max + 7).clamp(min, max).value).toBe(max);
-	});
-	t("snapped", 12.345, 0.1, 12.3);
- 
-	test("lerp()", () => {
-		const a = 2;
-		const b = 4;
- 
-		expect($(a).lerp(b, 0).value).toBe(a);
-		expect($(a).lerp(b, 0.5).value).toBe(3);
-		expect($(a).lerp(b, 1).value).toBe(b);
- 
-		expect($(a).lerp(b, 2).value).toBe(b + (b - a));
-		expect($(a).lerp(b, -1).value).toBe(0);
-	});
- 
-	t("sin", M.PI, M.sin(M.PI));
-	t("cos", M.PI, M.cos(M.PI));
-	t("acos", M.PI, M.acos(M.PI));
-	t("tan", M.PI, M.tan(M.PI));
-	t("atan", M.PI, M.atan(M.PI));
-	t("atan2", 10, M.PI, M.atan2(M.PI, 10));
- 
-	t("sinh", M.PI, M.sinh(M.PI));
-	t("asinh", M.PI, M.asinh(M.PI));
-	t("cosh", M.PI, M.cosh(M.PI));
-	t("acosh", M.PI, M.acosh(M.PI));
-	t("tanh", M.PI, M.tanh(M.PI));
-	t("atanh", 0.5, M.atanh(0.5));
- 
-	test(".to.radians()", () => {
-		const angle = 180;
- 
-		expect($(angle).to.radians().value).toBe(M.PI);
-	});
- 
-	test(".to.degrees()", () => {
-		const angle = M.PI;
- 
-		expect($(angle).to.degrees().value).toBe(180);
-	});
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/math/index.html b/coverage/src/mixin/math/index.html deleted file mode 100644 index e7dce0e..0000000 --- a/coverage/src/mixin/math/index.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - Code coverage report for src/mixin/math - - - - - - - - - -
-
-

All files src/mixin/math

-
- -
- 100% - Statements - 36/36 -
- - -
- 100% - Branches - 10/10 -
- - -
- 100% - Functions - 11/11 -
- - -
- 100% - Lines - 32/32 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
swizzle.ts -
-
100%36/36100%10/10100%11/11100%32/32
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/math/swizzle.ts.html b/coverage/src/mixin/math/swizzle.ts.html deleted file mode 100644 index 92f7b58..0000000 --- a/coverage/src/mixin/math/swizzle.ts.html +++ /dev/null @@ -1,1054 +0,0 @@ - - - - - - Code coverage report for src/mixin/math/swizzle.ts - - - - - - - - - -
-
-

All files / src/mixin/math swizzle.ts

-
- -
- 100% - Statements - 36/36 -
- - -
- 100% - Branches - 10/10 -
- - -
- 100% - Functions - 11/11 -
- - -
- 100% - Lines - 32/32 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -5x -  -  -  -  -  -  -31x -31x -  -31x -10964x -13706x -13706x -10933x -  -  -10964x -10964x -38284x -7715x -30569x -4942x -  -  -  -6022x -23796x -21783x -  -6022x -5892x -23352x -21684x -5892x -  -  -8x -  -  -13706x -  -31x -  -1x -  -  -31x -  -1x -  -  -31x -  -1x -  -  -31x -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { makeFluent } from "../../base";
-import type { Props, Return } from "../../base/mixin";
-import { type MaxDepth } from "../../internal";
-import { Math } from "../math";
- 
-type Axis = typeof axis;
-type Vec<
-	T,
-	N extends number,
-	TOut extends T[] = [],
-> = TOut["length"] extends N
-	? TOut
-	: TOut["length"] extends MaxDepth
-		? T[]
-		: Vec<T, N, [...TOut, T]>;
- 
-type Inc<N extends number | undefined> = N extends number
-	? [...Vec<null, N>, null]["length"]
-	: 0;
-type Dec<N extends number> =
-	Vec<null, N> extends [...infer Rest extends null[], null]
-		? Rest["length"]
-		: -1;
- 
-type Next<
-	N extends number,
-	State extends readonly (number | undefined)[],
-	TOut extends (number | undefined)[] = [],
-> = State extends readonly [
-	infer Current extends number | undefined,
-	...infer Rest extends (number | undefined)[],
-]
-	? Inc<Current> extends infer TInc
-		? TInc extends N
-			? Next<N, Rest, [...TOut, undefined]>
-			: [...TOut, TInc, ...Rest]
-		: never
-	: null;
- 
-type Key<
-	State extends (number | undefined)[],
-	TOut extends string = "",
-> = State extends readonly [infer Only extends number, ...undefined[]]
-	? `${TOut}${Axis[Only]}`
-	: State extends readonly [
-				infer Current extends number,
-				...infer Rest extends (number | undefined)[],
-		  ]
-		? Key<Rest, `${TOut}${Axis[Current]}`>
-		: never;
- 
-type IsAscending<
-	State extends (number | undefined)[],
-	Prev extends number | undefined = undefined,
-> = State extends readonly [
-	infer Current extends number,
-	...infer Rest extends number[],
-]
-	? Current extends Inc<Prev>
-		? IsAscending<Rest, Inc<Prev>>
-		: false
-	: State extends readonly []
-		? true
-		: false;
- 
-type Pretty<T> = { [K in keyof T]: T[K] };
- 
-type SwizzlePermutations<
-	N extends number,
-	State extends Vec<number | undefined, N> = Vec<undefined, N>,
-	TOut extends Record<string, readonly number[]> = Record<
-		never,
-		never
-	>,
-> =
-	Next<N, State> extends infer TNext
-		? TNext extends Vec<number | undefined, N>
-			? SwizzlePermutations<
-					N,
-					TNext,
-					TOut &
-						(IsAscending<State> extends true
-							? unknown
-							: Record<Key<State>, State>)
-				>
-			: Pretty<TOut & Record<Key<State>, State>>
-		: never;
- 
-type Sequence<
-	T extends readonly unknown[],
-	Indexes extends (number | undefined)[],
-	TOut extends T[number][] = [],
-> = Indexes extends readonly [
-	infer Current extends number,
-	...infer Rest extends (number | undefined)[],
-]
-	? Sequence<T, Rest, [...TOut, T[Current]]>
-	: TOut;
- 
-type Primative<
-	T extends readonly unknown[],
-	t extends Props,
-	Axes extends readonly string[] = Axis,
-	Acc = unknown,
-	TOut extends unknown[] = [],
-> = Axes extends readonly [
-	infer Current extends string,
-	...infer Rest extends string[],
-]
-	? Acc &
-			Record<
-				Current,
-				Return<T[TOut["length"]], t>
-			> extends infer TAcc
-		? Primative<T, t, Rest, TAcc, [...TOut, TAcc]>
-		: never
-	: TOut;
- 
-type SwizzleCache = [
-	{ x: [0] },
-	SwizzlePermutations<2>,
-	SwizzlePermutations<3>,
-	SwizzlePermutations<4>,
-];
- 
-export type Swizzle<
-	T extends readonly unknown[],
-	t extends Props,
-> = number extends T["length"]
-	? unknown
-	: (
-				Dec<T["length"]> extends infer K extends 0 | 1 | 2 | 3
-					? { k: K; c: SwizzleCache[K] }
-					: SwizzleCache extends [...unknown[], infer Last]
-						? { k: Dec<SwizzleCache["length"]>; c: Last }
-						: never
-		  ) extends {
-				k: infer K extends number;
-				c: infer C extends Record<
-					PropertyKey,
-					(number | undefined)[]
-				>;
-		  }
-		? Omit<
-				{
-					readonly [K in keyof C]: Return<
-						Sequence<T, C[K]>,
-						t
-					>;
-				},
-				Axis[number]
-			> &
-				Primative<T, t>[K]
-		: never;
- 
-const axis = ["x", "y", "z", "w"] as const;
- 
-export function applySwizzle(
-	value: number[],
-	$: object,
-	fluent: (value: unknown) => never,
-) {
-	const length = globalThis.Math.min(value.length, axis.length);
-	const state = new Array<number>(length).fill(-1);
- 
-	main: do {
-		for (let i = 0; i < state.length; i++) {
-			state[i] += 1;
-			if (state[i] >= length) state[i] = -1;
-			else break;
-		}
- 
-		let reachedEmpty = false;
-		for (const item of state) {
-			if (item === -1) {
-				reachedEmpty = true;
-			} else if (reachedEmpty) {
-				continue main;
-			}
-		}
- 
-		const key = state
-			.filter((x) => x !== -1)
-			.map((x) => axis[x])
-			.join("");
-		if (key.length <= 1 || key in $) continue;
-		const permutation = state
-			.filter((x) => x !== -1)
-			.map((x) => value[x]);
-		Object.defineProperty($, key, {
-			get: () => {
-				// OPTIMIZE? Reduce amount of arrays allocated and held for the lambda..?
-				return fluent(permutation);
-			},
-		});
-	} while (state.some((x) => x !== -1));
- 
-	Object.defineProperty($, "x", {
-		get: () => {
-			return fluent(value[0]);
-		},
-	});
-	Object.defineProperty($, "y", {
-		get: () => {
-			return fluent(value[1]);
-		},
-	});
-	Object.defineProperty($, "z", {
-		get: () => {
-			return fluent(value[2]);
-		},
-	});
-	Object.defineProperty($, "w", {
-		get: () => {
-			return fluent(value[3]);
-		},
-	});
-}
- 
-if (import.meta.vitest) {
-	const { test, expect, expectTypeOf } = import.meta.vitest;
- 
-	const registry = [Math] as const;
-	const $ = makeFluent(registry);
- 
-	test("Swizzling (.xx, .xy, etc.)", () => {
-		const x = 5 as const;
-		const y = 7 as const;
- 
-		const vec = [x, y] as const;
- 
-		expect($(vec).xx.value).toMatchObject([x, x]);
-		expect($(vec).yy.value).toMatchObject([y, y]);
- 
-		const yx = $(vec).yx.value;
-		expect(yx).toMatchObject([y, x]);
-		expectTypeOf(yx).toEqualTypeOf<[typeof y, typeof x]>();
- 
-		const large = [x, y, x, y] as const;
- 
-		expect($(large).wzyx.value).toMatchObject([y, x, y, x]);
-		expect($(large).xzyw.value).toMatchObject([x, x, y, y]);
-		expect($(large).ywxz.value).toMatchObject([y, y, x, x]);
-		expect($(large).xxxx.value).toMatchObject([x, x, x, x]);
-		expect($(large).wwww.value).toMatchObject([y, y, y, y]);
-	});
- 
-	test(".x", () => {
-		const x = 5 as const;
-		const arr = [x] as const;
- 
-		const v = $(arr).x.value;
-		expect(v).toBe(x);
-		expectTypeOf(v).toEqualTypeOf(x);
-	});
- 
-	test(".y", () => {
-		const y = 2 as const;
-		const arr = [y, y] as const;
- 
-		const v = $(arr).y.value;
-		expect(v).toBe(y);
-		expectTypeOf(v).toEqualTypeOf(y);
-	});
- 
-	test(".z", () => {
-		const z = 9 as const;
-		const arr = [z, z, z] as const;
- 
-		const v = $(arr).z.value;
-		expect(v).toBe(z);
-		expectTypeOf(v).toEqualTypeOf(z);
-	});
- 
-	test(".w", () => {
-		const w = 0 as const;
-		const arr = [w, w, w, w] as const;
- 
-		const v = $(arr).w.value;
-		expect(v).toBe(w);
-		expectTypeOf(v).toEqualTypeOf(w);
-	});
- 
-	test("Next", () => {
-		type N = 3;
- 
-		expectTypeOf<
-			Next<N, [undefined, undefined, undefined]>
-		>().toEqualTypeOf<[0, undefined, undefined]>();
- 
-		expectTypeOf<
-			Next<N, [2, undefined, undefined]>
-		>().toEqualTypeOf<[undefined, 0, undefined]>();
- 
-		expectTypeOf<Next<N, [2, 2, 2]>>().toEqualTypeOf<null>();
-	});
- 
-	test("Key", () => {
-		expectTypeOf<Key<[1, 2, undefined]>>().toEqualTypeOf<"yz">();
-		expectTypeOf<Key<[1, 1, 1]>>().toEqualTypeOf<"yyy">();
-	});
- 
-	test("Sequence", () => {
-		type In = [1, 2, 3, 4, 5];
-		type Out = [5, 4, 3, 2, 1];
-		type Reverse = [4, 3, 2, 1, 0];
- 
-		expectTypeOf<Sequence<In, Reverse>>().toEqualTypeOf<Out>();
-	});
- 
-	test("Primative", () => {
-		interface Props {
-			value: [number, number];
-			meta: { registry: [] };
-		}
- 
-		type V = Primative<[number, number], Props>[1];
- 
-		expectTypeOf<V>().toHaveProperty("x");
-		expectTypeOf<V>().toHaveProperty("y");
-		expectTypeOf<V>().not.toHaveProperty("z");
-	});
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/mixin/optional.ts.html b/coverage/src/mixin/optional.ts.html deleted file mode 100644 index 54b76c5..0000000 --- a/coverage/src/mixin/optional.ts.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - - Code coverage report for src/mixin/optional.ts - - - - - - - - - -
-
-

All files / src/mixin optional.ts

-
- -
- 100% - Statements - 31/31 -
- - -
- 100% - Branches - 7/7 -
- - -
- 100% - Functions - 13/13 -
- - -
- 100% - Lines - 30/30 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -58x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -4x -58x -10x -1x -  -  -10x -1x -  -10x -10x -  -2x -  -  -  -10x -1x -  -10x -10x -  -1x -  -  -  -48x -1x -  -  -48x -1x -  -  -48x -48x -  -2x -  -  -  -48x -1x -  -48x -48x -  -1x -  -  -  -  -58x -  -  -  -3x -2x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { makeFluent } from "../base";
-import type { HKT } from "../base/hkt";
-import {
-	Mixin,
-	type Input,
-	type Props,
-	type Return,
-} from "../base/mixin";
-import { assert, assertType, type HidePrototype } from "../internal";
- 
-type NoneSentinel = null | undefined;
-type None<T> = Extract<T, NoneSentinel>;
-type Some<T> = Exclude<T, NoneSentinel>;
- 
-function isNone<T>(v: T): v is None<T> {
-	return v === null || v === undefined;
-}
- 
-interface Where<T, t extends Props> {
-	/**
-	 * Set a value to a fallback if it does not conform to some conditional
-	 * @param callback Callback returning a boolean, `false` sets the value to the fallback
-	 * @param fallback The fallback value, `null` by default
-	 * @example
-	 * const parse = () => { version: "1.2.4" } as unknown;
-	 *
-	 * const version = $(parse())
-	 *  .where(v => typeof v === 'object' &&
-	 *      v !== null &&
-	 *      'version' in v)
-	 *  .and(v => v.version)
-	 *  .or("1.0.0")
-	 *  .value;
-	 * expect(version).toBe("1.2.4");
-	 * @from {@link Optional `Optional`}
-	 */
-	where: <const U = null>(
-		callback: (v: T) => boolean,
-		fallback?: U,
-	) => Return<T | U, t>;
-}
- 
-export interface Optional extends Mixin.HKT {
-	new: (t: HKT.T<this>) => Input<typeof t> extends infer T
-		? None<T> extends never
-			? Where<T, typeof t>
-			: {
-					/**
-					 * Transform a value via callback if it is not `null` or
-					 * `undefined`
-					 *
-					 * If the value is equal to `null` or `undefined`, it
-					 * remains unchanged and the callback is not called.
-					 * @param callback Function for a non-null value
-					 * @example
-					 * const none = () => null as number | null;
-					 * const some = () => 10 as number | null;
-					 *
-					 * const callback = (v: number) => v + 5;
-					 *
-					 * const a = $(none()).and(callback).value;
-					 * expect(a).toBe(null)
-					 *
-					 * const b = $(some()).and(callback).value;
-					 * expect(b).toBe(15);
-					 * @from {@link Optional `Optional`}
-					 */
-					and: <U>(
-						callback: (v: Some<T>) => U,
-					) => Return<None<T> | U, typeof t>;
-					/**
-					 * Set value to a fallback if it is `null` or `undefined`.
-					 * @param fallback The fallback value to use. To defer
-					 * computing this fallback value, you can use `.or.else()`
-					 * @example
-					 * const none = () => null as number | null;
-					 * const some = () => 10 as number | null;
-					 *
-					 * const fallback = -1;
-					 *
-					 * const a = $(none()).or(fallback).value;
-					 * expect(a).toBe(fallback);
-					 *
-					 * const b = $(some()).or(fallback).value;
-					 * expect(b).toBe(10);
-					 * @from {@link Optional `Optional`}
-					 */
-					or: (<const U>(
-						fallback: U,
-					) => Return<Some<T> | U, typeof t>) & {
-						/**
-						 * Set value to the result of `callback` if it is `null`
-						 * or `undefined`. Unlike the normal `.or()`, this method
-						 * only computes the fallback if the value is `null` or
-						 * `undefined`
-						 * @param callback
-						 * @from {@link Optional `Optional`}
-						 * @example
-						 * ```ts
-						 * const none = () => null as number | null;
-						 * const some = () => 8 as number | null;
-						 *
-						 * const fallback = vi.fn(() => 22); // mocked
-						 *
-						 * const a = $(none()).or.else(fallback).value;
-						 * expect(a).toBe(22);
-						 *
-						 * const b = $(some()).or.else(fallback).value;
-						 * expect(b).toBe(8);
-						 *
-						 * expect(fallback).toHaveBeenCalledOnce()
-						 * ```
-						 */
-						else: <U>(
-							callback: (v: None<T>) => U,
-						) => Return<Some<T> | U, typeof t>;
-					} & HidePrototype;
-					/**
-					 * Assert that value is not `null` or `undefined`
-					 * @param msg Reasoning to attach to the `AssertionError`
-					 * @see `.assert.none()` for the inverse assertion
-					 * @from {@link Optional `Optional`}
-					 * @example
-					 * ```ts
-					 * const array = [1, 2, 3] as const;
-					 * const element = array.at(1);
-					 *
-					 * const v = $(element).assert("index within bounds").value;
-					 * expect(v).toBe(2);
-					 *
-					 * expect(() => {
-					 *  $(array.at(6)).assert()
-					 * }).toThrow()
-					 * ```
-					 */
-					assert: ((
-						msg?: string,
-					) => Return<Some<T>, typeof t>) & {
-						/**
-						 * Assert that the value is either `null` or `undefined`
-						 * @param msg Reasoning to attach to the `AssertionError`
-						 * @from {@link Optional `Optional`}
-						 * @example
-						 * ```ts
-						 * const array = [1, 2, 3] as const;
-						 * const element = array.at(5);
-						 *
-						 * const v = $(element).assert.none("index out of bounds").value;
-						 * expect(v).toBe(undefined);
-						 *
-						 * expect(() => {
-						 *  $(array.at(1)).assert.none()
-						 * }).toThrow()
-						 * ```
-						 */
-						none: (
-							msg?: string,
-						) => Return<None<T>, typeof t>;
-					} & HidePrototype;
-				} & Where<T, typeof t>
-		: never;
-}
- 
-export const Optional = Mixin<Optional>((value, $, fluent) => {
-	if (isNone(value)) {
-		$.and = () => {
-			return fluent(value);
-		};
- 
-		$.or = (fallback: unknown) => {
-			return fluent(fallback);
-		};
-		assertType<object>($.or);
-		Object.assign($.or, {
-			else: (callback: (v: unknown) => unknown) => {
-				return fluent(callback(value));
-			},
-		});
- 
-		$.assert = (msg?: string) => {
-			assert(false, msg);
-		};
-		assertType<object>($.assert);
-		Object.assign($.assert, {
-			none: () => {
-				return fluent(value);
-			},
-		});
-	} else {
-		$.and = (callback: (v: unknown) => unknown) => {
-			return fluent(callback(value));
-		};
- 
-		$.or = () => {
-			return fluent(value);
-		};
- 
-		assertType<object>($.or);
-		Object.assign($.or, {
-			else: () => {
-				return fluent(value);
-			},
-		});
- 
-		$.assert = () => {
-			return fluent(value);
-		};
-		assertType<object>($.assert);
-		Object.assign($.assert, {
-			none: (msg?: string) => {
-				assert(false, msg);
-			},
-		});
-	}
- 
-	$.where = (
-		callback: (v: unknown) => boolean,
-		fallback = null,
-	) => {
-		if (callback(value)) return fluent(value);
-		return fluent(fallback);
-	};
-});
- 
-if (import.meta.vitest) {
-	const { test, expect, expectTypeOf, vi } = import.meta.vitest;
- 
-	const registry = [Optional] as const;
-	const $ = makeFluent(registry);
- 
-	const Value = <const T>(v: T) => v as T | null;
- 
-	test("and()", () => {
-		const value = 10;
-		const some = Value(value);
-		const none = Value(null);
- 
-		const callback = (v: number) => v + 5;
- 
-		expect($(some).and(callback).value).toBe(callback(value));
-		expect($(none).and(callback).value).toBe(null);
-	});
- 
-	test("or()", () => {
-		const value = 10 as const;
-		const some = Value(value);
-		const none = Value(null);
- 
-		const fallback = 15 as const;
- 
-		const a = $(some).or(fallback).value;
-		expect(a).toBe(some);
-		expectTypeOf(a).toEqualTypeOf<
-			typeof value | typeof fallback
-		>();
- 
-		const b = $(none).or(fallback).value;
-		expect(b).toBe(fallback);
-		expectTypeOf(b).toEqualTypeOf<typeof fallback>();
- 
-		const callback = vi.fn(() => fallback);
- 
-		const c = $(some).or.else(callback).value;
-		expect(c).toBe(some);
-		expectTypeOf(c).toEqualTypeOf<
-			typeof value | typeof fallback
-		>();
- 
-		const d = $(none).or.else(callback).value;
-		expect(d).toBe(fallback);
-		expectTypeOf(d).toEqualTypeOf<typeof fallback>();
- 
-		expect(callback).toHaveBeenCalledOnce();
-	});
- 
-	test("where()", () => {
-		const even = 4 as const;
-		const odd = 7 as const;
- 
-		const isEven = (v: number) => v % 2 === 0;
- 
-		expect($(even).where(isEven).value).toBe(even);
-		expect($(odd).where(isEven).value).toBe(null);
- 
-		expect($(odd).where(isEven, -1).value).toBe(-1);
-	});
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/coverage/src/registry.ts.html b/coverage/src/registry.ts.html deleted file mode 100644 index 701deb1..0000000 --- a/coverage/src/registry.ts.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - Code coverage report for src/registry.ts - - - - - - - - - -
-
-

All files / src registry.ts

-
- -
- 100% - Statements - 1/1 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 1/1 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30  -  -  -  -  -  -  -  -  -3x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { Mixin, type Instansiate } from "./base/mixin";
-import { Array } from "./mixin/array";
-import { AsyncMixin as Async } from "./mixin/awaited";
-import { Base } from "./mixin/base";
-import { Math } from "./mixin/math";
-import { Optional } from "./mixin/optional";
- 
-export type Registry = readonly Mixin[];
- 
-export const DEFAULT_REGISTRY = [
-	Async,
-	Array,
-	Base,
-	Optional,
-	Math,
-] as const satisfies Registry;
-export type DefaultRegistry = typeof DEFAULT_REGISTRY;
- 
-export type Methods<
-	T,
-	Reg extends Registry,
-	TReg extends Registry = Reg,
-	TOut extends Record<PropertyKey, unknown> = Record<never, never>,
-> = TReg extends readonly [
-	infer M extends Mixin,
-	...infer Rest extends Registry,
-]
-	? Methods<T, Reg, Rest, TOut & Instansiate<M, T, Reg>>
-	: TOut;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/src/mixin/math.ts b/src/mixin/math.ts index defcf85..3572169 100644 --- a/src/mixin/math.ts +++ b/src/mixin/math.ts @@ -48,82 +48,463 @@ export interface Math extends Mixin.HKT { new: (t: HKT.T) => Input extends infer T ? T extends number ? { - add: (other: number) => Return; - subtract: ( + /** + * `x + y` + * @param other The second term of the addition (`y`) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(12).add(8).value; + * expect(v).toBe(20); + * ``` + */ + add: ( + /** Term to add */ other: number, ) => Return; + /** + * `x - y` + * @param other The second term of the subtraction (`y`) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(12).subtract(8).value; + * expect(v).toBe(4); + * ``` + */ + subtract: ( + /** Term to subtract by */ + other: number, + ) => Return; + /** + * `x * y` + * @param factor Factor term of the multiplication (`y`) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(12).multiply(8).value; + * expect(v).toBe(96) + * ``` + */ multiply: ( + /** Factor to multiply by */ factor: number, ) => Return; + /** + * `x ** y` + * @param exponent Exponent term of the power (`y`) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(12).pow(2).value; + * expect(v).toBe(144); + * ``` + */ pow: ( + /** Exponent to raise to */ exponent: number, ) => Return; + /** + * `Math.sqrt(x)` + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(144).sqrt().value; + * expect(v).toBe(12); + * ``` + */ sqrt: () => Return; + /** + * `x / y` + * @param divisor Divisor term of the division (`y`) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(12).divide(8).value; + * expect(v).toBe(1.5); + * ``` + */ divide: ( + /** Divisor to divide by */ divisor: number, ) => Return; + /** + * `x % y` + * @param divisor Divisor term of the remainder operation (`y`) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(12).mod(8).value; + * expect(v).toBe(4); + * ``` + */ mod: ( + /** Divisor to divide by */ divisor: number, ) => Return; - log: (base?: number) => Return; + /** + * `ln(x)`, `log(x, base)`, or alternatively `Math.log(x) / Math.log(base)` + * @param base Base of the logarithm (`base`). Defaults to `Math.E` for a natural logarithm function + * @from {@link Math `Math`} + * @example + * ```ts + * const a = $(Math.E).log().value; + * expect(a).toBe(1); + * + * const b = $(125).log(5).value; + * expect(b).toBeCloseTo(3); + * ``` + */ + log: ( + /** The base of the logarithm */ + base?: number, + ) => Return; + /** + * Loosely compare value to the specified other value, + * accounting for floating-point inaccuracies. Comparision + * is performed within some degree of error. + * @param other Value to compare against + * @param delta The degree of acceptable error (defaults to `Number.EPSILON`) + * @from {@link Math `Math`} + * @example + * ```ts + * const result = 0.1 + 0.2; + * const target = 0.3; + * + * const a = $(result).comparesTo(target).value; + * expect(a).toBe(true); + * + * const b = $(result).comparesTo(1, 1).value; + * expect(b).toBe(true); + * + * const c = $(result).comparesTo(0).value; + * expect(c).toBe(false); + * ``` + */ comparesTo: ( + /** Value to compare against */ other: number, + /** Degree of acceptable error */ delta?: number, ) => Return; + /** + * `Math.floor(x)` + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(1.7).floor().value; + * expect(v).toBe(1); + * ``` + */ floor: () => Return, typeof t>; + /** + * `Math.ceil(x)` + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(1.3).ceil().value; + * expect(v).toBe(2); + * ``` + */ ceil: () => Return, typeof t>; + /** + * `Math.round(x)` + * @see `.snapped()` for a rounding with customizable precision + * @from {@link Math `Math`} + * @example + * ```ts + * const a = $(1.3).round().value; + * const b = $(1.7).round().value; + * + * expect(a).toBe(1); + * expect(b).toBe(2); + * ``` + */ round: () => Return, typeof t>; + /** + * `Math.fround(x)`, round to the nearest 32-bit float + * approximation of value + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(0.99999999).fround().value; + * expect(v).toBe(1); + * ``` + */ fround: () => Return; + /** + * `Math.abs(x)`, calculate the absolute value (distance + * from 0). + * @from {@link Math `Math`} + * @example + * ```ts + * const v = 4 as const; + * + * const a = $(v).abs().value; + * const b = $(-v).abs().value; + * + * expect(a).toBe(v); + * expect(b).toBe(v); + * ``` + */ abs: () => Return< `${T}` extends `-${infer N extends number}` ? N : T, typeof t >; + /** + * `-x` or alternatively `x * -1` + * @from {@link Math `Math`} + * @example + * ```ts + * const v = 10 as const; + * + * const a = $(v).negate().value; + * expect(a).toBe(-v); + * + * const b = $(-v).negate().value; + * expect(b).toBe(v); + * ``` + */ negate: () => Return, typeof t>; + /** + * `Math.sign(x)`, returns the sign of the value or zero + * @from {@link Math `Math`} + * @example + * ```ts + * const a = $(-42).sign().value; + * const b = $(0).sign().value; + * const c = $(99).sign().value; + * + * expect(a).toBe(-1); + * expect(b).toBe(0); + * expect(c).toBe(1); + * ``` + */ sign: () => Return, typeof t>; - min: ( - ...others: number[] - ) => Return; - max: ( - ...others: number[] - ) => Return; + /** + * `Math.min(x, ...values)`, pick the _smallest_ out of the + * provided numbers + * @param others Other numbers + * @from {@link Math `Math`} + * @example + * ```ts + * const maximum = 10; + * + * const a = $(5).min(maximum).value; + * const b = $(15).min(maximum).value; + * + * expect(a).toBe(5); + * expect(b).toBe(10); + * ``` + */ + min: ( + /** Other numbers */ + ...others: U + ) => Return; + /** + * `Math.max(x, ...values)`, pick the _largest_ out of the + * provided numbers + * @param others Other numbers + * @from {@link Math `Math`} + * @example + * ```ts + * const minimum = 0; + * + * const a = $(5).max(minimum).value; + * const b = $(-5).max(minimum).value; + * + * expect(a).toBe(5); + * expect(b).toBe(0); + * ``` + */ + max: ( + /** Other numbers */ + ...others: U + ) => Return; + /** + * Clamp value to be within the specified range, or + * alternatively the form of `Math.min(Math.max(x, min), + * max)`. + * @param min Start of the range, the smallest that the value can be + * @param max End of the range, the largest that the value can be + * @from {@link Math `Math`} + * @example + * ```ts + * const min = 0; + * const max = 10; + * + * const a = $(5).clamp(min, max).value; + * const b = $(-2).clamp(min, max).value; + * const c = $(15).clamp(min, max).value; + * + * expect(a).toBe(5); + * expect(b).toBe(0); + * expect(c).toBe(10); + * ``` + */ clamp: ( + /** The minimum (smallest) value of the range */ min: number, + /** The maximum (largest) value of the range */ max: number, ) => Return; + /** + * Snap or round value to a nearest multiple of the + * specified unit + * @param multiple The unit to snap to + * @from {@link Math `Math`} + * @example + * ```ts + * const unit = 32; + * + * const a = $(32).snapped(unit).value; + * const b = $(48).snapped(unit).value; + * const c = $(64).snapped(unit).value; + * + * expect(a).toBe(32); + * expect(b).toBe(64); + * expect(c).toBe(64); + * ``` + */ snapped: ( + /** Unit to snap to */ multiple: number, ) => Return; + /** + * Calculate the linear interpolation of value (`a`) to the + * specified target value (`b`) at the specified point + * (`t`). + * + * Alternative forms: `lerp(a, b, t)` or `a * (1 - t) + + * b * t` + * @param b Target value to interpolate to + * @param t Interpolation factor, 0 is `a` and 1 is `b` + * @from {@link Math `Math`} + * @example + * ```ts + * const from = 12; + * const to = 8; + * + * const a = $(from).lerp(to, 0).value; + * const b = $(from).lerp(to, 0.5).value; + * const c = $(from).lerp(to, 1).value; + * + * expect(a).toBe(12); + * expect(b).toBe(10); + * expect(c).toBe(8); + * + * const d = $(from).lerp(to, -1).value; + * const e = $(from).lerp(to, 2).value; + * + * expect(d).toBe(16); + * expect(e).toBe(4); + * ``` + */ lerp: typeof t extends infer TProps extends Props ? ( + /** Target value */ b: number, + /** Interpolation factor, 0 is representative of `a` and 1 is representative of `b` */ t: number, ) => Return : never; + /** + * `Math.sin(x)` + * @from {@link Math `Math`} + */ sin: () => Return; + /** + * `Math.asin(x)` + * @from {@link Math `Math`} + */ asin: () => Return; + /** + * `Math.cos(x)` + * @from {@link Math `Math`} + */ cos: () => Return; + /** + * `Math.acos(x)` + * @from {@link Math `Math`} + */ acos: () => Return; + /** + * `Math.tan(x)` + * @from {@link Math `Math`} + */ tan: () => Return; + /** + * `Math.atan(x)` + * @from {@link Math `Math`} + */ atan: () => Return; + /** + * `Math.atan2(x, y)` + * @from {@link Math `Math`} + */ atan2: (y: number) => Return; + /** + * `Math.sinh(x)` + * @from {@link Math `Math`} + */ sinh: () => Return; + /** + * `Math.asinh(x)` + * @from {@link Math `Math`} + */ asinh: () => Return; + /** + * `Math.cosh(x)` + * @from {@link Math `Math`} + */ cosh: () => Return; + /** + * `Math.acosh(x)` + * @from {@link Math `Math`} + */ acosh: () => Return; + /** + * `Math.tanh(x)` + * @from {@link Math `Math`} + */ tanh: () => Return; + /** + * `Math.atanh(x)` + * @from {@link Math `Math`} + */ atanh: () => Return; to: { + /** + * Convert angle to representation in radians (`1 * + * Math.PI` radians per `1 * 180` degrees) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(360).to.radians().value; + * expect(v).toBe(2 * Math.PI); + * ``` + */ radians: () => Return; + /** + * Convert angle to representation in degrees (`1 * 180` + * degrees per `1 * Math.PI` radians) + * @from {@link Math `Math`} + * @example + * ```ts + * const v = $(2 * Math.PI).to.degrees().value; + * expect(v).toBe(360); + * ``` + */ degrees: () => Return; }; }