@ezez/utils 4.4.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 +21 -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/deserialize.d.ts +1 -1
- package/dist/deserialize.d.ts.map +1 -1
- package/dist/deserialize.js +2 -1
- package/dist/deserialize.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 +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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/const.d.ts +10 -0
- package/dist/serializeToBuffer/const.d.ts.map +1 -0
- package/dist/serializeToBuffer/const.js +16 -0
- package/dist/serializeToBuffer/const.js.map +1 -0
- package/dist/serializeToBuffer/serializeToBuffer.d.ts +5 -0
- package/dist/serializeToBuffer/serializeToBuffer.d.ts.map +1 -0
- package/dist/serializeToBuffer/serializeToBuffer.js +39 -0
- package/dist/serializeToBuffer/serializeToBuffer.js.map +1 -0
- package/dist/serializeToBuffer/unserializeFromBuffer.d.ts +5 -0
- package/dist/serializeToBuffer/unserializeFromBuffer.d.ts.map +1 -0
- package/dist/serializeToBuffer/unserializeFromBuffer.js +52 -0
- package/dist/serializeToBuffer/unserializeFromBuffer.js.map +1 -0
- 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 +4 -5
- package/docs/functions/index.serializeToBuffer.html +19 -0
- 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 +8 -0
- 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 -89
- 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/deserialize.d.ts +1 -1
- package/esm/deserialize.d.ts.map +1 -1
- package/esm/deserialize.js +1 -1
- package/esm/deserialize.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 +3 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -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/const.d.ts +10 -0
- package/esm/serializeToBuffer/const.d.ts.map +1 -0
- package/esm/serializeToBuffer/const.js +10 -0
- package/esm/serializeToBuffer/const.js.map +1 -0
- package/esm/serializeToBuffer/serializeToBuffer.d.ts +5 -0
- package/esm/serializeToBuffer/serializeToBuffer.d.ts.map +1 -0
- package/esm/serializeToBuffer/serializeToBuffer.js +36 -0
- package/esm/serializeToBuffer/serializeToBuffer.js.map +1 -0
- package/esm/serializeToBuffer/unserializeFromBuffer.d.ts +5 -0
- package/esm/serializeToBuffer/unserializeFromBuffer.d.ts.map +1 -0
- package/esm/serializeToBuffer/unserializeFromBuffer.js +48 -0
- package/esm/serializeToBuffer/unserializeFromBuffer.js.map +1 -0
- 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/deserialize.ts +1 -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 +3 -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 +4 -5
- package/src/serializeToBuffer/const.ts +16 -0
- package/src/serializeToBuffer/serialization.spec.ts +61 -0
- package/src/serializeToBuffer/serializeToBuffer.spec.ts +43 -0
- package/src/serializeToBuffer/serializeToBuffer.ts +89 -0
- package/src/serializeToBuffer/unserializeFromBuffer.spec.ts +63 -0
- package/src/serializeToBuffer/unserializeFromBuffer.ts +74 -0
- 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 -349
- package/pnpm-lock.yaml +0 -6529
- package/typedoc.cjs +0 -3
|
@@ -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>sortByMultiple | @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>sortByMultiple | @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.sortByMultiple.html">sortByMultiple</a></li></ul><h1>Function sortByMultiple</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Returns a function that can be used as a callback to <code>.sort()</code> method. Returned function will sort array by given
|
|
2
2
|
properties.</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="
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">ascending</span>: <span class="tsd-signature-type">boolean</span
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">defaultValues</span>: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#
|
|
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="sortbymultiple" class="tsd-anchor"></a><span class="tsd-kind-call-signature">sortByMultiple</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplet">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplek">K</a> <span class="tsd-signature-keyword">extends</span> (<span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplet">T</a>)<span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">propertyNames</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplek">K</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">ascending</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplek">K</a><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">boolean</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">defaultValues</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplek">K</a><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">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">a</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplet">T</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">b</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplet">T</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">-1</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">1</span><a href="#sortbymultiple" 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="sortbymultiplet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span><a id="sortbymultiplek" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span><span class="tsd-signature-keyword"> extends </span>(<span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplet">T</a>)<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">propertyNames</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplek">K</a></span><div class="tsd-comment tsd-typography"><p>name of the properties to sort by, in order of priority</p>
|
|
4
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">ascending</span>: <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplek">K</a><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">boolean</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = true</span></span><div class="tsd-comment tsd-typography"><p>should sort be ascending? Pass boolean or object with boolean values for each property</p>
|
|
5
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">defaultValues</span>: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplek">K</a><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">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>values to use when properties are not defined in one of the objects</p>
|
|
6
6
|
<p>@example:</p>
|
|
7
7
|
<pre><code><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-8">videos</span><span class="hl-1"> = [</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">480</span><span class="hl-1">, </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-5">300</span><span class="hl-1"> },</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">720</span><span class="hl-1">, </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-5">100</span><span class="hl-1"> },</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">720</span><span class="hl-1"> },</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">720</span><span class="hl-1">, </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-5">200</span><span class="hl-1"> },</span><br/><span class="hl-1">];</span><br/><span class="hl-6">// Sort by height ascending, then by bitrate descending, and set default bitrate to 150</span><br/><span class="hl-3">itemsMissing</span><span class="hl-1">.</span><span class="hl-2">sort</span><span class="hl-1">(</span><span class="hl-2">sortByMultiple</span><span class="hl-1">([</span><span class="hl-7">"height"</span><span class="hl-1">, </span><span class="hl-7">"bitrate"</span><span class="hl-1">], { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1">, </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-0">false</span><span class="hl-1"> }, { </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-5">150</span><span class="hl-1"> }));</span><br/><span class="hl-6">// Result:</span><br/><span class="hl-1">[</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">480</span><span class="hl-1">, </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-5">300</span><span class="hl-1"> },</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">720</span><span class="hl-1">, </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-5">200</span><span class="hl-1"> },</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">720</span><span class="hl-1"> }, </span><span class="hl-6">// bitrate assumed to be 150</span><br/><span class="hl-1"> { </span><span class="hl-3">height:</span><span class="hl-1"> </span><span class="hl-5">720</span><span class="hl-1">, </span><span class="hl-3">bitrate:</span><span class="hl-1"> </span><span class="hl-5">100</span><span class="hl-1"> },</span><br/><span class="hl-1">]</span>
|
|
8
8
|
</code><button>Copy</button></pre>
|
|
9
9
|
|
|
10
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span><span class="tsd-
|
|
10
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">a</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplet">T</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">b</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortByMultiple.html#sortbymultiplet">T</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">-1</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">1</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/sortByMultiple.ts#L30">sortByMultiple.ts:30</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>sortProps | @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>sortProps | @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.sortProps.html">sortProps</a></li></ul><h1>Function sortProps</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Sorts the properties of an object alphabetically, ascending or descending.
|
|
2
2
|
It does not mutate the original object.</p>
|
|
3
3
|
<p>REMEMBER: In theory, JS engines do not guarantee the order of object properties.
|
|
4
4
|
In practice most of the popular engines do.</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-
|
|
5
|
+
</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">sortProps</span><span class="hl-1">({ </span><span class="hl-3">b:</span><span class="hl-1"> </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-3">a:</span><span class="hl-1"> </span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-3">z:</span><span class="hl-1"> </span><span class="hl-5">26</span><span class="hl-1"> }) </span><span class="hl-6">// { a: 1, b: 2, z: 26 }</span>
|
|
6
6
|
</code><button type="button">Copy</button></pre>
|
|
7
7
|
|
|
8
|
-
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="
|
|
8
|
+
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="sortprops" class="tsd-anchor"></a><span class="tsd-kind-call-signature">sortProps</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortProps.html#sortpropst">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><span class="tsd-kind-parameter">object</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortProps.html#sortpropst">T</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">asc</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortProps.html#sortpropst">T</a><a href="#sortprops" 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="sortpropst" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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">object</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.sortProps.html#sortpropst">T</a></span><div class="tsd-comment tsd-typography"><p>source object</p>
|
|
9
9
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">asc</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span><div class="tsd-comment tsd-typography"><p>sort ascending?</p>
|
|
10
|
-
</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.sortProps.html#
|
|
10
|
+
</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.sortProps.html#sortpropst">T</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/sortProps.ts#L11">sortProps.ts:11</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,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>stripPrefix | @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="
|
|
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>stripPrefix | @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.stripPrefix.html">stripPrefix</a></li></ul><h1>Function stripPrefix</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Strip a prefix from a string.</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="stripprefix" class="tsd-anchor"></a><span class="tsd-kind-call-signature">stripPrefix</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">from</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">prefix</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="#stripprefix" 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">from</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>string to strip prefix from</p>
|
|
3
3
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">prefix</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>prefix to strip</p>
|
|
4
|
-
</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/
|
|
4
|
+
</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/stripPrefix.ts#L6">stripPrefix.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,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>stripSuffix | @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="
|
|
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>stripSuffix | @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.stripSuffix.html">stripSuffix</a></li></ul><h1>Function stripSuffix</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Strip a suffix from a string.</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="stripsuffix" class="tsd-anchor"></a><span class="tsd-kind-call-signature">stripSuffix</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">from</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">suffix</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="#stripsuffix" 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">from</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>string to strip suffix from</p>
|
|
3
3
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">suffix</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>suffix to strip</p>
|
|
4
|
-
</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/
|
|
4
|
+
</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/stripSuffix.ts#L7">stripSuffix.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,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>throttle | @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>throttle | @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.throttle.html">throttle</a></li></ul><h1>Function throttle</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Creates a throttled function that calls given function only once every given time. Throttled function takes the same
|
|
2
2
|
arguments, returns "cached" value of last "real" call to the given function.
|
|
3
3
|
Time (in ms) can be specified as an array - each "real" call to the function will then pick next value of that array
|
|
4
4
|
as a time to wait for the next "real" call. This is useful for throttled notifications or auto-retries. Last value of
|
|
@@ -9,6 +9,6 @@ progress) and <code>flush</code> property - call it to immediately run planned c
|
|
|
9
9
|
(<code>leading</code> property) and if it should be called after given time (<code>trailing</code> property).</p>
|
|
10
10
|
<p>If (this is default) both <code>leading</code> and <code>trailing</code> property are true then it's required to call throttled function at
|
|
11
11
|
least twice.</p>
|
|
12
|
-
</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="throttle" class="tsd-anchor"></a><span class="tsd-kind-call-signature">throttle</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#throttle.
|
|
13
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">time</span>: <span class="tsd-signature-type">number</span
|
|
14
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/index.ThrottleOptions.html" class="tsd-signature-type tsd-kind-interface">ThrottleOptions</a></span><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../types/index.ThrottledFunction.html" class="tsd-signature-type tsd-kind-type-alias">ThrottledFunction</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#
|
|
12
|
+
</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="throttle" class="tsd-anchor"></a><span class="tsd-kind-call-signature">throttle</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#throttlert">RT</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#throttlef">F</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><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.throttle.html#throttlert">RT</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">fn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#throttlef">F</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">time</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">number</span><span class="tsd-signature-symbol">,</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-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <a href="../interfaces/index.ThrottleOptions.html" class="tsd-signature-type tsd-kind-interface">ThrottleOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="../types/index.ThrottledFunction.html" class="tsd-signature-type tsd-kind-type-alias">ThrottledFunction</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#throttlef">F</a><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> <a href="../interfaces/index.ThrottledFunctionExtras.html" class="tsd-signature-type tsd-kind-interface">ThrottledFunctionExtras</a><a href="#throttle" 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="throttlert" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RT</span></span></li><li><span><a id="throttlef" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">F</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><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.throttle.html#throttlert">RT</a></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>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#throttlef">F</a></span><div class="tsd-comment tsd-typography"><p>function to throttle</p>
|
|
13
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">time</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">number</span><span class="tsd-signature-symbol">,</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-symbol"> = 0</span></span><div class="tsd-comment tsd-typography"><p>throttle time as number or array of numbers (min 1 element)</p>
|
|
14
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/index.ThrottleOptions.html" class="tsd-signature-type tsd-kind-interface">ThrottleOptions</a></span><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../types/index.ThrottledFunction.html" class="tsd-signature-type tsd-kind-type-alias">ThrottledFunction</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.throttle.html#throttlef">F</a><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> <a href="../interfaces/index.ThrottledFunctionExtras.html" class="tsd-signature-type tsd-kind-interface">ThrottledFunctionExtras</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dzek69/ezez-utils/blob/dca3e6b0fee1f3f5bdf18ce83a5fd6fbd4d4bfa2/src/throttle.ts#L49">throttle.ts:49</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,5 +1,5 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>toggle | @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>toggle | @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.toggle.html">toggle</a></li></ul><h1>Function toggle</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Toggles an item in an array. If it exists, remove it. If it doesn't exist, add it.
|
|
2
2
|
If the array contains the given value more than once, this function will remove only one occurrence.</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="toggle" class="tsd-anchor"></a><span class="tsd-kind-call-signature">toggle</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">item</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#
|
|
5
|
-
</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.toggle.html#
|
|
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="toggle" class="tsd-anchor"></a><span class="tsd-kind-call-signature">toggle</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#togglet">T</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">array</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#togglet">T</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">item</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#togglet">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#togglet">T</a><span class="tsd-signature-symbol">[]</span><a href="#toggle" 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="togglet" 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">array</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#togglet">T</a><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>source array</p>
|
|
4
|
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">item</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.toggle.html#togglet">T</a></span><div class="tsd-comment tsd-typography"><p>item to toggle</p>
|
|
5
|
+
</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.toggle.html#togglet">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/toggle.ts#L8">toggle.ts:8</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>trim | @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>trim | @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.trim.html">trim</a></li></ul><h1>Function trim</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Removes given characters from both sides of the string.
|
|
2
2
|
If you want to remove from one side of the string see <a href="index.trimStart.html" class="tsd-kind-function">trimStart</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">trim</span><span class="hl-1">(</span><span class="hl-7">"abcb"</span><span class="hl-1">, </span><span class="hl-7">"ab"</span><span class="hl-1">); </span><span class="hl-6">// "cb"</span><br/><span class="hl-2">trim</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><br/><span class="hl-2">trim</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><br/><span class="hl-2">trim</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="trim" class="tsd-anchor"></a><span class="tsd-kind-call-signature">trim</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span
|
|
6
|
+
</div></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="trim" class="tsd-anchor"></a><span class="tsd-kind-call-signature">trim</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="#trim" 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/trim.ts#L17">trim.ts:17</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>
|