@ezez/utils 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/dist/cap.d.ts.map +1 -1
- package/dist/cap.js.map +1 -1
- package/dist/capitalize.d.ts.map +1 -1
- package/dist/capitalize.js.map +1 -1
- package/dist/compareArrays.d.ts +4 -4
- package/dist/compareArrays.d.ts.map +1 -1
- package/dist/compareArrays.js.map +1 -1
- package/dist/ensureError.d.ts.map +1 -1
- package/dist/ensureError.js +3 -1
- package/dist/ensureError.js.map +1 -1
- package/dist/ensurePrefix.d.ts.map +1 -1
- package/dist/ensurePrefix.js.map +1 -1
- package/dist/ensureSuffix.d.ts.map +1 -1
- package/dist/ensureSuffix.js.map +1 -1
- package/dist/escapeRegExp.d.ts.map +1 -1
- package/dist/escapeRegExp.js.map +1 -1
- package/dist/formatDate.d.ts.map +1 -1
- package/dist/formatDate.js.map +1 -1
- package/dist/getMultiple.d.ts.map +1 -1
- package/dist/getMultiple.js.map +1 -1
- package/dist/ignore.d.ts +3 -0
- package/dist/ignore.d.ts.map +1 -0
- package/dist/ignore.js +16 -0
- package/dist/ignore.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/isEmpty.d.ts.map +1 -1
- package/dist/isEmpty.js +4 -4
- package/dist/isEmpty.js.map +1 -1
- package/dist/isNumericString.d.ts.map +1 -1
- package/dist/isNumericString.js.map +1 -1
- package/dist/isPlainObject.d.ts.map +1 -1
- package/dist/isPlainObject.js.map +1 -1
- package/dist/match.d.ts.map +1 -1
- package/dist/match.js.map +1 -1
- package/dist/memoize.d.ts.map +1 -1
- package/dist/memoize.js.map +1 -1
- package/dist/mostFrequent.d.ts.map +1 -1
- package/dist/mostFrequent.js.map +1 -1
- package/dist/noop.d.ts.map +1 -1
- package/dist/noop.js.map +1 -1
- package/dist/occurrences.d.ts.map +1 -1
- package/dist/occurrences.js.map +1 -1
- package/dist/removeCommonProperties.d.ts.map +1 -1
- package/dist/removeCommonProperties.js.map +1 -1
- package/dist/replace.d.ts.map +1 -1
- package/dist/replace.js.map +1 -1
- package/dist/rethrow.d.ts +1 -1
- package/dist/rethrow.d.ts.map +1 -1
- package/dist/rethrow.js.map +1 -1
- package/dist/round.d.ts.map +1 -1
- package/dist/round.js.map +1 -1
- package/dist/safe.d.ts.map +1 -1
- package/dist/safe.js.map +1 -1
- package/dist/scale.d.ts.map +1 -1
- package/dist/scale.js.map +1 -1
- package/dist/seq.d.ts.map +1 -1
- package/dist/seq.js +5 -1
- package/dist/seq.js.map +1 -1
- package/dist/serialize.d.ts.map +1 -1
- package/dist/serialize.js +2 -2
- package/dist/serialize.js.map +1 -1
- package/dist/serializeToBuffer/serializeToBuffer.d.ts.map +1 -1
- package/dist/serializeToBuffer/serializeToBuffer.js.map +1 -1
- package/dist/serializeToBuffer/unserializeFromBuffer.d.ts.map +1 -1
- package/dist/serializeToBuffer/unserializeFromBuffer.js.map +1 -1
- package/dist/setImmutable.js.map +1 -1
- package/dist/sortBy.d.ts +1 -1
- package/dist/sortBy.d.ts.map +1 -1
- package/dist/sortBy.js.map +1 -1
- package/dist/sortByMultiple.d.ts +1 -1
- package/dist/sortByMultiple.d.ts.map +1 -1
- package/dist/sortByMultiple.js.map +1 -1
- package/dist/trim.d.ts.map +1 -1
- package/dist/trim.js +1 -1
- package/dist/trim.js.map +1 -1
- package/dist/trimEnd.d.ts.map +1 -1
- package/dist/trimEnd.js.map +1 -1
- package/dist/trimStart.d.ts.map +1 -1
- package/dist/trimStart.js.map +1 -1
- package/dist/unique.d.ts +1 -1
- package/dist/unique.d.ts.map +1 -1
- package/dist/unique.js.map +1 -1
- package/dist/utils/utils.js +1 -0
- package/dist/utils/utils.js.map +1 -1
- package/dist/wait.d.ts.map +1 -1
- package/dist/wait.js.map +1 -1
- package/dist/waitFor.d.ts.map +1 -1
- package/dist/waitFor.js.map +1 -1
- package/dist/waitSync.d.ts.map +1 -1
- package/dist/waitSync.js.map +1 -1
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +5 -5
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +1405 -1288
- package/docs/documents/Changelog.html +370 -0
- package/docs/functions/index.cap.html +3 -3
- package/docs/functions/index.capitalize.html +7 -7
- package/docs/functions/index.coalesce.html +8 -8
- package/docs/functions/index.compareArrays.html +5 -5
- package/docs/functions/index.compareProps.html +5 -5
- package/docs/functions/index.deserialize.html +4 -4
- package/docs/functions/index.ensureArray.html +3 -3
- package/docs/functions/index.ensureDate.html +6 -6
- package/docs/functions/index.ensureError.html +6 -6
- package/docs/functions/index.ensurePrefix.html +5 -5
- package/docs/functions/index.ensureSuffix.html +5 -5
- package/docs/functions/index.ensureTimestamp.html +6 -6
- package/docs/functions/index.escapeRegExp.html +5 -5
- package/docs/functions/index.formatDate.html +5 -2
- package/docs/functions/index.get.html +8 -8
- package/docs/functions/index.getMultiple.html +6 -6
- package/docs/functions/index.ignore.html +8 -0
- package/docs/functions/index.insertSeparator.html +5 -5
- package/docs/functions/index.isEmpty.html +12 -13
- package/docs/functions/index.isNumericString.html +3 -3
- package/docs/functions/index.isPlainObject.html +8 -8
- package/docs/functions/index.last.html +7 -7
- package/docs/functions/index.later-1.html +3 -3
- package/docs/functions/index.mapAsync.html +5 -5
- package/docs/functions/index.mapValues.html +7 -7
- package/docs/functions/index.match.html +4 -4
- package/docs/functions/index.memoize.html +4 -4
- package/docs/functions/index.merge.html +6 -6
- package/docs/functions/index.mostFrequent.html +2 -2
- package/docs/functions/index.noop.html +2 -2
- package/docs/functions/index.occurrences.html +7 -6
- package/docs/functions/index.omit.html +7 -7
- package/docs/functions/index.pick.html +7 -7
- package/docs/functions/index.pull.html +2 -2
- package/docs/functions/index.race.html +5 -5
- package/docs/functions/index.remove.html +2 -2
- package/docs/functions/index.removeCommonProperties.html +5 -5
- package/docs/functions/index.replace.html +6 -6
- package/docs/functions/index.replaceDeep.html +3 -3
- package/docs/functions/index.rethrow.html +2 -2
- package/docs/functions/index.retry.html +4 -4
- package/docs/functions/index.round.html +4 -4
- package/docs/functions/index.safe.html +5 -5
- package/docs/functions/index.sample.html +4 -4
- package/docs/functions/index.samples.html +3 -3
- package/docs/functions/index.scale.html +2 -2
- package/docs/functions/index.seq.html +7 -7
- package/docs/functions/index.seqEarlyBreak.html +6 -6
- package/docs/functions/index.serialize.html +3 -3
- package/docs/functions/index.serializeToBuffer.html +7 -7
- package/docs/functions/index.set.html +8 -8
- package/docs/functions/index.setImmutable.html +7 -7
- package/docs/functions/index.shuffle.html +3 -3
- package/docs/functions/index.sortBy.html +3 -3
- package/docs/functions/index.sortByMultiple.html +5 -5
- package/docs/functions/index.sortProps.html +4 -4
- package/docs/functions/index.stripPrefix.html +3 -3
- package/docs/functions/index.stripSuffix.html +3 -3
- package/docs/functions/index.throttle.html +4 -4
- package/docs/functions/index.toggle.html +4 -4
- package/docs/functions/index.trim.html +4 -4
- package/docs/functions/index.trimEnd.html +4 -4
- package/docs/functions/index.trimStart.html +4 -4
- package/docs/functions/index.truthy.html +4 -4
- package/docs/functions/index.unique.html +4 -4
- package/docs/functions/index.unserializeFromBuffer.html +6 -6
- package/docs/functions/index.wait.html +3 -3
- package/docs/functions/index.waitFor.html +4 -4
- package/docs/functions/index.waitSync.html +3 -3
- package/docs/index.html +16 -16
- package/docs/interfaces/index.ComparePropsOptions.html +4 -4
- package/docs/interfaces/index.GetMultipleSource.html +3 -3
- package/docs/interfaces/index.GetSource.html +3 -3
- package/docs/interfaces/index.IsNumericStringOptions.html +5 -5
- package/docs/interfaces/index.OccurencesOptions.html +2 -2
- package/docs/interfaces/index.SetImmutableSource.html +3 -3
- package/docs/interfaces/index.SetSource.html +3 -3
- package/docs/interfaces/index.ThrottleOptions.html +3 -3
- package/docs/interfaces/index.ThrottledFunctionExtras.html +4 -4
- package/docs/modules/index.html +1 -93
- package/docs/modules.html +1 -3
- package/docs/types/index.CustomDeserializers.html +1 -1
- package/docs/types/index.CustomSerializers.html +1 -1
- package/docs/types/index.Later.html +4 -4
- package/docs/types/index.MapValuesFn.html +7 -7
- package/docs/types/index.MatchCallback.html +1 -1
- package/docs/types/index.MergeTwo.html +2 -2
- package/docs/types/index.SeqEarlyBreaker.html +4 -4
- package/docs/types/index.SeqFn.html +3 -3
- package/docs/types/index.SeqFunctions.html +3 -3
- package/docs/types/index.SetImmutablePath.html +2 -2
- package/docs/types/index.ThrottledFunction.html +1 -1
- package/docs/variables/index.mapValuesUNSET.html +2 -2
- package/docs/variables/index.mergeUNSET.html +3 -3
- package/esm/cap.d.ts.map +1 -1
- package/esm/cap.js.map +1 -1
- package/esm/capitalize.d.ts.map +1 -1
- package/esm/capitalize.js.map +1 -1
- package/esm/compareArrays.d.ts +4 -4
- package/esm/compareArrays.d.ts.map +1 -1
- package/esm/compareArrays.js.map +1 -1
- package/esm/ensureError.d.ts.map +1 -1
- package/esm/ensureError.js +3 -1
- package/esm/ensureError.js.map +1 -1
- package/esm/ensurePrefix.d.ts.map +1 -1
- package/esm/ensurePrefix.js.map +1 -1
- package/esm/ensureSuffix.d.ts.map +1 -1
- package/esm/ensureSuffix.js.map +1 -1
- package/esm/escapeRegExp.d.ts.map +1 -1
- package/esm/escapeRegExp.js.map +1 -1
- package/esm/formatDate.d.ts.map +1 -1
- package/esm/formatDate.js.map +1 -1
- package/esm/getMultiple.d.ts.map +1 -1
- package/esm/getMultiple.js.map +1 -1
- package/esm/ignore.d.ts +3 -0
- package/esm/ignore.d.ts.map +1 -0
- package/esm/ignore.js +13 -0
- package/esm/ignore.js.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/isEmpty.d.ts.map +1 -1
- package/esm/isEmpty.js +4 -4
- package/esm/isEmpty.js.map +1 -1
- package/esm/isNumericString.d.ts.map +1 -1
- package/esm/isNumericString.js.map +1 -1
- package/esm/isPlainObject.d.ts.map +1 -1
- package/esm/isPlainObject.js.map +1 -1
- package/esm/match.d.ts.map +1 -1
- package/esm/match.js.map +1 -1
- package/esm/memoize.d.ts.map +1 -1
- package/esm/memoize.js.map +1 -1
- package/esm/mostFrequent.d.ts.map +1 -1
- package/esm/mostFrequent.js.map +1 -1
- package/esm/noop.d.ts.map +1 -1
- package/esm/noop.js.map +1 -1
- package/esm/occurrences.d.ts.map +1 -1
- package/esm/occurrences.js.map +1 -1
- package/esm/removeCommonProperties.d.ts.map +1 -1
- package/esm/removeCommonProperties.js.map +1 -1
- package/esm/replace.d.ts.map +1 -1
- package/esm/replace.js.map +1 -1
- package/esm/rethrow.d.ts +1 -1
- package/esm/rethrow.d.ts.map +1 -1
- package/esm/rethrow.js.map +1 -1
- package/esm/round.d.ts.map +1 -1
- package/esm/round.js.map +1 -1
- package/esm/safe.d.ts.map +1 -1
- package/esm/safe.js.map +1 -1
- package/esm/scale.d.ts.map +1 -1
- package/esm/scale.js.map +1 -1
- package/esm/seq.d.ts.map +1 -1
- package/esm/seq.js +5 -1
- package/esm/seq.js.map +1 -1
- package/esm/serialize.d.ts.map +1 -1
- package/esm/serialize.js +2 -2
- package/esm/serialize.js.map +1 -1
- package/esm/serializeToBuffer/serializeToBuffer.d.ts.map +1 -1
- package/esm/serializeToBuffer/serializeToBuffer.js.map +1 -1
- package/esm/serializeToBuffer/unserializeFromBuffer.d.ts.map +1 -1
- package/esm/serializeToBuffer/unserializeFromBuffer.js.map +1 -1
- package/esm/setImmutable.js.map +1 -1
- package/esm/sortBy.d.ts +1 -1
- package/esm/sortBy.d.ts.map +1 -1
- package/esm/sortBy.js.map +1 -1
- package/esm/sortByMultiple.d.ts +1 -1
- package/esm/sortByMultiple.d.ts.map +1 -1
- package/esm/sortByMultiple.js.map +1 -1
- package/esm/trim.d.ts.map +1 -1
- package/esm/trim.js +1 -1
- package/esm/trim.js.map +1 -1
- package/esm/trimEnd.d.ts.map +1 -1
- package/esm/trimEnd.js.map +1 -1
- package/esm/trimStart.d.ts.map +1 -1
- package/esm/trimStart.js.map +1 -1
- package/esm/unique.d.ts +1 -1
- package/esm/unique.d.ts.map +1 -1
- package/esm/unique.js.map +1 -1
- package/esm/utils/utils.js +1 -0
- package/esm/utils/utils.js.map +1 -1
- package/esm/wait.d.ts.map +1 -1
- package/esm/wait.js.map +1 -1
- package/esm/waitFor.d.ts.map +1 -1
- package/esm/waitFor.js.map +1 -1
- package/esm/waitSync.d.ts.map +1 -1
- package/esm/waitSync.js.map +1 -1
- package/package.json +31 -34
- package/src/cap.ts +1 -1
- package/src/capitalize.ts +3 -3
- package/src/compareArrays.ts +2 -3
- package/src/deserialize.spec.ts +2 -1
- package/src/ensureError.ts +6 -2
- package/src/ensurePrefix.ts +1 -1
- package/src/ensureSuffix.ts +1 -1
- package/src/escapeRegExp.ts +1 -1
- package/src/formatDate.ts +7 -2
- package/src/get.spec.ts +0 -1
- package/src/getMultiple.ts +0 -1
- package/src/ignore.spec.ts +80 -0
- package/src/ignore.ts +38 -0
- package/src/index.ts +1 -0
- package/src/isEmpty.ts +9 -15
- package/src/isNumericString.ts +1 -1
- package/src/isPlainObject.ts +1 -1
- package/src/later.spec.ts +1 -0
- package/src/mapAsync.ts +4 -4
- package/src/match.ts +1 -1
- package/src/memoize.spec.ts +1 -1
- package/src/memoize.ts +1 -1
- package/src/mostFrequent.spec.ts +2 -0
- package/src/mostFrequent.ts +0 -1
- package/src/noop.ts +1 -1
- package/src/occurrences.ts +1 -1
- package/src/remove.spec.ts +1 -1
- package/src/removeCommonProperties.spec.ts +2 -0
- package/src/removeCommonProperties.ts +1 -1
- package/src/replace.ts +1 -1
- package/src/replaceDeep.spec.ts +2 -0
- package/src/replaceDeepByFn.spec.ts +2 -0
- package/src/rethrow.ts +1 -1
- package/src/round.ts +1 -1
- package/src/safe.ts +2 -1
- package/src/scale.ts +1 -1
- package/src/seq.ts +7 -3
- package/src/serialize.spec.ts +2 -1
- package/src/serialize.ts +3 -3
- package/src/serializeToBuffer/serialization.spec.ts +2 -2
- package/src/serializeToBuffer/serializeToBuffer.ts +0 -1
- package/src/serializeToBuffer/unserializeFromBuffer.ts +0 -1
- package/src/setImmutable.ts +1 -1
- package/src/sortBy.ts +3 -1
- package/src/sortByMultiple.ts +5 -3
- package/src/toggle.spec.ts +2 -0
- package/src/trim.spec.ts +2 -0
- package/src/trim.ts +3 -2
- package/src/trimEnd.spec.ts +2 -0
- package/src/trimEnd.ts +1 -1
- package/src/trimStart.spec.ts +2 -0
- package/src/trimStart.ts +1 -1
- package/src/unique.ts +2 -2
- package/src/wait.ts +1 -1
- package/src/waitFor.spec.ts +9 -8
- package/src/waitFor.ts +1 -1
- package/src/waitSync.spec.ts +2 -0
- package/src/waitSync.ts +1 -1
- package/.prettierignore +0 -3
- package/.prettierrc.json +0 -1
- package/docs/documents/CHANGELOG.html +0 -357
- package/pnpm-lock.yaml +0 -6529
- package/typedoc.cjs +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>trimEnd | @ezez/utils - v4.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>trimEnd | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.trimEnd.html">trimEnd</a></li></ul><h1>Function trimEnd</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Removes given characters from the end of the string.
|
|
2
2
|
See also: <a href="index.trim.html" class="tsd-kind-function">trim</a> and <a href="index.trimStart.html" class="tsd-kind-function">trimStart</a>.</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-2">trimEnd</span><span class="hl-1">(</span><span class="hl-7">"abcxzyz"</span><span class="hl-1">, </span><span class="hl-7">"yz"</span><span class="hl-1">); </span><span class="hl-6">// "abcxz"</span><br/><span class="hl-2">trimEnd</span><span class="hl-1">(</span><span class="hl-7">"!aaa!!"</span><span class="hl-1">, </span><span class="hl-7">"!"</span><span class="hl-1">); </span><span class="hl-6">// "!aaa"</span>
|
|
4
4
|
</code><button type="button">Copy</button></pre>
|
|
5
5
|
|
|
6
|
-
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="
|
|
6
|
+
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="trimend" class="tsd-anchor"></a><span class="tsd-kind-call-signature">trimEnd</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">characters</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><a href="#trimend" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">source</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Source string.</p>
|
|
7
7
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">characters</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Characters to remove, taken as a whole.</p>
|
|
8
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/
|
|
8
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/trimEnd.ts#L12">trimEnd.ts:12</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>trimStart | @ezez/utils - v4.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>trimStart | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.trimStart.html">trimStart</a></li></ul><h1>Function trimStart</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Removes given characters from the start of the string.
|
|
2
2
|
See also: <a href="index.trim.html" class="tsd-kind-function">trim</a> and <a href="index.trimEnd.html" class="tsd-kind-function">trimEnd</a>.</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-2">trimStart</span><span class="hl-1">(</span><span class="hl-7">"abbcb"</span><span class="hl-1">, </span><span class="hl-7">"ab"</span><span class="hl-1">); </span><span class="hl-6">// "bcb"</span><br/><span class="hl-2">trimStart</span><span class="hl-1">(</span><span class="hl-7">"!!aaa!"</span><span class="hl-1">, </span><span class="hl-7">"!"</span><span class="hl-1">); </span><span class="hl-6">// "aaa!"</span>
|
|
4
4
|
</code><button type="button">Copy</button></pre>
|
|
5
5
|
|
|
6
|
-
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="
|
|
6
|
+
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="trimstart" class="tsd-anchor"></a><span class="tsd-kind-call-signature">trimStart</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">characters</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><a href="#trimstart" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">source</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Source string.</p>
|
|
7
7
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">characters</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Characters to remove, taken as a whole.</p>
|
|
8
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/
|
|
8
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/trimStart.ts#L12">trimStart.ts:12</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>truthy | @ezez/utils - v4.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>truthy | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.truthy.html">truthy</a></li></ul><h1>Function truthy</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Returns true if value is truthy, useful with <code>Array.prototype.filter</code> and TypeScript (<code>[].filter(Boolean)</code> won't
|
|
2
2
|
filter out falsy values from the types)</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="truthy" class="tsd-anchor"></a><span class="tsd-kind-call-signature">truthy</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.truthy.html#
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-kind-parameter">val</span
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="truthy" class="tsd-anchor"></a><span class="tsd-kind-call-signature">truthy</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.truthy.html#truthyt">T</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">val</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">""</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.truthy.html#truthyt">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-kind-parameter">val</span> <span class="tsd-signature-keyword">is</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.truthy.html#truthyt">T</a><a href="#truthy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="truthyt" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">val</span>: <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">""</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.truthy.html#truthyt">T</a></span><div class="tsd-comment tsd-typography"><p>test value</p>
|
|
4
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-kind-parameter">val</span> <span class="tsd-signature-keyword">is</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.truthy.html#truthyt">T</a></h4><ul>
|
|
5
5
|
<li>is value truthy</li>
|
|
6
6
|
</ul>
|
|
7
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/
|
|
7
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/truthy.ts#L7">truthy.ts:7</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>unique | @ezez/utils - v4.
|
|
2
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>unique | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.unique.html">unique</a></li></ul><h1>Function unique</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Returns a new array with unique values of given array.</p>
|
|
2
|
+
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-2">unique</span><span class="hl-1">([</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">1</span><span class="hl-1">]) </span><span class="hl-6">// [1, 2, 3]</span>
|
|
3
3
|
</code><button type="button">Copy</button></pre>
|
|
4
4
|
|
|
5
|
-
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="unique" class="tsd-anchor"></a><span class="tsd-kind-call-signature">unique</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.unique.html#
|
|
6
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unique.html#
|
|
5
|
+
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="unique" class="tsd-anchor"></a><span class="tsd-kind-call-signature">unique</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.unique.html#uniquet">T</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">arr</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unique.html#uniquet">T</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unique.html#uniquet">T</a><span class="tsd-signature-symbol">[]</span><a href="#unique" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="uniquet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">arr</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unique.html#uniquet">T</a><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>source array</p>
|
|
6
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unique.html#uniquet">T</a><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/unique.ts#L6">unique.ts:6</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>unserializeFromBuffer | @ezez/utils - v4.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>unserializeFromBuffer | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.unserializeFromBuffer.html">unserializeFromBuffer</a></li></ul><h1>Function unserializeFromBuffer</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Unserialize data from a Buffer serialized with <a href="index.serializeToBuffer.html" class="tsd-kind-function">serializeToBuffer</a>, useful when working with web sockets or
|
|
2
2
|
other binary protocols. Make sure to understand how <a href="index.deserialize.html" class="tsd-kind-function">deserialize</a> works before using this function.</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="unserializefrombuffer" class="tsd-anchor"></a><span class="tsd-kind-call-signature">unserializeFromBuffer</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.unserializeFromBuffer.html#unserializefrombufferrt">RT</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">BufferImplementation</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BufferConstructor</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">deserializeArgs</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span>customDeserializers<span class="tsd-signature-symbol">?:</span> <a href="../types/index.CustomDeserializers.html" class="tsd-signature-type tsd-kind-type-alias">CustomDeserializers</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">rawData</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Buffer</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unserializeFromBuffer.html#unserializefrombufferrt">RT</a><a href="#unserializefrombuffer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="unserializefrombufferrt" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RT</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span> = <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">BufferImplementation</span>: <span class="tsd-signature-type">BufferConstructor</span></span><div class="tsd-comment tsd-typography"><p>Buffer implementation, in browsers use <code>buffer</code> npm package
|
|
4
4
|
and import it from <code>buffer/</code>, in Node.js simply pass <code>Buffer</code>.</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">deserializeArgs</span>: <span class="tsd-signature-symbol">[</span>customDeserializers<span class="tsd-signature-symbol"
|
|
6
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">rawData</span>: <span class="tsd-signature-type">Buffer</span
|
|
7
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unserializeFromBuffer.html#
|
|
8
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/
|
|
5
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">deserializeArgs</span>: <span class="tsd-signature-symbol">[</span>customDeserializers<span class="tsd-signature-symbol">?:</span> <a href="../types/index.CustomDeserializers.html" class="tsd-signature-type tsd-kind-type-alias">CustomDeserializers</a><span class="tsd-signature-symbol">]</span></span><div class="tsd-comment tsd-typography"><p>[customDeserializers] - optional arguments if you need to unserialize custom data types,</p>
|
|
6
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">rawData</span>: <span class="tsd-signature-type">Buffer</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Uint8Array</span></span><div class="tsd-comment tsd-typography"><p>Buffer to unserialize</p>
|
|
7
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.unserializeFromBuffer.html#unserializefrombufferrt">RT</a></h4><p>unserialized data</p>
|
|
8
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/serializeToBuffer/unserializeFromBuffer.ts#L20">serializeToBuffer/unserializeFromBuffer.ts:20</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>wait | @ezez/utils - v4.
|
|
2
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="wait" class="tsd-anchor"></a><span class="tsd-kind-call-signature">wait</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">timeMs</span><span class="tsd-signature-symbol"
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>wait | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.wait.html">wait</a></li></ul><h1>Function wait</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Returns a promise that resolves after given time</p>
|
|
2
|
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="wait" class="tsd-anchor"></a><span class="tsd-kind-call-signature">wait</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">timeMs</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#wait" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">timeMs</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></span><div class="tsd-comment tsd-typography"><p>time to wait</p>
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/wait.ts#L6">wait.ts:6</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>waitFor | @ezez/utils - v4.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>waitFor | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.waitFor.html">waitFor</a></li></ul><h1>Function waitFor</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Runs the callback function every specified interval and returns a Promise that resolves when the callback returns
|
|
2
2
|
any other value than <code>null</code>, <code>undefined</code> or <code>false</code>.
|
|
3
3
|
If your callback throws (or Promise rejects) it will stop the interval and reject the returned Promise.
|
|
4
4
|
To avoid that use:</p>
|
|
5
5
|
<pre><code class="typescript"><span class="hl-2">waitFor</span><span class="hl-1">(() </span><span class="hl-0">=></span><span class="hl-1"> </span><span class="hl-2">promiseReturningFunction</span><span class="hl-1">().</span><span class="hl-2">catch</span><span class="hl-1">(() </span><span class="hl-0">=></span><span class="hl-1"> </span><span class="hl-0">null</span><span class="hl-1">));</span><br/><span class="hl-6">// or</span><br/><span class="hl-2">waitFor</span><span class="hl-1">(() </span><span class="hl-0">=></span><span class="hl-1"> </span><span class="hl-2">safe</span><span class="hl-1">(() </span><span class="hl-0">=></span><span class="hl-1"> </span><span class="hl-2">functionThatThrows</span><span class="hl-1">()));</span>
|
|
6
6
|
</code><button type="button">Copy</button></pre>
|
|
7
7
|
|
|
8
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="
|
|
9
|
-
</div><div class="tsd-comment tsd-typography"></div
|
|
10
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.waitFor.html#
|
|
8
|
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="waitfor" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitFor</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.waitFor.html#waitfort">T</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">fn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">MaybePromise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.waitFor.html#waitfort">T</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">Options</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.waitFor.html#waitfort">T</a><span class="tsd-signature-symbol">></span><a href="#waitfor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="waitfort" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">fn</span>: <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">MaybePromise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.waitFor.html#waitfort">T</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>callback function</p>
|
|
9
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">Options</span><span class="tsd-signature-symbol"> = defaultOptions</span></span><div class="tsd-comment tsd-typography"><p>options object</p>
|
|
10
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.waitFor.html#waitfort">T</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/waitFor.ts#L42">waitFor.ts:42</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>waitSync | @ezez/utils - v4.
|
|
2
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>waitSync | @ezez/utils - v4.6.0</title><meta name="description" content="Documentation for @ezez/utils"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@ezez/utils - v4.6.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@ezez/utils</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.waitSync.html">waitSync</a></li></ul><h1>Function waitSync</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Synchronously wait for a given time, blocking the event loop [!]</p>
|
|
2
|
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="waitsync" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitSync</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">timeMs</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#waitsync" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">timeMs</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></span><div class="tsd-comment tsd-typography"><p>time to wait</p>
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/waitSync.ts#L6">waitSync.ts:6</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@ezez/utils - v4.6.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|