braid-http 1.3.81 → 1.3.83
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/braid-http-client.js +10 -3
- package/braid-http-server.js +1 -0
- package/package.json +1 -1
package/braid-http-client.js
CHANGED
|
@@ -557,16 +557,23 @@ var subscription_parser = (cb) => ({
|
|
|
557
557
|
for (var k in update)
|
|
558
558
|
if (update[k] === undefined) delete update[k]
|
|
559
559
|
|
|
560
|
+
var body_text_cache = null
|
|
560
561
|
Object.defineProperty(update, 'body_text', {
|
|
561
562
|
get: function () {
|
|
562
|
-
if (
|
|
563
|
-
|
|
563
|
+
if (body_text_cache !== null) return body_text_cache
|
|
564
|
+
return body_text_cache = this.body != null ?
|
|
565
|
+
new TextDecoder('utf-8').decode(this.body.buffer) : undefined
|
|
564
566
|
}
|
|
565
567
|
})
|
|
566
568
|
|
|
567
569
|
for (let p of update.patches ?? []) {
|
|
570
|
+
let content_text_cache = null
|
|
568
571
|
Object.defineProperty(p, 'content_text', {
|
|
569
|
-
get: () =>
|
|
572
|
+
get: () => {
|
|
573
|
+
if (content_text_cache !== null) return content_text_cache
|
|
574
|
+
return content_text_cache =
|
|
575
|
+
new TextDecoder('utf-8').decode(p.content)
|
|
576
|
+
}
|
|
570
577
|
})
|
|
571
578
|
}
|
|
572
579
|
|
package/braid-http-server.js
CHANGED