@kedaruma/revlm-client 1.0.38 → 1.0.40

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/dist/index.js CHANGED
@@ -224,11 +224,8 @@ var Revlm = class {
224
224
  try {
225
225
  return import_bson.EJSON.parse(text);
226
226
  } catch (e) {
227
- }
228
- try {
229
- return JSON.parse(text);
230
- } catch (e) {
231
- return text;
227
+ const preview = text.length > 200 ? `${text.slice(0, 200)}...` : text;
228
+ throw new Error(`Invalid EJSON response: ${preview}`);
232
229
  }
233
230
  }
234
231
  async request(path, method = "POST", body) {
package/dist/index.mjs CHANGED
@@ -181,11 +181,8 @@ var Revlm = class {
181
181
  try {
182
182
  return EJSON.parse(text);
183
183
  } catch (e) {
184
- }
185
- try {
186
- return JSON.parse(text);
187
- } catch (e) {
188
- return text;
184
+ const preview = text.length > 200 ? `${text.slice(0, 200)}...` : text;
185
+ throw new Error(`Invalid EJSON response: ${preview}`);
189
186
  }
190
187
  }
191
188
  async request(path, method = "POST", body) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kedaruma/revlm-client",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "private": false,
5
5
  "description": "TypeScript client SDK for talking to the Revlm server replacement for MongoDB Realm.",
6
6
  "keywords": [
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "bson": "^6.10.4",
50
50
  "dotenv": "^17.2.3",
51
- "@kedaruma/revlm-shared": "1.0.7"
51
+ "@kedaruma/revlm-shared": "1.0.8"
52
52
  },
53
53
  "devDependencies": {
54
54
  "tsup": "^8.5.1"