mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-29 20:34:06 +03:00
sophisticated rollup setup and eslint base setup
This commit is contained in:
+287
-301
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage generated="1595257697964" clover="3.2.0">
|
||||
<project timestamp="1595257697964" name="All files">
|
||||
<metrics statements="324" coveredstatements="307" conditionals="204" coveredconditionals="192" methods="79" coveredmethods="72" elements="607" coveredelements="571" complexity="0" loc="324" ncloc="324" packages="5" files="18" classes="18"/>
|
||||
<coverage generated="1595630216423" clover="3.2.0">
|
||||
<project timestamp="1595630216423" name="All files">
|
||||
<metrics statements="310" coveredstatements="295" conditionals="202" coveredconditionals="190" methods="81" coveredmethods="73" elements="593" coveredelements="558" complexity="0" loc="310" ncloc="310" packages="5" files="18" classes="18"/>
|
||||
<package name="src">
|
||||
<metrics statements="33" coveredstatements="33" conditionals="1" coveredconditionals="1" methods="6" coveredmethods="6"/>
|
||||
<file name="instances.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\instances.ts">
|
||||
<metrics statements="19" coveredstatements="19" conditionals="1" coveredconditionals="1" methods="6" coveredmethods="6"/>
|
||||
<metrics statements="32" coveredstatements="32" conditionals="1" coveredconditionals="1" methods="6" coveredmethods="6"/>
|
||||
<file name="instances.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\instances.ts">
|
||||
<metrics statements="18" coveredstatements="18" conditionals="1" coveredconditionals="1" methods="6" coveredmethods="6"/>
|
||||
<line num="1" count="1" type="stmt"/>
|
||||
<line num="2" count="1" type="stmt"/>
|
||||
<line num="9" count="1" type="stmt"/>
|
||||
@@ -15,18 +15,17 @@
|
||||
<line num="19" count="4" type="stmt"/>
|
||||
<line num="20" count="4" type="stmt"/>
|
||||
<line num="27" count="1" type="stmt"/>
|
||||
<line num="28" count="1" type="stmt"/>
|
||||
<line num="35" count="1" type="stmt"/>
|
||||
<line num="33" count="1" type="stmt"/>
|
||||
<line num="34" count="2" type="stmt"/>
|
||||
<line num="36" count="2" type="stmt"/>
|
||||
<line num="38" count="2" type="stmt"/>
|
||||
<line num="40" count="1" type="cond" truecount="1" falsecount="0"/>
|
||||
<line num="41" count="1" type="stmt"/>
|
||||
<line num="38" count="1" type="cond" truecount="1" falsecount="0"/>
|
||||
<line num="39" count="1" type="stmt"/>
|
||||
<line num="43" count="2" type="stmt"/>
|
||||
<line num="45" count="2" type="stmt"/>
|
||||
<line num="47" count="2" type="stmt"/>
|
||||
<line num="48" count="1" type="stmt"/>
|
||||
<line num="51" count="2" type="stmt"/>
|
||||
<line num="46" count="1" type="stmt"/>
|
||||
<line num="49" count="2" type="stmt"/>
|
||||
</file>
|
||||
<file name="options.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\options.ts">
|
||||
<file name="options.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\options.ts">
|
||||
<metrics statements="14" coveredstatements="14" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
||||
<line num="5" count="1" type="stmt"/>
|
||||
<line num="6" count="1" type="stmt"/>
|
||||
@@ -45,354 +44,341 @@
|
||||
</file>
|
||||
</package>
|
||||
<package name="src.core.compatibility">
|
||||
<metrics statements="49" coveredstatements="49" conditionals="14" coveredconditionals="14" methods="10" coveredmethods="10"/>
|
||||
<file name="vendors.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\compatibility\vendors.ts">
|
||||
<metrics statements="49" coveredstatements="49" conditionals="14" coveredconditionals="14" methods="10" coveredmethods="10"/>
|
||||
<line num="4" count="1" type="stmt"/>
|
||||
<line num="5" count="20" type="stmt"/>
|
||||
<line num="7" count="1" type="stmt"/>
|
||||
<line num="8" count="10" type="stmt"/>
|
||||
<metrics statements="47" coveredstatements="47" conditionals="14" coveredconditionals="14" methods="10" coveredmethods="10"/>
|
||||
<file name="vendors.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\compatibility\vendors.ts">
|
||||
<metrics statements="47" coveredstatements="47" conditionals="14" coveredconditionals="14" methods="10" coveredmethods="10"/>
|
||||
<line num="4" count="20" type="stmt"/>
|
||||
<line num="5" count="10" type="stmt"/>
|
||||
<line num="9" count="1" type="stmt"/>
|
||||
<line num="10" count="1" type="stmt"/>
|
||||
<line num="12" count="1" type="stmt"/>
|
||||
<line num="13" count="1" type="stmt"/>
|
||||
<line num="14" count="1" type="stmt"/>
|
||||
<line num="16" count="1" type="stmt"/>
|
||||
<line num="17" count="1" type="stmt"/>
|
||||
<line num="19" count="1" type="stmt"/>
|
||||
<line num="20" count="4" type="stmt"/>
|
||||
<line num="22" count="4" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="23" count="1" type="stmt"/>
|
||||
<line num="24" count="4" type="stmt"/>
|
||||
<line num="26" count="4" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="27" count="1" type="stmt"/>
|
||||
<line num="26" count="3" type="stmt"/>
|
||||
<line num="27" count="3" type="stmt"/>
|
||||
<line num="29" count="3" type="stmt"/>
|
||||
<line num="30" count="3" type="stmt"/>
|
||||
<line num="32" count="3" type="stmt"/>
|
||||
<line num="33" count="9" type="stmt"/>
|
||||
<line num="34" count="9" type="stmt"/>
|
||||
<line num="40" count="33" type="stmt"/>
|
||||
<line num="41" count="9" type="stmt"/>
|
||||
<line num="44" count="3" type="stmt"/>
|
||||
<line num="45" count="3" type="stmt"/>
|
||||
<line num="54" count="1" type="stmt"/>
|
||||
<line num="55" count="11" type="stmt"/>
|
||||
<line num="56" count="11" type="stmt"/>
|
||||
<line num="58" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="59" count="4" type="stmt"/>
|
||||
<line num="61" count="7" type="stmt"/>
|
||||
<line num="30" count="9" type="stmt"/>
|
||||
<line num="31" count="9" type="stmt"/>
|
||||
<line num="37" count="33" type="stmt"/>
|
||||
<line num="38" count="9" type="stmt"/>
|
||||
<line num="41" count="3" type="stmt"/>
|
||||
<line num="42" count="3" type="stmt"/>
|
||||
<line num="51" count="1" type="stmt"/>
|
||||
<line num="52" count="11" type="stmt"/>
|
||||
<line num="53" count="11" type="stmt"/>
|
||||
<line num="55" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="56" count="4" type="stmt"/>
|
||||
<line num="59" count="7" type="stmt"/>
|
||||
<line num="60" count="7" type="stmt"/>
|
||||
<line num="61" count="7" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="62" count="7" type="stmt"/>
|
||||
<line num="63" count="7" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="64" count="7" type="stmt"/>
|
||||
<line num="66" count="7" type="stmt"/>
|
||||
<line num="67" count="10" type="stmt"/>
|
||||
<line num="68" count="42" type="stmt"/>
|
||||
<line num="69" count="42" type="stmt"/>
|
||||
<line num="70" count="42" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="71" count="2" type="stmt"/>
|
||||
<line num="72" count="2" type="stmt"/>
|
||||
<line num="75" count="10" type="stmt"/>
|
||||
<line num="78" count="7" type="stmt"/>
|
||||
<line num="79" count="7" type="stmt"/>
|
||||
<line num="86" count="1" type="stmt"/>
|
||||
<line num="65" count="10" type="stmt"/>
|
||||
<line num="66" count="42" type="stmt"/>
|
||||
<line num="67" count="42" type="stmt"/>
|
||||
<line num="68" count="42" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="69" count="2" type="stmt"/>
|
||||
<line num="70" count="2" type="stmt"/>
|
||||
<line num="73" count="10" type="stmt"/>
|
||||
<line num="76" count="7" type="stmt"/>
|
||||
<line num="77" count="7" type="stmt"/>
|
||||
<line num="84" count="1" type="stmt"/>
|
||||
<line num="85" count="5" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="87" count="5" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="89" count="5" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="90" count="1" type="stmt"/>
|
||||
<line num="92" count="4" type="stmt"/>
|
||||
<line num="93" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="94" count="11" type="stmt"/>
|
||||
<line num="88" count="1" type="stmt"/>
|
||||
<line num="91" count="4" type="stmt"/>
|
||||
<line num="92" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="93" count="11" type="stmt"/>
|
||||
<line num="96" count="4" type="stmt"/>
|
||||
<line num="97" count="4" type="stmt"/>
|
||||
<line num="98" count="4" type="stmt"/>
|
||||
</file>
|
||||
</package>
|
||||
<package name="src.core.dom">
|
||||
<metrics statements="124" coveredstatements="107" conditionals="79" coveredconditionals="67" methods="36" coveredmethods="29"/>
|
||||
<file name="attributes.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\attributes.ts">
|
||||
<metrics statements="121" coveredstatements="106" conditionals="79" coveredconditionals="67" methods="37" coveredmethods="29"/>
|
||||
<file name="attributes.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\attributes.ts">
|
||||
<metrics statements="18" coveredstatements="18" conditionals="8" coveredconditionals="8" methods="5" coveredmethods="5"/>
|
||||
<line num="8" count="4" type="stmt"/>
|
||||
<line num="9" count="7" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="10" count="5" type="stmt"/>
|
||||
<line num="11" count="2" type="stmt"/>
|
||||
<line num="19" count="4" type="stmt"/>
|
||||
<line num="20" count="1" type="stmt"/>
|
||||
<line num="28" count="4" type="stmt"/>
|
||||
<line num="29" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="30" count="2" type="stmt"/>
|
||||
<line num="31" count="1" type="stmt"/>
|
||||
<line num="39" count="4" type="stmt"/>
|
||||
<line num="40" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="41" count="2" type="stmt"/>
|
||||
<line num="42" count="1" type="stmt"/>
|
||||
<line num="50" count="4" type="stmt"/>
|
||||
<line num="51" count="5" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="52" count="3" type="stmt"/>
|
||||
<line num="53" count="2" type="stmt"/>
|
||||
<line num="12" count="2" type="stmt"/>
|
||||
<line num="20" count="4" type="stmt"/>
|
||||
<line num="21" count="1" type="stmt"/>
|
||||
<line num="29" count="4" type="stmt"/>
|
||||
<line num="30" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="31" count="2" type="stmt"/>
|
||||
<line num="33" count="1" type="stmt"/>
|
||||
<line num="41" count="4" type="stmt"/>
|
||||
<line num="42" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="43" count="2" type="stmt"/>
|
||||
<line num="45" count="1" type="stmt"/>
|
||||
<line num="53" count="4" type="stmt"/>
|
||||
<line num="54" count="5" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="55" count="3" type="stmt"/>
|
||||
<line num="57" count="2" type="stmt"/>
|
||||
</file>
|
||||
<file name="classes.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\classes.ts">
|
||||
<metrics statements="19" coveredstatements="19" conditionals="10" coveredconditionals="10" methods="4" coveredmethods="4"/>
|
||||
<file name="classes.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\classes.ts">
|
||||
<metrics statements="18" coveredstatements="18" conditionals="10" coveredconditionals="10" methods="4" coveredmethods="4"/>
|
||||
<line num="3" count="4" type="stmt"/>
|
||||
<line num="10" count="4" type="stmt"/>
|
||||
<line num="11" count="7" type="stmt"/>
|
||||
<line num="19" count="4" type="stmt"/>
|
||||
<line num="21" count="11" type="stmt"/>
|
||||
<line num="23" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="24" count="9" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="25" count="9" type="stmt"/>
|
||||
<line num="26" count="11" type="stmt"/>
|
||||
<line num="35" count="4" type="stmt"/>
|
||||
<line num="37" count="7" type="stmt"/>
|
||||
<line num="39" count="7" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="40" count="5" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="41" count="5" type="stmt"/>
|
||||
<line num="42" count="6" type="stmt"/>
|
||||
<line num="10" count="7" type="stmt"/>
|
||||
<line num="17" count="4" type="stmt"/>
|
||||
<line num="19" count="11" type="stmt"/>
|
||||
<line num="21" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="22" count="9" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="23" count="9" type="stmt"/>
|
||||
<line num="24" count="11" type="stmt"/>
|
||||
<line num="34" count="4" type="stmt"/>
|
||||
<line num="36" count="7" type="stmt"/>
|
||||
<line num="38" count="7" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="39" count="5" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="40" count="5" type="stmt"/>
|
||||
<line num="41" count="6" type="stmt"/>
|
||||
<line num="52" count="4" type="stmt"/>
|
||||
<line num="53" count="4" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="54" count="2" type="stmt"/>
|
||||
<line num="57" count="2" type="stmt"/>
|
||||
<line num="56" count="2" type="stmt"/>
|
||||
</file>
|
||||
<file name="create.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\create.ts">
|
||||
<metrics statements="6" coveredstatements="6" conditionals="0" coveredconditionals="0" methods="3" coveredmethods="3"/>
|
||||
<line num="5" count="4" type="stmt"/>
|
||||
<line num="6" count="204" type="stmt"/>
|
||||
<line num="9" count="4" type="stmt"/>
|
||||
<line num="10" count="3" type="stmt"/>
|
||||
<line num="11" count="3" type="stmt"/>
|
||||
<line num="13" count="9" type="stmt"/>
|
||||
<file name="create.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\create.ts">
|
||||
<metrics statements="5" coveredstatements="5" conditionals="0" coveredconditionals="0" methods="3" coveredmethods="3"/>
|
||||
<line num="5" count="204" type="stmt"/>
|
||||
<line num="7" count="4" type="stmt"/>
|
||||
<line num="8" count="3" type="stmt"/>
|
||||
<line num="9" count="3" type="stmt"/>
|
||||
<line num="11" count="9" type="stmt"/>
|
||||
</file>
|
||||
<file name="index.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\index.ts">
|
||||
<file name="index.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\index.ts">
|
||||
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
||||
</file>
|
||||
<file name="manipulation.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\manipulation.ts">
|
||||
<metrics statements="28" coveredstatements="28" conditionals="24" coveredconditionals="24" methods="8" coveredmethods="8"/>
|
||||
<file name="manipulation.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\manipulation.ts">
|
||||
<metrics statements="32" coveredstatements="32" conditionals="24" coveredconditionals="24" methods="8" coveredmethods="8"/>
|
||||
<line num="13" count="4" type="stmt"/>
|
||||
<line num="14" count="24" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="15" count="20" type="stmt"/>
|
||||
<line num="19" count="20" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="20" count="16" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="21" count="8" type="stmt"/>
|
||||
<line num="24" count="8" type="stmt"/>
|
||||
<line num="25" count="24" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="26" count="3" type="stmt"/>
|
||||
<line num="28" count="24" type="stmt"/>
|
||||
<line num="32" count="8" type="stmt"/>
|
||||
<line num="36" count="16" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="37" count="12" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="38" count="1" type="stmt"/>
|
||||
<line num="40" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="41" count="2" type="stmt"/>
|
||||
<line num="45" count="16" type="stmt"/>
|
||||
<line num="55" count="6" type="stmt"/>
|
||||
<line num="62" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="69" count="6" type="stmt"/>
|
||||
<line num="76" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="82" count="4" type="stmt"/>
|
||||
<line num="83" count="23" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="84" count="9" type="stmt"/>
|
||||
<line num="86" count="21" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="87" count="20" type="stmt"/>
|
||||
<line num="88" count="20" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="89" count="15" type="stmt"/>
|
||||
<line num="18" count="24" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="19" count="20" type="stmt"/>
|
||||
<line num="23" count="20" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="24" count="16" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="25" count="8" type="stmt"/>
|
||||
<line num="28" count="8" type="stmt"/>
|
||||
<line num="29" count="24" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="30" count="3" type="stmt"/>
|
||||
<line num="32" count="24" type="stmt"/>
|
||||
<line num="35" count="8" type="stmt"/>
|
||||
<line num="39" count="16" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="40" count="12" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="41" count="1" type="stmt"/>
|
||||
<line num="42" count="11" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="43" count="2" type="stmt"/>
|
||||
<line num="47" count="16" type="stmt"/>
|
||||
<line num="57" count="4" type="stmt"/>
|
||||
<line num="58" count="6" type="stmt"/>
|
||||
<line num="66" count="4" type="stmt"/>
|
||||
<line num="67" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="75" count="4" type="stmt"/>
|
||||
<line num="76" count="6" type="stmt"/>
|
||||
<line num="84" count="4" type="stmt"/>
|
||||
<line num="85" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="92" count="4" type="stmt"/>
|
||||
<line num="93" count="23" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="94" count="9" type="stmt"/>
|
||||
<line num="95" count="21" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="96" count="20" type="stmt"/>
|
||||
<line num="97" count="20" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="98" count="15" type="stmt"/>
|
||||
</file>
|
||||
<file name="offset.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\offset.ts">
|
||||
<metrics statements="5" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="0"/>
|
||||
<file name="offset.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\offset.ts">
|
||||
<metrics statements="4" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="0"/>
|
||||
<line num="1" count="3" type="stmt"/>
|
||||
<line num="2" count="0" type="stmt"/>
|
||||
<line num="3" count="0" type="stmt"/>
|
||||
<line num="9" count="3" type="stmt"/>
|
||||
<line num="10" count="0" type="stmt"/>
|
||||
</file>
|
||||
<file name="style.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\style.ts">
|
||||
<metrics statements="19" coveredstatements="5" conditionals="12" coveredconditionals="0" methods="5" coveredmethods="0"/>
|
||||
<file name="style.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\style.ts">
|
||||
<metrics statements="18" coveredstatements="5" conditionals="12" coveredconditionals="0" methods="6" coveredmethods="0"/>
|
||||
<line num="5" count="3" type="stmt"/>
|
||||
<line num="21" count="3" type="stmt"/>
|
||||
<line num="22" count="0" type="stmt"/>
|
||||
<line num="23" count="0" type="cond" truecount="0" falsecount="2"/>
|
||||
<line num="24" count="0" type="stmt"/>
|
||||
<line num="29" count="3" type="stmt"/>
|
||||
<line num="30" count="0" type="cond" truecount="0" falsecount="4"/>
|
||||
<line num="36" count="0" type="stmt"/>
|
||||
<line num="22" count="0" type="cond" truecount="0" falsecount="4"/>
|
||||
<line num="24" count="3" type="stmt"/>
|
||||
<line num="25" count="0" type="stmt"/>
|
||||
<line num="26" count="0" type="cond" truecount="0" falsecount="2"/>
|
||||
<line num="27" count="0" type="stmt"/>
|
||||
<line num="35" count="0" type="stmt"/>
|
||||
<line num="37" count="0" type="cond" truecount="0" falsecount="2"/>
|
||||
<line num="38" count="0" type="cond" truecount="0" falsecount="2"/>
|
||||
<line num="39" count="0" type="cond" truecount="0" falsecount="2"/>
|
||||
<line num="40" count="0" type="stmt"/>
|
||||
<line num="43" count="0" type="cond" truecount="0" falsecount="2"/>
|
||||
<line num="39" count="0" type="stmt"/>
|
||||
<line num="42" count="0" type="cond" truecount="0" falsecount="2"/>
|
||||
<line num="44" count="0" type="stmt"/>
|
||||
<line num="46" count="0" type="stmt"/>
|
||||
<line num="50" count="0" type="stmt"/>
|
||||
<line num="50" count="3" type="stmt"/>
|
||||
<line num="51" count="0" type="stmt"/>
|
||||
<line num="55" count="3" type="stmt"/>
|
||||
<line num="56" count="0" type="stmt"/>
|
||||
<line num="59" count="3" type="stmt"/>
|
||||
<line num="60" count="0" type="stmt"/>
|
||||
<line num="54" count="3" type="stmt"/>
|
||||
<line num="55" count="0" type="stmt"/>
|
||||
</file>
|
||||
<file name="traversal.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\traversal.ts">
|
||||
<metrics statements="29" coveredstatements="29" conditionals="25" coveredconditionals="25" methods="9" coveredmethods="9"/>
|
||||
<line num="3" count="4" type="stmt"/>
|
||||
<line num="4" count="4" type="cond" truecount="3" falsecount="0"/>
|
||||
<line num="7" count="4" type="stmt"/>
|
||||
<line num="8" count="6" type="stmt"/>
|
||||
<line num="10" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="11" count="18" type="stmt"/>
|
||||
<line num="14" count="6" type="stmt"/>
|
||||
<file name="traversal.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\dom\traversal.ts">
|
||||
<metrics statements="26" coveredstatements="26" conditionals="25" coveredconditionals="25" methods="9" coveredmethods="9"/>
|
||||
<line num="3" count="4" type="cond" truecount="3" falsecount="0"/>
|
||||
<line num="5" count="4" type="stmt"/>
|
||||
<line num="6" count="6" type="stmt"/>
|
||||
<line num="8" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="9" count="18" type="stmt"/>
|
||||
<line num="12" count="6" type="stmt"/>
|
||||
<line num="15" count="19" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="17" count="4" type="stmt"/>
|
||||
<line num="18" count="19" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="21" count="4" type="stmt"/>
|
||||
<line num="22" count="31" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="23" count="22" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="24" count="2" type="stmt"/>
|
||||
<line num="25" count="20" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="26" count="2" type="stmt"/>
|
||||
<line num="27" count="18" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="28" count="6" type="stmt"/>
|
||||
<line num="30" count="21" type="stmt"/>
|
||||
<line num="33" count="4" type="stmt"/>
|
||||
<line num="34" count="3" type="stmt"/>
|
||||
<line num="36" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="37" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="38" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="39" count="1" type="stmt"/>
|
||||
<line num="42" count="3" type="stmt"/>
|
||||
<line num="18" count="31" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="19" count="22" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="20" count="2" type="stmt"/>
|
||||
<line num="22" count="20" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="23" count="2" type="stmt"/>
|
||||
<line num="25" count="18" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="26" count="6" type="stmt"/>
|
||||
<line num="29" count="21" type="stmt"/>
|
||||
<line num="32" count="4" type="stmt"/>
|
||||
<line num="33" count="3" type="stmt"/>
|
||||
<line num="35" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="36" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="37" count="3" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="38" count="1" type="stmt"/>
|
||||
<line num="41" count="3" type="stmt"/>
|
||||
<line num="45" count="3" type="stmt"/>
|
||||
<line num="48" count="4" type="stmt"/>
|
||||
<line num="49" count="38" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="52" count="14" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="48" count="38" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="50" count="14" type="cond" truecount="2" falsecount="0"/>
|
||||
</file>
|
||||
</package>
|
||||
<package name="src.core.options">
|
||||
<metrics statements="53" coveredstatements="53" conditionals="39" coveredconditionals="39" methods="10" coveredmethods="10"/>
|
||||
<file name="index.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\options\index.ts">
|
||||
<file name="index.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\options\index.ts">
|
||||
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
||||
</file>
|
||||
<file name="transformation.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\options\transformation.ts">
|
||||
<file name="transformation.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\options\transformation.ts">
|
||||
<metrics statements="6" coveredstatements="6" conditionals="3" coveredconditionals="3" methods="2" coveredmethods="2"/>
|
||||
<line num="13" count="16" type="stmt"/>
|
||||
<line num="15" count="16" type="stmt"/>
|
||||
<line num="16" count="102" type="stmt"/>
|
||||
<line num="19" count="102" type="cond" truecount="1" falsecount="0"/>
|
||||
<line num="20" count="90" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="25" count="16" type="stmt"/>
|
||||
<line num="19" count="16" type="stmt"/>
|
||||
<line num="21" count="16" type="stmt"/>
|
||||
<line num="22" count="102" type="stmt"/>
|
||||
<line num="25" count="102" type="cond" truecount="1" falsecount="0"/>
|
||||
<line num="26" count="90" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="32" count="16" type="stmt"/>
|
||||
</file>
|
||||
<file name="validation.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\options\validation.ts">
|
||||
<file name="validation.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\options\validation.ts">
|
||||
<metrics statements="47" coveredstatements="47" conditionals="36" coveredconditionals="36" methods="8" coveredmethods="8"/>
|
||||
<line num="5" count="3" type="stmt"/>
|
||||
<line num="10" count="3" type="stmt"/>
|
||||
<line num="16" count="3" type="stmt"/>
|
||||
<line num="25" count="21" type="stmt"/>
|
||||
<line num="13" count="3" type="stmt"/>
|
||||
<line num="18" count="3" type="stmt"/>
|
||||
<line num="24" count="3" type="stmt"/>
|
||||
<line num="26" count="21" type="stmt"/>
|
||||
<line num="47" count="3" type="stmt"/>
|
||||
<line num="48" count="65" type="stmt"/>
|
||||
<line num="49" count="65" type="stmt"/>
|
||||
<line num="50" count="372" type="stmt"/>
|
||||
<line num="52" count="65" type="stmt"/>
|
||||
<line num="53" count="372" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="54" count="372" type="stmt"/>
|
||||
<line num="55" count="372" type="stmt"/>
|
||||
<line num="56" count="372" type="stmt"/>
|
||||
<line num="57" count="372" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="60" count="372" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="61" count="33" type="stmt"/>
|
||||
<line num="62" count="33" type="stmt"/>
|
||||
<line num="63" count="33" type="stmt"/>
|
||||
<line num="65" count="33" type="stmt"/>
|
||||
<line num="66" count="66" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="67" count="33" type="stmt"/>
|
||||
<line num="71" count="339" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="72" count="336" type="stmt"/>
|
||||
<line num="73" count="336" type="stmt"/>
|
||||
<line num="74" count="336" type="stmt"/>
|
||||
<line num="75" count="336" type="stmt"/>
|
||||
<line num="76" count="336" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="78" count="336" type="stmt"/>
|
||||
<line num="80" count="417" type="stmt"/>
|
||||
<line num="81" count="417" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="83" count="64" type="stmt"/>
|
||||
<line num="84" count="121" type="stmt"/>
|
||||
<line num="87" count="64" type="stmt"/>
|
||||
<line num="90" count="353" type="stmt"/>
|
||||
<line num="94" count="417" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="97" count="417" type="stmt"/>
|
||||
<line num="101" count="336" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="102" count="310" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="103" count="310" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="104" count="256" type="stmt"/>
|
||||
<line num="107" count="26" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="108" count="2" type="stmt"/>
|
||||
<line num="113" count="336" type="stmt"/>
|
||||
<line num="117" count="65" type="stmt"/>
|
||||
<line num="140" count="3" type="stmt"/>
|
||||
<line num="151" count="32" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="27" count="21" type="stmt"/>
|
||||
<line num="50" count="3" type="stmt"/>
|
||||
<line num="57" count="65" type="stmt"/>
|
||||
<line num="58" count="65" type="stmt"/>
|
||||
<line num="59" count="372" type="stmt"/>
|
||||
<line num="61" count="65" type="stmt"/>
|
||||
<line num="62" count="372" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="63" count="372" type="stmt"/>
|
||||
<line num="64" count="372" type="stmt"/>
|
||||
<line num="65" count="372" type="stmt"/>
|
||||
<line num="66" count="372" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="69" count="372" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="70" count="33" type="stmt"/>
|
||||
<line num="71" count="33" type="stmt"/>
|
||||
<line num="72" count="33" type="stmt"/>
|
||||
<line num="74" count="33" type="stmt"/>
|
||||
<line num="75" count="66" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="76" count="33" type="stmt"/>
|
||||
<line num="79" count="339" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="80" count="336" type="stmt"/>
|
||||
<line num="81" count="336" type="stmt"/>
|
||||
<line num="82" count="336" type="stmt"/>
|
||||
<line num="83" count="336" type="stmt"/>
|
||||
<line num="84" count="336" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="88" count="336" type="stmt"/>
|
||||
<line num="90" count="417" type="stmt"/>
|
||||
<line num="91" count="417" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="93" count="64" type="stmt"/>
|
||||
<line num="94" count="121" type="stmt"/>
|
||||
<line num="97" count="64" type="stmt"/>
|
||||
<line num="99" count="353" type="stmt"/>
|
||||
<line num="103" count="417" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="106" count="417" type="stmt"/>
|
||||
<line num="109" count="336" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="110" count="310" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="111" count="310" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="112" count="256" type="stmt"/>
|
||||
<line num="114" count="26" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="115" count="2" type="stmt"/>
|
||||
<line num="123" count="336" type="stmt"/>
|
||||
<line num="127" count="65" type="stmt"/>
|
||||
<line num="150" count="3" type="stmt"/>
|
||||
<line num="165" count="32" type="cond" truecount="4" falsecount="0"/>
|
||||
</file>
|
||||
</package>
|
||||
<package name="src.core.utils">
|
||||
<metrics statements="65" coveredstatements="65" conditionals="71" coveredconditionals="71" methods="17" coveredmethods="17"/>
|
||||
<file name="arrays.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\arrays.ts">
|
||||
<metrics statements="12" coveredstatements="12" conditionals="8" coveredconditionals="8" methods="2" coveredmethods="2"/>
|
||||
<line num="19" count="694" type="stmt"/>
|
||||
<line num="21" count="694" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="22" count="688" type="stmt"/>
|
||||
<line num="23" count="2211" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="24" count="320" type="stmt"/>
|
||||
<line num="27" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="28" count="5" type="stmt"/>
|
||||
<line num="29" count="13" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="30" count="1" type="stmt"/>
|
||||
<line num="33" count="694" type="stmt"/>
|
||||
<line num="42" count="9" type="stmt"/>
|
||||
<line num="43" count="418" type="stmt"/>
|
||||
<metrics statements="57" coveredstatements="57" conditionals="69" coveredconditionals="69" methods="18" coveredmethods="18"/>
|
||||
<file name="arrays.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\arrays.ts">
|
||||
<metrics statements="8" coveredstatements="8" conditionals="6" coveredconditionals="6" methods="3" coveredmethods="3"/>
|
||||
<line num="33" count="699" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="34" count="693" type="stmt"/>
|
||||
<line num="35" count="2224" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="36" count="321" type="stmt"/>
|
||||
<line num="39" count="6" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="40" count="13" type="stmt"/>
|
||||
<line num="42" count="699" type="stmt"/>
|
||||
<line num="51" count="418" type="stmt"/>
|
||||
</file>
|
||||
<file name="extend.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\extend.ts">
|
||||
<file name="extend.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\extend.ts">
|
||||
<metrics statements="21" coveredstatements="21" conditionals="26" coveredconditionals="26" methods="2" coveredmethods="2"/>
|
||||
<line num="11" count="180" type="stmt"/>
|
||||
<line num="14" count="180" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="15" count="3" type="stmt"/>
|
||||
<line num="18" count="180" type="stmt"/>
|
||||
<line num="20" count="1080" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="23" count="217" type="stmt"/>
|
||||
<line num="24" count="632" type="stmt"/>
|
||||
<line num="28" count="632" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="29" count="1" type="stmt"/>
|
||||
<line num="32" count="631" type="stmt"/>
|
||||
<line num="35" count="631" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="36" count="126" type="stmt"/>
|
||||
<line num="37" count="126" type="stmt"/>
|
||||
<line num="40" count="126" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="41" count="33" type="stmt"/>
|
||||
<line num="42" count="93" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="43" count="76" type="stmt"/>
|
||||
<line num="47" count="126" type="stmt"/>
|
||||
<line num="50" count="505" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="51" count="504" type="stmt"/>
|
||||
<line num="58" count="180" type="stmt"/>
|
||||
<line num="20" count="180" type="stmt"/>
|
||||
<line num="23" count="180" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="24" count="3" type="stmt"/>
|
||||
<line num="27" count="180" type="stmt"/>
|
||||
<line num="29" count="1080" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="31" count="217" type="stmt"/>
|
||||
<line num="32" count="632" type="stmt"/>
|
||||
<line num="36" count="632" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="37" count="1" type="stmt"/>
|
||||
<line num="40" count="631" type="stmt"/>
|
||||
<line num="43" count="631" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="44" count="126" type="stmt"/>
|
||||
<line num="45" count="126" type="stmt"/>
|
||||
<line num="48" count="126" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="49" count="33" type="stmt"/>
|
||||
<line num="50" count="93" type="cond" truecount="4" falsecount="0"/>
|
||||
<line num="51" count="76" type="stmt"/>
|
||||
<line num="55" count="126" type="stmt"/>
|
||||
<line num="58" count="505" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="59" count="504" type="stmt"/>
|
||||
<line num="66" count="180" type="stmt"/>
|
||||
</file>
|
||||
<file name="index.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\index.ts">
|
||||
<file name="index.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\index.ts">
|
||||
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
||||
</file>
|
||||
<file name="types.ts" path="C:\Git\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\types.ts">
|
||||
<metrics statements="32" coveredstatements="32" conditionals="37" coveredconditionals="37" methods="13" coveredmethods="13"/>
|
||||
<file name="types.ts" path="D:\Github\OverlayScrollbars\packages\overlayscrollbars\src\core\utils\types.ts">
|
||||
<metrics statements="28" coveredstatements="28" conditionals="37" coveredconditionals="37" methods="13" coveredmethods="13"/>
|
||||
<line num="3" count="11" type="stmt"/>
|
||||
<line num="4" count="576" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="5" count="1" type="stmt"/>
|
||||
<line num="6" count="575" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="7" count="48" type="stmt"/>
|
||||
<line num="8" count="527" type="stmt"/>
|
||||
<line num="12" count="97" type="stmt"/>
|
||||
<line num="16" count="114" type="stmt"/>
|
||||
<line num="20" count="28" type="stmt"/>
|
||||
<line num="24" count="1605" type="cond" truecount="3" falsecount="0"/>
|
||||
<line num="28" count="464" type="stmt"/>
|
||||
<line num="32" count="611" type="stmt"/>
|
||||
<line num="36" count="500" type="stmt"/>
|
||||
<line num="40" count="2666" type="stmt"/>
|
||||
<line num="49" count="761" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="50" count="761" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="5" count="575" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="6" count="527" type="stmt"/>
|
||||
<line num="13" count="97" type="stmt"/>
|
||||
<line num="17" count="114" type="stmt"/>
|
||||
<line num="21" count="28" type="stmt"/>
|
||||
<line num="25" count="464" type="stmt"/>
|
||||
<line num="29" count="611" type="stmt"/>
|
||||
<line num="33" count="500" type="stmt"/>
|
||||
<line num="37" count="2671" type="stmt"/>
|
||||
<line num="41" count="1605" type="cond" truecount="3" falsecount="0"/>
|
||||
<line num="49" count="766" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="50" count="766" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="58" count="1337" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="59" count="1123" type="stmt"/>
|
||||
<line num="61" count="214" type="stmt"/>
|
||||
<line num="62" count="214" type="stmt"/>
|
||||
<line num="63" count="214" type="stmt"/>
|
||||
<line num="64" count="214" type="stmt"/>
|
||||
<line num="65" count="214" type="cond" truecount="3" falsecount="0"/>
|
||||
<line num="67" count="214" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="68" count="3" type="stmt"/>
|
||||
<line num="64" count="214" type="cond" truecount="3" falsecount="0"/>
|
||||
<line num="66" count="214" type="cond" truecount="5" falsecount="0"/>
|
||||
<line num="67" count="3" type="stmt"/>
|
||||
<line num="71" count="211" type="stmt"/>
|
||||
<line num="73" count="211" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="81" count="358" type="stmt"/>
|
||||
<line num="82" count="358" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="83" count="358" type="stmt"/>
|
||||
<line num="93" count="105" type="stmt"/>
|
||||
<line num="94" count="42" type="stmt"/>
|
||||
<line num="95" count="63" type="stmt"/>
|
||||
<line num="76" count="211" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="84" count="358" type="stmt"/>
|
||||
<line num="85" count="358" type="cond" truecount="2" falsecount="0"/>
|
||||
<line num="86" count="358" type="cond" truecount="6" falsecount="0"/>
|
||||
<line num="95" count="105" type="stmt"/>
|
||||
<line num="96" count="63" type="stmt"/>
|
||||
</file>
|
||||
</package>
|
||||
</project>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -23,30 +23,30 @@
|
||||
<div class='clearfix'>
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">94.91% </span>
|
||||
<span class="strong">94.89% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>317/334</span>
|
||||
<span class='fraction'>316/333</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">94.12% </span>
|
||||
<span class="strong">94.06% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>192/204</span>
|
||||
<span class='fraction'>190/202</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">91.14% </span>
|
||||
<span class="strong">90.12% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>72/79</span>
|
||||
<span class='fraction'>73/81</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">94.75% </span>
|
||||
<span class="strong">95.16% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>307/324</span>
|
||||
<span class='fraction'>295/310</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="6" class="abs high">6/6</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="33" class="abs high">33/33</td>
|
||||
<td data-value="32" class="abs high">32/32</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -99,7 +99,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="10" class="abs high">10/10</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="49" class="abs high">49/49</td>
|
||||
<td data-value="47" class="abs high">47/47</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -111,10 +111,10 @@
|
||||
<td data-value="131" class="abs high">114/131</td>
|
||||
<td data-value="84.81" class="pct high">84.81%</td>
|
||||
<td data-value="79" class="abs high">67/79</td>
|
||||
<td data-value="80.56" class="pct high">80.56%</td>
|
||||
<td data-value="36" class="abs high">29/36</td>
|
||||
<td data-value="86.29" class="pct high">86.29%</td>
|
||||
<td data-value="124" class="abs high">107/124</td>
|
||||
<td data-value="78.38" class="pct medium">78.38%</td>
|
||||
<td data-value="37" class="abs medium">29/37</td>
|
||||
<td data-value="87.6" class="pct high">87.6%</td>
|
||||
<td data-value="121" class="abs high">106/121</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -138,13 +138,13 @@
|
||||
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
||||
</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="65" class="abs high">65/65</td>
|
||||
<td data-value="64" class="abs high">64/64</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="71" class="abs high">71/71</td>
|
||||
<td data-value="69" class="abs high">69/69</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="17" class="abs high">17/17</td>
|
||||
<td data-value="18" class="abs high">18/18</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="65" class="abs high">65/65</td>
|
||||
<td data-value="57" class="abs high">57/57</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
@@ -155,7 +155,7 @@
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>49/49</span>
|
||||
<span class='fraction'>47/47</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="10" class="abs high">10/10</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="49" class="abs high">49/49</td>
|
||||
<td data-value="47" class="abs high">47/47</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
@@ -95,7 +95,7 @@
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>49/49</span>
|
||||
<span class='fraction'>47/47</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -155,19 +155,14 @@
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L99'></a><a href='#L99'>99</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">20x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">10x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -184,6 +179,7 @@
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -216,6 +212,7 @@
|
||||
<span class="cline-any cline-yes">11x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
@@ -247,6 +244,7 @@
|
||||
<span class="cline-any cline-yes">5x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">11x</span>
|
||||
<span class="cline-any cline-yes">11x</span>
|
||||
@@ -258,14 +256,10 @@
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { each } from 'core/utils';
|
||||
import { createDiv } from 'core/dom';
|
||||
|
||||
const firstLetterToUpper: (str: string) => string = (str) => {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
}
|
||||
const getDummyStyle: () => CSSStyleDeclaration = () => {
|
||||
return createDiv().style;
|
||||
}
|
||||
const firstLetterToUpper: (str: string) => string = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
||||
const getDummyStyle: () => CSSStyleDeclaration = () => createDiv().style;
|
||||
|
||||
//https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix
|
||||
// https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix
|
||||
|
||||
export const cssPrefixes: ReadonlyArray<string> = ['-webkit-', '-moz-', '-o-', '-ms-'];
|
||||
export const jsPrefixes: ReadonlyArray<string> = ['WebKit', 'Moz', 'O', 'MS', 'webkit', 'moz', 'o', 'ms'];
|
||||
@@ -278,82 +272,85 @@ export const cssCache: { [key: string]: string } = {};
|
||||
* @param name The name of the CSS property which shall be get.
|
||||
*/
|
||||
export const cssProperty: (name: string) => string | undefined = (name) => {
|
||||
let result: string | undefined = cssCache[name];
|
||||
let result: string | undefined = cssCache[name];
|
||||
|
||||
if (cssCache.hasOwnProperty(name))
|
||||
return result;
|
||||
|
||||
const uppercasedName: string = firstLetterToUpper(name);
|
||||
const elmStyle: CSSStyleDeclaration = getDummyStyle();
|
||||
|
||||
each(cssPrefixes, (prefix: string) => {
|
||||
const prefixWithoutDashes: string = prefix.replace(/-/g, '');
|
||||
const resultPossibilities: Array<string> = [
|
||||
name, //transition
|
||||
prefix + name, //-webkit-transition
|
||||
prefixWithoutDashes + uppercasedName, //webkitTransition
|
||||
firstLetterToUpper(prefixWithoutDashes) + uppercasedName //WebkitTransition
|
||||
];
|
||||
result = resultPossibilities.find((resultPossibility: string) => elmStyle[resultPossibility] !== undefined);
|
||||
return !result;
|
||||
});
|
||||
|
||||
cssCache[name] = result;
|
||||
if (cssCache.hasOwnProperty(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
const uppercasedName: string = firstLetterToUpper(name);
|
||||
const elmStyle: CSSStyleDeclaration = getDummyStyle();
|
||||
|
||||
each(cssPrefixes, (prefix: string) => {
|
||||
const prefixWithoutDashes: string = prefix.replace(/-/g, '');
|
||||
const resultPossibilities: Array<string> = [
|
||||
name, // transition
|
||||
prefix + name, // -webkit-transition
|
||||
prefixWithoutDashes + uppercasedName, // webkitTransition
|
||||
firstLetterToUpper(prefixWithoutDashes) + uppercasedName, // WebkitTransition
|
||||
];
|
||||
result = resultPossibilities.find((resultPossibility: string) => elmStyle[resultPossibility] !== undefined);
|
||||
return !result;
|
||||
});
|
||||
|
||||
cssCache[name] = result;
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the name of the given CSS property value(s), with vendor prefix if it isn't supported wuthout, or undefined if no value is supported.
|
||||
* Get the name of the given CSS property value(s), with vendor prefix if it isn't supported wuthout, or undefined if no value is supported.
|
||||
* @param property The CSS property to which the CSS property value(s) belong.
|
||||
* @param values The value(s) separated by spaces which shall be get.
|
||||
* @param suffix A suffix which is added to each value in case the value is a function or something else more advanced.
|
||||
*/
|
||||
export const cssPropertyValue: (property: string, values: string, suffix?: string) => string | undefined = (property, values, suffix) => {
|
||||
const name: string = property + ' ' + values;
|
||||
let result: string | undefined = cssCache[name];
|
||||
const name = `${property} ${values}`;
|
||||
let result: string | undefined = cssCache[name];
|
||||
|
||||
if (cssCache.hasOwnProperty(name))
|
||||
return result;
|
||||
|
||||
const dummyStyle: CSSStyleDeclaration = getDummyStyle();
|
||||
const possbleValues: Array<string> = values.split(' ');
|
||||
const preparedSuffix: string = suffix || '';
|
||||
const cssPrefixesWithFirstEmpty = [''].concat(cssPrefixes);
|
||||
|
||||
each(possbleValues, (possibleValue: string) => {
|
||||
each(cssPrefixesWithFirstEmpty, (prefix: string) => {
|
||||
const prop = prefix + possibleValue;
|
||||
dummyStyle.cssText = property + ':' + prop + preparedSuffix;
|
||||
if (dummyStyle.length) {
|
||||
result = prop;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return !result;
|
||||
});
|
||||
|
||||
cssCache[name] = result;
|
||||
if (cssCache.hasOwnProperty(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
const dummyStyle: CSSStyleDeclaration = getDummyStyle();
|
||||
const possbleValues: Array<string> = values.split(' ');
|
||||
const preparedSuffix: string = suffix || '';
|
||||
const cssPrefixesWithFirstEmpty = [''].concat(cssPrefixes);
|
||||
|
||||
each(possbleValues, (possibleValue: string) => {
|
||||
each(cssPrefixesWithFirstEmpty, (prefix: string) => {
|
||||
const prop = prefix + possibleValue;
|
||||
dummyStyle.cssText = `${property}:${prop}${preparedSuffix}`;
|
||||
if (dummyStyle.length) {
|
||||
result = prop;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return !result;
|
||||
});
|
||||
|
||||
cssCache[name] = result;
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the requested JS function, object or constructor with vendor prefix if it isn't supported without or undefined if unsupported.
|
||||
* @param name The name of the JS function, object or constructor.
|
||||
*/
|
||||
export const jsAPI: (name: string) => any = (name) => {
|
||||
let result: any = jsCache[name] || window[name];
|
||||
let result: any = jsCache[name] || window[name];
|
||||
|
||||
if (jsCache.hasOwnProperty(name))
|
||||
return result;
|
||||
|
||||
each(jsPrefixes, (prefix: string) => {
|
||||
result = result || window[prefix + firstLetterToUpper(name)];
|
||||
return !result;
|
||||
});
|
||||
|
||||
jsCache[name] = result;
|
||||
if (jsCache.hasOwnProperty(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
each(jsPrefixes, (prefix: string) => {
|
||||
result = result || window[prefix + firstLetterToUpper(name)];
|
||||
return !result;
|
||||
});
|
||||
|
||||
jsCache[name] = result;
|
||||
return result;
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
@@ -361,7 +358,7 @@ export const jsAPI: (name: string) => any = (name) => {
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -110,7 +110,12 @@
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -120,6 +125,7 @@
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
<span class="cline-any cline-yes">5x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -140,6 +146,7 @@
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -151,6 +158,7 @@
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -162,7 +170,9 @@
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">5x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
||||
* Gets or sets a attribute with the given attribute of the given element depending whether the value attribute is given.
|
||||
* Returns null if the element has no attribute with the given name.
|
||||
@@ -171,10 +181,11 @@
|
||||
* @param value The value of the attribute which shall be set.
|
||||
*/
|
||||
export const attr: (elm: Element, attrName: string, value?: string) => string | null | void = (elm, attrName, value) => {
|
||||
if (value === undefined)
|
||||
return elm.getAttribute(attrName);
|
||||
elm.setAttribute(attrName, value);
|
||||
}
|
||||
if (value === undefined) {
|
||||
return elm.getAttribute(attrName);
|
||||
}
|
||||
elm.setAttribute(attrName, value);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the given attribute from the given element.
|
||||
@@ -182,8 +193,8 @@ export const attr: (elm: Element, attrName: string, value?: string) => string
|
||||
* @param attrName The attribute name.
|
||||
*/
|
||||
export const removeAttr: (elm: Element, attrName: string) => void = (elm, attrName) => {
|
||||
elm.removeAttribute(attrName);
|
||||
}
|
||||
elm.removeAttribute(attrName);
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets or sets the scrollLeft value of the given element depending whether the value attribute is given.
|
||||
@@ -191,10 +202,11 @@ export const removeAttr: (elm: Element, attrName: string) => void = (elm, att
|
||||
* @param value The scrollLeft value which shall be set.
|
||||
*/
|
||||
export const scrollLeft: (elm: HTMLElement, value?: number) => number | void = (elm, value) => {
|
||||
if (value === undefined)
|
||||
return elm.scrollLeft;
|
||||
elm.scrollLeft = value;
|
||||
}
|
||||
if (value === undefined) {
|
||||
return elm.scrollLeft;
|
||||
}
|
||||
elm.scrollLeft = value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets or sets the scrollTop value of the given element depending whether the value attribute is given.
|
||||
@@ -202,10 +214,11 @@ export const scrollLeft: (elm: HTMLElement, value?: number) => number | void
|
||||
* @param value The scrollTop value which shall be set.
|
||||
*/
|
||||
export const scrollTop: (elm: HTMLElement, value?: number) => number | void = (elm, value) => {
|
||||
if (value === undefined)
|
||||
return elm.scrollTop;
|
||||
elm.scrollTop = value;
|
||||
}
|
||||
if (value === undefined) {
|
||||
return elm.scrollTop;
|
||||
}
|
||||
elm.scrollTop = value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets or sets the value of the given input element depending whether the value attribute is given.
|
||||
@@ -213,17 +226,19 @@ export const scrollTop: (elm: HTMLElement, value?: number) => number | void =
|
||||
* @param value The value which shall be set.
|
||||
*/
|
||||
export const val: (elm: HTMLInputElement, value?: string) => string | void = (elm, value) => {
|
||||
if (value === undefined)
|
||||
return elm.value;
|
||||
elm.value = value;
|
||||
}</pre></td></tr></table></pre>
|
||||
if (value === undefined) {
|
||||
return elm.value;
|
||||
}
|
||||
elm.value = value;
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>19/19</span>
|
||||
<span class='fraction'>18/18</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -124,7 +124,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -132,7 +131,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">11x</span>
|
||||
@@ -149,6 +147,7 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
@@ -166,25 +165,24 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { isString } from 'core/utils/types';
|
||||
|
||||
const rnothtmlwhite: RegExp = (/[^\x20\t\r\n\f]+/g);
|
||||
const rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
|
||||
|
||||
/**
|
||||
* Check whether the given element has the given class name.
|
||||
* @param elm The element.
|
||||
* @param className The class name.
|
||||
*/
|
||||
export const hasClass: (elm: Element, className: string) => boolean = (elm, className) => {
|
||||
return elm.classList.contains(className);
|
||||
}
|
||||
export const hasClass: (elm: Element, className: string) => boolean = (elm, className) => elm.classList.contains(className);
|
||||
|
||||
/**
|
||||
* Adds the given class name(s) to the given element.
|
||||
@@ -192,15 +190,16 @@ export const hasClass: (elm: Element, className: string) => boolean = (elm, c
|
||||
* @param className The class name(s) which shall be added. (separated by spaces)
|
||||
*/
|
||||
export const addClass: (elm: Element, className: string) => void = (elm, className) => {
|
||||
let clazz: string;
|
||||
let i: number = 0;
|
||||
let clazz: string;
|
||||
let i = 0;
|
||||
|
||||
if (isString(className)) {
|
||||
const classes: Array<string> = className.match(rnothtmlwhite) || [];
|
||||
while ((clazz = classes[i++]))
|
||||
elm.classList.add(clazz);
|
||||
if (isString(className)) {
|
||||
const classes: Array<string> = className.match(rnothtmlwhite) || [];
|
||||
while ((clazz = classes[i++])) {
|
||||
elm.classList.add(clazz);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the given class name(s) from the given element.
|
||||
@@ -208,15 +207,16 @@ export const addClass: (elm: Element, className: string) => void = (elm, clas
|
||||
* @param className The class name(s) which shall be removed. (separated by spaces)
|
||||
*/
|
||||
export const removeClass: (elm: Element, className: string) => void = (elm, className) => {
|
||||
let clazz: string;
|
||||
let i: number = 0;
|
||||
let clazz: string;
|
||||
let i = 0;
|
||||
|
||||
if (isString(className)) {
|
||||
const classes: Array<string> = className.match(rnothtmlwhite) || [];
|
||||
while ((clazz = classes[i++]))
|
||||
elm.classList.remove(clazz);
|
||||
if (isString(className)) {
|
||||
const classes: Array<string> = className.match(rnothtmlwhite) || [];
|
||||
while ((clazz = classes[i++])) {
|
||||
elm.classList.remove(clazz);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds or removes the given class name(s) from the given element depending on the given condition.
|
||||
@@ -225,20 +225,20 @@ export const removeClass: (elm: Element, className: string) => void = (elm, c
|
||||
* @param className The class name(s) which shall be added or removed. (separated by spaces)
|
||||
*/
|
||||
export const conditionalClass: (elm: Element, className: string, condition: boolean) => void = (elm, className, condition) => {
|
||||
if (condition) {
|
||||
addClass(elm, className);
|
||||
}
|
||||
else {
|
||||
removeClass(elm, className);
|
||||
}
|
||||
}</pre></td></tr></table></pre>
|
||||
if (condition) {
|
||||
addClass(elm, className);
|
||||
} else {
|
||||
removeClass(elm, className);
|
||||
}
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>6/6</span>
|
||||
<span class='fraction'>5/5</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -69,41 +69,38 @@
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L13'></a><a href='#L13'>13</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">204x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">9x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { each } from 'core/utils/arrays';
|
||||
import { contents } from 'core/dom/traversal';
|
||||
import { removeElements } from 'core/dom/manipulation';
|
||||
|
||||
export const createDiv: () => HTMLDivElement = () => {
|
||||
return document.createElement('div');
|
||||
}
|
||||
export const createDiv: () => HTMLDivElement = () => document.createElement('div');
|
||||
|
||||
export const createDOM: (html: string) => ReadonlyArray<Node> = (html) => {
|
||||
const elm = createDiv();
|
||||
elm.innerHTML = html.trim();
|
||||
const createdDiv = createDiv();
|
||||
createdDiv.innerHTML = html.trim();
|
||||
|
||||
return each(contents(elm), (elm) => removeElements(elm));
|
||||
}</pre></td></tr></table></pre>
|
||||
return each(contents(createdDiv), (elm) => removeElements(elm));
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -37,16 +37,16 @@
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">80.56% </span>
|
||||
<span class="strong">78.38% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>29/36</span>
|
||||
<span class='fraction'>29/37</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">86.29% </span>
|
||||
<span class="strong">87.6% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>107/124</span>
|
||||
<span class='fraction'>106/121</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="4" class="abs high">4/4</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="19" class="abs high">19/19</td>
|
||||
<td data-value="18" class="abs high">18/18</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -114,7 +114,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="3" class="abs high">3/3</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="6" class="abs high">6/6</td>
|
||||
<td data-value="5" class="abs high">5/5</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -144,7 +144,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="8" class="abs high">8/8</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="28" class="abs high">28/28</td>
|
||||
<td data-value="32" class="abs high">32/32</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -158,8 +158,8 @@
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="0" class="pct low">0%</td>
|
||||
<td data-value="2" class="abs low">0/2</td>
|
||||
<td data-value="40" class="pct low">40%</td>
|
||||
<td data-value="5" class="abs low">2/5</td>
|
||||
<td data-value="50" class="pct medium">50%</td>
|
||||
<td data-value="4" class="abs medium">2/4</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -172,9 +172,9 @@
|
||||
<td data-value="0" class="pct low">0%</td>
|
||||
<td data-value="12" class="abs low">0/12</td>
|
||||
<td data-value="0" class="pct low">0%</td>
|
||||
<td data-value="5" class="abs low">0/5</td>
|
||||
<td data-value="26.32" class="pct low">26.32%</td>
|
||||
<td data-value="19" class="abs low">5/19</td>
|
||||
<td data-value="6" class="abs low">0/6</td>
|
||||
<td data-value="27.78" class="pct low">27.78%</td>
|
||||
<td data-value="18" class="abs low">5/18</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -189,7 +189,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="9" class="abs high">9/9</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="29" class="abs high">29/29</td>
|
||||
<td data-value="26" class="abs high">26/26</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
@@ -200,7 +200,7 @@
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -75,14 +77,15 @@ export * from 'core/dom/create';
|
||||
export * from 'core/dom/style';
|
||||
export * from 'core/dom/manipulation';
|
||||
export * from 'core/dom/offset';
|
||||
export * from 'core/dom/traversal';</pre></td></tr></table></pre>
|
||||
export * from 'core/dom/traversal';
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>28/28</span>
|
||||
<span class='fraction'>32/32</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -147,7 +147,18 @@
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -160,6 +171,10 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">24x</span>
|
||||
<span class="cline-any cline-yes">20x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -177,7 +192,6 @@
|
||||
<span class="cline-any cline-yes">24x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">8x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -185,7 +199,6 @@
|
||||
<span class="cline-any cline-yes">16x</span>
|
||||
<span class="cline-any cline-yes">12x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">11x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -201,6 +214,7 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -208,6 +222,8 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -215,6 +231,8 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -222,22 +240,26 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-yes">9x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">21x</span>
|
||||
<span class="cline-any cline-yes">20x</span>
|
||||
<span class="cline-any cline-yes">20x</span>
|
||||
<span class="cline-any cline-yes">15x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { isArrayLike, isHTMLElement } from 'core/utils/types';
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { isArrayLike } from 'core/utils/types';
|
||||
import { each } from 'core/utils/arrays';
|
||||
import { parent } from 'core/dom/traversal';
|
||||
|
||||
@@ -245,96 +267,107 @@ type NodeCollection = ArrayLike<Node> | Node | undefined | null;
|
||||
|
||||
/**
|
||||
* Inserts Nodes before the given preferredAnchor element.
|
||||
* @param parent The parent of the preferredAnchor element or the element which shall be the parent of the inserted Nodes.
|
||||
* @param parentElm The parent of the preferredAnchor element or the element which shall be the parent of the inserted Nodes.
|
||||
* @param preferredAnchor The element before which the Nodes shall be inserted or null if the elements shall be appended at the end.
|
||||
* @param insertedElms The Nodes which shall be inserted.
|
||||
*/
|
||||
const before: (parent: Node | null, preferredAnchor: Node | null, insertedElms: NodeCollection) => void = (parent, preferredAnchor, insertedElms) => {
|
||||
if (insertedElms) {
|
||||
let anchor: Node | null = preferredAnchor;
|
||||
let fragment: DocumentFragment | Node | undefined | null;
|
||||
const before: (parentElm: Node | null, preferredAnchor: Node | null, insertedElms: NodeCollection) => void = (
|
||||
parentElm,
|
||||
preferredAnchor,
|
||||
insertedElms,
|
||||
) => {
|
||||
if (insertedElms) {
|
||||
let anchor: Node | null = preferredAnchor;
|
||||
let fragment: DocumentFragment | Node | undefined | null;
|
||||
|
||||
// parent must be defined
|
||||
if (parent) {
|
||||
if (isArrayLike(insertedElms)) {
|
||||
fragment = document.createDocumentFragment();
|
||||
// parent must be defined
|
||||
if (parentElm) {
|
||||
if (isArrayLike(insertedElms)) {
|
||||
fragment = document.createDocumentFragment();
|
||||
|
||||
// append all insertedElms to the fragment and if one of these is the anchor, change the anchor
|
||||
each(insertedElms, (insertedElm) => {
|
||||
if (insertedElm === anchor) {
|
||||
anchor = insertedElm.previousSibling;
|
||||
}
|
||||
fragment!.appendChild(insertedElm);
|
||||
});
|
||||
}
|
||||
else {
|
||||
fragment = insertedElms;
|
||||
}
|
||||
// append all insertedElms to the fragment and if one of these is the anchor, change the anchor
|
||||
each(insertedElms, (insertedElm) => {
|
||||
if (insertedElm === anchor) {
|
||||
anchor = insertedElm.previousSibling;
|
||||
}
|
||||
fragment!.appendChild(insertedElm);
|
||||
});
|
||||
} else {
|
||||
fragment = insertedElms;
|
||||
}
|
||||
|
||||
// if the preferred anchor isn't null set it to a valid anchor
|
||||
if (preferredAnchor) {
|
||||
if (!anchor) {
|
||||
anchor = parent.firstChild;
|
||||
}
|
||||
else if (anchor !== preferredAnchor) {
|
||||
anchor = anchor.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
parent.insertBefore(fragment, anchor);
|
||||
// if the preferred anchor isn't null set it to a valid anchor
|
||||
if (preferredAnchor) {
|
||||
if (!anchor) {
|
||||
anchor = parentElm.firstChild;
|
||||
} else if (anchor !== preferredAnchor) {
|
||||
anchor = anchor.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
parentElm.insertBefore(fragment, anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends the given children at the end of the given Node.
|
||||
* @param node The Node to which the children shall be appended.
|
||||
* @param children The Nodes which shall be appended.
|
||||
*/
|
||||
export const appendChildren: (node: Node | null, children: NodeCollection) => void = (node, children) => { before(node, null, children) };
|
||||
export const appendChildren: (node: Node | null, children: NodeCollection) => void = (node, children) => {
|
||||
before(node, null, children);
|
||||
};
|
||||
|
||||
/**
|
||||
* Prepends the given children at the start of the given Node.
|
||||
* @param node The Node to which the children shall be prepended.
|
||||
* @param children The Nodes which shall be prepended.
|
||||
*/
|
||||
export const prependChildren: (node: Node | null, children: NodeCollection) => void = (node, children) => { before(node, node && node.firstChild, children) };
|
||||
export const prependChildren: (node: Node | null, children: NodeCollection) => void = (node, children) => {
|
||||
before(node, node && node.firstChild, children);
|
||||
};
|
||||
|
||||
/**
|
||||
* Inserts the given Nodes before the given Node.
|
||||
* @param node The Node before which the given Nodes shall be inserted.
|
||||
* @param insertedNodes The Nodes which shall be inserted.
|
||||
*/
|
||||
export const insertBefore: (node: Node | null, insertedNodes: NodeCollection) => void = (node, insertedNodes) => { before(parent(node), node, insertedNodes) };
|
||||
export const insertBefore: (node: Node | null, insertedNodes: NodeCollection) => void = (node, insertedNodes) => {
|
||||
before(parent(node), node, insertedNodes);
|
||||
};
|
||||
|
||||
/**
|
||||
* Inserts the given Nodes after the given Node.
|
||||
* @param node The Node after which the given Nodes shall be inserted.
|
||||
* @param insertedNodes The Nodes which shall be inserted.
|
||||
*/
|
||||
export const insertAfter: (node: Node | null, insertedNodes: NodeCollection) => void = (node, insertedNodes) => { before(parent(node), node && node.nextSibling, insertedNodes) };
|
||||
export const insertAfter: (node: Node | null, insertedNodes: NodeCollection) => void = (node, insertedNodes) => {
|
||||
before(parent(node), node && node.nextSibling, insertedNodes);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the given Nodes from their parent.
|
||||
* @param nodes The Nodes which shall be removed.
|
||||
*/
|
||||
export const removeElements: (nodes: NodeCollection) => void = (nodes) => {
|
||||
if (isArrayLike(nodes)) {
|
||||
each(Array.from(nodes), (e) => removeElements(e));
|
||||
if (isArrayLike(nodes)) {
|
||||
each(Array.from(nodes), (e) => removeElements(e));
|
||||
} else if (nodes) {
|
||||
const { parentNode } = nodes;
|
||||
if (parentNode) {
|
||||
parentNode.removeChild(nodes);
|
||||
}
|
||||
else if (nodes) {
|
||||
const parentNode = nodes.parentNode;
|
||||
if (parentNode)
|
||||
parentNode.removeChild(nodes);
|
||||
}
|
||||
}</pre></td></tr></table></pre>
|
||||
}
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">40% </span>
|
||||
<span class="strong">50% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>2/5</span>
|
||||
<span class='fraction'>2/4</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -69,8 +69,7 @@
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
|
||||
<a name='L13'></a><a href='#L13'>13</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -79,31 +78,29 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">export const offset = <span class="fstat-no" title="function not covered" >(e</span>lm: HTMLElement) => {
|
||||
const rect = <span class="cstat-no" title="statement not covered" >elm.getBoundingClientRect();</span>
|
||||
<span class="cstat-no" title="statement not covered" > return {</span>
|
||||
top: rect.top + window.pageXOffset,
|
||||
left: rect.left + window.pageYOffset
|
||||
};
|
||||
}
|
||||
const rect = <span class="cstat-no" title="statement not covered" >elm.getBoundingClientRect();</span>
|
||||
<span class="cstat-no" title="statement not covered" > return {</span>
|
||||
top: rect.top + window.pageXOffset,
|
||||
left: rect.left + window.pageYOffset,
|
||||
};
|
||||
};
|
||||
|
||||
export const position = <span class="fstat-no" title="function not covered" >(e</span>lm: HTMLElement) => {
|
||||
<span class="cstat-no" title="statement not covered" > return {</span>
|
||||
top: elm.offsetTop,
|
||||
left: elm.offsetLeft
|
||||
};
|
||||
}</pre></td></tr></table></pre>
|
||||
export const position = <span class="fstat-no" title="function not covered" >(e</span>lm: HTMLElement) => (<span class="cstat-no" title="statement not covered" >{</span>
|
||||
top: elm.offsetTop,
|
||||
left: elm.offsetLeft,
|
||||
});
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -39,14 +39,14 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/5</span>
|
||||
<span class='fraction'>0/6</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">26.32% </span>
|
||||
<span class="strong">27.78% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>5/19</span>
|
||||
<span class='fraction'>5/18</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -113,13 +113,7 @@
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L57'></a><a href='#L57'>57</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -141,14 +135,13 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -163,12 +156,8 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -180,69 +169,62 @@
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { isString, isNumber, isUndefined } from 'core/utils/types';
|
||||
|
||||
type cssStyleObj = { [key: string]: string | number };
|
||||
|
||||
const cssNumber = {
|
||||
animationIterationCount: true,
|
||||
columnCount: true,
|
||||
fillOpacity: true,
|
||||
flexGrow: true,
|
||||
flexShrink: true,
|
||||
fontWeight: true,
|
||||
lineHeight: true,
|
||||
opacity: true,
|
||||
order: true,
|
||||
orphans: true,
|
||||
widows: true,
|
||||
zIndex: true,
|
||||
zoom: true
|
||||
animationIterationCount: true,
|
||||
columnCount: true,
|
||||
fillOpacity: true,
|
||||
flexGrow: true,
|
||||
flexShrink: true,
|
||||
fontWeight: true,
|
||||
lineHeight: true,
|
||||
opacity: true,
|
||||
order: true,
|
||||
orphans: true,
|
||||
widows: true,
|
||||
zIndex: true,
|
||||
zoom: true,
|
||||
};
|
||||
|
||||
const setCSSVal: (elm: HTMLElement, prop: string, val: string | number) => void = <span class="fstat-no" title="function not covered" >(e</span>lm, prop, val) => {
|
||||
<span class="cstat-no" title="statement not covered" > try {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (elm.style[prop] !== undefined) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > elm.style[prop] = parseCSSVal(prop, val);</span>
|
||||
}
|
||||
} catch (e) { }
|
||||
}
|
||||
const parseCSSVal: (prop: string, val: string | number) => string | number = <span class="fstat-no" title="function not covered" >(p</span>rop, val) =>
|
||||
<span class="cstat-no" title="statement not covered" > !cssNumber[prop.toLowerCase()] && isNumber(val) ? `${val}px` : val;</span>
|
||||
|
||||
const parseCSSVal: (prop: string, val: string | number) => string | number = <span class="fstat-no" title="function not covered" >(p</span>rop, val) => {
|
||||
<span class="cstat-no" title="statement not covered" > return !cssNumber[prop.toLowerCase()] && isNumber(val) ? val + 'px' : val;</span>
|
||||
}
|
||||
const setCSSVal: (elm: HTMLElement, prop: string, val: string | number) => void = <span class="fstat-no" title="function not covered" >(e</span>lm, prop, val) => {
|
||||
<span class="cstat-no" title="statement not covered" > try {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (elm.style[prop] !== undefined) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > elm.style[prop] = parseCSSVal(prop, val);</span>
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
|
||||
export function style(elm: HTMLElement, styles: string | cssStyleObj): string;
|
||||
export function style(elm: HTMLElement, styles: string | cssStyleObj, val: string | number): void;
|
||||
export function <span class="fstat-no" title="function not covered" >style(</span>elm: HTMLElement, styles: string | cssStyleObj, val?: string | number): string | void {
|
||||
const getCptStyle: Function = <span class="cstat-no" title="statement not covered" >window.getComputedStyle;</span>
|
||||
const getCptStyle = <span class="cstat-no" title="statement not covered" >window.getComputedStyle;</span>
|
||||
|
||||
<span class="cstat-no" title="statement not covered" > if (isString(styles)) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (isUndefined(val)) {</span>
|
||||
const cptStyle: CSSStyleDeclaration = <span class="cstat-no" title="statement not covered" >getCptStyle(elm, null);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (isString(styles)) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (isUndefined(val)) {</span>
|
||||
const cptStyle: CSSStyleDeclaration = <span class="cstat-no" title="statement not covered" >getCptStyle(elm, null);</span>
|
||||
|
||||
//https://bugzilla.mozilla.org/show_bug.cgi?id=548397 can be null sometimes if iframe with display: none (firefox only!)
|
||||
<span class="cstat-no" title="statement not covered" > return cptStyle != null ? cptStyle.getPropertyValue(styles) : elm.style[styles];</span>
|
||||
}
|
||||
else {
|
||||
<span class="cstat-no" title="statement not covered" > setCSSVal(elm, styles, val);</span>
|
||||
}
|
||||
}
|
||||
else {
|
||||
<span class="cstat-no" title="statement not covered" > for (const key in styles)</span>
|
||||
<span class="cstat-no" title="statement not covered" > setCSSVal(elm, key, styles[key]);</span>
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=548397 can be null sometimes if iframe with display: none (firefox only!)
|
||||
<span class="cstat-no" title="statement not covered" > return cptStyle != null ? cptStyle.getPropertyValue(styles) : elm.style[styles];</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > setCSSVal(elm, styles, val);</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > Object.keys(styles).forEach(<span class="fstat-no" title="function not covered" >(k</span>ey) => <span class="cstat-no" title="statement not covered" >setCSSVal(elm, key, styles[key]))</span>;</span>
|
||||
}
|
||||
}
|
||||
|
||||
export const hide: (elm: HTMLElement) => void = <span class="fstat-no" title="function not covered" >(e</span>lm) => {
|
||||
<span class="cstat-no" title="statement not covered" > elm.style.display = 'none';</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > elm.style.display = 'none';</span>
|
||||
};
|
||||
|
||||
export const show: (elm: HTMLElement) => void = <span class="fstat-no" title="function not covered" >(e</span>lm) => {
|
||||
<span class="cstat-no" title="statement not covered" > elm.style.display = 'block';</span>
|
||||
}
|
||||
|
||||
<span class="cstat-no" title="statement not covered" > elm.style.display = 'block';</span>
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
@@ -250,7 +232,7 @@ export const show: (elm: HTMLElement) => void = <span class="fstat-no" title=
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>29/29</span>
|
||||
<span class='fraction'>26/26</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -107,12 +107,9 @@
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L51'></a><a href='#L51'>51</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
@@ -124,19 +121,20 @@
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">19x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">31x</span>
|
||||
<span class="cline-any cline-yes">22x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">20x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">18x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">21x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -152,72 +150,71 @@
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">38x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">14x</span></td><td class="text"><pre class="prettyprint lang-js">import { each } from 'core/utils/arrays';
|
||||
<span class="cline-any cline-yes">14x</span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { each } from 'core/utils/arrays';
|
||||
|
||||
const elementIsVisible: (elm: HTMLElement) => boolean = (elm) => {
|
||||
return !!(elm.offsetWidth || elm.offsetHeight || elm.getClientRects().length);
|
||||
}
|
||||
const elementIsVisible: (elm: HTMLElement) => boolean = (elm) => !!(elm.offsetWidth || elm.offsetHeight || elm.getClientRects().length);
|
||||
|
||||
export const find: (selector: string, elm?: Element | null) => ReadonlyArray<Element> = (selector, elm?) => {
|
||||
const arr: Array<Element> = [];
|
||||
const arr: Array<Element> = [];
|
||||
|
||||
each((elm || document).querySelectorAll(selector), (e: Element) => {
|
||||
arr.push(e);
|
||||
});
|
||||
each((elm || document).querySelectorAll(selector), (e: Element) => {
|
||||
arr.push(e);
|
||||
});
|
||||
|
||||
return arr;
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
|
||||
export const findFirst: (selector: string, elm?: Element | null) => Element | null = (selector, elm?) => {
|
||||
return (elm || document).querySelector(selector);
|
||||
}
|
||||
export const findFirst: (selector: string, elm?: Element | null) => Element | null = (selector, elm?) => (elm || document).querySelector(selector);
|
||||
|
||||
export const is: (elm: Element | null, selector: string) => boolean = (elm, selector) => {
|
||||
if (elm) {
|
||||
if (selector === ':visible')
|
||||
return elementIsVisible(elm as HTMLElement);
|
||||
if (selector === ':hidden')
|
||||
return !elementIsVisible(elm as HTMLElement);
|
||||
if (elm.matches(selector))
|
||||
return true;
|
||||
if (elm) {
|
||||
if (selector === ':visible') {
|
||||
return elementIsVisible(elm as HTMLElement);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (selector === ':hidden') {
|
||||
return !elementIsVisible(elm as HTMLElement);
|
||||
}
|
||||
if (elm.matches(selector)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
export const children: (elm: Element | null, selector?: string) => ReadonlyArray<Element> = (elm, selector?) => {
|
||||
const children: Array<Element> = [];
|
||||
const childs: Array<Element> = [];
|
||||
|
||||
each(elm && elm.children, (child: Element) => {
|
||||
if (selector) {
|
||||
if (child.matches(selector))
|
||||
children.push(child);
|
||||
}
|
||||
else
|
||||
children.push(child);
|
||||
});
|
||||
each(elm && elm.children, (child: Element) => {
|
||||
if (selector) {
|
||||
if (child.matches(selector)) {
|
||||
childs.push(child);
|
||||
}
|
||||
} else {
|
||||
childs.push(child);
|
||||
}
|
||||
});
|
||||
|
||||
return children;
|
||||
}
|
||||
return childs;
|
||||
};
|
||||
|
||||
export const contents: (elm: Element | null) => ReadonlyArray<ChildNode> = (elm) => {
|
||||
return elm ? Array.from<ChildNode>(elm.childNodes) : [];
|
||||
}
|
||||
export const contents: (elm: Element | null) => ReadonlyArray<ChildNode> = (elm) => (elm ? Array.from<ChildNode>(elm.childNodes) : []);
|
||||
|
||||
export const parent: (elm: Node | null) => Node | null = (elm) => elm ? elm.parentElement : null;</pre></td></tr></table></pre>
|
||||
export const parent: (elm: Node | null) => Node | null = (elm) => (elm ? elm.parentElement : null);
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -58,16 +58,19 @@
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">export * from 'core/options/validation';
|
||||
export * from 'core/options/transformation';</pre></td></tr></table></pre>
|
||||
export * from 'core/options/transformation';
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -83,7 +83,20 @@
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -107,11 +120,12 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">16x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { OptionsTemplate, OptionsAndOptionsTemplate, PlainObject, OptionsTemplateTypes } from "core/typings";
|
||||
import { isArray, isObject } from "core/utils/types";
|
||||
import { each } from "core/utils/arrays";
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { OptionsTemplate, OptionsAndOptionsTemplate, PlainObject, OptionsTemplateTypes } from 'core/typings';
|
||||
import { isArray, isObject } from 'core/utils/types';
|
||||
import { each } from 'core/utils/arrays';
|
||||
|
||||
/**
|
||||
* Transforms the given OptionsAndOptionsTemplate<T> object to its corresponding generic (T) Object or its corresponding Template object.
|
||||
@@ -119,22 +133,29 @@ import { each } from "core/utils/arrays";
|
||||
* @param toTemplate True if the given OptionsAndOptionsTemplate<T> shall be converted to its corresponding Template object.
|
||||
*/
|
||||
export function transform<T extends Required<T>>(optionsWithOptionsTemplate: OptionsAndOptionsTemplate<T>): T;
|
||||
export function transform<T extends Required<T>>(optionsWithOptionsTemplate: OptionsAndOptionsTemplate<T>, toTemplate: true | void): OptionsTemplate<T>;
|
||||
export function transform<T extends Required<T>>(optionsWithOptionsTemplate: OptionsAndOptionsTemplate<T>, toTemplate?: true | void): OptionsTemplate<T> | T {
|
||||
const result: any = {};
|
||||
export function transform<T extends Required<T>>(
|
||||
optionsWithOptionsTemplate: OptionsAndOptionsTemplate<T>,
|
||||
toTemplate: true | void,
|
||||
): OptionsTemplate<T>;
|
||||
export function transform<T extends Required<T>>(
|
||||
optionsWithOptionsTemplate: OptionsAndOptionsTemplate<T>,
|
||||
toTemplate?: true | void,
|
||||
): OptionsTemplate<T> | T {
|
||||
const result: any = {};
|
||||
|
||||
each(Object.keys(optionsWithOptionsTemplate), (key: Extract<keyof T, string>) => {
|
||||
const val: PlainObject | OptionsTemplateTypes | Array<OptionsTemplateTypes> = optionsWithOptionsTemplate[key];
|
||||
each(Object.keys(optionsWithOptionsTemplate), (key: Extract<keyof T, string>) => {
|
||||
const val: PlainObject | OptionsTemplateTypes | Array<OptionsTemplateTypes> = optionsWithOptionsTemplate[key];
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (isArray(val))
|
||||
result[key] = val[toTemplate ? 1 : 0];
|
||||
else if (isObject(val))
|
||||
result[key] = transform(val as OptionsAndOptionsTemplate<typeof val>, toTemplate);
|
||||
});
|
||||
/* istanbul ignore else */
|
||||
if (isArray(val)) {
|
||||
result[key] = val[toTemplate ? 1 : 0];
|
||||
} else if (isObject(val)) {
|
||||
result[key] = transform(val as OptionsAndOptionsTemplate<typeof val>, toTemplate);
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
};
|
||||
return result;
|
||||
}
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
@@ -142,7 +163,7 @@ export function transform<T extends Required<T>>(optionsWithOptionsT
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -221,7 +221,29 @@
|
||||
<a name='L162'></a><a href='#L162'>162</a>
|
||||
<a name='L163'></a><a href='#L163'>163</a>
|
||||
<a name='L164'></a><a href='#L164'>164</a>
|
||||
<a name='L165'></a><a href='#L165'>165</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L165'></a><a href='#L165'>165</a>
|
||||
<a name='L166'></a><a href='#L166'>166</a>
|
||||
<a name='L167'></a><a href='#L167'>167</a>
|
||||
<a name='L168'></a><a href='#L168'>168</a>
|
||||
<a name='L169'></a><a href='#L169'>169</a>
|
||||
<a name='L170'></a><a href='#L170'>170</a>
|
||||
<a name='L171'></a><a href='#L171'>171</a>
|
||||
<a name='L172'></a><a href='#L172'>172</a>
|
||||
<a name='L173'></a><a href='#L173'>173</a>
|
||||
<a name='L174'></a><a href='#L174'>174</a>
|
||||
<a name='L175'></a><a href='#L175'>175</a>
|
||||
<a name='L176'></a><a href='#L176'>176</a>
|
||||
<a name='L177'></a><a href='#L177'>177</a>
|
||||
<a name='L178'></a><a href='#L178'>178</a>
|
||||
<a name='L179'></a><a href='#L179'>179</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -238,13 +260,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">21x</span>
|
||||
<span class="cline-any cline-yes">21x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -267,7 +282,15 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65x</span>
|
||||
<span class="cline-any cline-yes">65x</span>
|
||||
<span class="cline-any cline-yes">372x</span>
|
||||
@@ -290,7 +313,6 @@
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">339x</span>
|
||||
<span class="cline-any cline-yes">336x</span>
|
||||
<span class="cline-any cline-yes">336x</span>
|
||||
@@ -298,6 +320,8 @@
|
||||
<span class="cline-any cline-yes">336x</span>
|
||||
<span class="cline-any cline-yes">336x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">336x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">417x</span>
|
||||
@@ -309,7 +333,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">64x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">353x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -320,19 +343,20 @@
|
||||
<span class="cline-any cline-yes">417x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">336x</span>
|
||||
<span class="cline-any cline-yes">310x</span>
|
||||
<span class="cline-any cline-yes">310x</span>
|
||||
<span class="cline-any cline-yes">256x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">26x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">336x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -371,6 +395,10 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -387,9 +415,17 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { each, indexOf } from 'core/utils/arrays';
|
||||
import { type, isArray, isUndefined, isEmptyObject, isPlainObject, isString } from 'core/utils/types';
|
||||
import { PlainObject, OptionsTemplate, OptionsTemplateTypes, OptionsTemplateType, OptionsValidated, Func, OptionsValidatedResult } from 'core/typings';
|
||||
import {
|
||||
PlainObject,
|
||||
OptionsTemplate,
|
||||
OptionsTemplateTypes,
|
||||
OptionsTemplateType,
|
||||
OptionsValidated,
|
||||
Func,
|
||||
OptionsValidatedResult,
|
||||
} from 'core/typings';
|
||||
|
||||
const stringify = JSON.stringify;
|
||||
const { stringify } = JSON;
|
||||
|
||||
/**
|
||||
* A prefix and suffix tuple which serves as recognition pattern for template types.
|
||||
@@ -400,18 +436,13 @@ const templateTypePrefixSuffix: readonly [string, string] = ['__TPL_', '_TYPE__'
|
||||
* Key = normal type string
|
||||
* value = template type string
|
||||
*/
|
||||
const optionsTemplateTypes: OptionsTemplateTypesDictionary = [
|
||||
'boolean',
|
||||
'number',
|
||||
'string',
|
||||
'array',
|
||||
'object',
|
||||
'function',
|
||||
'null'
|
||||
].reduce((result, item) => {
|
||||
const optionsTemplateTypes: OptionsTemplateTypesDictionary = ['boolean', 'number', 'string', 'array', 'object', 'function', 'null'].reduce(
|
||||
(result, item) => {
|
||||
result[item] = templateTypePrefixSuffix[0] + item + templateTypePrefixSuffix[1];
|
||||
return result;
|
||||
}, {} as OptionsTemplateTypesDictionary);
|
||||
},
|
||||
{} as OptionsTemplateTypesDictionary,
|
||||
);
|
||||
|
||||
/**
|
||||
* Validates the given options object according to the given template object and returns a object which looks like:
|
||||
@@ -422,7 +453,7 @@ const optionsTemplateTypes: OptionsTemplateTypesDictionary = [
|
||||
* @param options The options object which shall be validated.
|
||||
* @param template The template according to which the options object shall be validated.
|
||||
* @param optionsDiff When provided the returned validated object will only have properties which are different to this objects properties.
|
||||
* Example (assume all properties are valid to the template):
|
||||
* Example (assume all properties are valid to the template):
|
||||
* Options object : { a: 'a', b: 'b', c: 'c' }
|
||||
* optionsDiff object : { a: 'a', b: 'b', c: undefined }
|
||||
* Returned validated object : { c: 'c' }
|
||||
@@ -431,80 +462,87 @@ const optionsTemplateTypes: OptionsTemplateTypesDictionary = [
|
||||
* @param doWriteErrors True if errors shall be logged into the console, false otherwise.
|
||||
* @param propPath The propertyPath which lead to this object. (used for error logging)
|
||||
*/
|
||||
const validateRecursive = function <T extends PlainObject>(options: T, template: OptionsTemplate<Required<T>>, optionsDiff: OptionsValidated<T>, doWriteErrors?: boolean, propPath?: string): OptionsValidatedResult<T> {
|
||||
const validatedOptions: OptionsValidated<T> = {};
|
||||
const optionsCopy: T = Object.assign({}, options);
|
||||
const props = Object.keys(template).filter(prop => options.hasOwnProperty(prop));
|
||||
const validateRecursive = function <T extends PlainObject>(
|
||||
options: T,
|
||||
template: OptionsTemplate<Required<T>>,
|
||||
optionsDiff: OptionsValidated<T>,
|
||||
doWriteErrors?: boolean,
|
||||
propPath?: string,
|
||||
): OptionsValidatedResult<T> {
|
||||
const validatedOptions: OptionsValidated<T> = {};
|
||||
const optionsCopy: T = { ...options };
|
||||
const props = Object.keys(template).filter((prop) => options.hasOwnProperty(prop));
|
||||
|
||||
each(props, (prop: Extract<keyof T, string>) => {
|
||||
const optionsDiffValue: any = isUndefined(optionsDiff[prop]) ? {} : optionsDiff[prop];
|
||||
const optionsValue: any = options[prop];
|
||||
const templateValue: PlainObject | string | OptionsTemplateTypes | Array<OptionsTemplateTypes> = template[prop];
|
||||
const templateIsComplex = isPlainObject(templateValue);
|
||||
const propPrefix = propPath ? propPath + '.' : '';
|
||||
each(props, (prop: Extract<keyof T, string>) => {
|
||||
const optionsDiffValue: any = isUndefined(optionsDiff[prop]) ? {} : optionsDiff[prop];
|
||||
const optionsValue: any = options[prop];
|
||||
const templateValue: PlainObject | string | OptionsTemplateTypes | Array<OptionsTemplateTypes> = template[prop];
|
||||
const templateIsComplex = isPlainObject(templateValue);
|
||||
const propPrefix = propPath ? `${propPath}.` : '';
|
||||
|
||||
//if the template has a object as value, it means that the options are complex (verschachtelt)
|
||||
if (templateIsComplex && isPlainObject(optionsValue)) {
|
||||
const validatedResult = validateRecursive(optionsValue, templateValue as PlainObject, optionsDiffValue, doWriteErrors, propPrefix + prop);
|
||||
validatedOptions[prop] = validatedResult.validated;
|
||||
optionsCopy[prop] = validatedResult.foreign as any;
|
||||
// if the template has a object as value, it means that the options are complex (verschachtelt)
|
||||
if (templateIsComplex && isPlainObject(optionsValue)) {
|
||||
const validatedResult = validateRecursive(optionsValue, templateValue as PlainObject, optionsDiffValue, doWriteErrors, propPrefix + prop);
|
||||
validatedOptions[prop] = validatedResult.validated;
|
||||
optionsCopy[prop] = validatedResult.foreign as any;
|
||||
|
||||
each([optionsCopy, validatedOptions], (value) => {
|
||||
if (isEmptyObject(value[prop])) {
|
||||
delete value[prop];
|
||||
}
|
||||
});
|
||||
each([optionsCopy, validatedOptions], (value) => {
|
||||
if (isEmptyObject(value[prop])) {
|
||||
delete value[prop];
|
||||
}
|
||||
else if (!templateIsComplex) {
|
||||
let isValid = false;
|
||||
const errorEnumStrings: Array<string> = [];
|
||||
const errorPossibleTypes: Array<string> = [];
|
||||
const optionsValueType = type(optionsValue);
|
||||
const templateValueArr: Array<string | OptionsTemplateTypes> = !isArray(templateValue) ? [templateValue as string | OptionsTemplateTypes] : templateValue as Array<OptionsTemplateTypes>;
|
||||
});
|
||||
} else if (!templateIsComplex) {
|
||||
let isValid = false;
|
||||
const errorEnumStrings: Array<string> = [];
|
||||
const errorPossibleTypes: Array<string> = [];
|
||||
const optionsValueType = type(optionsValue);
|
||||
const templateValueArr: Array<string | OptionsTemplateTypes> = !isArray(templateValue)
|
||||
? [templateValue as string | OptionsTemplateTypes]
|
||||
: (templateValue as Array<OptionsTemplateTypes>);
|
||||
|
||||
each(templateValueArr, (currTemplateType) => {
|
||||
//if currType value isn't inside possibleTemplateTypes we assume its a enum string value
|
||||
const isEnumString = indexOf(Object.values(optionsTemplateTypes), currTemplateType) < 0;
|
||||
if (isEnumString && isString(optionsValue)) {
|
||||
//split it into a array which contains all possible values for example: ["yes", "no", "maybe"]
|
||||
const enumStringSplit = currTemplateType.split(' ');
|
||||
isValid = !!enumStringSplit.find(possibility => possibility === optionsValue);
|
||||
each(templateValueArr, (currTemplateType) => {
|
||||
// if currType value isn't inside possibleTemplateTypes we assume its a enum string value
|
||||
const isEnumString = indexOf(Object.values(optionsTemplateTypes), currTemplateType) < 0;
|
||||
if (isEnumString && isString(optionsValue)) {
|
||||
// split it into a array which contains all possible values for example: ["yes", "no", "maybe"]
|
||||
const enumStringSplit = currTemplateType.split(' ');
|
||||
isValid = !!enumStringSplit.find((possibility) => possibility === optionsValue);
|
||||
|
||||
// build error message
|
||||
errorEnumStrings.push(...enumStringSplit);
|
||||
}
|
||||
else {
|
||||
isValid = optionsTemplateTypes[optionsValueType] === currTemplateType;
|
||||
}
|
||||
|
||||
// build error message
|
||||
errorPossibleTypes.push(isEnumString ? optionsTemplateTypes.string : currTemplateType);
|
||||
|
||||
// continue if invalid, break if valid
|
||||
return !isValid;
|
||||
});
|
||||
|
||||
|
||||
if (isValid) {
|
||||
const doStringifyComparison = isArray(optionsValue) || isPlainObject(optionsValue);
|
||||
if (doStringifyComparison ? stringify(optionsValue) !== stringify(optionsDiffValue) : optionsValue !== optionsDiffValue) {
|
||||
validatedOptions[prop] = optionsValue;
|
||||
}
|
||||
}
|
||||
else if (doWriteErrors) {
|
||||
console.warn(`The option "${propPrefix}${prop}" wasn't set, because it doesn't accept the type [ ${optionsValueType.toUpperCase()} ] with the value of "${optionsValue}".\r\n` +
|
||||
`Accepted types are: [ ${errorPossibleTypes.join(', ').toUpperCase()} ].\r\n` +
|
||||
(errorEnumStrings.length > 0 ? `\r\nValid strings are: [ ${errorEnumStrings.join(', ')} ].` : ''))
|
||||
}
|
||||
|
||||
delete optionsCopy[prop];
|
||||
// build error message
|
||||
errorEnumStrings.push(...enumStringSplit);
|
||||
} else {
|
||||
isValid = optionsTemplateTypes[optionsValueType] === currTemplateType;
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
foreign: optionsCopy,
|
||||
validated: validatedOptions
|
||||
};
|
||||
// build error message
|
||||
errorPossibleTypes.push(isEnumString ? optionsTemplateTypes.string : currTemplateType);
|
||||
|
||||
// continue if invalid, break if valid
|
||||
return !isValid;
|
||||
});
|
||||
|
||||
if (isValid) {
|
||||
const doStringifyComparison = isArray(optionsValue) || isPlainObject(optionsValue);
|
||||
if (doStringifyComparison ? stringify(optionsValue) !== stringify(optionsDiffValue) : optionsValue !== optionsDiffValue) {
|
||||
validatedOptions[prop] = optionsValue;
|
||||
}
|
||||
} else if (doWriteErrors) {
|
||||
console.warn(
|
||||
`${
|
||||
`The option "${propPrefix}${prop}" wasn't set, because it doesn't accept the type [ ${optionsValueType.toUpperCase()} ] with the value of "${optionsValue}".\r\n` +
|
||||
`Accepted types are: [ ${errorPossibleTypes.join(', ').toUpperCase()} ].\r\n`
|
||||
}${errorEnumStrings.length > 0 ? `\r\nValid strings are: [ ${errorEnumStrings.join(', ')} ].` : ''}`,
|
||||
);
|
||||
}
|
||||
|
||||
delete optionsCopy[prop];
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
foreign: optionsCopy,
|
||||
validated: validatedOptions,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -516,7 +554,7 @@ const validateRecursive = function <T extends PlainObject>(options: T, tem
|
||||
* @param options The options object which shall be validated.
|
||||
* @param template The template according to which the options object shall be validated.
|
||||
* @param optionsDiff When provided the returned validated object will only have properties which are different to this objects properties.
|
||||
* Example (assume all properties are valid to the template):
|
||||
* Example (assume all properties are valid to the template):
|
||||
* Options object : { a: 'a', b: 'b', c: 'c' }
|
||||
* optionsDiff object : { a: 'a', b: 'b', c: undefined }
|
||||
* Returned validated object : { c: 'c' }
|
||||
@@ -524,31 +562,35 @@ const validateRecursive = function <T extends PlainObject>(options: T, tem
|
||||
* Without the optionsDiff object the returned validated object would be: { a: 'a', b: 'b', c: 'c' }
|
||||
* @param doWriteErrors True if errors shall be logged into the console, false otherwise.
|
||||
*/
|
||||
const validate = function <T extends PlainObject>(options: T, template: OptionsTemplate<Required<T>>, optionsDiff?: OptionsValidated<T>, doWriteErrors?: boolean): OptionsValidatedResult<T> {
|
||||
/*
|
||||
const validate = function <T extends PlainObject>(
|
||||
options: T,
|
||||
template: OptionsTemplate<Required<T>>,
|
||||
optionsDiff?: OptionsValidated<T>,
|
||||
doWriteErrors?: boolean,
|
||||
): OptionsValidatedResult<T> {
|
||||
/*
|
||||
if (!isEmptyObject(foreign) && doWriteErrors)
|
||||
console.warn(`The following options are discarded due to invalidity:\r\n ${window.JSON.stringify(foreign, null, 2)}`);
|
||||
|
||||
|
||||
//add values, which aren't specified in the template, to the finished validated object to prevent them from being discarded
|
||||
if (keepForeignProps) {
|
||||
Object.assign(result.validated, foreign);
|
||||
}
|
||||
*/
|
||||
return validateRecursive(options, template, optionsDiff || {}, doWriteErrors || false);
|
||||
return validateRecursive(options, template, optionsDiff || {}, doWriteErrors || false);
|
||||
};
|
||||
|
||||
export { validate, optionsTemplateTypes };
|
||||
|
||||
type OptionsTemplateTypesDictionary = {
|
||||
readonly boolean: OptionsTemplateType<boolean>;
|
||||
readonly number: OptionsTemplateType<number>;
|
||||
readonly string: OptionsTemplateType<string>;
|
||||
readonly array: OptionsTemplateType<Array<any>>;
|
||||
readonly object: OptionsTemplateType<object>;
|
||||
readonly function: OptionsTemplateType<Func>;
|
||||
readonly null: OptionsTemplateType<null>;
|
||||
}
|
||||
readonly boolean: OptionsTemplateType<boolean>;
|
||||
readonly number: OptionsTemplateType<number>;
|
||||
readonly string: OptionsTemplateType<string>;
|
||||
readonly array: OptionsTemplateType<Array<any>>;
|
||||
readonly object: OptionsTemplateType<object>; // eslint-disable-line @typescript-eslint/ban-types
|
||||
readonly function: OptionsTemplateType<Func>;
|
||||
readonly null: OptionsTemplateType<null>;
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
@@ -556,7 +598,7 @@ type OptionsTemplateTypesDictionary = {
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -25,28 +25,28 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>12/12</span>
|
||||
<span class='fraction'>11/11</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>8/8</span>
|
||||
<span class='fraction'>6/6</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>2/2</span>
|
||||
<span class='fraction'>3/3</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>12/12</span>
|
||||
<span class='fraction'>8/8</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -100,7 +100,15 @@
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -118,21 +126,30 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">694x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">694x</span>
|
||||
<span class="cline-any cline-yes">688x</span>
|
||||
<span class="cline-any cline-yes">2211x</span>
|
||||
<span class="cline-any cline-yes">320x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">699x</span>
|
||||
<span class="cline-any cline-yes">693x</span>
|
||||
<span class="cline-any cline-yes">2224x</span>
|
||||
<span class="cline-any cline-yes">321x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">5x</span>
|
||||
<span class="cline-any cline-yes">13x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">694x</span>
|
||||
<span class="cline-any cline-yes">699x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -141,42 +158,50 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">9x</span>
|
||||
<span class="cline-any cline-yes">418x</span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { isArrayLike } from 'core/utils/types';
|
||||
import { PlainObject } from 'core/typings';
|
||||
|
||||
|
||||
/**
|
||||
* Iterates through a array or object
|
||||
* @param arrayLikeOrObject The array or object through which shall be iterated.
|
||||
* @param callback The function which is responsible for the iteration.
|
||||
* @param callback The function which is responsible for the iteration.
|
||||
* If the function returns true its treated like a "continue" statement.
|
||||
* If the function returns false its treated like a "break" statement.
|
||||
*/
|
||||
export function each<T>(array: Array<T> | ReadonlyArray<T>, callback: (value: T, indexOrKey: number, source: Array<T>) => boolean | void): Array<T> | ReadonlyArray<T>;
|
||||
export function each<T>(array: Array<T> | ReadonlyArray<T> | null, callback: (value: T, indexOrKey: number, source: Array<T>) => boolean | void): Array<T> | ReadonlyArray<T> | null;
|
||||
export function each<T>(arrayLikeObject: ArrayLike<T>, callback: (value: T, indexOrKey: number, source: ArrayLike<T>) => boolean | void): ArrayLike<T>;
|
||||
export function each<T>(arrayLikeObject: ArrayLike<T> | null, callback: (value: T, indexOrKey: number, source: ArrayLike<T>) => boolean | void): ArrayLike<T> | null;
|
||||
export function each<T>(
|
||||
array: Array<T> | ReadonlyArray<T>,
|
||||
callback: (value: T, indexOrKey: number, source: Array<T>) => boolean | void,
|
||||
): Array<T> | ReadonlyArray<T>;
|
||||
export function each<T>(
|
||||
array: Array<T> | ReadonlyArray<T> | null,
|
||||
callback: (value: T, indexOrKey: number, source: Array<T>) => boolean | void,
|
||||
): Array<T> | ReadonlyArray<T> | null;
|
||||
export function each<T>(
|
||||
arrayLikeObject: ArrayLike<T>,
|
||||
callback: (value: T, indexOrKey: number, source: ArrayLike<T>) => boolean | void,
|
||||
): ArrayLike<T>;
|
||||
export function each<T>(
|
||||
arrayLikeObject: ArrayLike<T> | null,
|
||||
callback: (value: T, indexOrKey: number, source: ArrayLike<T>) => boolean | void,
|
||||
): ArrayLike<T> | null;
|
||||
export function each(obj: PlainObject, callback: (value: any, indexOrKey: string, source: PlainObject) => boolean | void): PlainObject;
|
||||
export function each(obj: PlainObject | null, callback: (value: any, indexOrKey: string, source: PlainObject) => boolean | void): PlainObject | null;
|
||||
export function each<T>(source: ArrayLike<T> | PlainObject | null, callback: (value: T | any, indexOrKey: any, source: any) => boolean | void): Array<T> | ReadonlyArray<T> | ArrayLike<T> | PlainObject | null {
|
||||
let i: number | string = 0;
|
||||
|
||||
if (isArrayLike(source)) {
|
||||
for (; i < source.length; i++) {
|
||||
if (callback(source[i], i, source) === false)
|
||||
break;
|
||||
}
|
||||
export function each<T>(
|
||||
source: ArrayLike<T> | PlainObject | null,
|
||||
callback: (value: T | any, indexOrKey: any, source: any) => boolean | void,
|
||||
): Array<T> | ReadonlyArray<T> | ArrayLike<T> | PlainObject | null {
|
||||
if (isArrayLike(source)) {
|
||||
for (let i = 0; i < source.length; i++) {
|
||||
if (callback(source[i], i, source) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (source) {
|
||||
for (i in source) {
|
||||
if (callback(source[i], i, source) === false)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return source;
|
||||
};
|
||||
} else if (source) {
|
||||
each(Object.keys(source), (key) => callback(source[key], key, source));
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the index of the given inside the given array or -1 if the given item isn't part of the given array.
|
||||
@@ -184,16 +209,15 @@ export function each<T>(source: ArrayLike<T> | PlainObject | null, c
|
||||
* @param item The item.
|
||||
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
|
||||
*/
|
||||
export const indexOf: <T = any>(arr: Array<T>, item: T, fromIndex?: number) => number = (arr, item, fromIndex) => {
|
||||
return arr.indexOf(item, fromIndex);
|
||||
}</pre></td></tr></table></pre>
|
||||
export const indexOf: <T = any>(arr: Array<T>, item: T, fromIndex?: number) => number = (arr, item, fromIndex) => arr.indexOf(item, fromIndex);
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -115,7 +115,26 @@
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -136,7 +155,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1080x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">217x</span>
|
||||
<span class="cline-any cline-yes">632x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -173,6 +191,8 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">180x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { isArray, isFunction, isPlainObject, isNull } from 'core/utils/types';
|
||||
import { each } from 'core/utils/arrays';
|
||||
|
||||
@@ -182,63 +202,73 @@ export function extend<T, U, V>(target: T, object1: U, object2: V): T &
|
||||
export function extend<T, U, V, W>(target: T, object1: U, object2: V, object3: W): T & U & V & W;
|
||||
export function extend<T, U, V, W, X>(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;
|
||||
export function extend<T, U, V, W, X, Y>(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y;
|
||||
export function extend<T, U, V, W, X, Y, Z>(target: T, object1?: U, object2?: V, object3?: W, object4?: X, object5?: Y, object6?: Z): T & U & V & W & X & Y & Z {
|
||||
const sources: Array<any> = [object1, object2, object3, object4, object5, object6];
|
||||
export function extend<T, U, V, W, X, Y, Z>(
|
||||
target: T,
|
||||
object1?: U,
|
||||
object2?: V,
|
||||
object3?: W,
|
||||
object4?: X,
|
||||
object5?: Y,
|
||||
object6?: Z,
|
||||
): T & U & V & W & X & Y & Z {
|
||||
/* eslint-disable no-restricted-syntax, guard-for-in */
|
||||
const sources: Array<any> = [object1, object2, object3, object4, object5, object6];
|
||||
|
||||
// Handle case when target is a string or something (possible in deep copy)
|
||||
if ((typeof target !== "object" || isNull(target)) && !isFunction(target)) {
|
||||
target = {} as T;
|
||||
}
|
||||
// Handle case when target is a string or something (possible in deep copy)
|
||||
if ((typeof target !== 'object' || isNull(target)) && !isFunction(target)) {
|
||||
target = {} as T;
|
||||
}
|
||||
|
||||
each(sources, (source) => {
|
||||
// Only deal with non-null/undefined values
|
||||
if (source != null) {
|
||||
each(sources, (source) => {
|
||||
// Only deal with non-null/undefined values
|
||||
if (source != null) {
|
||||
// Extend the base object
|
||||
for (const name in source) {
|
||||
const copy: any = source[name];
|
||||
|
||||
// Extend the base object
|
||||
for (const name in source) {
|
||||
const copy: any = source[name];
|
||||
|
||||
// Prevent Object.prototype pollution
|
||||
// Prevent never-ending loop
|
||||
if (name === "__proto__" || target === copy) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const copyIsArray = isArray(copy);
|
||||
|
||||
// Recurse if we're merging plain objects or arrays
|
||||
if (copy && (isPlainObject(copy) || copyIsArray)) {
|
||||
const src = target[name];
|
||||
let clone: any = src;
|
||||
|
||||
// Ensure proper type for the source value
|
||||
if (copyIsArray && !isArray(src)) {
|
||||
clone = [];
|
||||
} else if (!copyIsArray && !isPlainObject(src)) {
|
||||
clone = {};
|
||||
}
|
||||
|
||||
// Never move original objects, clone them
|
||||
target[name] = extend(clone, copy) as any;
|
||||
|
||||
// Don't bring in undefined values
|
||||
} else if (copy !== undefined) {
|
||||
target[name] = copy;
|
||||
}
|
||||
}
|
||||
// Prevent Object.prototype pollution
|
||||
// Prevent never-ending loop
|
||||
if (name === '__proto__' || target === copy) {
|
||||
continue;
|
||||
}
|
||||
});
|
||||
|
||||
// Return the modified object
|
||||
return target as any;
|
||||
}</pre></td></tr></table></pre>
|
||||
const copyIsArray = isArray(copy);
|
||||
|
||||
// Recurse if we're merging plain objects or arrays
|
||||
if (copy && (isPlainObject(copy) || copyIsArray)) {
|
||||
const src = target[name];
|
||||
let clone: any = src;
|
||||
|
||||
// Ensure proper type for the source value
|
||||
if (copyIsArray && !isArray(src)) {
|
||||
clone = [];
|
||||
} else if (!copyIsArray && !isPlainObject(src)) {
|
||||
clone = {};
|
||||
}
|
||||
|
||||
// Never move original objects, clone them
|
||||
target[name] = extend(clone, copy) as any;
|
||||
|
||||
// Don't bring in undefined values
|
||||
} else if (copy !== undefined) {
|
||||
target[name] = copy;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Return the modified object
|
||||
return target as any;
|
||||
/* eslint-enable */
|
||||
}
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -25,28 +25,28 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>65/65</span>
|
||||
<span class='fraction'>64/64</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>71/71</span>
|
||||
<span class='fraction'>69/69</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>17/17</span>
|
||||
<span class='fraction'>18/18</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>65/65</span>
|
||||
<span class='fraction'>57/57</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -78,13 +78,13 @@
|
||||
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
||||
</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="12" class="abs high">12/12</td>
|
||||
<td data-value="11" class="abs high">11/11</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="6" class="abs high">6/6</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="3" class="abs high">3/3</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="8" class="abs high">8/8</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="2" class="abs high">2/2</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="12" class="abs high">12/12</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -129,7 +129,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="13" class="abs high">13/13</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="32" class="abs high">32/32</td>
|
||||
<td data-value="28" class="abs high">28/28</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
@@ -140,7 +140,7 @@
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -59,18 +59,21 @@
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">export * from 'core/utils/arrays';
|
||||
export * from 'core/utils/extend';
|
||||
export * from 'core/utils/types';</pre></td></tr></table></pre>
|
||||
export * from 'core/utils/types';
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>32/32</span>
|
||||
<span class='fraction'>28/28</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -152,17 +152,21 @@
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">11x</span>
|
||||
<span class="cline-any cline-yes">576x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">575x</span>
|
||||
<span class="cline-any cline-yes">48x</span>
|
||||
<span class="cline-any cline-yes">527x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">97x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -175,10 +179,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1605x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">464x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -191,7 +191,11 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2666x</span>
|
||||
<span class="cline-any cline-yes">2671x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1605x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -199,9 +203,8 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">761x</span>
|
||||
<span class="cline-any cline-yes">761x</span>
|
||||
<span class="cline-any cline-yes">766x</span>
|
||||
<span class="cline-any cline-yes">766x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -210,7 +213,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1337x</span>
|
||||
<span class="cline-any cline-yes">1123x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">214x</span>
|
||||
@@ -222,8 +224,12 @@
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">211x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">211x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -243,95 +249,96 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">105x</span>
|
||||
<span class="cline-any cline-yes">42x</span>
|
||||
<span class="cline-any cline-yes">63x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { PlainObject } from 'core/typings';
|
||||
|
||||
export const type: (obj: any) => string = (obj) => {
|
||||
if (obj === undefined)
|
||||
return obj + '';
|
||||
if (obj === null)
|
||||
return obj + '';
|
||||
return Object.prototype.toString.call(obj).replace(/^\[object (.+)\]$/, '$1').toLowerCase();
|
||||
}
|
||||
|
||||
export function isNumber(obj: any): obj is number {
|
||||
return typeof obj === 'number';
|
||||
if (obj === undefined) return `${obj}`;
|
||||
if (obj === null) return `${obj}`;
|
||||
return Object.prototype.toString
|
||||
.call(obj)
|
||||
.replace(/^\[object (.+)\]$/, '$1')
|
||||
.toLowerCase();
|
||||
};
|
||||
|
||||
export function isNumber(obj: any): obj is number {
|
||||
return typeof obj === 'number';
|
||||
}
|
||||
|
||||
export function isString(obj: any): obj is string {
|
||||
return typeof obj === 'string';
|
||||
return typeof obj === 'string';
|
||||
}
|
||||
|
||||
export function isBoolean(obj: any): obj is boolean {
|
||||
return typeof obj === 'boolean';
|
||||
return typeof obj === 'boolean';
|
||||
}
|
||||
|
||||
export function isObject(obj: any): boolean {
|
||||
return typeof obj === 'object' && !isArray(obj) && !isNull(obj);
|
||||
}
|
||||
|
||||
export function isFunction(obj: any): obj is Function {
|
||||
return typeof obj === 'function';
|
||||
export function isFunction(obj: any): obj is (...args: Array<unknown>) => unknown {
|
||||
return typeof obj === 'function';
|
||||
}
|
||||
|
||||
export function isUndefined(obj: any): obj is undefined {
|
||||
return obj === undefined;
|
||||
return obj === undefined;
|
||||
}
|
||||
|
||||
export function isNull(obj: any): obj is null {
|
||||
return obj === null;
|
||||
return obj === null;
|
||||
}
|
||||
|
||||
export function isArray(obj: any): obj is Array<any> {
|
||||
return Array.isArray(obj);
|
||||
return Array.isArray(obj);
|
||||
}
|
||||
|
||||
export function isObject(obj: any): boolean {
|
||||
return typeof obj === 'object' && !isArray(obj) && !isNull(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given object is array like, false otherwise.
|
||||
* @param obj The Object
|
||||
*/
|
||||
export function isArrayLike<T extends PlainObject = any>(obj: any): obj is ArrayLike<T> {
|
||||
const length = !!obj && obj.length;
|
||||
return isArray(obj) || (!isFunction(obj) && isNumber(length) && length > -1 && length % 1 == 0);
|
||||
const length = !!obj && obj.length;
|
||||
return isArray(obj) || (!isFunction(obj) && isNumber(length) && length > -1 && length % 1 == 0); // eslint-disable-line eqeqeq
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given object is a "plain" (e.g. { key: value }) object, false otherwise.
|
||||
* Returns true if the given object is a "plain" (e.g. { key: value }) object, false otherwise.
|
||||
* @param obj The Object.
|
||||
*/
|
||||
export function isPlainObject<T = any>(obj: any): obj is PlainObject<T> {
|
||||
if (!obj || !isObject(obj) || type(obj) !== 'object')
|
||||
return false;
|
||||
if (!obj || !isObject(obj) || type(obj) !== 'object') return false;
|
||||
|
||||
let key;
|
||||
const proto = 'prototype';
|
||||
const hasOwnProperty = Object[proto].hasOwnProperty;
|
||||
const hasOwnConstructor = hasOwnProperty.call(obj, 'constructor');
|
||||
const hasIsPrototypeOf = obj.constructor && obj.constructor[proto] && hasOwnProperty.call(obj.constructor[proto], 'isPrototypeOf');
|
||||
let key;
|
||||
const proto = 'prototype';
|
||||
const { hasOwnProperty } = Object[proto];
|
||||
const hasOwnConstructor = hasOwnProperty.call(obj, 'constructor');
|
||||
const hasIsPrototypeOf = obj.constructor && obj.constructor[proto] && hasOwnProperty.call(obj.constructor[proto], 'isPrototypeOf');
|
||||
|
||||
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
|
||||
return false;
|
||||
}
|
||||
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (key in obj) { /**/ }
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
for (key in obj) {
|
||||
/**/
|
||||
}
|
||||
/* eslint-enable */
|
||||
|
||||
return isUndefined(key) || hasOwnProperty.call(obj, key);
|
||||
};
|
||||
return isUndefined(key) || hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given object is a HTMLElement.
|
||||
* @param obj The object which shall be checked.
|
||||
*/
|
||||
export function isHTMLElement(obj: any): obj is HTMLElement {
|
||||
const instaceOfRightHandSide = window.HTMLElement;
|
||||
const doInstanceOf = isObject(instaceOfRightHandSide) || isFunction(instaceOfRightHandSide);
|
||||
return !!(
|
||||
doInstanceOf ? obj instanceof instaceOfRightHandSide : (obj && isObject(obj) && obj.nodeType === 1 && isString(obj.nodeName))
|
||||
);
|
||||
const instaceOfRightHandSide = window.HTMLElement;
|
||||
const doInstanceOf = isObject(instaceOfRightHandSide) || isFunction(instaceOfRightHandSide);
|
||||
return !!(doInstanceOf ? obj instanceof instaceOfRightHandSide : obj && isObject(obj) && obj.nodeType === 1 && isString(obj.nodeName));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,17 +346,19 @@ export function isHTMLElement(obj: any): obj is HTMLElement {
|
||||
* @param obj The Object.
|
||||
*/
|
||||
export function isEmptyObject(obj: any): boolean {
|
||||
for (let name in obj)
|
||||
return false;
|
||||
return true;
|
||||
};</pre></td></tr></table></pre>
|
||||
/* eslint-disable no-restricted-syntax, guard-for-in */
|
||||
for (const name in obj) return false;
|
||||
return true;
|
||||
/* eslint-enable */
|
||||
}
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>33/33</span>
|
||||
<span class='fraction'>32/32</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="6" class="abs high">6/6</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="19" class="abs high">19/19</td>
|
||||
<td data-value="18" class="abs high">18/18</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -110,7 +110,7 @@
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>19/19</span>
|
||||
<span class='fraction'>18/18</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -107,8 +107,7 @@
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
||||
<a name='L51'></a><a href='#L51'>51</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -135,8 +134,6 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -159,6 +156,7 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const targets: Set<Element> = new Set();
|
||||
const targetInstanceMap: WeakMap<Element, any> = new WeakMap();
|
||||
|
||||
@@ -168,56 +166,55 @@ const targetInstanceMap: WeakMap<Element, any> = new WeakMap();
|
||||
* @param osInstance The OverlayScrollbars instance.
|
||||
*/
|
||||
export const addInstance: (target: Element, osInstance: any) => void = (target, osInstance) => {
|
||||
targetInstanceMap.set(target, osInstance);
|
||||
targets.add(target);
|
||||
}
|
||||
targetInstanceMap.set(target, osInstance);
|
||||
targets.add(target);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes a OverlayScrollbars instance from the given element.
|
||||
* @param target The element from which its OverlayScrollbars instance shall be removed.
|
||||
*/
|
||||
export const removeInstance: (target: Element) => void = (target) => {
|
||||
targetInstanceMap.delete(target);
|
||||
targets.delete(target);
|
||||
}
|
||||
targetInstanceMap.delete(target);
|
||||
targets.delete(target);
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the OverlayScrollbars from the given element or undefined if it doesn't have one.
|
||||
* @param target The element of which its OverlayScrollbars instance shall be get.
|
||||
*/
|
||||
export const getInstance: (target: Element) => any = (target) => {
|
||||
return targetInstanceMap.get(target);
|
||||
}
|
||||
export const getInstance: (target: Element) => any = (target) => targetInstanceMap.get(target);
|
||||
|
||||
/**
|
||||
* Gets a Map which represents all active OverayScrollbars instances.
|
||||
* Gets a Map which represents all active OverayScrollbars instances.
|
||||
* The Key is the ekement and the value is the instance.
|
||||
*/
|
||||
export const allInstances: () => ReadonlyMap<Element, any> = () => {
|
||||
const validTargetInstanceMap: Map<Element, any> = new Map();
|
||||
const validTargetInstanceMap: Map<Element, any> = new Map();
|
||||
|
||||
targets.forEach((target: Element) => {
|
||||
/* istanbul ignore else */
|
||||
if (targetInstanceMap.has(target)) {
|
||||
validTargetInstanceMap.set(target, targetInstanceMap.get(target))
|
||||
}
|
||||
});
|
||||
targets.forEach((target: Element) => {
|
||||
/* istanbul ignore else */
|
||||
if (targetInstanceMap.has(target)) {
|
||||
validTargetInstanceMap.set(target, targetInstanceMap.get(target));
|
||||
}
|
||||
});
|
||||
|
||||
targets.clear();
|
||||
targets.clear();
|
||||
|
||||
validTargetInstanceMap.forEach((instance: any, validTarget: Element) => {
|
||||
targets.add(validTarget);
|
||||
});
|
||||
validTargetInstanceMap.forEach((instance: any, validTarget: Element) => {
|
||||
targets.add(validTarget);
|
||||
});
|
||||
|
||||
return validTargetInstanceMap;
|
||||
}</pre></td></tr></table></pre>
|
||||
return validTargetInstanceMap;
|
||||
};
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
|
||||
@@ -138,8 +138,7 @@
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<a name='L82'></a><a href='#L82'>82</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -220,10 +219,9 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { OptionsTemplate, OptionsTemplateValue, OptionsAndOptionsTemplateValue, OptionsAndOptionsTemplate, Func } from "core/typings";
|
||||
import { optionsTemplateTypes as oTypes, transform } from "core/options";
|
||||
import { OverlayScrollbars } from "typings";
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { OptionsTemplate, OptionsTemplateValue, OptionsAndOptionsTemplateValue, OptionsAndOptionsTemplate, Func } from 'core/typings';
|
||||
import { optionsTemplateTypes as oTypes, transform } from 'core/options';
|
||||
import { OverlayScrollbars } from 'typings';
|
||||
|
||||
const classNameAllowedValues: OptionsTemplateValue<string | null> = [oTypes.string, oTypes.null];
|
||||
const numberAllowedValues: OptionsTemplateValue<number> = oTypes.number;
|
||||
@@ -240,7 +238,7 @@ const scrollbarsAutoHideAllowedValues: OptionsTemplateValue<OverlayScrollbars
|
||||
/**
|
||||
* A object which serves as "default options object" and "options template object".
|
||||
* I combined these two into one object so that I don't have to define two separate big objects, instead I define one big object.
|
||||
*
|
||||
*
|
||||
* The property value is a tuple:
|
||||
* the first value is the default value
|
||||
* the second value is the template value
|
||||
@@ -253,56 +251,55 @@ const scrollbarsAutoHideAllowedValues: OptionsTemplateValue<OverlayScrollbars
|
||||
* Property "b" has a default value of 250 and it can be number
|
||||
*/
|
||||
const defaultOptionsWithTemplate: OptionsAndOptionsTemplate<Required<OverlayScrollbars.Options>> = {
|
||||
className: ['os-theme-dark', classNameAllowedValues], //null || string
|
||||
resize: ['none', resizeAllowedValues], //none || both || horizontal || vertical || n || b || h || v
|
||||
sizeAutoCapable: booleanTrueTemplate, //true || false
|
||||
clipAlways: booleanTrueTemplate, //true || false
|
||||
normalizeRTL: booleanTrueTemplate, //true || false
|
||||
paddingAbsolute: booleanFalseTemplate, //true || false
|
||||
autoUpdate: [null, booleanNullAllowedValues], //true || false || null
|
||||
autoUpdateInterval: [33, numberAllowedValues], //number
|
||||
updateOnLoad: [['img'], stringArrayNullAllowedValues], //string || array || null
|
||||
nativeScrollbarsOverlaid: {
|
||||
showNativeScrollbars: booleanFalseTemplate, //true || false
|
||||
initialize: booleanFalseTemplate //true || false
|
||||
},
|
||||
overflowBehavior: {
|
||||
x: ['scroll', overflowBehaviorAllowedValues], //visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s
|
||||
y: ['scroll', overflowBehaviorAllowedValues] //visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s
|
||||
},
|
||||
scrollbars: {
|
||||
visibility: ['auto', scrollbarsVisibilityAllowedValues], //visible || hidden || auto || v || h || a
|
||||
autoHide: ['never', scrollbarsAutoHideAllowedValues], //never || scroll || leave || move || n || s || l || m
|
||||
autoHideDelay: [800, numberAllowedValues], //number
|
||||
dragScrolling: booleanTrueTemplate, //true || false
|
||||
clickScrolling: booleanFalseTemplate, //true || false
|
||||
touchSupport: booleanTrueTemplate, //true || false
|
||||
snapHandle: booleanFalseTemplate //true || false
|
||||
},
|
||||
textarea: {
|
||||
dynWidth: booleanFalseTemplate, //true || false
|
||||
dynHeight: booleanFalseTemplate, //true || false
|
||||
inheritedAttrs: [['style', 'class'], stringArrayNullAllowedValues], //string || array || null
|
||||
},
|
||||
callbacks: {
|
||||
onInitialized: callbackTemplate, //null || function
|
||||
onInitializationWithdrawn: callbackTemplate, //null || function
|
||||
onDestroyed: callbackTemplate, //null || function
|
||||
onScrollStart: callbackTemplate, //null || function
|
||||
onScroll: callbackTemplate, //null || function
|
||||
onScrollStop: callbackTemplate, //null || function
|
||||
onOverflowChanged: callbackTemplate, //null || function
|
||||
onOverflowAmountChanged: callbackTemplate, //null || function
|
||||
onDirectionChanged: callbackTemplate, //null || function
|
||||
onContentSizeChanged: callbackTemplate, //null || function
|
||||
onHostSizeChanged: callbackTemplate, //null || function
|
||||
onUpdated: callbackTemplate //null || function
|
||||
}
|
||||
}
|
||||
className: ['os-theme-dark', classNameAllowedValues], // null || string
|
||||
resize: ['none', resizeAllowedValues], // none || both || horizontal || vertical || n || b || h || v
|
||||
sizeAutoCapable: booleanTrueTemplate, // true || false
|
||||
clipAlways: booleanTrueTemplate, // true || false
|
||||
normalizeRTL: booleanTrueTemplate, // true || false
|
||||
paddingAbsolute: booleanFalseTemplate, // true || false
|
||||
autoUpdate: [null, booleanNullAllowedValues], // true || false || null
|
||||
autoUpdateInterval: [33, numberAllowedValues], // number
|
||||
updateOnLoad: [['img'], stringArrayNullAllowedValues], // string || array || null
|
||||
nativeScrollbarsOverlaid: {
|
||||
showNativeScrollbars: booleanFalseTemplate, // true || false
|
||||
initialize: booleanFalseTemplate, // true || false
|
||||
},
|
||||
overflowBehavior: {
|
||||
x: ['scroll', overflowBehaviorAllowedValues], // visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s
|
||||
y: ['scroll', overflowBehaviorAllowedValues], // visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s
|
||||
},
|
||||
scrollbars: {
|
||||
visibility: ['auto', scrollbarsVisibilityAllowedValues], // visible || hidden || auto || v || h || a
|
||||
autoHide: ['never', scrollbarsAutoHideAllowedValues], // never || scroll || leave || move || n || s || l || m
|
||||
autoHideDelay: [800, numberAllowedValues], // number
|
||||
dragScrolling: booleanTrueTemplate, // true || false
|
||||
clickScrolling: booleanFalseTemplate, // true || false
|
||||
touchSupport: booleanTrueTemplate, // true || false
|
||||
snapHandle: booleanFalseTemplate, // true || false
|
||||
},
|
||||
textarea: {
|
||||
dynWidth: booleanFalseTemplate, // true || false
|
||||
dynHeight: booleanFalseTemplate, // true || false
|
||||
inheritedAttrs: [['style', 'class'], stringArrayNullAllowedValues], // string || array || null
|
||||
},
|
||||
callbacks: {
|
||||
onInitialized: callbackTemplate, // null || function
|
||||
onInitializationWithdrawn: callbackTemplate, // null || function
|
||||
onDestroyed: callbackTemplate, // null || function
|
||||
onScrollStart: callbackTemplate, // null || function
|
||||
onScroll: callbackTemplate, // null || function
|
||||
onScrollStop: callbackTemplate, // null || function
|
||||
onOverflowChanged: callbackTemplate, // null || function
|
||||
onOverflowAmountChanged: callbackTemplate, // null || function
|
||||
onDirectionChanged: callbackTemplate, // null || function
|
||||
onContentSizeChanged: callbackTemplate, // null || function
|
||||
onHostSizeChanged: callbackTemplate, // null || function
|
||||
onUpdated: callbackTemplate, // null || function
|
||||
},
|
||||
};
|
||||
|
||||
export const optionsTemplate: OptionsTemplate<Required<OverlayScrollbars.Options>> = transform(defaultOptionsWithTemplate, true);
|
||||
export const defaultOptions: OverlayScrollbars.Options = transform(defaultOptionsWithTemplate);
|
||||
|
||||
</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
@@ -310,7 +307,7 @@ export const defaultOptions: OverlayScrollbars.Options = transform(defaultOption
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
||||
at Mon Jul 20 2020 17:08:17 GMT+0200 (GMT+02:00)
|
||||
at Sat Jul 25 2020 00:36:56 GMT+0200 (GMT+02:00)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
|
||||
+519
-531
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user