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.
Files changed (2) hide show
  1. package/index.js +5 -0
  2. 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.2.27",
3
+ "version": "0.2.28",
4
4
  "description": "Library for collaborative text over http using braid.",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braid-text",