diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 00000000..95924ec2 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,8 @@ +name: "CodeQL config" + +queries: + - uses: security-and-quality + +paths-ignore: + - '**/rollup.config.js' + - '**/docs/typedoc/' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 112285ae..9a5dd921 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,10 @@ jobs: - run: npm install - name: Build run: npm run build --verbose - timeout-minutes: 10 + timeout-minutes: 15 - name: Unit tests run: npm run test --verbose + timeout-minutes: 15 - name: Report Coverage run: npm run codecov - name: Size tests diff --git a/docs/typedoc/assets/main.js b/docs/typedoc/assets/main.js index 7d7f77a0..35728810 100644 --- a/docs/typedoc/assets/main.js +++ b/docs/typedoc/assets/main.js @@ -1,9 +1,9 @@ "use strict"; window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; -"use strict";(()=>{var Ce=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Ce(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),Ve(t,i,r,e)}function Ve(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?He(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` - ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function He(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",H="mouseup",J={x:0,y:0},me=!1,ne=!1,je=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(je=!0,F="touchstart",ye="touchmove",H="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(H,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var qe=new U;Object.defineProperty(window,"app",{value:qe});fe();we();})(); +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!Ve(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/docs/typedoc/assets/style.css b/docs/typedoc/assets/style.css index d0c980d4..9d619a64 100644 --- a/docs/typedoc/assets/style.css +++ b/docs/typedoc/assets/style.css @@ -793,6 +793,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { margin-left: -1.5rem; } +.tsd-page-navigation-section { + margin-left: 10px; +} +.tsd-page-navigation-section > summary { + padding: 0.25rem; +} +.tsd-page-navigation-section > div { + margin-left: 20px; +} .tsd-page-navigation ul { padding-left: 1.75rem; } @@ -841,6 +850,7 @@ a.tsd-index-link { } .tsd-accordion .tsd-accordion-summary > svg { margin-left: 0.25rem; + vertical-align: text-top; } .tsd-index-content > :not(:first-child) { margin-top: 0.75rem; diff --git a/docs/typedoc/enums/WellKnownSymbols.html b/docs/typedoc/enums/WellKnownSymbols.html index 08dbd5fb..82b69af7 100644 --- a/docs/typedoc/enums/WellKnownSymbols.html +++ b/docs/typedoc/enums/WellKnownSymbols.html @@ -79,4 +79,4 @@ and inherited property names are excluded from the with environment bindings of the associated object.

See: Symbol.unscopables

-
\ No newline at end of file +
diff --git a/docs/typedoc/functions/arrAppend.html b/docs/typedoc/functions/arrAppend.html index d431f54c..6dc02184 100644 --- a/docs/typedoc/functions/arrAppend.html +++ b/docs/typedoc/functions/arrAppend.html @@ -9,4 +9,4 @@
// Adding a single value
arrAppend([], undefined); // []
arrAppend([], 0); // [ 0 ]
arrAppend([1], undefined); // [ 1 ]
arrAppend([1], 2); // [ 1, 2 ]

// Adding an array
arrAppend([], [] as number[]); // []
arrAppend([], [0]); // [ 0 ]
arrAppend([1], []); // [ 1 ]
arrAppend([1], [2]); // [ 1, 2 ]

// Adding with an iterator
arrAppend([], ([] as number[]).values()); // []
arrAppend([], [0].values()); // [ 0 ]
arrAppend([1], [].keys()); // [ 1 ]
arrAppend([1], [2].values()); // [ 1, 2 ]
arrAppend([1], [2].keys()); // [ 1, 0 ] - 0 is from the index from the first element
-
\ No newline at end of file +
diff --git a/docs/typedoc/functions/arrContains.html b/docs/typedoc/functions/arrContains.html index 120e8a79..f76e1a97 100644 --- a/docs/typedoc/functions/arrContains.html +++ b/docs/typedoc/functions/arrContains.html @@ -15,4 +15,4 @@
const items = ['item1', 'item2', 'item3'];
const copyItems = [];

// before using for loop
for (let i = 0; i < items.length; i++) {
copyItems.push(items[i]);
}

// before using forEach()
items.forEach((item) => {
copyItems.push(item);
});

// after
arrForEach(items, (item) => {
copyItems.push(item);
// May return -1 to abort the iteration
});

// Also supports input as an array like object
const items = { length: 3, 0: 'item1', 1: 'item2', 2: 'item3' };
-
\ No newline at end of file +
diff --git a/docs/typedoc/functions/arrFrom.html b/docs/typedoc/functions/arrFrom.html index 0af5c0a8..baf69cc7 100644 --- a/docs/typedoc/functions/arrFrom.html +++ b/docs/typedoc/functions/arrFrom.html @@ -10,4 +10,4 @@

Returns U[]

diff --git a/docs/typedoc/functions/arrIncludes.html b/docs/typedoc/functions/arrIncludes.html index 0a19ec55..31303aef 100644 --- a/docs/typedoc/functions/arrIncludes.html +++ b/docs/typedoc/functions/arrIncludes.html @@ -15,4 +15,4 @@

Returns number

The first index of the element in the array; -1 if not found.

-
\ No newline at end of file +
diff --git a/docs/typedoc/functions/arrLastIndexOf.html b/docs/typedoc/functions/arrLastIndexOf.html index 7e597085..e1ed5775 100644 --- a/docs/typedoc/functions/arrLastIndexOf.html +++ b/docs/typedoc/functions/arrLastIndexOf.html @@ -22,4 +22,4 @@

Returns R[]

\ No newline at end of file +

Returns R[]

diff --git a/docs/typedoc/functions/arrReduce.html b/docs/typedoc/functions/arrReduce.html index e9b90885..d5983b21 100644 --- a/docs/typedoc/functions/arrReduce.html +++ b/docs/typedoc/functions/arrReduce.html @@ -12,4 +12,4 @@
  • callbackfn: ArrReduceCallbackFn<T, R>

    A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

  • OptionalinitialValue: T | R

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

  • Returns R

    The value that results from running the "reducer" callback function to completion over the entire array.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/arrSlice.html b/docs/typedoc/functions/arrSlice.html index 418cf4ed..e0772061 100644 --- a/docs/typedoc/functions/arrSlice.html +++ b/docs/typedoc/functions/arrSlice.html @@ -28,4 +28,4 @@
    const lyrics = ["Hello", "Darkness", "my", "old", "friend.", "I've", "come", "to", "talk" ];

    arrSlice(lyrics); // [ "Hello", "Darkness", "my", "old", "friend.", "I've", "come", "to", "talk" ]
    arrSlice(lyrics, 1, 3); // [ "Darkness", "my" ]
    arrSlicw(lyrics, 2); // [ "my", "old", "friend.", "I've", "come", "to", "talk" ]
    arrSlice(lyrics, 2, 4); // [ "my", "old" ]
    arrSlice(lyrics, 1, 5); // [ "Darkness", "my", "old", "friend." ]
    arrSlice(lyrics, -2); // [ "to", "talk" ]
    arrSlice(lyrics, 2, -1); // [ "my", "old", "friend.", "I've", "come", "to" ]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/arrSome.html b/docs/typedoc/functions/arrSome.html index 00aabfa4..cf791494 100644 --- a/docs/typedoc/functions/arrSome.html +++ b/docs/typedoc/functions/arrSome.html @@ -28,4 +28,4 @@
  • OptionalthisArg: any

    A value to use as this when executing callbackFn. Defaults to the array if not provided.

  • Returns boolean

    true if the callback function returns a truthy value for at least one element in the array. Otherwise, false.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/arrayDeepCopyHandler.html b/docs/typedoc/functions/arrayDeepCopyHandler.html index 43f53178..636d6813 100644 --- a/docs/typedoc/functions/arrayDeepCopyHandler.html +++ b/docs/typedoc/functions/arrayDeepCopyHandler.html @@ -2,4 +2,4 @@

    Parameters

    Returns boolean

    true if the current value is a function otherwise false

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/asString.html b/docs/typedoc/functions/asString.html index 41a54354..d684ca2d 100644 --- a/docs/typedoc/functions/asString.html +++ b/docs/typedoc/functions/asString.html @@ -5,4 +5,4 @@

    Returns string

    diff --git a/docs/typedoc/functions/createArrayIterator.html b/docs/typedoc/functions/createArrayIterator.html index 73a55ab1..e8a26317 100644 --- a/docs/typedoc/functions/createArrayIterator.html +++ b/docs/typedoc/functions/createArrayIterator.html @@ -10,4 +10,4 @@
    let cnt = 0;
    let values = [];
    iterForOf(createArrayIterator([10, 20, 5, 15]), (value) => {
    cnt++;
    values.push(value);
    });
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createCachedValue.html b/docs/typedoc/functions/createCachedValue.html index 7c0bddc4..ba5e8bd6 100644 --- a/docs/typedoc/functions/createCachedValue.html +++ b/docs/typedoc/functions/createCachedValue.html @@ -9,4 +9,4 @@
    let cachedValue = createCachedValue("some value");
    // cachedValue.v === "some value"

    JSON.stringify(cachedValue) === '{"v":"some value"}';
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createCustomError.html b/docs/typedoc/functions/createCustomError.html index 9242d728..d209dbfd 100644 --- a/docs/typedoc/functions/createCustomError.html +++ b/docs/typedoc/functions/createCustomError.html @@ -7,4 +7,4 @@
    import { createCustomError, isError } from "@nevware21/ts-utils";

    // For an error that just contains a message
    let myCustomErrorError = createCustomError("MessageError");

    try {
    throw new myCustomErrorError("Error Message!");
    } catch(e) {
    // e.name === MessageError
    // isError(e) === true;
    // Object.prototype.toString.call(e) === "[object Error]";
    }

    // Or a more complex error object
    interface MyCriticalErrorConstructor extends CustomErrorConstructor {
    new(message: string, file: string, line: number, col: number): MyCriticalError;
    (message: string, file: string, line: number, col: number): MyCriticalError;
    }

    interface MyCriticalError extends Error {
    readonly errorId: number;
    readonly args: any[]; // Holds all of the arguments passed during construction
    }

    let _totalErrors = 0;
    let myCustomError = createCustomError<MyCriticalErrorConstructor>("CriticalError", (self, args) => {
    _totalErrors++;
    self.errorId = _totalErrors;
    self.args = args;
    });

    try {
    throw new myCustomError("Not Again!");
    } catch(e) {
    // e.name === CriticalError
    // isError(e) === true;
    // Object.prototype.toString.call(e) === "[object Error]";
    }

    // ----------------------------------------------------------
    // Extending another custom error class
    // ----------------------------------------------------------

    let AppError = createCustomError("ApplicationError");
    let theAppError = new appError();

    isError(theAppError); // true
    theAppError instanceof Error; // true
    theAppError instanceof AppError; // true

    let StartupError = createCustomError("StartupError", null, AppError);
    let theStartupError = new StartupError();

    isError(theStartupError); // true
    theStartupError instanceof Error; // true
    theStartupError instanceof AppError; // true
    theStartupError instanceof StartupError; // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createDeferredCachedValue.html b/docs/typedoc/functions/createDeferredCachedValue.html index 0cae4ac0..a1fa5f42 100644 --- a/docs/typedoc/functions/createDeferredCachedValue.html +++ b/docs/typedoc/functions/createDeferredCachedValue.html @@ -6,4 +6,4 @@

    Type Parameters

    • T

      The type of the value to be cached

    Parameters

    • cb: (() => T)

      The callback function to fetch the value to be lazily evaluated and cached

        • (): T
        • Returns T

    Returns ICachedValue<T>

    0.10.5

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createEnum.html b/docs/typedoc/functions/createEnum.html index 7b7c6c4d..5bbf773d 100644 --- a/docs/typedoc/functions/createEnum.html +++ b/docs/typedoc/functions/createEnum.html @@ -6,4 +6,4 @@
    const enum Animal {
    Dog = 0,
    Cat = 1,
    Butterfly = 2,
    Bear = 3
    }
    const Animals = createEnum<typeof Animal>({
    Dog: Animal.Dog,
    Cat: Animal.Cat,
    Butterfly: Animal.Butterfly,
    Bear: Animal.Bear
    });
    // You end up with an object that maps everything to the name
    Animals.Dog === 0; // true
    Animals[0] === "Dog"; // true
    Animals["Dog"] === 0; // true
    Animals.Cat === 1; // true
    Animals[1] === "Cat"; // true
    Animals["Cat"] === 1; // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createEnumKeyMap.html b/docs/typedoc/functions/createEnumKeyMap.html index fab94849..a6b24ea4 100644 --- a/docs/typedoc/functions/createEnumKeyMap.html +++ b/docs/typedoc/functions/createEnumKeyMap.html @@ -6,4 +6,4 @@
    const enum Animal {
    Dog = 0,
    Cat = 1,
    Butterfly = 2,
    Bear = 3
    }
    const animalMap = createEnumKeyMap<typeof Animal>({
    Dog: Animal.Dog,
    Cat: Animal.Cat,
    Butterfly: Animal.Butterfly,
    Bear: Animal.Bear
    });
    // You end up with an object that maps everything to the name
    animalMap.Dog === "Dog"; // true
    animalMap[0] === "Dog"; // true
    animalMap["Dog"] === "Dog"; // true
    animalMap.Cat === "Cat"; // true
    animalMap[1] === "Cat"; // true
    animalMap["Cat"] === "Cat"; // true
    // Helper function to always return the "Name" of the type of animal
    function getAnimalType(type: string | number | Animal) {
    return animalMap[type];
    }
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createEnumValueMap.html b/docs/typedoc/functions/createEnumValueMap.html index c17b2193..bf5824c9 100644 --- a/docs/typedoc/functions/createEnumValueMap.html +++ b/docs/typedoc/functions/createEnumValueMap.html @@ -6,4 +6,4 @@
    const enum Animal {
    Dog = 0,
    Cat = 1,
    Butterfly = 2,
    Bear = 3
    }
    const animalMap = createEnumValueMap<typeof Animal>({
    Dog: Animal.Dog,
    Cat: Animal.Cat,
    Butterfly: Animal.Butterfly,
    Bear: Animal.Bear
    });
    // You end up with an object that maps everything to the name
    animalMap.Dog === 0; // true
    animalMap[0] === 0; // true
    animalMap["Dog"] === 0; // true
    animalMap.Cat === 1; // true
    animalMap[1] === 1; // true
    animalMap["Cat"] === 1; // true

    // Helper function to always return the "Name" of the type of animal
    function getAnimalValue(type: string | number | Animal) {
    return animalMap[type];
    }
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createFilenameRegex.html b/docs/typedoc/functions/createFilenameRegex.html index a4066164..c2be678e 100644 --- a/docs/typedoc/functions/createFilenameRegex.html +++ b/docs/typedoc/functions/createFilenameRegex.html @@ -19,4 +19,4 @@
    let regex = createFilenameRegex("*.txt");

    lat matches = regex.exec("Hello");
    matches; // null

    let matches = regex.exec("ug.txt");
    matches[0]; // "ug.txt"
    matches[1]; // "ug"

    let matches = regex.exec(" ug.txt ");
    matches[0]; // " ug.txt"
    matches[1]; // " ug"

    let matches = regex.exec("C:\\temp\\ug.txt");
    matches[0]; // "C:\\temp\\ug.txt"
    matches[1]; // "C:\\temp\\ug"

    let matches = regex.exec("/var/log/ug.txt");
    matches[0]; // "/var/log/ug.txt"
    matches[1]; // "/var/log/ug"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createFnDeferredProxy.html b/docs/typedoc/functions/createFnDeferredProxy.html index 999e123d..f9650133 100644 --- a/docs/typedoc/functions/createFnDeferredProxy.html +++ b/docs/typedoc/functions/createFnDeferredProxy.html @@ -10,4 +10,4 @@
    const module1 = {
    prefix: "Hello",
    x: 21,
    getX() {
    return this.x;
    },
    log(value: string) {
    return this.prefix + " " + value + " : " + this.x
    }
    };

    // The 'this' parameter of 'getX' is bound to 'module'.
    module1.getX(); // 21
    module1.log("Darkness"); // Hello Darkness : 21

    // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.
    let module2 = {
    prefix: "my",
    x: 42
    };

    let getHost = () => {
    return module1;
    };

    let deferredFn = createFnDeferredProxy(getHost, "getX");

    deferredFn(); // 21

    module2.defX = deferredFn;

    module2.defX(); // 21
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createIterable.html b/docs/typedoc/functions/createIterable.html index f6ea1b68..b55bcd48 100644 --- a/docs/typedoc/functions/createIterable.html +++ b/docs/typedoc/functions/createIterable.html @@ -8,4 +8,4 @@
    let current = 0;
    let next = 1;
    let done = false;
    let fibCtx: CreateIteratorContext<number> = {
    n: function() {
    fibCtx.v = current;
    current = next;
    next = fibCtx.v + next;

    // Return not done
    return false;
    },
    r: function(value) {
    done = true;
    return value;
    }
    };

    let values: number[] = [];
    iterForOf(createIterable(fibCtx), (value) => {
    values.push(value);
    if (values.length === 10) {
    return -1;
    }
    });

    // Done is true
    // done === true
    // Values: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createIterator.html b/docs/typedoc/functions/createIterator.html index d9a49610..a46b6372 100644 --- a/docs/typedoc/functions/createIterator.html +++ b/docs/typedoc/functions/createIterator.html @@ -8,4 +8,4 @@
    let idx = -1;
    let theValues = [ 5, 10, 15, 20, 25, 30 ];

    function getNextFn() {
    idx++;
    let isDone = idx >= theValues.length;
    if (!isDone) {
    // this is passed as the current iterator
    // so you can directly assign the next "value" that will be returned
    this.v = theValues[idx];
    }

    return isDone;
    }

    let theIterator = createIterator<number>({ n: getNextFn });

    let values: number[] = [];
    iterForOf(theIterator, (value) => {
    values.push(value);
    });

    // Values: [5, 10, 15, 20, 25, 30 ]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createProxyFuncs.html b/docs/typedoc/functions/createProxyFuncs.html index 8a4cd0ac..fef8d3e5 100644 --- a/docs/typedoc/functions/createProxyFuncs.html +++ b/docs/typedoc/functions/createProxyFuncs.html @@ -9,4 +9,4 @@
    let test = {
    x: 21,
    func1() {
    return this.x;
    }
    };

    test.func1(); // 21
    let newTarget = createProxyFuncs({} as any, test, [
    { n: "func1" },
    { n: "func1", as: "aliasFn" }
    ]);

    newTarget.func1(); // 21
    newTarget.aliasFn(); // 21

    newTarget.x = 42;

    // The return is still using the `this.x` from the original `test` as it's proxied
    newTarget.func1(); // 21
    newTarget.aliasFn(); // 21

    let getHostFn = () => {
    return test;
    };

    newTarget = createProxyFuncs({} as any, getHostFn, [
    { n: "func1" },
    { n: "func1", as: "aliasFn" }
    ]);

    newTarget.func1(); // 21
    newTarget.aliasFn(); // 21

    newTarget.x = 42;

    // The return is still using the `this.x` from the original `test` as it's proxied
    newTarget.func1(); // 21
    newTarget.aliasFn(); // 21
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createRangeIterator.html b/docs/typedoc/functions/createRangeIterator.html index f1e2a663..33667d67 100644 --- a/docs/typedoc/functions/createRangeIterator.html +++ b/docs/typedoc/functions/createRangeIterator.html @@ -13,4 +13,4 @@
    let cnt = 0;
    iterForOf(createRangeIterator(0, -1, 1), (value) => {
    // Will never get called as -1 < 0
    });

    cnt = 0;
    let values: number[] = [];
    iterForOf(createRangeIterator(1, 1), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 1
    // values: [ 1 ]

    cnt = 0;
    values = [];
    iterForOf(createRangeIterator(10, null as any), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 1
    // values: [ 10 ]

    cnt = 0;
    values = [];
    iterForOf(createRangeIterator(-10, undefined as any), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 1
    // values: [ -10 ]

    cnt = 0;
    values = [];
    iterForOf(createRangeIterator(5, 20, 5), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 4
    // values: [ 5, 10, 15, 20 ]

    cnt = 0;
    values = [];
    iterForOf(createRangeIterator(20, 5, -5), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 4
    // values: [ 20, 15, 10, 5 ]

    cnt = 0;
    values = [];
    iterForOf(createRangeIterator(20, 15), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 6
    // values: [ 20, 19, 18, 17, 16, 15 ]

    cnt = 0;
    values = [];
    iterForOf(createRangeIterator(-1, 1), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 3;
    // values: [ -1, 0, 1 ]

    cnt = 0;
    values = [];
    iterForOf(createRangeIterator(1, -1), (value) => {
    cnt++;
    values.push(value);
    });
    // cnt === 3;
    // values: [ 1, 0, -1 ]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createSimpleMap.html b/docs/typedoc/functions/createSimpleMap.html index 5d4761c7..282a1b17 100644 --- a/docs/typedoc/functions/createSimpleMap.html +++ b/docs/typedoc/functions/createSimpleMap.html @@ -7,4 +7,4 @@
    const enum Animal {
    Dog = 0,
    Cat = 1,
    Butterfly = 2,
    Bear = 3
    };
    // Creates a simple mapping to a string value
    const animalFamilyMap = createValueMap<typeof Animal, string>({
    Dog: [ Animal.Dog, "Canidae"],
    Cat: [ Animal.Cat, "Felidae"],
    Butterfly: [ Animal.Butterfly, "Papilionidae"],
    Bear: [ Animal.Bear, "Ursidae"]
    });
    // You end up with an object that maps everything to the name
    animalMap.Dog === "Canidae"; // true with typeof animalMap.Dog is "string"
    animalMap[0] === "Canidae"; // true with typeof animalMap[0] is "string"
    animalMap["Dog"] === "Canidae"; // true with typeof animalMap["Dog"] is "string"
    animalMap.Cat === "Felidae"; // true with typeof animalMap.Cat is "string"
    animalMap[1] === "Felidae"; // true with typeof animalMap[1] is "string"
    animalMap["Cat"] === "Felidae"; // true with typeof animalMap["Cat"] is "string"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createTimeout.html b/docs/typedoc/functions/createTimeout.html index a13cc520..a3bf5997 100644 --- a/docs/typedoc/functions/createTimeout.html +++ b/docs/typedoc/functions/createTimeout.html @@ -28,4 +28,4 @@
    let timeoutCalled = false;
    let theTimeout = createTimeout(() => {
    // This callback will be called after 100ms as this uses setTimeout()
    timeoutCalled = true;
    }, 100);

    // As the timer is not started you will need to call "refresh" to start the timer
    theTimeout.refresh();

    // or set enabled to true
    theTimeout.enabled = true;
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createTimeoutWith.html b/docs/typedoc/functions/createTimeoutWith.html index bf7c4363..d23d4e77 100644 --- a/docs/typedoc/functions/createTimeoutWith.html +++ b/docs/typedoc/functions/createTimeoutWith.html @@ -42,4 +42,4 @@
    let timeoutCalled = false;
    // Your own "setTimeout" implementation to allow you to perform additional operations or possible wrap
    // the callback to add timings.
    function newSetTimeoutFn(callback: TimeoutOverrideFn) {
    overrideCalled ++;
    return setTimeout(callback, timeout);
    }

    // Your own "clearTimeout" implementation to allow you to perform additional operations or possible wrap
    // the callback to add timings.
    function newClearTimeoutFn(timeoutId: number) {
    overrideCalled ++;
    return clearTimeout( timeout);
    }

    let theTimeout = createTimeoutWith([newSetTimeoutFn, newClearTimeoutFn], () => {
    // This callback will be called after 100ms as this uses setTimeout()
    timeoutCalled = true;
    }, 100);

    // As the timer is not started you will need to call "refresh" to start the timer
    theTimeout.refresh();

    // or set enabled to true
    theTimeout.enabled = true;
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createTypeMap.html b/docs/typedoc/functions/createTypeMap.html index 1ebb5992..8ed54a24 100644 --- a/docs/typedoc/functions/createTypeMap.html +++ b/docs/typedoc/functions/createTypeMap.html @@ -13,4 +13,4 @@
    // Create a strongly types map
    const animalFamilyMap = createTypeMap<typeof Animal, {
    // Defined the enum lookups
    [Animal.Dog]: "Canidae",
    [Animal.Cat]: "Felidae",
    [Animal.Butterfly]: "Papilionidae",
    [Animal.Bear]: "Ursidae",
    // Defined Named reference
    Dog: "Canidae",
    Cat: "Felidae",
    Butterfly: "Papilionidae",
    Bear: "Ursidae",
    }>({
    Dog: [ Animal.Dog, "Canidae"],
    Cat: [ Animal.Cat, "Felidae"],
    Butterfly: [ Animal.Butterfly, "Papilionidae"],
    Bear: [ Animal.Bear, "Ursidae"]
    });
    // You end up with a strongly types result for each value
    animalMap.Dog === "Canidae"; // true with typeof animalMap.Dog is (const) "Canidae"
    animalMap[0] === "Canidae"; // true with typeof animalMap[0] is "Canidae"
    animalMap["Dog"] === "Canidae"; // true with typeof animalMap["Dog"] is "Canidae"
    animalMap.Cat === "Felidae"; // true with typeof animalMap.Cat is "Felidae"
    animalMap[1] === "Felidae"; // true with typeof animalMap[1] is "Felidae"
    animalMap["Cat"] === "Felidae"; // true with typeof animalMap["Cat"] is "Felidae"

    or using an interface to define the direct string mappings

    interface IAnimalFamilyMap {
    Dog: "Canidae",
    Cat: "Felidae",
    Butterfly: "Papilionidae",
    Bear: "Ursidae"
    }

    // Create a strongly types map
    const animalFamilyMap = createTypeMap<typeof Animal, IAnimalFamilyMap & {
    // Defined the enum lookups
    [Animal.Dog]: "Canidae",
    [Animal.Cat]: "Felidae",
    [Animal.Butterfly]: "Papilionidae",
    [Animal.Bear]: "Ursidae"
    }>({
    Dog: [ Animal.Dog, "Canidae"],
    Cat: [ Animal.Cat, "Felidae"],
    Butterfly: [ Animal.Butterfly, "Papilionidae"],
    Bear: [ Animal.Bear, "Ursidae"]
    });

    // You also end up with a strongly types result for each value
    animalMap.Dog === "Canidae"; // true with typeof animalMap.Dog is (const) "Canidae"
    animalMap[0] === "Canidae"; // true with typeof animalMap[0] is "Canidae"
    animalMap["Dog"] === "Canidae"; // true with typeof animalMap["Dog"] is "Canidae"
    animalMap.Cat === "Felidae"; // true with typeof animalMap.Cat is "Felidae"
    animalMap[1] === "Felidae"; // true with typeof animalMap[1] is "Felidae"
    animalMap["Cat"] === "Felidae"; // true with typeof animalMap["Cat"] is "Felidae"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/createWildcardRegex.html b/docs/typedoc/functions/createWildcardRegex.html index 9bef8b2f..5bb91817 100644 --- a/docs/typedoc/functions/createWildcardRegex.html +++ b/docs/typedoc/functions/createWildcardRegex.html @@ -16,4 +16,4 @@
    let regex = createWildcardRegex("Hello*");

    let matches = regex.exec("Hello");
    matches[0]; // "Hello";
    matches[1]; // ""

    let matches = regex.exec("Hello Darkness");
    matches[0]; // "Hello Darkness"
    matches[1]; // " Darkness"

    let matches = regex.exec("Darkness Hello");
    matches[0]; // "Hello"
    matches[1]; // ""

    let regex.exec("Darkness Hello.");
    matches[0]; // "Hello."
    matches[1]; // "."
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/dateDeepCopyHandler.html b/docs/typedoc/functions/dateDeepCopyHandler.html index 47959267..a8e9b35f 100644 --- a/docs/typedoc/functions/dateDeepCopyHandler.html +++ b/docs/typedoc/functions/dateDeepCopyHandler.html @@ -2,4 +2,4 @@

    Parameters

    Returns boolean

    true if the current value is a function otherwise false

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/deepExtend.html b/docs/typedoc/functions/deepExtend.html index fe54fa8a..7d5bb4de 100644 --- a/docs/typedoc/functions/deepExtend.html +++ b/docs/typedoc/functions/deepExtend.html @@ -12,4 +12,4 @@

    dumpObj

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/elapsedTime.html b/docs/typedoc/functions/elapsedTime.html index 219d9385..8c9ea214 100644 --- a/docs/typedoc/functions/elapsedTime.html +++ b/docs/typedoc/functions/elapsedTime.html @@ -7,4 +7,4 @@
    let start = perfNow();
    // Do some work
    let totalTime = elapsedTime(start);
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/encodeAsHtml.html b/docs/typedoc/functions/encodeAsHtml.html index 35e69914..bdf16a9e 100644 --- a/docs/typedoc/functions/encodeAsHtml.html +++ b/docs/typedoc/functions/encodeAsHtml.html @@ -6,4 +6,4 @@
    encodeAsHtml("HelloDarkness"); // "HelloDarkness"
    encodeAsHtml("Hello Darkness"); // "Hello Darkness"
    encodeAsHtml("hello.Darkness"); // "hello.Darkness"
    encodeAsHtml("hello-Darkness"); // "hello-Darkness"
    encodeAsHtml("hello_Darkness"); // "hello_Darkness"
    encodeAsHtml("abc-123"); // "abc-123"
    encodeAsHtml("0abc0"); // "0abc0"
    encodeAsHtml("\"HelloDarkness\""); // "&quot;HelloDarkness&quot;"
    encodeAsHtml("\"Hello Darkness\""); // "&quot;Hello Darkness&quot;"
    encodeAsHtml("\"hello Darkness\""); // "&quot;hello Darkness&quot;"
    encodeAsHtml("\"hello Darkness\""); // "&quot;hello Darkness&quot;"
    encodeAsHtml("\"hello .,#<[]>Darkness\""); // "&quot;hello .,#&lt;[]&gt;Darkness&quot;"
    encodeAsHtml("<script src=\"javascript:alert('Hello');\"></script>"); // "&lt;script src=&quot;javascript:alert(&#39;Hello&#39;);&quot;&gt;&lt;/script&gt;"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/encodeAsJson.html b/docs/typedoc/functions/encodeAsJson.html index 030abeff..89e164d6 100644 --- a/docs/typedoc/functions/encodeAsJson.html +++ b/docs/typedoc/functions/encodeAsJson.html @@ -15,4 +15,4 @@
    // String values
    encodeAsJson("abc.123"); // "\"abc.123\""
    encodeAsJson("321-abc"); // "\"321-abc\""
    encodeAsJson("Hello darkness, my \"old\" friend..."); // "\"Hello darkness, my \\\"old\\\" friend...\""
    encodeAsJson("Hello: Darkness"); // "\"Hello: Darkness\""
    encodeAsJson("Hello\\u003A Darkness"); // "\"Hello\\\\u003A Darkness\""
    encodeAsJson("`!@#$%^&*()_-+=[]{}:;'<>?"); // "\"\\u0060!@#$%^&*()_-+=[]{}:;\\u0027<>?\""
    encodeAsJson("0"); // "\"0\""
    encodeAsJson("1"); // "\"1\""

    encodeAsJson([]); // "[]"
    encodeAsJson(["A"]); // "[\"A\"]"
    encodeAsJson([0]); // "[0]"
    encodeAsJson([false]); // "[false]"
    encodeAsJson(new Array(1)); // "[null]"
    encodeAsJson(true); // "true",
    encodeAsJson(false); // "false"

    encodeAsJson({}); // "{}"
    encodeAsJson({ Hello: "Darkness" }); // "{\"Hello\":\"Darkness\"}");
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/fnApply.html b/docs/typedoc/functions/fnApply.html index b95e19cf..640b07ad 100644 --- a/docs/typedoc/functions/fnApply.html +++ b/docs/typedoc/functions/fnApply.html @@ -18,4 +18,4 @@
    // min / max number in an array
    let max = fnApply(Math.max, null, [ 21, 42, 84, 168, 7, 3 ]);
    // 168

    let min = fnApply(Math.min, null, [ 21, 42, 84, 168, 7, 3 ]);
    // 3

    const module1 = {
    prefix: "Hello",
    x: 21,
    getX() {
    return this.x;
    },
    log(value: string) {
    return this.prefix + " " + value + " : " + this.x
    }
    };

    // The 'this' parameter of 'getX' is bound to 'module'.
    module1.getX(); // 21
    module1.log("Darkness"); // Hello Darkness : 21

    // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.
    let module2 = {
    prefix: "my",
    x: 42
    };

    // Call the function of module1 with module2 as it's this
    fnApply(module1.getX, module2); // 42
    fnApply(module1.log, module2, [ "friend" ]); // my friend : 42
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/fnBind.html b/docs/typedoc/functions/fnBind.html index ecf2e0d8..529b56c5 100644 --- a/docs/typedoc/functions/fnBind.html +++ b/docs/typedoc/functions/fnBind.html @@ -18,4 +18,4 @@
    const module1 = {
    x: 21,
    getX() {
    return this.x;
    },
    };

    // The 'this' parameter of 'getX' is bound to 'module'.
    console.log(module1.getX()); // 21

    // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.
    let module2 = {
    x: 42
    };

    module2.getX = fnBind(module1.getX, module2);
    module2.getX(); // 42

    // It can also be used to proxy to the original function from the new one
    module2.getX = fnBind(module1.getX, module1);
    module2.getX(); // 21
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/fnCall.html b/docs/typedoc/functions/fnCall.html index e283c202..438610c6 100644 --- a/docs/typedoc/functions/fnCall.html +++ b/docs/typedoc/functions/fnCall.html @@ -38,4 +38,4 @@

    Type Parameters

    • F extends ((...args: any) => any)
    • T

    Parameters

    • fn: F
    • thisArg: T
    • Rest...argArray: any[]

    Returns ReturnType<F>

    // min / max number in an array
    let max = fnCall(Math.max, null, 21, 42, 84, 168, 7, 3);
    // 168

    let min = fnCall(Math.min, null, 21, 42, 84, 168, 7, 3);
    // 3

    const module1 = {
    prefix: "Hello",
    x: 21,
    getX() {
    return this.x;
    },
    log(value: string) {
    return this.prefix + " " + value + " : " + this.x
    }
    };

    // The 'this' parameter of 'getX' is bound to 'module'.
    module1.getX(); // 21
    module1.log("Darkness"); // Hello Darkness : 21

    // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.
    let module2 = {
    prefix: "my",
    x: 42
    };

    // Call the function of module1 with module2 as it's this
    fnCall(module1.getX, module2); // 42
    fnCall(module1.log, module2, "friend"); // my friend : 42
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/functionDeepCopyHandler.html b/docs/typedoc/functions/functionDeepCopyHandler.html index 5c0f5c8e..6391c46c 100644 --- a/docs/typedoc/functions/functionDeepCopyHandler.html +++ b/docs/typedoc/functions/functionDeepCopyHandler.html @@ -3,4 +3,4 @@

    Parameters

    Returns boolean

    true if the current value is a function otherwise false

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getCancelIdleCallback.html b/docs/typedoc/functions/getCancelIdleCallback.html index 22e6f649..6e474d60 100644 --- a/docs/typedoc/functions/getCancelIdleCallback.html +++ b/docs/typedoc/functions/getCancelIdleCallback.html @@ -2,4 +2,4 @@ cancel a previously scheduled idle callback, or if the runtime does not support the cancelIdleCallback it will return null.

    0.11.2

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getDocument.html b/docs/typedoc/functions/getDocument.html index 6867c21f..214a139e 100644 --- a/docs/typedoc/functions/getDocument.html +++ b/docs/typedoc/functions/getDocument.html @@ -1,2 +1,2 @@ getDocument | @nevware21/ts-utils

    Function getDocument

    Return the global document instance.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getGlobal.html b/docs/typedoc/functions/getGlobal.html index 466dde22..a7c869e9 100644 --- a/docs/typedoc/functions/getGlobal.html +++ b/docs/typedoc/functions/getGlobal.html @@ -13,4 +13,4 @@

    Parameters

    • OptionaluseCached: boolean

      [Optional] used for testing to bypass the cached lookup, when true this will cause the cached global to be reset.

      -

    Returns Window

    \ No newline at end of file +

    Returns Window

    diff --git a/docs/typedoc/functions/getHistory.html b/docs/typedoc/functions/getHistory.html index 75a69fa2..93728dca 100644 --- a/docs/typedoc/functions/getHistory.html +++ b/docs/typedoc/functions/getHistory.html @@ -1,2 +1,2 @@ getHistory | @nevware21/ts-utils

    Returns the global history instance

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getIdleCallback.html b/docs/typedoc/functions/getIdleCallback.html index 66d489ee..72f6c0f7 100644 --- a/docs/typedoc/functions/getIdleCallback.html +++ b/docs/typedoc/functions/getIdleCallback.html @@ -2,4 +2,4 @@ schedule work when there is free time in the event loop, or if the runtime does not support the requestIdleCallback it will return null.

    0.11.2

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getInst.html b/docs/typedoc/functions/getInst.html index ce6ae826..6ca2b6c8 100644 --- a/docs/typedoc/functions/getInst.html +++ b/docs/typedoc/functions/getInst.html @@ -5,4 +5,4 @@

    Returns T | null

    // This does not cause the evaluation to occur
    window.myGlobal = "Hello";
    let cachedValue = getInst("myGlobal");
    // cachedValue === "Hello"

    window.myGlobal = "Darkness";
    // getInst("myGlobal") === "Darkness"

    let promiseCls = getInst("Promise");
    // May throw if the global is not supported by the runtime
    // otherwise the Promise class.
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getIntValue.html b/docs/typedoc/functions/getIntValue.html index cb7cc2b9..8b110707 100644 --- a/docs/typedoc/functions/getIntValue.html +++ b/docs/typedoc/functions/getIntValue.html @@ -4,4 +4,4 @@

    Parameters

    • Optionalvalue: string | number

      The string or numeric value to get the integer value from

    • OptionaldefValue: number

      The default value if unsuccessful

    Returns number

    The default or parsed value.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getKnownSymbol.html b/docs/typedoc/functions/getKnownSymbol.html index e1b239d3..d0af2020 100644 --- a/docs/typedoc/functions/getKnownSymbol.html +++ b/docs/typedoc/functions/getKnownSymbol.html @@ -6,4 +6,4 @@
    // If Symbol is supported in the runtime
    getKnownSymbol("toStringTag") === Symbol.toStringTag; // true
    getKnownSymbol(WellKnownSymbols.toStringTag) === Symbol.toStringTag; // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getLazy.html b/docs/typedoc/functions/getLazy.html index f306aee2..2bfaad75 100644 --- a/docs/typedoc/functions/getLazy.html +++ b/docs/typedoc/functions/getLazy.html @@ -8,4 +8,4 @@
    // This does not cause the evaluation to occur
    let cachedValue = getLazy(() => callSomeExpensiveFunction());
    let theValue;

    // Just checking if there is an object still does not cause the evaluation
    if (cachedValue) {
    // This will cause the evaluation to occur and the result will be cached
    theValue = cachedValue.v;
    }

    // Accessing the value again will not cause the re-evaluation to occur, it will just return the same
    // result value again.
    theValue === cachedValue.v; // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getLength.html b/docs/typedoc/functions/getLength.html index 231dbc43..27155f81 100644 --- a/docs/typedoc/functions/getLength.html +++ b/docs/typedoc/functions/getLength.html @@ -5,4 +5,4 @@

    Returns T["length"]

    diff --git a/docs/typedoc/functions/getNavigator.html b/docs/typedoc/functions/getNavigator.html index 1c48ef88..29564fd6 100644 --- a/docs/typedoc/functions/getNavigator.html +++ b/docs/typedoc/functions/getNavigator.html @@ -1,2 +1,2 @@ getNavigator | @nevware21/ts-utils

    Function getNavigator

    Returns the global navigator instance

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getPerformance.html b/docs/typedoc/functions/getPerformance.html index 415a02a6..61282dad 100644 --- a/docs/typedoc/functions/getPerformance.html +++ b/docs/typedoc/functions/getPerformance.html @@ -4,4 +4,4 @@ API, the Navigation Timing API, the User Timing API, and the Resource Timing API.

    Returns Performance

    The global performance object if available.

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getSymbol.html b/docs/typedoc/functions/getSymbol.html index 186d7344..7b85ab20 100644 --- a/docs/typedoc/functions/getSymbol.html +++ b/docs/typedoc/functions/getSymbol.html @@ -1,3 +1,3 @@ getSymbol | @nevware21/ts-utils
    • If Symbols are supported then attempt to return the named Symbol

      Returns Symbol

      The value of the named Symbol (if available)

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getValueByIter.html b/docs/typedoc/functions/getValueByIter.html index 7a3acdef..42514002 100644 --- a/docs/typedoc/functions/getValueByIter.html +++ b/docs/typedoc/functions/getValueByIter.html @@ -13,4 +13,4 @@
    let theValue = {
    Hello: {
    Darkness: {
    my: "old"
    }
    },
    friend: "I've",
    come: {
    to: {
    see: "you"
    }
    }
    };

    let value = getValueByKey(theValue, ["Hello", "Darkness", "my"], "friend");
    // value === "my"

    let value = getValueByKey(theValue, ["My", "Old"], "friend");
    // value === "friend"

    let value = getValueByKey(theValue, ["come", "to"], "friend");
    // value === { see: "you" }

    let value = getValueByKey(theValue, ["friend"], "friend");
    // value === "I've"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getValueByKey.html b/docs/typedoc/functions/getValueByKey.html index 190d8a16..a771544c 100644 --- a/docs/typedoc/functions/getValueByKey.html +++ b/docs/typedoc/functions/getValueByKey.html @@ -9,4 +9,4 @@
    let theValue = {
    Hello: {
    Darkness: {
    my: "old"
    }
    },
    friend: "I've",
    come: {
    to: {
    see: "you"
    }
    }
    };

    let value = getValueByKey(theValue, "Hello.Darkness.my", "friend");
    // value === "my"

    let value = getValueByKey(theValue, "My.Old", "friend");
    // value === "friend"

    let value = getValueByKey(theValue, "come.to", "friend");
    // value === { see: "you" }

    let value = getValueByKey(theValue, "friend", "friend");
    // value === "I've"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/getWindow.html b/docs/typedoc/functions/getWindow.html index ba1daff7..9b622f8f 100644 --- a/docs/typedoc/functions/getWindow.html +++ b/docs/typedoc/functions/getWindow.html @@ -1,2 +1,2 @@ getWindow | @nevware21/ts-utils

    Return the global window instance.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/hasDocument.html b/docs/typedoc/functions/hasDocument.html index a896b5bc..4ed3e60a 100644 --- a/docs/typedoc/functions/hasDocument.html +++ b/docs/typedoc/functions/hasDocument.html @@ -2,4 +2,4 @@

    Returns boolean

    • True if a document exists
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/hasHistory.html b/docs/typedoc/functions/hasHistory.html index fbab072b..0ec9c8c9 100644 --- a/docs/typedoc/functions/hasHistory.html +++ b/docs/typedoc/functions/hasHistory.html @@ -1,2 +1,2 @@ hasHistory | @nevware21/ts-utils
    \ No newline at end of file +

    Returns boolean

    diff --git a/docs/typedoc/functions/hasIdleCallback.html b/docs/typedoc/functions/hasIdleCallback.html index b5e3cf8f..4186f1fe 100644 --- a/docs/typedoc/functions/hasIdleCallback.html +++ b/docs/typedoc/functions/hasIdleCallback.html @@ -4,4 +4,4 @@
    let nativeIdleTimeouts = hasIdleCallback();
    // true === idle timeouts are supported by the runtime otherwise false and the {@linke scheduleIdleCallback}
    will use `setTimeout` instead.
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/hasNavigator.html b/docs/typedoc/functions/hasNavigator.html index b4c690df..efe8c80e 100644 --- a/docs/typedoc/functions/hasNavigator.html +++ b/docs/typedoc/functions/hasNavigator.html @@ -1,2 +1,2 @@ hasNavigator | @nevware21/ts-utils

    Function hasNavigator

    \ No newline at end of file +

    Returns boolean

    diff --git a/docs/typedoc/functions/hasPerformance.html b/docs/typedoc/functions/hasPerformance.html index 3c36f2b1..c6afcef3 100644 --- a/docs/typedoc/functions/hasPerformance.html +++ b/docs/typedoc/functions/hasPerformance.html @@ -1,3 +1,3 @@ hasPerformance | @nevware21/ts-utils

    Function hasPerformance

    • Identify whether the runtimne contains a performance object

      Returns boolean

      0.4.4

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/hasSymbol.html b/docs/typedoc/functions/hasSymbol.html index 7f95af4e..4948086a 100644 --- a/docs/typedoc/functions/hasSymbol.html +++ b/docs/typedoc/functions/hasSymbol.html @@ -1,3 +1,3 @@ hasSymbol | @nevware21/ts-utils
    • Helper to identify whether the runtime support the Symbols either via native or an installed polyfill

      Returns boolean

      true if Symbol's are support otherwise false

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/hasValue.html b/docs/typedoc/functions/hasValue.html index 553c547f..169fb00e 100644 --- a/docs/typedoc/functions/hasValue.html +++ b/docs/typedoc/functions/hasValue.html @@ -16,4 +16,4 @@

    Returns boolean

    // False
    hasValue(null); // false
    hasValue(undefined); // false
    hasValue("undefined"); // false (Special Case)
    hasValue(""); // false -- use: !strIsNullOrEmpty("")
    hasValue([]); // false
    hasValue(/[a-z]/g); // false
    hasValue(new RegExp("")); // false
    hasValue(new ArrayBuffer(0)); // false
    hasValue(new Error("Test Error")); // false
    hasValue(new TypeError("Test TypeError")); // false
    hasValue(new TestError("Test TestError")); // false
    hasValue(Promise.reject()); // false
    hasValue(Promise.resolve()); // false
    hasValue(new Promise(() => {})); // false
    hasValue({}); // false
    hasValue(Object.create(null)); // false
    hasValue(polyObjCreate(null)); // false

    // Objects with length / size property or function
    hasValue({ length: 0 }); // false
    hasValue({ length: () => 0 }); // false
    hasValue({ byteLength: 0 }); // false
    hasValue({ byteLength: () => 0 }); // false
    hasValue({ size: 0 }); // false
    hasValue({ size: () => 0 }); // false
    hasValue({ count: 0 }); // false
    hasValue({ count: undefined as any }); // false
    hasValue({ count: null as any }); // false
    hasValue({ count: () => 0 }); // false
    hasValue({ count: () => undefined as any }); // false
    hasValue({ count: () => null as any }); // false
    hasValue({ valueOf: () => undefined as any});// false
    hasValue({ valueOf: () => null as any }); // false

    // True
    hasValue("null"); // true
    hasValue("0"); // true
    hasValue("1"); // true
    hasValue("aa"); // true
    hasValue(new Date()); // true
    hasValue(0); // true
    hasValue(1); // true
    hasValue(_dummyFunction); // true
    hasValue(["A"]); // true
    hasValue([0]); // true
    hasValue([false]); // true
    hasValue(new Array(1)); // true
    hasValue(true); // true
    hasValue(false); // true
    hasValue("true"); // true
    hasValue("false"); // true
    hasValue((/[a-z]/g).exec("hello")); // true
    hasValue(new ArrayBuffer(1)); // true
    hasValue(_dummyError()); // true
    hasValue(_simplePromise()); // true
    hasValue(_simplePromiseLike()); // true

    // Boolean objects
    hasValue(new Boolean(true)); // true
    hasValue(new Boolean(false)); // true
    hasValue(new Boolean("true")); // true
    hasValue(new Boolean("false")); // true
    hasValue(new Boolean("0")); // true
    hasValue(new Boolean(0)); // true
    hasValue(new Boolean("1")); // true
    hasValue(new Boolean(1)); // true

    // Boolean values
    hasValue(Boolean(true)); // true
    hasValue(Boolean(false)); // true
    hasValue(Boolean("true")); // true
    hasValue(Boolean("false")); // true
    hasValue(Boolean("0")); // true
    hasValue(Boolean(0)); // true
    hasValue(Boolean("1")); // true
    hasValue(Boolean(1)); // true

    // Objects with length / size property or function
    hasValue({ length: 1 }); // true
    hasValue({ length: () => 1 }); // true
    hasValue({ byteLength: 1 }); // true
    hasValue({ byteLength: () => 1 }); // true
    hasValue({ size: 1 }); // true
    hasValue({ size: () => 1 }); // true
    hasValue({ count: 1 }); // true
    hasValue({ count: () => 1 }); // true
    hasValue({ valueOf: () => 0 }); // true
    hasValue({ valueOf: () => 1 }); // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/hasWindow.html b/docs/typedoc/functions/hasWindow.html index 0c417b9f..5d75cd32 100644 --- a/docs/typedoc/functions/hasWindow.html +++ b/docs/typedoc/functions/hasWindow.html @@ -1,2 +1,2 @@ hasWindow | @nevware21/ts-utils
    \ No newline at end of file +

    Returns boolean

    diff --git a/docs/typedoc/functions/isArray.html b/docs/typedoc/functions/isArray.html index 11bf0b78..34bbdebc 100644 --- a/docs/typedoc/functions/isArray.html +++ b/docs/typedoc/functions/isArray.html @@ -4,4 +4,4 @@
    • Type Parameters

      • T = any

      Parameters

      • arg: any

        Value to be checked.

      Returns arg is T[]

      True if the value is a Array, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isArrayBuffer.html b/docs/typedoc/functions/isArrayBuffer.html index fc4f4832..17dba938 100644 --- a/docs/typedoc/functions/isArrayBuffer.html +++ b/docs/typedoc/functions/isArrayBuffer.html @@ -1,4 +1,4 @@ isArrayBuffer | @nevware21/ts-utils

    Function isArrayBuffer

    Checks if the type of value is a ArrayBuffer object.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is ArrayBuffer

      True if the value is a ArrayBuffer, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isBlob.html b/docs/typedoc/functions/isBlob.html index 9545932d..ef5269f5 100644 --- a/docs/typedoc/functions/isBlob.html +++ b/docs/typedoc/functions/isBlob.html @@ -1,4 +1,4 @@ isBlob | @nevware21/ts-utils

    Checks if the type of value is a Blob object.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is Blob

      True if the value is a Blob, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isBoolean.html b/docs/typedoc/functions/isBoolean.html index 235eda9f..a5e77a96 100644 --- a/docs/typedoc/functions/isBoolean.html +++ b/docs/typedoc/functions/isBoolean.html @@ -1,4 +1,4 @@ isBoolean | @nevware21/ts-utils

    Checks if the type of value is a boolean.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is boolean

      True if the value is a boolean, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isDate.html b/docs/typedoc/functions/isDate.html index 14f30918..1d9b6b0c 100644 --- a/docs/typedoc/functions/isDate.html +++ b/docs/typedoc/functions/isDate.html @@ -2,4 +2,4 @@
    import { isDate } from "@nevware21/ts-utils";

    let _theDate = null;

    function getSetDate(newDate?: any) {
    _theDate = isDate(newDate) ? newDate : new Date();

    return _theDate;
    }
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isDefined.html b/docs/typedoc/functions/isDefined.html index 96cbe7f3..beec6567 100644 --- a/docs/typedoc/functions/isDefined.html +++ b/docs/typedoc/functions/isDefined.html @@ -5,4 +5,4 @@
    isDefined(null);         // false
    isDefined(undefined); // false
    isDefined("undefined"); // true

    let value = null;
    isDefined(value); // false
    let value = undefined;
    isDefined(value); // false

    isDefined(""); // true
    isDefined(0); // true
    isDefined(new Date()); // true
    isDefined(true); // true
    isDefined(false); // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isError.html b/docs/typedoc/functions/isError.html index c4fd2f89..28c68cff 100644 --- a/docs/typedoc/functions/isError.html +++ b/docs/typedoc/functions/isError.html @@ -1,4 +1,4 @@ isError | @nevware21/ts-utils

    Checks if the type of value is a Error object.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is Error

      True if the value is a Error, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isFile.html b/docs/typedoc/functions/isFile.html index 3874b5c2..ba0212f9 100644 --- a/docs/typedoc/functions/isFile.html +++ b/docs/typedoc/functions/isFile.html @@ -1,4 +1,4 @@ isFile | @nevware21/ts-utils

    Checks if the type of value is a File object.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is File

      True if the value is a File, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isFormData.html b/docs/typedoc/functions/isFormData.html index c82a23ad..7c6b45fa 100644 --- a/docs/typedoc/functions/isFormData.html +++ b/docs/typedoc/functions/isFormData.html @@ -1,4 +1,4 @@ isFormData | @nevware21/ts-utils

    Checks if the type of value is a FormData object.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is FormData

      True if the value is a FormData, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isFunction.html b/docs/typedoc/functions/isFunction.html index 0edcee95..393fbcb1 100644 --- a/docs/typedoc/functions/isFunction.html +++ b/docs/typedoc/functions/isFunction.html @@ -3,4 +3,4 @@
    • Parameters

      • value: any

        The value to check

        -

      Returns value is Function

    \ No newline at end of file +

    Returns value is Function

    diff --git a/docs/typedoc/functions/isIterable.html b/docs/typedoc/functions/isIterable.html index f4a7b022..223bfe84 100644 --- a/docs/typedoc/functions/isIterable.html +++ b/docs/typedoc/functions/isIterable.html @@ -6,4 +6,4 @@
    isIterable(null);        // false
    isIterable(undefined); // false
    isIterable("null"); // true (Strings are iterable)
    isIterable([]); // true (Arrays are iterable)
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isIterator.html b/docs/typedoc/functions/isIterator.html index 483b1082..fcb4523f 100644 --- a/docs/typedoc/functions/isIterator.html +++ b/docs/typedoc/functions/isIterator.html @@ -6,4 +6,4 @@
    isIterator(null);        // false
    isIterator(undefined); // false
    isIterator("null"); // false (Strings are iterable but not iterators)
    isIterator([]); // false (Arrays are iterable but not iterators)
    isIterator({
    next: function() { return true }
    }); // true, iterators must contain a "next" function
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isNode.html b/docs/typedoc/functions/isNode.html index 27a939b0..aa8db49b 100644 --- a/docs/typedoc/functions/isNode.html +++ b/docs/typedoc/functions/isNode.html @@ -1,3 +1,3 @@ isNode | @nevware21/ts-utils

    Simple method to determine if we are running in a node environment

    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isNotTruthy.html b/docs/typedoc/functions/isNotTruthy.html index ec4fa7ac..35b9434f 100644 --- a/docs/typedoc/functions/isNotTruthy.html +++ b/docs/typedoc/functions/isNotTruthy.html @@ -2,4 +2,4 @@ case usages of Boolean(true/false) and new Boolean(true/false).

    Parameters

    • value: any

      Value to be checked.

    Returns boolean

    True if the value is not truthy, false otherwise.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isNullOrUndefined.html b/docs/typedoc/functions/isNullOrUndefined.html index cd0fb627..a0f1c3bf 100644 --- a/docs/typedoc/functions/isNullOrUndefined.html +++ b/docs/typedoc/functions/isNullOrUndefined.html @@ -4,4 +4,4 @@
    isNullOrUndefined(null);         // true
    isNullOrUndefined(undefined); // true
    isNullOrUndefined("undefined"); // true

    let value = null;
    isNullOrUndefined(value); // true
    let value = undefined;
    isNullOrUndefined(value); // true

    isNullOrUndefined(""); // false
    isNullOrUndefined(0); // false
    isNullOrUndefined(new Date()); // false
    isNullOrUndefined(true); // false
    isNullOrUndefined(false); // false
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isNumber.html b/docs/typedoc/functions/isNumber.html index b8d7ee95..8b4ec06d 100644 --- a/docs/typedoc/functions/isNumber.html +++ b/docs/typedoc/functions/isNumber.html @@ -1,4 +1,4 @@ isNumber | @nevware21/ts-utils

    Checks if the type of value is a number.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is number

      True if the value is a number, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isObject.html b/docs/typedoc/functions/isObject.html index 8198a9d9..3478430b 100644 --- a/docs/typedoc/functions/isObject.html +++ b/docs/typedoc/functions/isObject.html @@ -1,4 +1,4 @@ isObject | @nevware21/ts-utils
    • Checks to see if the past value is an object value

      Type Parameters

      • T

        The object type, defaults to any

      Parameters

      • value: T

        The value to check

        -

      Returns value is T

    \ No newline at end of file +

    Returns value is T

    diff --git a/docs/typedoc/functions/isPlainObject.html b/docs/typedoc/functions/isPlainObject.html index fe05d8f0..885db972 100644 --- a/docs/typedoc/functions/isPlainObject.html +++ b/docs/typedoc/functions/isPlainObject.html @@ -7,4 +7,4 @@
    console.log(isPlainObject({ 0: 'a', 1: 'b', 2: 'c' }));      // true
    console.log(isPlainObject({ 100: 'a', 2: 'b', 7: 'c' })); // true
    console.log(isPlainObject(objCreate(null))); // true

    const myObj = objCreate({}, {
    getFoo: {
    value() { return this.foo; }
    }
    });
    myObj.foo = 1;
    console.log(isPlainObject(myObj)); // true

    console.log(isPlainObject(['a', 'b', 'c'])); // false
    console.log(isPlainObject(new Date())); // false
    console.log(isPlainObject(new Error("An Error"))); // false
    console.log(isPlainObject(null)); // false
    console.log(isPlainObject(undefined)); // false
    console.log(isPlainObject("null")); // false
    console.log(isPlainObject("undefined")); // false
    console.log(isPlainObject("1")); // false
    console.log(isPlainObject("aa")); // false
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isPrimitive.html b/docs/typedoc/functions/isPrimitive.html index 4831f185..3865d7a5 100644 --- a/docs/typedoc/functions/isPrimitive.html +++ b/docs/typedoc/functions/isPrimitive.html @@ -19,4 +19,4 @@
    isPrimitive(null);                   // true
    isPrimitive(undefined); // true
    isPrimitive("null"); // true
    isPrimitive("undefined"); // true
    isPrimitive("1"); // true
    isPrimitive("aa"); // true
    isPrimitive(1); // true
    isPrimitive(Number(2)); // true
    isPrimitive(""); // true
    isPrimitive(String("")); // true
    isPrimitive(true); // true
    isPrimitive(false); // true
    isPrimitive("true"); // true
    isPrimitive("false"); // true
    isPrimitive(BigInt(42)); // true
    isPrimitive(Symbol.for("Hello")); // true

    isPrimitive(new String("aa")); // false
    isPrimitive(new Date()); // false
    isPrimitive(_dummyFunction); // false
    isPrimitive([]); // false
    isPrimitive(new Array(1)); // false
    isPrimitive(new Boolean(true)); // false
    isPrimitive(new Boolean(false)); // false
    isPrimitive(new Boolean("true")); // false
    isPrimitive(new Boolean("false")); // false
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isPrimitiveType.html b/docs/typedoc/functions/isPrimitiveType.html index 639dfd83..ac3e877d 100644 --- a/docs/typedoc/functions/isPrimitiveType.html +++ b/docs/typedoc/functions/isPrimitiveType.html @@ -19,4 +19,4 @@
    isPrimitiveType(null);                   // false
    isPrimitiveType(undefined); // false
    isPrimitiveType("null"); // false
    isPrimitiveType("undefined"); // false
    isPrimitiveType("1"); // false
    isPrimitiveType("aa"); // false
    isPrimitiveType(1); // false
    isPrimitiveType(Number(2)); // false
    isPrimitiveType(""); // false
    isPrimitiveType(String("")); // false
    isPrimitiveType(true); // false
    isPrimitiveType(false); // false
    isPrimitiveType("true"); // false
    isPrimitiveType("false"); // false
    isPrimitiveType(BigInt(42)); // false
    isPrimitiveType(Symbol.for("Hello")); // false

    isPrimitiveType("string"); // true
    isPrimitiveType("number"); // true
    isPrimitiveType("boolean"); // true
    isPrimitiveType("undefined"); // true
    isPrimitiveType("symbol"); // true
    isPrimitiveType("bigint"); // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isPromise.html b/docs/typedoc/functions/isPromise.html index 9a196043..d3c77639 100644 --- a/docs/typedoc/functions/isPromise.html +++ b/docs/typedoc/functions/isPromise.html @@ -1,4 +1,4 @@ isPromise | @nevware21/ts-utils
    • Checks if the type of value is a Promise instance (contains then and catch functions).

      Type Parameters

      • T

      Parameters

      • value: any

        Value to be checked.

      Returns value is Promise<T>

      True if the value is a Promise, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isPromiseLike.html b/docs/typedoc/functions/isPromiseLike.html index 373e28ea..438a2e6e 100644 --- a/docs/typedoc/functions/isPromiseLike.html +++ b/docs/typedoc/functions/isPromiseLike.html @@ -1,4 +1,4 @@ isPromiseLike | @nevware21/ts-utils

    Function isPromiseLike

    • Checks if the type of value is a PromiseLike instance (contains a then function).

      Type Parameters

      • T

      Parameters

      • value: any

        Value to be checked.

      Returns value is PromiseLike<T>

      True if the value is a PromiseLike, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isRegExp.html b/docs/typedoc/functions/isRegExp.html index 72dadf07..52ac9bfd 100644 --- a/docs/typedoc/functions/isRegExp.html +++ b/docs/typedoc/functions/isRegExp.html @@ -1,4 +1,4 @@ isRegExp | @nevware21/ts-utils

    Determines if a value is a regular expression object.

    • Parameters

      • value: any

        Reference to check.

      Returns value is RegExp

      True if value is a RegExp.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isStrictNullOrUndefined.html b/docs/typedoc/functions/isStrictNullOrUndefined.html index a8beb578..85d6eeab 100644 --- a/docs/typedoc/functions/isStrictNullOrUndefined.html +++ b/docs/typedoc/functions/isStrictNullOrUndefined.html @@ -4,4 +4,4 @@

    Returns boolean

    isStrictNullOrUndefined(null);         // true
    isStrictNullOrUndefined(undefined); // true
    isStrictNullOrUndefined("undefined"); // false

    let value = null;
    isStrictNullOrUndefined(value); // true
    let value = undefined;
    isStrictNullOrUndefined(value); // true

    isStrictNullOrUndefined(""); // false
    isStrictNullOrUndefined(0); // false
    isStrictNullOrUndefined(new Date()); // false
    isStrictNullOrUndefined(true); // false
    isStrictNullOrUndefined(false); // false
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isStrictUndefined.html b/docs/typedoc/functions/isStrictUndefined.html index 4dfed8b2..4347263b 100644 --- a/docs/typedoc/functions/isStrictUndefined.html +++ b/docs/typedoc/functions/isStrictUndefined.html @@ -5,4 +5,4 @@
    isStrictUndefined(undefined);    // true

    isStrictUndefined(null); // false
    isStrictUndefined("null"); // false
    isStrictUndefined("undefined"); // false
    isStrictUndefined("1"); // false
    isStrictUndefined("aa"); // false
    isStrictUndefined(new Date()); // false
    isStrictUndefined(0); // false
    isStrictUndefined(1); // false
    isStrictUndefined(""); // false
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isString.html b/docs/typedoc/functions/isString.html index 58a8a7d4..800b63ec 100644 --- a/docs/typedoc/functions/isString.html +++ b/docs/typedoc/functions/isString.html @@ -3,4 +3,4 @@
    \ No newline at end of file +

    Returns value is string

    diff --git a/docs/typedoc/functions/isSymbol.html b/docs/typedoc/functions/isSymbol.html index d9af2fbf..fbc91fe5 100644 --- a/docs/typedoc/functions/isSymbol.html +++ b/docs/typedoc/functions/isSymbol.html @@ -1,4 +1,4 @@ isSymbol | @nevware21/ts-utils

    Checks if the type of value is a symbol.

    • Parameters

      • value: any

        Value to be checked.

      Returns value is symbol

      True if the value is a symbol, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isThenable.html b/docs/typedoc/functions/isThenable.html index 32429f8f..bb14207c 100644 --- a/docs/typedoc/functions/isThenable.html +++ b/docs/typedoc/functions/isThenable.html @@ -2,4 +2,4 @@ This is an alias for isPromiseLike.

    • Type Parameters

      • T

      Parameters

      • value: any

        Value to be checked.

      Returns value is PromiseLike<T>

      True if the value is a PromiseLike, false otherwise.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isTruthy.html b/docs/typedoc/functions/isTruthy.html index 35ec762b..e156d697 100644 --- a/docs/typedoc/functions/isTruthy.html +++ b/docs/typedoc/functions/isTruthy.html @@ -2,4 +2,4 @@ case usages of Boolean(true/false) and new Boolean(true/false).

    Parameters

    • value: any

      Value to be checked.

    Returns boolean

    True if the value is not truthy, false otherwise.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isTypeof.html b/docs/typedoc/functions/isTypeof.html index 16e19627..ac6f11f6 100644 --- a/docs/typedoc/functions/isTypeof.html +++ b/docs/typedoc/functions/isTypeof.html @@ -2,4 +2,4 @@

    Parameters

    • value: any

      The value to check

    • theType: string

      The expected type name as a string

    Returns boolean

    true if the value matches the provided type

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isUndefined.html b/docs/typedoc/functions/isUndefined.html index 57270240..bc844293 100644 --- a/docs/typedoc/functions/isUndefined.html +++ b/docs/typedoc/functions/isUndefined.html @@ -5,4 +5,4 @@
    isUndefined(undefined);              // true
    isUndefined("undefined"); // true

    isUndefined(null); // false
    isUndefined("null"); // false
    isUndefined("1"); // false
    isUndefined("aa"); // false
    isUndefined(new Date()); // false
    isUndefined(1); // false
    isUndefined(""); // false
    isUndefined(_dummyFunction); // false
    isUndefined([]); // false
    isUndefined(new Array(1)); // false
    isUndefined(true); // false
    isUndefined(false); // false
    isUndefined("true"); // false
    isUndefined("false"); // false
    isUndefined(new Boolean(true)); // false
    isUndefined(new Boolean(false)); // false
    isUndefined(new Boolean("true")); // false
    isUndefined(new Boolean("false")); // false
    isUndefined(Boolean(true)); // false
    isUndefined(Boolean(false)); // false
    isUndefined(Boolean("true")); // false
    isUndefined(Boolean("false")); // false
    isUndefined(new RegExp("")); // false
    isUndefined(new ArrayBuffer(0)); // false
    isUndefined(new Error("Test Error"));// false
    isUndefined(new TypeError("Test TypeError")); // false
    isUndefined(new TestError("Test TestError")); // false
    isUndefined(_dummyError()); // false
    isUndefined(Promise.reject()); // false
    isUndefined(Promise.resolve()); // false
    isUndefined(new Promise(() => {})); // false
    isUndefined(_simplePromise()); // false
    isUndefined(_simplePromiseLike()); // false
    isUndefined(Object.create(null)); // false
    isUndefined(polyObjCreate(null)); // false
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/isWebWorker.html b/docs/typedoc/functions/isWebWorker.html index d33792ef..9c5d9907 100644 --- a/docs/typedoc/functions/isWebWorker.html +++ b/docs/typedoc/functions/isWebWorker.html @@ -1,3 +1,3 @@ isWebWorker | @nevware21/ts-utils

    Function isWebWorker

    Helper to identify if you are running as a Dedicated, Shared or Service worker

    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/iterForOf.html b/docs/typedoc/functions/iterForOf.html index 3703eeb6..d4d5b056 100644 --- a/docs/typedoc/functions/iterForOf.html +++ b/docs/typedoc/functions/iterForOf.html @@ -23,4 +23,4 @@
    const items = {
    'item1': 'value1',
    'item2': 'value2',
    'item3': 'value3
    };
    const copyItems = [];

    iterForOf(items, (item) => {
    copyItems.push(item);
    // May return -1 to abort the iteration
    });
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/lazySafeGetInst.html b/docs/typedoc/functions/lazySafeGetInst.html index acb728cb..7288e10d 100644 --- a/docs/typedoc/functions/lazySafeGetInst.html +++ b/docs/typedoc/functions/lazySafeGetInst.html @@ -10,4 +10,4 @@
    // This does not cause the evaluation to occur
    window.myGlobal = "Hello";
    let cachedValue = lazySafeGetInst("myGlobal");
    // cachedValue.v === "Hello"

    window.myGlobal = "Darkness";
    // cachedValue.v === "Hello"

    let promiseCls = lazySafeGetInst("Promise");
    // null if Promise is not supported in the runtime
    // otherwise the Promise class.
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/makeGlobRegex.html b/docs/typedoc/functions/makeGlobRegex.html index 12a9946e..f2e5746e 100644 --- a/docs/typedoc/functions/makeGlobRegex.html +++ b/docs/typedoc/functions/makeGlobRegex.html @@ -21,4 +21,4 @@
    let regex = makeGlobRegex("src\\**\\*.ts");

    let matches = regex.exec("Hello");
    matches; // null

    let matches = regex.exec("Src/index.ts");
    matches; // null - Specify the ignoreCase if you want this to match

    let matches = regex.exec("src/index.ts");
    matches[0]; // "src/index.ts"
    matches[1]; // undefined;
    matches[2]; // "index"

    let matches = regex.exec("src\\index.ts");
    matches[0]; // "src\\index.ts"
    matches[1]; // undefined;
    matches[2]; // "index"

    let matches = regex.exec("src/helpers/regexp.ts");
    matches[0]; // "src/helpers/regexp.ts"
    matches[1]; // "helpers/"
    matches[2]; // "regexp"

    let matches = regex.exec("src\\helpers/regexp.ts");
    matches[0]; // "src\\helpers/regexp.ts"
    matches[1]; // "helpers/"
    matches[2]; // "regexp"

    let matches = regex.exec(" src/index.tsx ");
    matches[0]; // "src/index.ts"
    matches[1]; // undefined
    matches[2]; // "index"

    let matches = regex.exec(" src/helpers/regexp.ts. ");
    matches[0]; // "src/helpers/regexp.ts"
    matches[1]; // "helpers/"
    matches[2]; // "regexp"]);
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/makeIterable.html b/docs/typedoc/functions/makeIterable.html index e02bb7d5..8ba5f482 100644 --- a/docs/typedoc/functions/makeIterable.html +++ b/docs/typedoc/functions/makeIterable.html @@ -9,4 +9,4 @@
    let current = 0;
    let next = 1;
    let done = false;
    let fibCtx: CreateIteratorContext<number> = {
    n: function() {
    fibCtx.v = current;
    current = next;
    next = fibCtx.v + next;

    // Return not done, so it will just continue
    return false;
    }
    };

    let values: number[] = [];
    let theIterable: Iterable<T> = makeIterable({}, fibCtx);

    iterForOf(theIterable, (value) => {
    values.push(value);
    if (values.length === 10) {
    return -1;
    }
    });

    // Values: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/mathCeil.html b/docs/typedoc/functions/mathCeil.html index 148454b7..41cc6c50 100644 --- a/docs/typedoc/functions/mathCeil.html +++ b/docs/typedoc/functions/mathCeil.html @@ -3,4 +3,4 @@

    The smallest integer greater than or equal to the given number.

    • Returns the smallest integer greater than or equal to its numeric argument.

      Parameters

      • x: number

        A numeric expression.

        -

      Returns number

    \ No newline at end of file +

    Returns number

    diff --git a/docs/typedoc/functions/mathFloor.html b/docs/typedoc/functions/mathFloor.html index 83ca2417..8a1b6253 100644 --- a/docs/typedoc/functions/mathFloor.html +++ b/docs/typedoc/functions/mathFloor.html @@ -3,4 +3,4 @@

    A number representing the largest integer less than or equal to the specified number.

    • Returns the greatest integer less than or equal to its numeric argument.

      Parameters

      • x: number

        A numeric expression.

        -

      Returns number

    \ No newline at end of file +

    Returns number

    diff --git a/docs/typedoc/functions/mathMax.html b/docs/typedoc/functions/mathMax.html index ed75397e..e113e1c0 100644 --- a/docs/typedoc/functions/mathMax.html +++ b/docs/typedoc/functions/mathMax.html @@ -9,4 +9,4 @@

    Returns number

    The value converted to an integer

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/mathTrunc.html b/docs/typedoc/functions/mathTrunc.html index 81510ebf..8772418e 100644 --- a/docs/typedoc/functions/mathTrunc.html +++ b/docs/typedoc/functions/mathTrunc.html @@ -5,4 +5,4 @@ The argument passed to this method will be converted to number type implicitly.

    • Parameters

      • value: number

        The value to be truncated

      Returns number

      The integer path of the given number

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/newSymbol.html b/docs/typedoc/functions/newSymbol.html index b9e54c68..97b2f7c3 100644 --- a/docs/typedoc/functions/newSymbol.html +++ b/docs/typedoc/functions/newSymbol.html @@ -3,4 +3,4 @@

    Parameters

    • Optionaldescription: string | number

      Description of the new Symbol object.

    • OptionalnoPoly: boolean

      Flag indicating whether to return a polyfil if symbols are not supported.

    Returns symbol

    The new symbol

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/normalizeJsName.html b/docs/typedoc/functions/normalizeJsName.html index 0aff3d52..82f55ee7 100644 --- a/docs/typedoc/functions/normalizeJsName.html +++ b/docs/typedoc/functions/normalizeJsName.html @@ -18,4 +18,4 @@
    normalizeJsName("HelloDarkness"); // "HelloDarkness"
    normalizeJsName("Hello Darkness"); // "Hello_Darkness"
    normalizeJsName("hello Darkness"); // "hello_Darkness"
    normalizeJsName("hello Darkness"); // "hello_Darkness"
    normalizeJsName("hello.Darkness"); // "hello_Darkness"
    normalizeJsName("hello-Darkness"); // "hello_Darkness"
    normalizeJsName("hello_Darkness"); // "hello_Darkness"
    normalizeJsName("abc-123"); // "abc_123"
    normalizeJsName("0abc0"); // "0abc0"
    normalizeJsName("\"HelloDarkness\""); // "_HelloDarkness_"
    normalizeJsName("\"Hello Darkness\""); // "_Hello_Darkness_"
    normalizeJsName("\"hello Darkness\""); // "_hello_Darkness_"
    normalizeJsName("\"hello Darkness\""); // "_hello_Darkness_"
    normalizeJsName("\"hello .,#[]Darkness\""); // "_hello______Darkness_"

    normalizeJsName("HelloDarkness", true); // "helloDarkness"
    normalizeJsName("Hello Darkness", true); // "helloDarkness"
    normalizeJsName("hello Darkness", true); // "helloDarkness"
    normalizeJsName("hello Darkness", true); // "helloDarkness"
    normalizeJsName("hello.Darkness", true); // "helloDarkness"
    normalizeJsName("hello-Darkness", true); // "helloDarkness"
    normalizeJsName("hello_Darkness", true); // "helloDarkness"
    normalizeJsName("abc-123", true); // "abc123"
    normalizeJsName("0abc0", true); // "0abc0"
    normalizeJsName("\"HelloDarkness\"", true); // "helloDarkness"
    normalizeJsName("\"Hello Darkness\"", true); // "helloDarkness"
    normalizeJsName("hello \"Darkness\"", true); // "helloDarkness"
    normalizeJsName("hello \"Darkness\"", true); // "helloDarkness"
    normalizeJsName("\"hello .,#[]Darkness\"", true); // "helloDarkness"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objAssign.html b/docs/typedoc/functions/objAssign.html index 9660ce5e..654c93f8 100644 --- a/docs/typedoc/functions/objAssign.html +++ b/docs/typedoc/functions/objAssign.html @@ -35,4 +35,4 @@ target object. Returns the target object.

    Parameters

    • target: object

      The target object to copy to.

    • Rest...sources: any[]

      One or more source objects from which to copy properties

      -

    Returns any

    \ No newline at end of file +

    Returns any

    diff --git a/docs/typedoc/functions/objCopyProps.html b/docs/typedoc/functions/objCopyProps.html index dafb6b82..65ec6eab 100644 --- a/docs/typedoc/functions/objCopyProps.html +++ b/docs/typedoc/functions/objCopyProps.html @@ -7,4 +7,4 @@
    let a: any = { a: 1 };
    let b: any = { b: 2, d: new Date(), e: new TestClass("Hello Darkness") };
    a.b = b; // { a: 1, b: { b: 2} }
    b.a = a; // { a: 1, b: { b: 2, a: { a: 1, { b: 2, a: ... }}}}

    function copyHandler(details: IObjDeepCopyHandlerDetails) {
    // details.origin === a
    // details.path[] is the path to the current value
    if (details.value && isDate(details.value)) {
    // So for the date path === [ "b", "d" ] which represents
    // details.origin["b"]["d"] === The Date

    // Create a clone the Date object and set as the "newValue"
    details.value = new Date(details.value.getTime());

    // Return true to indicate that we have "handled" the conversion
    // See objDeepCopy example for just reusing the original value (just don't replace details.value)
    return true;
    }

    return false;
    }

    let c: any = objCopyProps({}, a, copyHandler);

    assert.notEqual(a, c, "check a and c are not the same");
    assert.ok(c !== c.b.a, "The root object won't be the same for the target reference as are are copying properties to our target");
    assert.ok(c.b === c.b.a.b, "Check that the 2 'b' references are the same object");
    assert.ok(c.b.a === c.b.a.b.a, "Check that the 2 'a' references are the same object");
    assert.ok(c.b.d === c.b.a.b.d, "Check that the 2 'd' references are the same object");
    assert.ok(isDate(c.b.d), "The copied date is still real 'Date' instance");
    assert.notEqual(c.b.d, a.b.d, "And the copied date is not the same as the original");
    assert.equal(c.b.d.getTime(), a.b.d.getTime(), "But the dates are the same");

    assert.ok(isObject(c.b.d), "The copied date is now an object");
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objCreate.html b/docs/typedoc/functions/objCreate.html index 8a9de42c..26d5160b 100644 --- a/docs/typedoc/functions/objCreate.html +++ b/docs/typedoc/functions/objCreate.html @@ -2,4 +2,4 @@ for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations

    \ No newline at end of file +

    Returns any

    diff --git a/docs/typedoc/functions/objDeepCopy.html b/docs/typedoc/functions/objDeepCopy.html index bb09cc49..e08e4ea4 100644 --- a/docs/typedoc/functions/objDeepCopy.html +++ b/docs/typedoc/functions/objDeepCopy.html @@ -9,4 +9,4 @@
    let a: any = { a: 1 };
    let b: any = { b: 2, d: new Date(), e: new TestClass("Hello Darkness") };
    a.b = b; // { a: 1, b: { b: 2} }
    b.a = a; // { a: 1, b: { b: 2, a: { a: 1, { b: 2, a: ... }}}}

    function copyHandler(details: IObjDeepCopyHandlerDetails) {
    // details.origin === a
    // details.path[] is the path to the current value
    if (details.value && isDate(details.value)) {
    // So for the date path === [ "b", "d" ] which represents
    // details.origin["b"]["d"] === The Date

    // Return true to indicate that we have "handled" the conversion
    // Which in this case will reuse the existing instance (as we didn't replace details.value)
    // See objCopyProps example for replacing the Date instance
    return true;
    }

    return false;
    }

    let c: any = objDeepCopy(a, copyHandler);

    assert.notEqual(a, c, "check a and c are not the same");
    assert.ok(c === c.b.a, "The root object won't be the same for the target reference");
    assert.ok(c.b === c.b.a.b, "Check that the 2 'b' references are the same object");
    assert.ok(c.b.a === c.b.a.b.a, "Check that the 2 'a' references are the same object");
    assert.ok(c.b.d === c.b.a.b.d, "Check that the 2 'd' references are the same object");
    assert.ok(isDate(c.b.d), "The copied date is still real 'Date' instance");
    assert.equal(c.b.d, a.b.d, "And the copied date is the original date");
    assert.equal(c.b.d.getTime(), a.b.d.getTime(), "But the dates are the same");
    assert.ok(isObject(c.b.d), "The copied date is now an object");
    assert.ok(!isError(c.b.e), "The copied error is no longer a real 'Error' instance");
    assert.ok(isObject(c.b.e), "The copied error is now an object");
    assert.equal(42, c.b.e.value, "Expect that the local property was copied");
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objDeepFreeze.html b/docs/typedoc/functions/objDeepFreeze.html index b4ccf0f0..ca2ac17a 100644 --- a/docs/typedoc/functions/objDeepFreeze.html +++ b/docs/typedoc/functions/objDeepFreeze.html @@ -2,4 +2,4 @@ objFreeze() on all enumerable properties of the object and on each property returned.

    Type Parameters

    • T

    Parameters

    • value: T

      the object to be completly frozen.

    Returns T

    The originally passed in object.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objDefine.html b/docs/typedoc/functions/objDefine.html index 3a7ad54f..05eb67b5 100644 --- a/docs/typedoc/functions/objDefine.html +++ b/docs/typedoc/functions/objDefine.html @@ -7,4 +7,4 @@
  • propDesc: ObjDefinePropDescriptor<any>

    An object which defines the Property Descriptor mappings for the mapping.

  • Returns T

    The target object.

    0.6.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objDefineAccessors.html b/docs/typedoc/functions/objDefineAccessors.html index db6c469b..b0b47fcc 100644 --- a/docs/typedoc/functions/objDefineAccessors.html +++ b/docs/typedoc/functions/objDefineAccessors.html @@ -11,4 +11,4 @@

    It is recommended that you use objDefine instead objDefineAccessors as this internally creates the ObjDefinePropDescriptor definition based on your provided arguments. And only using a minimum set of functions reduces your overall bundle size.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objDefineGet.html b/docs/typedoc/functions/objDefineGet.html index d4f809f1..8e9373a7 100644 --- a/docs/typedoc/functions/objDefineGet.html +++ b/docs/typedoc/functions/objDefineGet.html @@ -9,4 +9,4 @@

    It is recommended that you use objDefine instead objDefineGet or objDefineAccessors as it provides a deterministic way for identifying whether the value is a value or a function rather than wrapping any function value in another function.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objDefineProp.html b/docs/typedoc/functions/objDefineProp.html index 397143f0..6d43cc8a 100644 --- a/docs/typedoc/functions/objDefineProp.html +++ b/docs/typedoc/functions/objDefineProp.html @@ -12,4 +12,4 @@
  • key: PropertyKey

    The name or Symbol of the property to be defined or modified.

  • descriptor: PropertyDescriptor & ThisType<any>

    The descriptor for the property being defined or modified.

  • Returns T

    The object that was passed to the function with the new or updated property.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objDefineProperties.html b/docs/typedoc/functions/objDefineProperties.html index 09997482..c1988a3c 100644 --- a/docs/typedoc/functions/objDefineProperties.html +++ b/docs/typedoc/functions/objDefineProperties.html @@ -5,4 +5,4 @@
  • props: PropertyDescriptorMap & ThisType<any>

    An object whose keys represent the names of properties to be defined or modified and whose values are objects describing those properties. Each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see ObjDefinePropDescriptorMap for more details).

    -
  • Returns T

    \ No newline at end of file +

    Returns T

    diff --git a/docs/typedoc/functions/objDefineProps.html b/docs/typedoc/functions/objDefineProps.html index 174462e7..1f81a7d4 100644 --- a/docs/typedoc/functions/objDefineProps.html +++ b/docs/typedoc/functions/objDefineProps.html @@ -8,4 +8,4 @@ it cannot be both (see ObjDefinePropDescriptorMap for more details).

    Returns T

    The target object.

    0.6.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objEntries.html b/docs/typedoc/functions/objEntries.html index a5597558..1d8a86b4 100644 --- a/docs/typedoc/functions/objEntries.html +++ b/docs/typedoc/functions/objEntries.html @@ -4,4 +4,4 @@

    Returns [string, T][]

    diff --git a/docs/typedoc/functions/objExtend.html b/docs/typedoc/functions/objExtend.html index f423be82..5a1b0a83 100644 --- a/docs/typedoc/functions/objExtend.html +++ b/docs/typedoc/functions/objExtend.html @@ -10,4 +10,4 @@

    Returns void

    function performAction<T>(target: T, source: any) {
    if (!isNullOrUndefined(source)) {
    objForEachKey(source, (key, value) => {
    // Set the target with a reference to the same value with the same name
    target[key] = value;
    });
    }

    return target;
    }
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objFreeze.html b/docs/typedoc/functions/objFreeze.html index 3433814d..8f193bc7 100644 --- a/docs/typedoc/functions/objFreeze.html +++ b/docs/typedoc/functions/objFreeze.html @@ -13,4 +13,4 @@

    objFreeze() returns the same object that was passed into the function. It does not create a frozen copy.

    • Type Parameters

      • T

      Parameters

      • value: T

        The object to freeze.

      Returns T

      The object that was passed to the function.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objGetOwnPropertyDescriptor.html b/docs/typedoc/functions/objGetOwnPropertyDescriptor.html index 94b2f36f..0dcd1056 100644 --- a/docs/typedoc/functions/objGetOwnPropertyDescriptor.html +++ b/docs/typedoc/functions/objGetOwnPropertyDescriptor.html @@ -9,4 +9,4 @@

    Returns any

    diff --git a/docs/typedoc/functions/objHasOwn.html b/docs/typedoc/functions/objHasOwn.html index fd83313b..71a4a303 100644 --- a/docs/typedoc/functions/objHasOwn.html +++ b/docs/typedoc/functions/objHasOwn.html @@ -16,4 +16,4 @@

    Returns any

    The specified object.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/objToString.html b/docs/typedoc/functions/objToString.html index 5d3cee19..276f6154 100644 --- a/docs/typedoc/functions/objToString.html +++ b/docs/typedoc/functions/objToString.html @@ -10,4 +10,4 @@
    objToString(new Date()); // [object Date]
    objToString(new String()); // [object String]

    // Math has its Symbol.toStringTag
    objToString(Math); // [object Math]

    objToString(undefined); // [object Undefined]
    objToString(null); // [object Null]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/perfNow.html b/docs/typedoc/functions/perfNow.html index e283f3c1..85114772 100644 --- a/docs/typedoc/functions/perfNow.html +++ b/docs/typedoc/functions/perfNow.html @@ -7,4 +7,4 @@
    let now = perfNow();
     
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/plainObjDeepCopyHandler.html b/docs/typedoc/functions/plainObjDeepCopyHandler.html index 310e1e08..1b2aecf5 100644 --- a/docs/typedoc/functions/plainObjDeepCopyHandler.html +++ b/docs/typedoc/functions/plainObjDeepCopyHandler.html @@ -2,4 +2,4 @@

    Parameters

    Returns boolean

    true if the current value is a function otherwise false

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyArrFind.html b/docs/typedoc/functions/polyArrFind.html index 52502b8e..491aff40 100644 --- a/docs/typedoc/functions/polyArrFind.html +++ b/docs/typedoc/functions/polyArrFind.html @@ -36,4 +36,4 @@
    const inventory = [
    { name: "apples", quantity: 2 },
    { name: "bananas", quantity: 0 },
    { name: "cherries", quantity: 5 },
    ];

    function isCherries(fruit) {
    return fruit.name === "cherries";
    }

    console.log(polyArrFind(inventory, isCherries));
    // { name: 'cherries', quantity: 5 }

    function isPrime(element, index, array) {
    let start = 2;
    while (start <= Math.sqrt(element)) {
    if (element % start++ < 1) {
    return false;
    }
    }
    return element > 1;
    }

    console.log(polyArrFind([4, 6, 8, 12], isPrime)); // undefined, not found
    console.log(polyArrFind([4, 5, 8, 12], isPrime)); // 5
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyArrFindIndex.html b/docs/typedoc/functions/polyArrFindIndex.html index 80a8cdd5..697d7294 100644 --- a/docs/typedoc/functions/polyArrFindIndex.html +++ b/docs/typedoc/functions/polyArrFindIndex.html @@ -26,4 +26,4 @@
    
     
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyArrFindLast.html b/docs/typedoc/functions/polyArrFindLast.html index 053dd78f..670bdfe1 100644 --- a/docs/typedoc/functions/polyArrFindLast.html +++ b/docs/typedoc/functions/polyArrFindLast.html @@ -35,4 +35,4 @@
    const inventory = [
    { name: "apples", quantity: 2 },
    { name: "bananas", quantity: 0 },
    { name: "cherries", quantity: 5 },
    ];

    function isCherries(fruit) {
    return fruit.name === "cherries";
    }

    console.log(polyArrFindLast(inventory, isCherries));
    // { name: 'cherries', quantity: 5 }

    function isPrime(element, index, array) {
    let start = 2;
    while (start <= Math.sqrt(element)) {
    if (element % start++ < 1) {
    return false;
    }
    }
    return element > 1;
    }

    console.log(polyArrFindLast([4, 6, 8, 12], isPrime)); // undefined, not found
    console.log(polyArrFindLast([4, 5, 7, 12], isPrime)); // 7
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyArrFindLastIndex.html b/docs/typedoc/functions/polyArrFindLastIndex.html index b17b7a35..5d75de18 100644 --- a/docs/typedoc/functions/polyArrFindLastIndex.html +++ b/docs/typedoc/functions/polyArrFindLastIndex.html @@ -23,4 +23,4 @@

    Returns number

    The index of the last (highest-index) element in the array that passes the test. Otherwise -1 if no matching element is found.

    0.8.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyArrFrom.html b/docs/typedoc/functions/polyArrFrom.html index 540e234f..cb207e31 100644 --- a/docs/typedoc/functions/polyArrFrom.html +++ b/docs/typedoc/functions/polyArrFrom.html @@ -10,4 +10,4 @@
    polyArrFrom("Hello");
    // [ "H", "e", "l", "l", "o" ]

    polyArrFrom(new Set(["Hello", "Darkness", "my", "old", "friend"]));
    // ["Hello", "Darkness", "my", "old", "friend"]

    let map = new Map([
    [ 1, "Hello" ],
    [ 2, "Darkness" ],
    [ 3, "my" ],
    [ 4, "old" ],
    [ 5, "friend"]
    ]);

    polyArrFrom(map.values());
    // ["Hello", "Darkness", "my", "old", "friend"]

    polyArrFrom(map.keys());
    // [ 1, 2, 3, 4, 5 ]

    polyArrFrom(map.entries());
    // [ [ 1, "Hello" ], [ 2, "Darkness" ], [ 3, "my" ], [ 4, "old" ], [ 5, "friend"] ]

    polyArrFrom(map, ([ key, value ]) => ({ [key]: value }));
    // [ {"1": "Hello"}, {"2": "Darkness"}, {"3": "my"}, {"4": "old"}, {"5": "friend"} ]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyArrIncludes.html b/docs/typedoc/functions/polyArrIncludes.html index b40e6a73..aa361e07 100644 --- a/docs/typedoc/functions/polyArrIncludes.html +++ b/docs/typedoc/functions/polyArrIncludes.html @@ -13,4 +13,4 @@

    Returns boolean

    A boolean value which is true if the value searchElement is found within the array (or the part of the array indicated by the index fromIndex, if specified).

    0.8.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyGetKnownSymbol.html b/docs/typedoc/functions/polyGetKnownSymbol.html index d7fb4c12..3dd3c13d 100644 --- a/docs/typedoc/functions/polyGetKnownSymbol.html +++ b/docs/typedoc/functions/polyGetKnownSymbol.html @@ -5,4 +5,4 @@
    // Always returns the polyfill version, even if Symbols are supported in the runtime
    polyGetKnownSymbol("toStringTag") === polyGetKnownSymbol("toStringTag"); // true
    polyGetKnownSymbol(WellKnownSymbols.toStringTag) === polyGetKnownSymbol("toStringTag"); // true
    polyGetKnownSymbol("toStringTag") !== Symbol.toStringTag; // true
    polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== Symbol.toStringTag; // true
    polyGetKnownSymbol("toStringTag") !== polySymbolFor("toStringTag"); // true
    polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== polySymbolFor("toStringTag"); // true
    polyGetKnownSymbol("toStringTag") !== polyNewSymbol("toStringTag"); // true
    polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== polyNewSymbol("toStringTag"); // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyIsArray.html b/docs/typedoc/functions/polyIsArray.html index 22ddcf30..045dab81 100644 --- a/docs/typedoc/functions/polyIsArray.html +++ b/docs/typedoc/functions/polyIsArray.html @@ -1,4 +1,4 @@ polyIsArray | @nevware21/ts-utils

    Function polyIsArray

    • Polyfill support function for Array.isArray

      Type Parameters

      • T

      Parameters

      • value: any

        The value to be checked

      Returns value is T[]

      true if the value is an array otherwise false.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyNewSymbol.html b/docs/typedoc/functions/polyNewSymbol.html index 069212e3..cae091c9 100644 --- a/docs/typedoc/functions/polyNewSymbol.html +++ b/docs/typedoc/functions/polyNewSymbol.html @@ -5,4 +5,4 @@ information hiding.

    Parameters

    • Optionaldescription: string | number

      The description of the symbol

    Returns symbol

    A new polyfill version of a Symbol object

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyObjEntries.html b/docs/typedoc/functions/polyObjEntries.html index c8cc1793..97a27052 100644 --- a/docs/typedoc/functions/polyObjEntries.html +++ b/docs/typedoc/functions/polyObjEntries.html @@ -4,4 +4,4 @@
    polyObjEntries({ Hello: "Darkness", my: "old", friend: "." });
    // [ [ "Hello", "Darkness" ], [ "my", "old"], [ "friend", "." ] ]

    // Array-like object
    polyObjEntries({ 0: "a", 1: "b", 2: "c" }));
    // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ]

    // Array-like object with random key ordering
    polyObjEntries({ 100: "a", 2: "b", 7: "c" });
    // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ]*
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyObjHasOwn.html b/docs/typedoc/functions/polyObjHasOwn.html index df3b3ad0..06e52c5b 100644 --- a/docs/typedoc/functions/polyObjHasOwn.html +++ b/docs/typedoc/functions/polyObjHasOwn.html @@ -18,4 +18,4 @@
    let example = {};
    polyObjHasOwn(example, 'prop'); // false

    example.prop = 'exists';
    polyObjHasOwn(example, 'prop'); // true - 'prop' has been defined

    example.prop = null;
    polyObjHasOwn(example, 'prop'); // true - own property exists with value of null

    example.prop = undefined;
    polyObjHasOwn(example, 'prop'); // true - own property exists with value of undefined
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyObjKeys.html b/docs/typedoc/functions/polyObjKeys.html index e8f529a7..a771d47a 100644 --- a/docs/typedoc/functions/polyObjKeys.html +++ b/docs/typedoc/functions/polyObjKeys.html @@ -2,4 +2,4 @@ that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations

    Parameters

    • obj: any

      Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

      -

    Returns string[]

    \ No newline at end of file +

    Returns string[]

    diff --git a/docs/typedoc/functions/polyStrIncludes.html b/docs/typedoc/functions/polyStrIncludes.html index 47530d97..f2f6b4de 100644 --- a/docs/typedoc/functions/polyStrIncludes.html +++ b/docs/typedoc/functions/polyStrIncludes.html @@ -9,4 +9,4 @@ when searchString is an empty string; otherwise, false.

    0.9.0

    TypeError If searchString is a regex.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyStrSubstr.html b/docs/typedoc/functions/polyStrSubstr.html index 7b4cfb7d..6506a311 100644 --- a/docs/typedoc/functions/polyStrSubstr.html +++ b/docs/typedoc/functions/polyStrSubstr.html @@ -5,4 +5,4 @@
  • Optionallength: number

    The number of characters to extract.

  • Returns string

    A new string containing the specified part of the given string.

    0.4.2

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyStrSymSplit.html b/docs/typedoc/functions/polyStrSymSplit.html index 941714c9..81ad46d8 100644 --- a/docs/typedoc/functions/polyStrSymSplit.html +++ b/docs/typedoc/functions/polyStrSymSplit.html @@ -19,4 +19,4 @@
    const splitByNumber = {
    [getKnownSymbol<typeof Symbol.split>(WellKnownSymbols.split)]: (str: string) => {
    let num = 1;
    let pos = 0;
    const result = [];
    while (pos < str.length) {
    const matchPos = strIndexOf(str, asString(num), pos);
    if (matchPos === -1) {
    result.push(strSubstring(str, pos));
    break;
    }
    result.push(strSubstring(str, pos, matchPos));
    pos = matchPos + asString(num).length;
    num++;
    }
    return result;
    }
    };

    const myString = "a1bc2c5d3e4f";
    console.log(polyStrSymSplit(myString, splitByNumber)); // [ "a", "bc", "c5d", "e", "f" ]
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyStrTrim.html b/docs/typedoc/functions/polyStrTrim.html index 58436ea6..4e7398d3 100644 --- a/docs/typedoc/functions/polyStrTrim.html +++ b/docs/typedoc/functions/polyStrTrim.html @@ -7,4 +7,4 @@ If neither the beginning or end of str has any whitespace, a new string is still returned (essentially a copy of str), with no exception being thrown. To return a new string with whitespace trimmed from just one end, use strTrimStart() or strTrimEnd().

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyStrTrimEnd.html b/docs/typedoc/functions/polyStrTrimEnd.html index 5f43ecb7..82fa890e 100644 --- a/docs/typedoc/functions/polyStrTrimEnd.html +++ b/docs/typedoc/functions/polyStrTrimEnd.html @@ -3,4 +3,4 @@

    Returns string

    A new string representing str stripped of whitespace from its end (right side). If the end of str has no whitespace, a new string is still returned (essentially a copy of str), with no exception being thrown.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polyStrTrimStart.html b/docs/typedoc/functions/polyStrTrimStart.html index 7db1774d..2c1946ae 100644 --- a/docs/typedoc/functions/polyStrTrimStart.html +++ b/docs/typedoc/functions/polyStrTrimStart.html @@ -3,4 +3,4 @@

    Returns string

    A new string representing str stripped of whitespace from its beginning (left side). If the beginning of str has no whitespace, a new string is still returned (essentially a copy of str), with no exception being thrown.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/polySymbolFor.html b/docs/typedoc/functions/polySymbolFor.html index da482c4e..1b067e19 100644 --- a/docs/typedoc/functions/polySymbolFor.html +++ b/docs/typedoc/functions/polySymbolFor.html @@ -1,4 +1,4 @@ polySymbolFor | @nevware21/ts-utils

    Function polySymbolFor

    • Returns a Symbol object from the global symbol registry matching the given key if found. Otherwise, returns a new symbol with this key.

      Parameters

      • key: string

        key to search for.

        -

      Returns symbol

    \ No newline at end of file +

    Returns symbol

    diff --git a/docs/typedoc/functions/polySymbolKeyFor.html b/docs/typedoc/functions/polySymbolKeyFor.html index 67519ca3..66f85d3e 100644 --- a/docs/typedoc/functions/polySymbolKeyFor.html +++ b/docs/typedoc/functions/polySymbolKeyFor.html @@ -1,4 +1,4 @@ polySymbolKeyFor | @nevware21/ts-utils

    Function polySymbolKeyFor

    • Returns a key from the global symbol registry matching the given Symbol if found. Otherwise, returns a undefined.

      Parameters

      • sym: symbol

        Symbol to find the key for.

        -

      Returns string | undefined

    \ No newline at end of file +

    Returns string | undefined

    diff --git a/docs/typedoc/functions/polyUtcNow.html b/docs/typedoc/functions/polyUtcNow.html index 044db5f9..bd7fe0ba 100644 --- a/docs/typedoc/functions/polyUtcNow.html +++ b/docs/typedoc/functions/polyUtcNow.html @@ -8,4 +8,4 @@
    let now = polyUtcNow();
     
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/readArgs.html b/docs/typedoc/functions/readArgs.html index b3cbe89c..fdddcb0b 100644 --- a/docs/typedoc/functions/readArgs.html +++ b/docs/typedoc/functions/readArgs.html @@ -23,4 +23,4 @@
    function myFunc<T>(firstArg: T, ...otherArgs) {
    // Read all of the arguments
    let allArgs = readArgs(arguments);

    // Get all of the arguments after the first
    let optArgs = readArgs(arguments, 1);
    }

    myFunc("Hello");
    myFunc("Hello", "Darkness", "my", "old", "friend", ".");

    function* myGenerator() {
    yield "Hello";
    yield "Darkness";
    yield "my";
    yield "old";
    yield "friend";
    }

    function* myGenerator2() {
    yield "I've";
    yield "come";
    yield "to";
    yield "talk";
    yield "with";
    yield "you";
    yield "again";
    }

    readArgs(myGenerator());
    // [ "Hello", "Darkness", "my", "old", "friend"]);

    readArgs(myGenerator(), 1);
    // [ "Darkness", "my", "old", "friend"]);

    readArgs(myGenerator2());
    // [ "I've", "come", "to", "talk", "with", "you", "again" ]);

    readArgs(myGenerator2(), 0, -2);
    // [ "I've", "come", "to", "talk", "with" ]);

    readArgs(myGenerator2(), -3, -2);
    // [ "with" ]);
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/safe.html b/docs/typedoc/functions/safe.html index 44c400aa..d6c46995 100644 --- a/docs/typedoc/functions/safe.html +++ b/docs/typedoc/functions/safe.html @@ -9,4 +9,4 @@
    let result = safe((value: string) => {
    return JSON.parse(value);
    }, ["{ invalid: json value"]);

    // result.e instanceof SyntaxError

    let result2 = safe((value: string) => {
    return JSON.parse(value);
    }, ["{ valid: json value"]);

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/safeGet.html b/docs/typedoc/functions/safeGet.html index 43d6129e..103a3881 100644 --- a/docs/typedoc/functions/safeGet.html +++ b/docs/typedoc/functions/safeGet.html @@ -8,4 +8,4 @@
    let theExpression = "{ invalid: json value";

    let result = safeGet(() => {
    return JSON.parse(theExpression);
    }, {});

    // result === {};
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/safeGetLazy.html b/docs/typedoc/functions/safeGetLazy.html index 80f450e2..3eb123ce 100644 --- a/docs/typedoc/functions/safeGetLazy.html +++ b/docs/typedoc/functions/safeGetLazy.html @@ -10,4 +10,4 @@
    // This does not cause the evaluation to occur
    let cachedValue = safeGetLazy(() => callSomeExpensiveFunctionWhichMightThrow(), "someDefaultValue");
    let theValue;

    // Just checking if there is an object still does not cause the evaluation
    if (cachedValue) {
    // This will cause the evaluation to occur and the result will be cached
    theValue = cachedValue.v;
    }

    // Accessing the value again will not cause the re-evaluation to occur, it will just return the same
    // result value again.
    theValue === cachedValue.v; // true
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/scheduleIdleCallback.html b/docs/typedoc/functions/scheduleIdleCallback.html index d7c9067f..a6900494 100644 --- a/docs/typedoc/functions/scheduleIdleCallback.html +++ b/docs/typedoc/functions/scheduleIdleCallback.html @@ -24,4 +24,4 @@
    let idleCalled = false;
    let idleTimedOut = false;
    let theIdleTimer = scheduleIdleCallback((idleDeadline: IdleDeadline) => {
    // This callback will be called when the system is idle (via requestIdleCallback) or after the provided timeout 100ms
    idleCalled = true;
    idleTimedOut = idleDeadline?.didTimeout;
    while ((idleDeadline.timeRemaining() > 0 || deadline.didTimeout)) {
    // Do some background operations while there is time remaining or we timed out
    // Unlike interval timers this callback will NOT be called again unless you call "refresh"
    // to restart it or create a new idle timer
    }
    }, 100);

    // Instead of calling cancelIdleCallback() with the returned value from requestIdleCallback() the returned
    // handler instance can be used instead to cancel the idle timer
    theIdleTimer.cancel();
    theIdleTimer.enabled; // false

    // You can start the timer via enabled
    theIdleTimer.enabled = true;

    // You can also "restart" the timer, whether it has previously triggered not not via the `refresh()`
    theIdleTimer.refresh();
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/scheduleInterval.html b/docs/typedoc/functions/scheduleInterval.html index 99910b64..7bdbfec0 100644 --- a/docs/typedoc/functions/scheduleInterval.html +++ b/docs/typedoc/functions/scheduleInterval.html @@ -20,4 +20,4 @@
    let intervalCalled = 0;
    let theIntervalTimer = scheduleInvertal(() => {
    // This callback will be called every 100ms as this uses setInterval()
    intervalCalled++;
    }, 100);

    // Instead of calling clearInterval() with the returned value from setInterval() the returned
    // handler instance can be used instead to cancel the timer
    theIntervalTimer.cancel();
    theIntervalTimer.enabled; // false

    // You can start the timer via enabled
    theIntervalTimer.enabled = true;

    // Or you can also "restart" the timer, whether it has previously triggered not not via the `refresh()`
    theIntervalTimer.refresh();
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/scheduleTimeout.html b/docs/typedoc/functions/scheduleTimeout.html index 51a1997f..052fd0ef 100644 --- a/docs/typedoc/functions/scheduleTimeout.html +++ b/docs/typedoc/functions/scheduleTimeout.html @@ -28,4 +28,4 @@
    let timeoutCalled = false;
    let theTimeout = scheduleTimeout(() => {
    // This callback will be called after 100ms as this uses setTimeout()
    timeoutCalled = true;
    }, 100);

    // Instead of calling clearTimeout() with the returned value from setTimeout() the returned
    // handler instance can be used instead to cancel the timer
    theTimeout.cancel();
    theTimeout.enabled; // false

    // You can start the timer via enabled
    theTimeout.enabled = true;

    // You can also "restart" the timer, whether it has previously triggered not not via the `refresh()`
    theTimeout.refresh();
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/scheduleTimeoutWith.html b/docs/typedoc/functions/scheduleTimeoutWith.html index b685ec0b..0189b319 100644 --- a/docs/typedoc/functions/scheduleTimeoutWith.html +++ b/docs/typedoc/functions/scheduleTimeoutWith.html @@ -42,4 +42,4 @@
    let timeoutCalled = false;
    // Your own "setTimeout" implementation to allow you to perform additional operations or possible wrap
    // the callback to add timings.
    function newSetTimeoutFn(callback: TimeoutOverrideFn) {
    overrideCalled ++;
    return setTimeout(callback, timeout);
    }

    // Your own "clearTimeout" implementation to allow you to perform additional operations or possible wrap
    // the callback to add timings.
    function newClearTimeoutFn(timeoutId: number) {
    overrideCalled ++;
    return clearTimeout( timeout);
    }

    let theTimeout = scheduleTimeoutWith([newSetTimeoutFn, newClearTimeoutFn], () => {
    // This callback will be called after 100ms as this uses setTimeout()
    timeoutCalled = true;
    }, 100);

    // Instead of calling clearTimeout() with the returned value from setTimeout() the returned
    // handler instance can be used instead to cancel the timer, internally this will call the newClearTimeoutFn
    theTimeout.cancel();
    theTimeout.enabled; // false

    // You can start the timer via enabled
    theTimeout.enabled = true;

    // You can also "restart" the timer, whether it has previously triggered not not via the `refresh()`
    theTimeout.refresh();
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/setBypassLazyCache.html b/docs/typedoc/functions/setBypassLazyCache.html index 1918f67e..b56e4c45 100644 --- a/docs/typedoc/functions/setBypassLazyCache.html +++ b/docs/typedoc/functions/setBypassLazyCache.html @@ -3,4 +3,4 @@ of the lazy wrappers.

    Parameters

    • newValue: boolean

      When true will cause all new lazy implementations to bypass the cached lookup.

    Returns void

    0.5.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/setDefaultIdleTimeout.html b/docs/typedoc/functions/setDefaultIdleTimeout.html index 983ca10f..97647ca0 100644 --- a/docs/typedoc/functions/setDefaultIdleTimeout.html +++ b/docs/typedoc/functions/setDefaultIdleTimeout.html @@ -2,4 +2,4 @@ the default idle timeout will be used for the scheduled timer. Defaults to 100ms

    Parameters

    • timeout: number

      The time in milliseconds that the timer should wait before calling the idle function.

    Returns void

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/setDefaultMaxExecutionTime.html b/docs/typedoc/functions/setDefaultMaxExecutionTime.html index 8382487d..8e172230 100644 --- a/docs/typedoc/functions/setDefaultMaxExecutionTime.html +++ b/docs/typedoc/functions/setDefaultMaxExecutionTime.html @@ -5,4 +5,4 @@ less the start time the callback was called. Defaults to 50ms.

    Parameters

    • maxTime: number

      The maximum execution time in milliseconds.

    Returns void

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/setValueByIter.html b/docs/typedoc/functions/setValueByIter.html index 39bd5fdd..7f80cae5 100644 --- a/docs/typedoc/functions/setValueByIter.html +++ b/docs/typedoc/functions/setValueByIter.html @@ -10,4 +10,4 @@
    let theValue = { };
    setValueByIter(theValue, ["Hello", "Darkness", "my"], "old");
    // Resulting Object: { Hello: { Darkness: { my: "old" } } }
    setValueByIter(theValue, ["friend"], "I've");
    // Resulting Object: { Hello: { Darkness: { my: "old" } }, friend: "I've" }
    setValueByIter(theValue, ["come", "to", "see"], "you");
    // Resulting Object: { Hello: { Darkness: { my: "old" } }, friend: "I've", come: { to : { see: "you" } } }
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/setValueByKey.html b/docs/typedoc/functions/setValueByKey.html index 93f8baaf..955fd80c 100644 --- a/docs/typedoc/functions/setValueByKey.html +++ b/docs/typedoc/functions/setValueByKey.html @@ -7,4 +7,4 @@
    let theValue = { };
    setValueByKey(theValue, "Hello.Darkness.my", "old");
    // Resulting Object: { Hello: { Darkness: { my: "old" } } }
    setValueByKey(theValue, "friend", "I've");
    // Resulting Object: { Hello: { Darkness: { my: "old" } }, friend: "I've" }
    setValueByKey(theValue, "come.to.see", "you");
    // Resulting Object: { Hello: { Darkness: { my: "old" } }, friend: "I've", come: { to : { see: "you" } } }
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strCamelCase.html b/docs/typedoc/functions/strCamelCase.html index 2b17be0e..93b36939 100644 --- a/docs/typedoc/functions/strCamelCase.html +++ b/docs/typedoc/functions/strCamelCase.html @@ -10,4 +10,4 @@
    strCamelCase(null);                  // "null"
    strCamelCase(undefined); // "undefined"
    strCamelCase("hello darkness"); // "helloDarkness"
    strCamelCase("hello_darkness"); // "helloDarkness"
    strCamelCase("_hello_darkness"); // "helloDarkness"
    strCamelCase("hello-darkness"); // "helloDarkness"
    strCamelCase("-hello-darkness"); // "helloDarkness"
    strCamelCase("hello darkness, my old friend."); // "helloDarknessMyOldFriend"

    // Uppercase first character
    strCamelCase("hello darkness", true); // "HelloDarkness"
    strCamelCase("hello_darkness", true); // "HelloDarkness"
    strCamelCase("_hello_darkness", true); // "HelloDarkness"
    strCamelCase("hello-darkness", true); // "HelloDarkness"
    strCamelCase("-hello-darkness", true); // "HelloDarkness"
    strCamelCase("hello darkness, my old friend.", true); // "HelloDarknessMyOldFriend"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strContains.html b/docs/typedoc/functions/strContains.html index 7f2e4a5d..f675ac55 100644 --- a/docs/typedoc/functions/strContains.html +++ b/docs/typedoc/functions/strContains.html @@ -10,4 +10,4 @@

    Returns boolean

    diff --git a/docs/typedoc/functions/strIncludes.html b/docs/typedoc/functions/strIncludes.html index bb18039f..dce4f968 100644 --- a/docs/typedoc/functions/strIncludes.html +++ b/docs/typedoc/functions/strIncludes.html @@ -10,4 +10,4 @@

    Returns number

    diff --git a/docs/typedoc/functions/strIsNullOrEmpty.html b/docs/typedoc/functions/strIsNullOrEmpty.html index c73a17a0..1b984a33 100644 --- a/docs/typedoc/functions/strIsNullOrEmpty.html +++ b/docs/typedoc/functions/strIsNullOrEmpty.html @@ -1,4 +1,4 @@ strIsNullOrEmpty | @nevware21/ts-utils

    Function strIsNullOrEmpty

    • Checks whether the passed value is null, undefined or an empty string.

      Parameters

      • value: string

        The string value to be checked.

      Returns boolean

      true if the string is null, undefined or an empty string.

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strIsNullOrWhiteSpace.html b/docs/typedoc/functions/strIsNullOrWhiteSpace.html index 76fd5939..ecc3d3cd 100644 --- a/docs/typedoc/functions/strIsNullOrWhiteSpace.html +++ b/docs/typedoc/functions/strIsNullOrWhiteSpace.html @@ -2,4 +2,4 @@ whiltespace \t \r \n \f \v characters.

    Parameters

    • value: string

      The string value to be checked.

    Returns boolean

    true if the string is null, undefined an empty string or contains only whitespace characters.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strKebabCase.html b/docs/typedoc/functions/strKebabCase.html index c41df3fd..dc6d5eb7 100644 --- a/docs/typedoc/functions/strKebabCase.html +++ b/docs/typedoc/functions/strKebabCase.html @@ -9,4 +9,4 @@
    strKebabCase(null);              // "null"
    strKebabCase(undefined); // "undefined"
    strKebabCase("hello darkness"); // "hello-darkness"
    strKebabCase("hello_darkness"); // "hello-darkness"
    strKebabCase("_hello_darkness"); // "-hello-darkness"
    strKebabCase("hello darkness, my old friend."); // "hello-darkness-my-old-friend-"

    // Add optional SCREAM flag
    strKebabCase("hello darkness", true); // "HELLO-DARKNESS"
    strKebabCase("hello_darkness", true); // "HELLO-DARKNESS"
    strKebabCase("_hello_darkness", true); // "-HELLO-DARKNESS"
    strKebabCase("hello darkness, my old friend.", true); // "HELLO-DARKNESS-MY-OLD-FRIEND-"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strLastIndexOf.html b/docs/typedoc/functions/strLastIndexOf.html index 37ec434d..fb752752 100644 --- a/docs/typedoc/functions/strLastIndexOf.html +++ b/docs/typedoc/functions/strLastIndexOf.html @@ -8,4 +8,4 @@
    • Parameters

      • value: string

        The value to be checked for the seeach string

      • searchString: string

        The substring to search for in the value

      • Optionalposition: number

        The starting position to search from

        -

      Returns number

    \ No newline at end of file +

    Returns number

    diff --git a/docs/typedoc/functions/strLeft.html b/docs/typedoc/functions/strLeft.html index 8353587e..c502310c 100644 --- a/docs/typedoc/functions/strLeft.html +++ b/docs/typedoc/functions/strLeft.html @@ -13,4 +13,4 @@
    strLeft("Nevware21", -1); // ""
    strLeft("Nevware21", 0); // ""
    strLeft("Nevware21", 1); // "N"
    strLeft("Nevware21", 3); // "Nev"
    strLeft("Nevware21", 21); // "Nevware21"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strLetterCase.html b/docs/typedoc/functions/strLetterCase.html index 02e80712..6d0d1032 100644 --- a/docs/typedoc/functions/strLetterCase.html +++ b/docs/typedoc/functions/strLetterCase.html @@ -7,4 +7,4 @@
    strLetterCase(null);             // "Null"
    strLetterCase(undefined); // "Undefined"
    strLetterCase("hello darkness"); // "Hello Darkness"
    strLetterCase("hello_darkness"); // "Hello_Darkness"
    strLetterCase("_hello_darkness"); // "_Hello_Darkness"
    strLetterCase("hello darkness, my old friend."); // "Hello Darkness; // My Old Friend."
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strLower.html b/docs/typedoc/functions/strLower.html index d40a3553..e9143707 100644 --- a/docs/typedoc/functions/strLower.html +++ b/docs/typedoc/functions/strLower.html @@ -6,4 +6,4 @@

    Returns string

    A String of the specified targetLength with the padString applied at the end of the current str.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strPadStart.html b/docs/typedoc/functions/strPadStart.html index 1342c0e3..ccc3c4b7 100644 --- a/docs/typedoc/functions/strPadStart.html +++ b/docs/typedoc/functions/strPadStart.html @@ -8,4 +8,4 @@
  • OptionalpadString: string

    The string to pad the current str with. If padString is too long to stay within the targetLength, it will be truncated from the end. The default value is the unicode "space" character (U+0020).

    -
  • Returns string

    \ No newline at end of file +

    Returns string

    diff --git a/docs/typedoc/functions/strRepeat.html b/docs/typedoc/functions/strRepeat.html index 5cdbdb3d..fcaf5238 100644 --- a/docs/typedoc/functions/strRepeat.html +++ b/docs/typedoc/functions/strRepeat.html @@ -6,4 +6,4 @@
    strRight("Nevware21", -1); // ""
    strRight("Nevware21", 0); // ""
    strRight("Nevware21", 1); // "1"
    strRight("Nevware21", 3); // "e21"
    strRight("Nevware21", 21); // "Nevware21"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strSlice.html b/docs/typedoc/functions/strSlice.html index 642a60c7..64975e19 100644 --- a/docs/typedoc/functions/strSlice.html +++ b/docs/typedoc/functions/strSlice.html @@ -20,4 +20,4 @@ If endIndex is greater than value.length, strSlice() also extracts to the end of the string. (E.g. strSlice("test", 2, 10)returns "st") IfendIndexis negative,strSlice()treats it asvalue.length + endIndex. (E.g, if endIndexis -2, it is treated asvalue.length - 2andstrSlice("test", 1, -2)returns "e") . IfendIndexrepresents a position that is before the one represented by startIndex,strSlice()returns "". (E.gstrSlice("test", 2, -10), strSlice("test", -1, -2) or strSlice("test", 3, 2)).

    Returns string

    A new string containing the extracted section of the string.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strSnakeCase.html b/docs/typedoc/functions/strSnakeCase.html index b24c574d..1bab38f1 100644 --- a/docs/typedoc/functions/strSnakeCase.html +++ b/docs/typedoc/functions/strSnakeCase.html @@ -9,4 +9,4 @@
    strSnakeCase(null);              // "null"
    strSnakeCase(undefined); // "undefined"
    strSnakeCase("hello darkness"); // "hello_darkness"
    strSnakeCase("hello_darkness"); // "hello_darkness"
    strSnakeCase("_hello_darkness"); // "_hello_darkness"
    strSnakeCase("hello-darkness"); // "hello_darkness"
    strSnakeCase("-hello-darkness"); // "_hello_darkness"
    strSnakeCase("hello darkness, my old friend."); // "hello_darkness_my_old_friend_"

    // Use optional Scream flag
    strSnakeCase("hello darkness", true); // "HELLO_DARKNESS"
    strSnakeCase("hello_darkness", true); // "HELLO_DARKNESS"
    strSnakeCase("_hello_darkness", true); // "_HELLO_DARKNESS"
    strSnakeCase("hello-darkness", true); // "HELLO_DARKNESS"
    strSnakeCase("-hello-darkness", true); // "_HELLO_DARKNESS"
    strSnakeCase("hello darkness, my old friend.", true); // "HELLO_DARKNESS_MY_OLD_FRIEND_"
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strSplit.html b/docs/typedoc/functions/strSplit.html index 8176eb28..72ae9195 100644 --- a/docs/typedoc/functions/strSplit.html +++ b/docs/typedoc/functions/strSplit.html @@ -21,4 +21,4 @@

    Returns boolean

    true if the given characters are found at the beginning of the string; otherwise, false.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strSubstr.html b/docs/typedoc/functions/strSubstr.html index 99fd2252..1b7ebff8 100644 --- a/docs/typedoc/functions/strSubstr.html +++ b/docs/typedoc/functions/strSubstr.html @@ -5,4 +5,4 @@
  • start: number

    The index of the first character to include in the returned substring.

  • Optionallength: number

    The number of characters to extract.

  • Returns string

    A new string containing the specified part of the given string.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strSubstring.html b/docs/typedoc/functions/strSubstring.html index 62493466..3a3e4c89 100644 --- a/docs/typedoc/functions/strSubstring.html +++ b/docs/typedoc/functions/strSubstring.html @@ -14,4 +14,4 @@
  • indexStart: number

    The index of the first character to include in the returned substring.

  • OptionalindexEnd: number

    The index of the first character to exclude from the returned substring.

  • Returns string

    A new string containing the specified part of the given string

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strSymSplit.html b/docs/typedoc/functions/strSymSplit.html index 5d17a787..bfd119d5 100644 --- a/docs/typedoc/functions/strSymSplit.html +++ b/docs/typedoc/functions/strSymSplit.html @@ -21,4 +21,4 @@

    Returns string

    A new string representing str stripped of whitespace from its end (right side). If the end of str has no whitespace, a new string is still returned (essentially a copy of str), with no exception being thrown.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strTrimLeft.html b/docs/typedoc/functions/strTrimLeft.html index 7ed0e0e3..ce0ed704 100644 --- a/docs/typedoc/functions/strTrimLeft.html +++ b/docs/typedoc/functions/strTrimLeft.html @@ -8,4 +8,4 @@

    Returns string

    A new string representing str stripped of whitespace from its beginning (left side). If the beginning of str has no whitespace, a new string is still returned (essentially a copy of str), with no exception being thrown.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/strUpper.html b/docs/typedoc/functions/strUpper.html index 415eb08a..d0bad6b1 100644 --- a/docs/typedoc/functions/strUpper.html +++ b/docs/typedoc/functions/strUpper.html @@ -7,4 +7,4 @@

    Returns symbol

    \ No newline at end of file +

    Returns symbol

    diff --git a/docs/typedoc/functions/symbolKeyFor.html b/docs/typedoc/functions/symbolKeyFor.html index 8f5fca27..08bc6982 100644 --- a/docs/typedoc/functions/symbolKeyFor.html +++ b/docs/typedoc/functions/symbolKeyFor.html @@ -2,4 +2,4 @@ Otherwise, returns a undefined. This will always attempt to lookup the polyfill implementation if symbols are not supported

    Parameters

    • sym: symbol

      Symbol to find the key for.

      -

    Returns string | undefined

    \ No newline at end of file +

    Returns string | undefined

    diff --git a/docs/typedoc/functions/throwError.html b/docs/typedoc/functions/throwError.html index a7b6c69c..b60f5dd8 100644 --- a/docs/typedoc/functions/throwError.html +++ b/docs/typedoc/functions/throwError.html @@ -1,2 +1,2 @@ throwError | @nevware21/ts-utils
    • Throw an error exception with the specified optional message

      -

      Parameters

      • Optionalmessage: string

      Returns never

    \ No newline at end of file +

    Parameters

    • Optionalmessage: string

    Returns never

    diff --git a/docs/typedoc/functions/throwRangeError.html b/docs/typedoc/functions/throwRangeError.html index 3208e23a..b746f981 100644 --- a/docs/typedoc/functions/throwRangeError.html +++ b/docs/typedoc/functions/throwRangeError.html @@ -1,2 +1,2 @@ throwRangeError | @nevware21/ts-utils

    Function throwRangeError

    • Throw a RangeError with the specified optional message

      -

      Parameters

      • Optionalmessage: string

      Returns never

    \ No newline at end of file +

    Parameters

    • Optionalmessage: string

    Returns never

    diff --git a/docs/typedoc/functions/throwTypeError.html b/docs/typedoc/functions/throwTypeError.html index d18aa3a8..0b7483ec 100644 --- a/docs/typedoc/functions/throwTypeError.html +++ b/docs/typedoc/functions/throwTypeError.html @@ -1,2 +1,2 @@ throwTypeError | @nevware21/ts-utils

    Function throwTypeError

    • Throw a type error with the specified optional message

      -

      Parameters

      • Optionalmessage: string

      Returns never

    \ No newline at end of file +

    Parameters

    • Optionalmessage: string

    Returns never

    diff --git a/docs/typedoc/functions/throwUnsupported.html b/docs/typedoc/functions/throwUnsupported.html index 8bd676c6..e5d6a94b 100644 --- a/docs/typedoc/functions/throwUnsupported.html +++ b/docs/typedoc/functions/throwUnsupported.html @@ -3,4 +3,4 @@

    Returns never

    import { throwUnsupported } from "@nevware21/ts-utils";

    if (!window) {
    throwUnsupported("A window is needed for this operation");
    }
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/functions/utcNow.html b/docs/typedoc/functions/utcNow.html index f211a705..013ba903 100644 --- a/docs/typedoc/functions/utcNow.html +++ b/docs/typedoc/functions/utcNow.html @@ -7,4 +7,4 @@
    let now = utcNow();
     
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/hierarchy.html b/docs/typedoc/hierarchy.html index 75563070..bd2a1591 100644 --- a/docs/typedoc/hierarchy.html +++ b/docs/typedoc/hierarchy.html @@ -1 +1 @@ -@nevware21/ts-utils

    @nevware21/ts-utils

    Class Hierarchy

    \ No newline at end of file +@nevware21/ts-utils

    @nevware21/ts-utils

    Class Hierarchy

    diff --git a/docs/typedoc/index.html b/docs/typedoc/index.html index 255f53b5..d36e85d4 100644 --- a/docs/typedoc/index.html +++ b/docs/typedoc/index.html @@ -324,4 +324,4 @@ isStrictUndefined isTruthy isUndefined -
    \ No newline at end of file +
    diff --git a/docs/typedoc/interfaces/CreateIteratorContext.html b/docs/typedoc/interfaces/CreateIteratorContext.html index 3716217e..96c43675 100644 --- a/docs/typedoc/interfaces/CreateIteratorContext.html +++ b/docs/typedoc/interfaces/CreateIteratorContext.html @@ -21,4 +21,4 @@
    v?: T

    The current value to be assigned to the returned iterator result, the next n function should assign this value to the context as part of incrementing to the next value.

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/interfaces/CustomErrorConstructor.html b/docs/typedoc/interfaces/CustomErrorConstructor.html index d03ab2eb..72ab2d1b 100644 --- a/docs/typedoc/interfaces/CustomErrorConstructor.html +++ b/docs/typedoc/interfaces/CustomErrorConstructor.html @@ -2,4 +2,4 @@ Used by: createCustomError

    interface CustomErrorConstructor<T> {
        new CustomErrorConstructornew (message?: string): T;
        new CustomErrorConstructornew (message?: string): Error;
        prototype: T;
        (message?: string): T;
        (message?: string): Error;
    }

    Type Parameters

    • T extends Error = Error

    Hierarchy

    • ErrorConstructor
      • CustomErrorConstructor

    Constructors

    Properties

    Constructors

    • Parameters

      • Optionalmessage: string

      Returns T

    • Parameters

      • Optionalmessage: string

      Returns Error

    Properties

    prototype: T
    \ No newline at end of file +

    Constructors

    • Parameters

      • Optionalmessage: string

      Returns T

    • Parameters

      • Optionalmessage: string

      Returns Error

    Properties

    prototype: T
    diff --git a/docs/typedoc/interfaces/GetLengthImpl.html b/docs/typedoc/interfaces/GetLengthImpl.html index deac85bd..95b491a0 100644 --- a/docs/typedoc/interfaces/GetLengthImpl.html +++ b/docs/typedoc/interfaces/GetLengthImpl.html @@ -3,4 +3,4 @@

    0.4.2

    interface GetLengthImpl {
        length: unknown;
    }

    Properties

    Properties

    length: unknown

    Identifies the property that returns the length of the instance

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/interfaces/ICachedValue.html b/docs/typedoc/interfaces/ICachedValue.html index f91225ac..3af167ad 100644 --- a/docs/typedoc/interfaces/ICachedValue.html +++ b/docs/typedoc/interfaces/ICachedValue.html @@ -8,4 +8,4 @@

    Returns T

    diff --git a/docs/typedoc/interfaces/ILazyValue.html b/docs/typedoc/interfaces/ILazyValue.html index 0a6db273..62e9e015 100644 --- a/docs/typedoc/interfaces/ILazyValue.html +++ b/docs/typedoc/interfaces/ILazyValue.html @@ -7,4 +7,4 @@
    v: T

    Returns the current cached value from the lazy lookup, if the callback function has not yet occurred accessing the value will cause the lazy evaluation to occur and the result will be returned.

    Methods

    \ No newline at end of file +

    Returns T

    diff --git a/docs/typedoc/interfaces/IObjDeepCopyHandlerDetails.html b/docs/typedoc/interfaces/IObjDeepCopyHandlerDetails.html index b07c12ca..db078972 100644 --- a/docs/typedoc/interfaces/IObjDeepCopyHandlerDetails.html +++ b/docs/typedoc/interfaces/IObjDeepCopyHandlerDetails.html @@ -30,4 +30,4 @@ and recursive references.

    Type Parameters

    • T

    Parameters

    • target: T

      The target object to populated

    • source: T

      The source object to copy the properties from

      -

    Returns T

    \ No newline at end of file +

    Returns T

    diff --git a/docs/typedoc/interfaces/ISafeReturn.html b/docs/typedoc/interfaces/ISafeReturn.html index 7d0a748f..2f9f051a 100644 --- a/docs/typedoc/interfaces/ISafeReturn.html +++ b/docs/typedoc/interfaces/ISafeReturn.html @@ -6,4 +6,4 @@
    let theTimer = createTimeout(...);

    // Unreference the timer so that the runtime (Node) may terminate if nothing else is running.
    theTimer.unref();
    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/interfaces/ObjDefinePropDescriptor.html b/docs/typedoc/interfaces/ObjDefinePropDescriptor.html index 3933a0d2..f31b3764 100644 --- a/docs/typedoc/interfaces/ObjDefinePropDescriptor.html +++ b/docs/typedoc/interfaces/ObjDefinePropDescriptor.html @@ -36,4 +36,4 @@

    Returns V

    • A function which serves as a setter for the property, or undefined if there is no setter. When the property is assigned, this function is called with one argument (the value being assigned to the property) and with this set to the object through which the property is assigned. Defaults to undefined.

      -

      Parameters

      • value: V

      Returns void

    \ No newline at end of file +

    Parameters

    • value: V

    Returns void

    diff --git a/docs/typedoc/types/ArrFromMapFn.html b/docs/typedoc/types/ArrFromMapFn.html index 355b96f9..4e8560ca 100644 --- a/docs/typedoc/types/ArrFromMapFn.html +++ b/docs/typedoc/types/ArrFromMapFn.html @@ -5,4 +5,4 @@

    Type declaration

      • (value, index?): R
      • Parameters

        • value: T

          The current element being processed in the array.

        • Optionalindex: number

          The index of the current element being processed in the array.

        Returns R

    0.9.7

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ArrMapCallbackFn.html b/docs/typedoc/types/ArrMapCallbackFn.html index 6bcc3da3..8823ccdd 100644 --- a/docs/typedoc/types/ArrMapCallbackFn.html +++ b/docs/typedoc/types/ArrMapCallbackFn.html @@ -6,4 +6,4 @@
  • Optionalindex: number

    The index of the current element being processed in the array.

  • Optionalarray: T[]

    The array that the map function was called on.

  • Returns R

    0.3.3

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ArrPredicateCallbackFn.html b/docs/typedoc/types/ArrPredicateCallbackFn.html index dd698840..19c560e1 100644 --- a/docs/typedoc/types/ArrPredicateCallbackFn.html +++ b/docs/typedoc/types/ArrPredicateCallbackFn.html @@ -7,4 +7,4 @@
  • array: T[]

    The array being processed.

  • Returns value is E

    A boolean value indicating that the value is of the type expected (the test is true)

    0.8.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ArrPredicateCallbackFn2.html b/docs/typedoc/types/ArrPredicateCallbackFn2.html index 30d8dac2..b53bf599 100644 --- a/docs/typedoc/types/ArrPredicateCallbackFn2.html +++ b/docs/typedoc/types/ArrPredicateCallbackFn2.html @@ -5,4 +5,4 @@
  • index: number

    The index of the current elemety of the array being processed.

  • array: T[]

    The array being processed.

  • Returns unknown

    0.8.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ArrReduceCallbackFn.html b/docs/typedoc/types/ArrReduceCallbackFn.html index 0a926333..83d472f9 100644 --- a/docs/typedoc/types/ArrReduceCallbackFn.html +++ b/docs/typedoc/types/ArrReduceCallbackFn.html @@ -8,4 +8,4 @@
  • currentIndex: number

    The index position of currentValue in the array. On first call, 0 if initialValue was specified, otherwise 1.

  • array: T[]

    The array being traversed.

    -
  • Returns R

    \ No newline at end of file +

    Returns R

    diff --git a/docs/typedoc/types/CancelIdleCallback.html b/docs/typedoc/types/CancelIdleCallback.html index d338e89a..590385a8 100644 --- a/docs/typedoc/types/CancelIdleCallback.html +++ b/docs/typedoc/types/CancelIdleCallback.html @@ -4,4 +4,4 @@

    Type declaration

      • (handle): void
      • Parameters

        • handle: number

          The handle returned by the requestIdleCallback function that identifies the idle callback to cancel.

        Returns void

    0.11.2

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ClearTimeoutOverrideFn.html b/docs/typedoc/types/ClearTimeoutOverrideFn.html index 4c66a17a..4dadae0d 100644 --- a/docs/typedoc/types/ClearTimeoutOverrideFn.html +++ b/docs/typedoc/types/ClearTimeoutOverrideFn.html @@ -2,4 +2,4 @@ the result returned from the TimeoutOverrideFn call.

    Type declaration

      • (timeoutId): void
      • Parameters

        Returns void

    0.4.5

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/EnumCls.html b/docs/typedoc/types/EnumCls.html index cb8cf971..31edacaf 100644 --- a/docs/typedoc/types/EnumCls.html +++ b/docs/typedoc/types/EnumCls.html @@ -1,4 +1,4 @@ EnumCls | @nevware21/ts-utils

    Type Alias EnumCls<E>

    EnumCls<E>: {
        readonly [key in keyof E extends string | number | symbol
            ? keyof E
            : never]: key extends string
            ? E[key]
            : key
    } & {
        readonly [key in keyof E]: E[key]
    }

    A type that identifies an enum class generated from a constant enum.

    Type Parameters

    • E = any

      The constant enum type

      Returned from createEnum

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/EnumNameMap.html b/docs/typedoc/types/EnumNameMap.html index 11c9f504..6b8a0e7d 100644 --- a/docs/typedoc/types/EnumNameMap.html +++ b/docs/typedoc/types/EnumNameMap.html @@ -2,4 +2,4 @@

    Type Parameters

    • E = any

      The source constant enum type which identifies the keys and values

    • T = {
          readonly [key in keyof E]: key extends string
              ? key
              : keyof E
      }

      The resulting type with the keys from the source type.

      Returned from createEnumKeyMap

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/EnumTypeMap.html b/docs/typedoc/types/EnumTypeMap.html index 79b728a4..ce2dc6f8 100644 --- a/docs/typedoc/types/EnumTypeMap.html +++ b/docs/typedoc/types/EnumTypeMap.html @@ -3,4 +3,4 @@
  • V

    The value type, typically string, number but may also be a complex type.

  • T = {
        readonly [key in keyof E]: V
    }

    The resulting type with the keys from the source type.

    Returned from createSimpleMap

    -
  • \ No newline at end of file +
    diff --git a/docs/typedoc/types/EnumValueMap.html b/docs/typedoc/types/EnumValueMap.html index c1a8dc89..0ca8b3e2 100644 --- a/docs/typedoc/types/EnumValueMap.html +++ b/docs/typedoc/types/EnumValueMap.html @@ -2,4 +2,4 @@

    Type Parameters

    • E = any

      The source type which identifies the keys.

    • T = {
          readonly [key in keyof E]: E[keyof E]
      }

      The resulting type with the keys from the source type.

      Returned from createEnumValueMap

      -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ObjDeepCopyHandler.html b/docs/typedoc/types/ObjDeepCopyHandler.html index 7468e326..abf2e4dc 100644 --- a/docs/typedoc/types/ObjDeepCopyHandler.html +++ b/docs/typedoc/types/ObjDeepCopyHandler.html @@ -12,4 +12,4 @@
  • dateDeepCopyHandler - Used to copy date instances
  • 0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ObjDefinePropDescriptorMap.html b/docs/typedoc/types/ObjDefinePropDescriptorMap.html index a01a9e13..a49accca 100644 --- a/docs/typedoc/types/ObjDefinePropDescriptorMap.html +++ b/docs/typedoc/types/ObjDefinePropDescriptorMap.html @@ -2,4 +2,4 @@ describing those properties. Each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see ObjDefinePropDescriptor for more details).

    0.6.0

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/ProxyFunctionDef.html b/docs/typedoc/types/ProxyFunctionDef.html index 98c5ccfd..db5a6bdb 100644 --- a/docs/typedoc/types/ProxyFunctionDef.html +++ b/docs/typedoc/types/ProxyFunctionDef.html @@ -3,4 +3,4 @@ as the host function when not defined.

  • n: TypeFuncNames<H>

    Identifies the host function name

  • Optionalrp?: boolean

    If the target already includes the function should it be replaced, defaults to false.

    -
  • \ No newline at end of file +
    diff --git a/docs/typedoc/types/RequestIdleCallback.html b/docs/typedoc/types/RequestIdleCallback.html index 186cec9c..d09f37c6 100644 --- a/docs/typedoc/types/RequestIdleCallback.html +++ b/docs/typedoc/types/RequestIdleCallback.html @@ -14,4 +14,4 @@

    Returns number

    A handle which can be used to cancel the callback by passing it into the cancelIdleCallback() method.

    0.11.2

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/SafeReturnType.html b/docs/typedoc/types/SafeReturnType.html index 51e40891..3cdc1aca 100644 --- a/docs/typedoc/types/SafeReturnType.html +++ b/docs/typedoc/types/SafeReturnType.html @@ -1,4 +1,4 @@ SafeReturnType | @nevware21/ts-utils

    Type Alias SafeReturnType<T>

    SafeReturnType<T>: T extends ((...args: any) => infer R)
        ? R
        : any

    Infers the return type of the specified function

    Type Parameters

    • T extends ((...args: any) => any)

      The type of the function which to infer the return type

    0.10.5

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/TimeoutOverrideFn.html b/docs/typedoc/types/TimeoutOverrideFn.html index cf200db8..30dc70f4 100644 --- a/docs/typedoc/types/TimeoutOverrideFn.html +++ b/docs/typedoc/types/TimeoutOverrideFn.html @@ -7,4 +7,4 @@

    Returns number | any

    The returned timeoutID is a positive integer value which identifies the timer created by the call to setTimeout(). This value can be passed to clearTimeout() to cancel the timeout.

    0.4.4

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/TimeoutOverrideFuncs.html b/docs/typedoc/types/TimeoutOverrideFuncs.html index 2d3f5ff8..c103bbb3 100644 --- a/docs/typedoc/types/TimeoutOverrideFuncs.html +++ b/docs/typedoc/types/TimeoutOverrideFuncs.html @@ -1,4 +1,4 @@ TimeoutOverrideFuncs | @nevware21/ts-utils

    Type Alias TimeoutOverrideFuncs

    TimeoutOverrideFuncs: [TimeoutOverrideFn | null, ClearTimeoutOverrideFn | null]

    Defines the array signature used to pass the override set and clean functions for creating a timeout. The first index [0] is the set function to be used and the second index [1] is the clear function to be used.

    0.4.5

    -
    \ No newline at end of file +
    diff --git a/docs/typedoc/types/TypeFuncNames.html b/docs/typedoc/types/TypeFuncNames.html index 36e81713..66682974 100644 --- a/docs/typedoc/types/TypeFuncNames.html +++ b/docs/typedoc/types/TypeFuncNames.html @@ -1 +1 @@ -TypeFuncNames | @nevware21/ts-utils

    Type Alias TypeFuncNames<T>

    TypeFuncNames<T>: {
        [key in keyof T]: T[key] extends Function
            ? key
            : never
    }[keyof T]

    Type Parameters

    • T
    \ No newline at end of file +TypeFuncNames | @nevware21/ts-utils

    Type Alias TypeFuncNames<T>

    TypeFuncNames<T>: {
        [key in keyof T]: T[key] extends Function
            ? key
            : never
    }[keyof T]

    Type Parameters

    • T
    diff --git a/lib/src/iterator/array.ts b/lib/src/iterator/array.ts index ccbdbdcc..1361bf3d 100644 --- a/lib/src/iterator/array.ts +++ b/lib/src/iterator/array.ts @@ -36,7 +36,7 @@ import { createIterator, CreateIteratorContext } from "./create"; export function createArrayIterator(values: T[]): Iterator { let idx = -1; let theValues = values ? values.slice() : []; - let len = theValues[LENGTH] + let len = theValues[LENGTH]; function _value(): T { if (idx >= 0 && idx < len) { diff --git a/lib/src/iterator/create.ts b/lib/src/iterator/create.ts index 3a11608f..3b2d6b16 100644 --- a/lib/src/iterator/create.ts +++ b/lib/src/iterator/create.ts @@ -230,7 +230,7 @@ export function createIterator(ctx: CreateIteratorContext): Iterator { }; if (ctx.r) { - theIterator.return = _return + theIterator.return = _return; } if (ctx.t) { diff --git a/lib/src/iterator/forOf.ts b/lib/src/iterator/forOf.ts index a75df826..46175a53 100644 --- a/lib/src/iterator/forOf.ts +++ b/lib/src/iterator/forOf.ts @@ -6,6 +6,7 @@ * Licensed under the MIT license. */ +import { fnCall } from "../funcs/funcs"; import { ICachedValue, createCachedValue } from "../helpers/cache"; import { CALL, NULL_VALUE, UNDEF_VALUE } from "../internal/constants"; import { getKnownSymbol } from "../symbol/symbol"; @@ -63,8 +64,8 @@ export function iterForOf(iter: Iterator | Iterable, callbackfn: (value } if (isIterator(iter)) { - let err: { e: any } = UNDEF_VALUE - let iterResult: IteratorResult = UNDEF_VALUE + let err: { e: any } = UNDEF_VALUE; + let iterResult: IteratorResult = UNDEF_VALUE; try { let count = 0; while(!(iterResult = iter.next()).done) { diff --git a/lib/src/iterator/range.ts b/lib/src/iterator/range.ts index 21b190f3..1b256984 100644 --- a/lib/src/iterator/range.ts +++ b/lib/src/iterator/range.ts @@ -113,21 +113,17 @@ export function createRangeIterator(start: number, end: number, step?: number): end = start; } - let theStep = step || ((start <= end) ? 1 : -1); + let theStep = step; + if (!theStep) { + theStep = (start <= end) ? 1 : -1; + } function _value(): number { return theValue; } function _getNext() { - - let isDone = false; - if (theStep > 0) { - isDone = nextValue > end; - } else { - isDone = nextValue < end; - } - + let isDone = (theStep > 0) ? (nextValue > end) : (nextValue < end); if (!isDone) { theValue = nextValue; nextValue += theStep; @@ -136,11 +132,9 @@ export function createRangeIterator(start: number, end: number, step?: number): return isDone; } - let ctx: CreateIteratorContext = { - n: _getNext - }; - - objDefine(ctx, "v", { g: _value }); - - return createIterator(ctx); + return createIterator( + objDefine({ + n: _getNext + } as CreateIteratorContext, "v", { g: _value }) + ); } \ No newline at end of file diff --git a/lib/src/object/define.ts b/lib/src/object/define.ts index d0d9562e..36ec73f9 100644 --- a/lib/src/object/define.ts +++ b/lib/src/object/define.ts @@ -123,11 +123,11 @@ function _createProp(value: ObjDefinePropDescriptor): PropertyDescriptor { if (desc && desc.set) { prop.set = (newValue: any) => { value.l.v = newValue; - } + }; } } - objForEachKey(value, (key, value) => { + objForEachKey(value, (key: keyof ObjDefinePropDescriptor, value) => { prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value; }); diff --git a/package.json b/package.json index f5816647..75dc1e0b 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,9 @@ "ECMAScript 2018", "ECMAScript 2019", "ECMAScript 2020", + "ECMAScript 2021", + "ECMAScript 2022", + "ECMAScript 2023", "getDocument", "getGlobal", "getHistory", @@ -156,8 +159,8 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@microsoft/api-extractor": "^7.34.4", - "@nevware21/grunt-eslint-ts": "0.2.5", - "@nevware21/grunt-ts-plugin": "0.4.6", + "@nevware21/grunt-eslint-ts": "0.5.0", + "@nevware21/grunt-ts-plugin": "0.5.0", "@rollup/plugin-commonjs": "^26.0.1", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.1", @@ -183,18 +186,18 @@ "eslint-plugin-security": "^1.5.0", "grunt": "^1.5.3", "grunt-cli": "^1.4.3", - "karma": "^6.3.20", - "karma-chrome-launcher": "^3.1.1", - "karma-coverage": "^2.2.0", + "karma": "^6.4.3", + "karma-chrome-launcher": "^3.2.0", + "karma-coverage": "^2.2.1", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-mocha": "^2.0.1", "karma-mocha-webworker": "^1.3.0", "karma-rollup-preprocessor": "^7.0.8", "karma-spec-reporter": "^0.0.36", "karma-typescript": "^5.5.4", - "mocha": "^10.0.0", + "mocha": "^10.7.0", "nyc": "^17.0.0", - "puppeteer": "^22.12.1", + "puppeteer": "^22.13.1", "rollup": "^4.14.1", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-istanbul": "^5.0.0",