Skip to content

Commit f4051c5

Browse files
authored
Merge pull request #158 from appwrite/dev
2 parents 068e1aa + f4d1074 commit f4051c5

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

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+
## 22.4.1
4+
5+
* Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals
6+
37
## 22.4.0
48

59
* Added Query.containsAny(attribute, value[]) to filter resources where the attribute contains any of the given values.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
3333
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
3434

3535
```html
36-
<script src="https://cdn.jsdelivr.net/npm/appwrite@22.4.0"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/appwrite@22.4.1"></script>
3737
```
3838

3939

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "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": "22.4.0",
5+
"version": "22.4.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
@@ -7,6 +7,8 @@ const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
77

88
const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
99
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
10+
const MAX_INT64 = BigInt('9223372036854775807');
11+
const MIN_INT64 = BigInt('-9223372036854775808');
1012

1113
function isBigNumber(value: any): boolean {
1214
return value !== null
@@ -25,7 +27,10 @@ function reviver(_key: string, value: any): any {
2527
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
2628
return Number(str);
2729
}
28-
return bi;
30+
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
31+
return bi;
32+
}
33+
return value.toNumber();
2934
}
3035
return value.toNumber();
3136
}
@@ -387,7 +392,7 @@ class Client {
387392
'x-sdk-name': 'Web',
388393
'x-sdk-platform': 'client',
389394
'x-sdk-language': 'web',
390-
'x-sdk-version': '22.4.0',
395+
'x-sdk-version': '22.4.1',
391396
'X-Appwrite-Response-Format': '1.8.0',
392397
};
393398

0 commit comments

Comments
 (0)