react-native-appwrite 0.24.0 → 0.24.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change log
2
2
 
3
+ ## 0.24.1
4
+
5
+ * Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals.
6
+
3
7
  ## 0.24.0
4
8
 
5
9
  * Added Query.contains, Query.containsAny, and Query.containsAll for enhanced filtering capabilities.
package/dist/cjs/sdk.js CHANGED
@@ -82,6 +82,8 @@ const JSONbigParser = JSONbigModule__default["default"]({ storeAsString: false }
82
82
  const JSONbigSerializer = JSONbigModule__default["default"]({ useNativeBigInt: true });
83
83
  const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
84
84
  const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
85
+ const MAX_INT64 = BigInt('9223372036854775807');
86
+ const MIN_INT64 = BigInt('-9223372036854775808');
85
87
  function isBigNumber(value) {
86
88
  return value !== null
87
89
  && typeof value === 'object'
@@ -98,7 +100,10 @@ function reviver(_key, value) {
98
100
  if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
99
101
  return Number(str);
100
102
  }
101
- return bi;
103
+ if (bi >= MIN_INT64 && bi <= MAX_INT64) {
104
+ return bi;
105
+ }
106
+ return value.toNumber();
102
107
  }
103
108
  return value.toNumber();
104
109
  }
@@ -134,7 +139,7 @@ class Client {
134
139
  'x-sdk-name': 'React Native',
135
140
  'x-sdk-platform': 'client',
136
141
  'x-sdk-language': 'reactnative',
137
- 'x-sdk-version': '0.24.0',
142
+ 'x-sdk-version': '0.24.1',
138
143
  'X-Appwrite-Response-Format': '1.8.0',
139
144
  };
140
145
  this.realtime = {