braid-text 0.2.31 → 0.2.32
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/index.js +5 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -911,23 +911,18 @@ function dt_get_patches(doc, version = null) {
|
|
|
911
911
|
if (version && v_eq(version,
|
|
912
912
|
doc.getRemoteVersion().map((x) => x.join("-")).sort())) {
|
|
913
913
|
// they want everything past the end, which is nothing
|
|
914
|
-
} else if (version) {
|
|
914
|
+
} else if (version?.length) {
|
|
915
915
|
let frontier = {}
|
|
916
916
|
version.forEach((x) => frontier[x] = true)
|
|
917
917
|
let local_version = []
|
|
918
918
|
for (let i = 0; i < versions.length; i++)
|
|
919
919
|
if (frontier[versions[i].join("-")]) local_version.push(i)
|
|
920
|
-
let after_bytes = doc.getPatchSince(new Uint32Array(local_version))
|
|
921
920
|
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
let before_doc = dt_get(doc, version)
|
|
925
|
-
let before_doc_frontier = before_doc.getLocalVersion()
|
|
921
|
+
local_version = new Uint32Array(local_version)
|
|
926
922
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
before_doc.free()
|
|
923
|
+
let after_bytes = doc.getPatchSince(local_version)
|
|
924
|
+
;[_agents, versions, parentss] = dt_parse([...after_bytes])
|
|
925
|
+
op_runs = doc.getOpsSince(local_version)
|
|
931
926
|
} else op_runs = doc.getOpsSince([])
|
|
932
927
|
|
|
933
928
|
doc.free()
|