From cdca0cac24fa184e4f16fbe91c24139f3935b58f Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Fri, 25 Feb 2022 00:01:02 +0100 Subject: [PATCH] 0.2.44 --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9fe0904..8503f68 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,20 @@ See encoding.writeAny for more information.

Decode an any-encoded value.

+
[lib0/cached-map] An implementation of a map which has keys that expire. +
import * as cached-map from 'lib0/cache'
+
+new cached-map.Cache(timeout: number)
+cached-map.removeStale(cache: module:cache.Cache<K, V>): number
+cached-map.set(cache: module:cache.Cache<K, V>, key: K, value: V)
+cached-map.get(cache: module:cache.Cache<K, V>, key: K): V | undefined
+cached-map.getAsync(cache: module:cache.Cache<K, V>, key: K): V | Promise<V> | undefined
+

Works well in conjunktion with setIfUndefined which has an async init function. +Using getAsync & setIfUndefined ensures that the init function is only called once.

+cached-map.setIfUndefined(cache: module:cache.Cache<K, V>, key: K, init: function():Promise<V>): Promise<V> | V
+cached-map.create(timeout: number)
+
+
[lib0/component] Web components.
import * as component from 'lib0/component'
@@ -387,6 +401,8 @@ efficient, but not very sophisticated.

efficient, but not very sophisticated.

Note: This is basically the same function as above. Another function was created so that the runtime can better optimize these function calls.

+diff.simpleDiffStringWithCursor(a: string, b: string, cursor: number)
+

Diff text and try to diff at the current cursor position.

[lib0/dom] Utility module to work with the DOM. @@ -787,6 +803,36 @@ In practice, when decoding several million small strings, the GC will kick in mo

Parse JSON object.

+
[lib0/list] +
import * as list from 'lib0/list'
+
+new e#ListNode()
+e#next: this|null
+e#prev: this|null
+new st()
+art: N | null
+d: N | null
+(): module:list.List<N>
+()
+(queue: module:list.List<N>)
+()
+ode(queue: module:list.List<N>, node: N)
+

Remove a single node from the queue. Only works with Queues that operate on Doubly-linked lists of nodes.

+ode()
+etween(queue: module:list.List<N>, left: N| null, right: N| null, node: N)
+etween()
+(queue: module:list.List<N>, n: N)
+()
+nt(queue: module:list.List<N>, n: N)
+nt()
+t(list: module:list.List<N>): N| null
+t()
+(list: module:list.List<N>): N| null
+()
+(list: module:list.List<N>, f: function(N):M): Array<M>
+()
+
+
[lib0/logging] Isomorphic logging module with support for colors!
import * as logging from 'lib0/logging'
@@ -1058,6 +1104,8 @@ library has some insane environment where global Promise objects are overwritten
set.create
set.toArray(set: Set<T>): Array<T>
+set.first(set: Set<T>): T
+set.from(entries: Iterable<T>): Set<T>
[lib0/sort] Efficient sort implementations. @@ -1104,6 +1152,7 @@ integrate this algorithm.

string.utf8TextEncoder
string.encodeUtf8
string.decodeUtf8
+string.splice(str: string, index: number, remove: number, insert: string)
[lib0/symbol] Utility module to work with EcmaScript Symbols. diff --git a/package-lock.json b/package-lock.json index 5ecfaed..88d7c75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lib0", - "version": "0.2.43", + "version": "0.2.44", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "lib0", - "version": "0.2.43", + "version": "0.2.44", "license": "MIT", "dependencies": { "isomorphic.js": "^0.2.4" diff --git a/package.json b/package.json index 43e551f..a886b83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lib0", - "version": "0.2.43", + "version": "0.2.44", "description": "", "sideEffects": false, "type": "module",