braid-text 0.2.27 → 0.2.28
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 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -808,6 +808,11 @@ function dt_len(doc, version) {
|
|
|
808
808
|
}
|
|
809
809
|
|
|
810
810
|
function dt_get_string(doc, version) {
|
|
811
|
+
// optimization: if version is the latest,
|
|
812
|
+
// then return the current text..
|
|
813
|
+
if (v_eq(version, doc.getRemoteVersion().map((x) => x.join("-")).sort()))
|
|
814
|
+
return doc.get()
|
|
815
|
+
|
|
811
816
|
var bytes = doc.toBytes()
|
|
812
817
|
var oplog = OpLog.fromBytes(bytes)
|
|
813
818
|
|