braid-text 0.2.8 → 0.2.9

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 (3) hide show
  1. package/index.js +1 -2
  2. package/package.json +1 -1
  3. package/test.html +5 -18
package/index.js CHANGED
@@ -207,8 +207,7 @@ braid_text.serve = async (req, res, options = {}) => {
207
207
  }
208
208
 
209
209
  braid_text.delete = async (key) => {
210
- let resource = (typeof key == 'string') ? await get_resource(key) : key
211
- await resource.delete_me()
210
+ await braid_text.put(key, {body: ''})
212
211
  }
213
212
 
214
213
  braid_text.get = async (key, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Library for collaborative text over http using braid.",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braidjs",
package/test.html CHANGED
@@ -110,31 +110,18 @@ runTest(
110
110
  async () => {
111
111
  let key = 'test-' + Math.random().toString(36).slice(2)
112
112
 
113
- let r0 = (await (await fetch(`/test.html?check=/${key}`)).json()).result
114
-
115
113
  await fetch(`/${key}`, {
116
114
  method: 'PUT',
117
- body: JSON.stringify({a: 5, b: 6}, null, 4)
118
- })
119
-
120
- let r1 = (await (await fetch(`/test.html?check=/${key}`)).json()).result
121
-
122
- await fetch(`/${key}`, {
123
- method: 'DELETE'
115
+ body: 'hi'
124
116
  })
125
117
 
126
- let r2 = (await (await fetch(`/test.html?check=/${key}`)).json()).result
118
+ await fetch(`/${key}`, {method: 'DELETE'})
127
119
 
128
- await fetch(`/${key}`, {
129
- method: 'PUT',
130
- body: JSON.stringify({a: 5, b: 7}, null, 4)
131
- })
132
-
133
- let r3 = (await (await fetch(`/test.html?check=/${key}`)).json()).result
120
+ let r = await fetch(`/${key}`)
134
121
 
135
- return JSON.stringify([r0, r1, r2, r3])
122
+ return await r.text()
136
123
  },
137
- JSON.stringify([false, true, false, true])
124
+ ''
138
125
  )
139
126
 
140
127
  runTest(