Skip to content

Commit cdca0ca

Browse files
committed
0.2.44
1 parent c2caad8 commit cdca0ca

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,20 @@ See encoding.writeAny for more information.</p></dd>
203203
<dd><p>Decode an any-encoded value.</p></dd>
204204
</dl>
205205
</details>
206+
<details><summary><b>[lib0/cached-map]</b> An implementation of a map which has keys that expire.</summary>
207+
<pre>import * as cached-map from 'lib0/cache'</pre>
208+
<dl>
209+
<b><code>new cached-map.Cache(timeout: number)</code></b><br>
210+
<b><code>cached-map.removeStale(cache: module:cache.Cache&lt;K, V&gt;): number</code></b><br>
211+
<b><code>cached-map.set(cache: module:cache.Cache&lt;K, V&gt;, key: K, value: V)</code></b><br>
212+
<b><code>cached-map.get(cache: module:cache.Cache&lt;K, V&gt;, key: K): V | undefined</code></b><br>
213+
<b><code>cached-map.getAsync(cache: module:cache.Cache&lt;K, V&gt;, key: K): V | Promise&lt;V&gt; | undefined</code></b><br>
214+
<dd><p>Works well in conjunktion with setIfUndefined which has an async init function.
215+
Using getAsync &amp; setIfUndefined ensures that the init function is only called once.</p></dd>
216+
<b><code>cached-map.setIfUndefined(cache: module:cache.Cache&lt;K, V&gt;, key: K, init: function():Promise&lt;V&gt;): Promise&lt;V&gt; | V</code></b><br>
217+
<b><code>cached-map.create(timeout: number)</code></b><br>
218+
</dl>
219+
</details>
206220
<details><summary><b>[lib0/component]</b> Web components.</summary>
207221
<pre>import * as component from 'lib0/component'</pre>
208222
<dl>
@@ -387,6 +401,8 @@ efficient, but not very sophisticated.</p></dd>
387401
efficient, but not very sophisticated.</p>
388402
<p>Note: This is basically the same function as above. Another function was created so that the runtime
389403
can better optimize these function calls.</p></dd>
404+
<b><code>diff.simpleDiffStringWithCursor(a: string, b: string, cursor: number)</code></b><br>
405+
<dd><p>Diff text and try to diff at the current cursor position.</p></dd>
390406
</dl>
391407
</details>
392408
<details><summary><b>[lib0/dom]</b> Utility module to work with the DOM.</summary>
@@ -787,6 +803,36 @@ In practice, when decoding several million small strings, the GC will kick in mo
787803
<dd><p>Parse JSON object.</p></dd>
788804
</dl>
789805
</details>
806+
<details><summary><b>[lib0/list]</b> </summary>
807+
<pre>import * as list from 'lib0/list'</pre>
808+
<dl>
809+
<b><code>new e#ListNode()</code></b><br>
810+
<b><code>e#next: this|null</code></b><br>
811+
<b><code>e#prev: this|null</code></b><br>
812+
<b><code>new st()</code></b><br>
813+
<b><code>art: N | null</code></b><br>
814+
<b><code>d: N | null</code></b><br>
815+
<b><code>(): module:list.List&lt;N&gt;</code></b><br>
816+
<b><code>()</code></b><br>
817+
<b><code>(queue: module:list.List&lt;N&gt;)</code></b><br>
818+
<b><code>()</code></b><br>
819+
<b><code>ode(queue: module:list.List&lt;N&gt;, node: N)</code></b><br>
820+
<dd><p>Remove a single node from the queue. Only works with Queues that operate on Doubly-linked lists of nodes.</p></dd>
821+
<b><code>ode()</code></b><br>
822+
<b><code>etween(queue: module:list.List&lt;N&gt;, left: N| null, right: N| null, node: N)</code></b><br>
823+
<b><code>etween()</code></b><br>
824+
<b><code>(queue: module:list.List&lt;N&gt;, n: N)</code></b><br>
825+
<b><code>()</code></b><br>
826+
<b><code>nt(queue: module:list.List&lt;N&gt;, n: N)</code></b><br>
827+
<b><code>nt()</code></b><br>
828+
<b><code>t(list: module:list.List&lt;N&gt;): N| null</code></b><br>
829+
<b><code>t()</code></b><br>
830+
<b><code>(list: module:list.List&lt;N&gt;): N| null</code></b><br>
831+
<b><code>()</code></b><br>
832+
<b><code>(list: module:list.List&lt;N&gt;, f: function(N):M): Array&lt;M&gt;</code></b><br>
833+
<b><code>()</code></b><br>
834+
</dl>
835+
</details>
790836
<details><summary><b>[lib0/logging]</b> Isomorphic logging module with support for colors!</summary>
791837
<pre>import * as logging from 'lib0/logging'</pre>
792838
<dl>
@@ -1058,6 +1104,8 @@ library has some insane environment where global Promise objects are overwritten
10581104
<dl>
10591105
<b><code>set.create</code></b><br>
10601106
<b><code>set.toArray(set: Set&lt;T&gt;): Array&lt;T&gt;</code></b><br>
1107+
<b><code>set.first(set: Set&lt;T&gt;): T</code></b><br>
1108+
<b><code>set.from(entries: Iterable&lt;T&gt;): Set&lt;T&gt;</code></b><br>
10611109
</dl>
10621110
</details>
10631111
<details><summary><b>[lib0/sort]</b> Efficient sort implementations.</summary>
@@ -1104,6 +1152,7 @@ integrate this algorithm.</p>
11041152
<b><code>string.utf8TextEncoder</code></b><br>
11051153
<b><code>string.encodeUtf8</code></b><br>
11061154
<b><code>string.decodeUtf8</code></b><br>
1155+
<b><code>string.splice(str: string, index: number, remove: number, insert: string)</code></b><br>
11071156
</dl>
11081157
</details>
11091158
<details><summary><b>[lib0/symbol]</b> Utility module to work with EcmaScript Symbols.</summary>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lib0",
3-
"version": "0.2.43",
3+
"version": "0.2.44",
44
"description": "",
55
"sideEffects": false,
66
"type": "module",

0 commit comments

Comments
 (0)