Skip to content

Commit 6bad29c

Browse files
author
Daniele Briggi
committed
fix(int64): process.env condition
1 parent 5ce0c23 commit 6bad29c

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

lib/drivers/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export declare const DEFAULT_PORT = 8860;
1515
* (inlcuding `lastID` from WRITE statements)
1616
* mixed - use BigInt and Number types depending on the value size
1717
*/
18-
export declare const SAFE_INTEGER_MODE: string | undefined;
18+
export declare let SAFE_INTEGER_MODE: string;
1919
/**
2020
* Configuration for SQLite cloud connection
2121
* @note Options are all lowecase so they 1:1 compatible with C SDK

lib/drivers/types.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ exports.DEFAULT_PORT = 8860;
1818
* (inlcuding `lastID` from WRITE statements)
1919
* mixed - use BigInt and Number types depending on the value size
2020
*/
21-
exports.SAFE_INTEGER_MODE = (_a = process.env['SAFE_INTEGER_MODE']) === null || _a === void 0 ? void 0 : _a.toLowerCase();
21+
exports.SAFE_INTEGER_MODE = 'number';
22+
if (typeof process !== 'undefined') {
23+
exports.SAFE_INTEGER_MODE = ((_a = process.env['SAFE_INTEGER_MODE']) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || 'number';
24+
}
2225
if (exports.SAFE_INTEGER_MODE == 'bigint') {
2326
console.debug('BigInt mode: Using Number for all INTEGER values from SQLite, including meta information from WRITE statements.');
2427
}

lib/sqlitecloud.drivers.dev.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/sqlitecloud.drivers.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sqlitecloud/drivers",
3-
"version": "1.0.505",
3+
"version": "1.0.506",
44
"description": "SQLiteCloud drivers for Typescript/Javascript in edge, web and node clients",
55
"main": "./lib/index.js",
66
"types": "./lib/index.d.ts",

src/drivers/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export const DEFAULT_PORT = 8860
1919
* (inlcuding `lastID` from WRITE statements)
2020
* mixed - use BigInt and Number types depending on the value size
2121
*/
22-
export const SAFE_INTEGER_MODE = process.env['SAFE_INTEGER_MODE']?.toLowerCase()
22+
export let SAFE_INTEGER_MODE = 'number'
23+
if (typeof process !== 'undefined') {
24+
SAFE_INTEGER_MODE = process.env['SAFE_INTEGER_MODE']?.toLowerCase() || 'number'
25+
}
2326
if (SAFE_INTEGER_MODE == 'bigint') {
2427
console.debug('BigInt mode: Using Number for all INTEGER values from SQLite, including meta information from WRITE statements.')
2528
}

0 commit comments

Comments
 (0)