Skip to content

Commit d287ed8

Browse files
authored
Merge pull request #90 from appwrite/dev
2 parents 9815530 + 99a01d7 commit d287ed8

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change log
22

3+
## 0.24.1
4+
5+
* Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals.
6+
37
## 0.24.0
48

59
* Added Query.contains, Query.containsAny, and Query.containsAll for enhanced filtering capabilities.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-native-appwrite",
33
"homepage": "https://appwrite.io/support",
44
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
5-
"version": "0.24.0",
5+
"version": "0.24.1",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {

src/client.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
88

99
const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
1010
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
11+
const MAX_INT64 = BigInt('9223372036854775807');
12+
const MIN_INT64 = BigInt('-9223372036854775808');
1113

1214
function isBigNumber(value: any): boolean {
1315
return value !== null
@@ -26,7 +28,10 @@ function reviver(_key: string, value: any): any {
2628
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
2729
return Number(str);
2830
}
29-
return bi;
31+
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
32+
return bi;
33+
}
34+
return value.toNumber();
3035
}
3136
return value.toNumber();
3237
}
@@ -153,7 +158,7 @@ class Client {
153158
'x-sdk-name': 'React Native',
154159
'x-sdk-platform': 'client',
155160
'x-sdk-language': 'reactnative',
156-
'x-sdk-version': '0.24.0',
161+
'x-sdk-version': '0.24.1',
157162
'X-Appwrite-Response-Format': '1.8.0',
158163
};
159164

0 commit comments

Comments
 (0)