fix: bigint

This commit is contained in:
Richard Ramos 2023-01-03 14:57:48 -04:00
parent a32ebd6bd2
commit 6dea7bb417
No known key found for this signature in database
GPG Key ID: 1CE87DB518195760
3 changed files with 14 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@waku/react-native",
"version": "0.0.9",
"version": "0.0.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@waku/react-native",
"version": "0.0.9",
"version": "0.0.11",
"license": "MIT",
"dependencies": {
"base-64": "^1.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@waku/react-native",
"version": "0.0.10",
"version": "0.0.11",
"description": "Waku React Native",
"author": "Status Research & Development GMBH",
"authors": [

View File

@ -166,7 +166,10 @@ export function relayPublish(
timeoutMs: Number = 0
): Promise<string> {
return new Promise<string>(async (resolve, reject) => {
let messageJSON = JSON.stringify(msg);
let messageJSON = JSON.stringify(msg).replace(
/"timestamp":"([0-9]+)"/,
`"timestamp":$1`
);
let response = JSON.parse(
await ReactNative.relayPublish(messageJSON, pubsubTopic, timeoutMs)
);
@ -516,7 +519,10 @@ export function lightpushPublish(
timeoutMs: Number = 0
): Promise<string> {
return new Promise<string>(async (resolve, reject) => {
let messageJSON = JSON.stringify(msg);
let messageJSON = JSON.stringify(msg).replace(
/"timestamp":"([0-9]+)"/,
`"timestamp":$1`
);
let response = JSON.parse(
await ReactNative.lightpushPublish(
messageJSON,
@ -722,7 +728,9 @@ export function storeQuery(
? bigInt(query.endTime.valueOf()).multiply(OneMillion).toString(10)
: 0,
pagingOptions: query.pagingOptions,
});
})
.replace(/"startTime":"([0-9]+)"/, `"startTime":$1`)
.replace(/"endTime":"([0-9]+)"/, `"endTime":$1`);
let response = JSON.parse(
await ReactNative.storeQuery(queryJSON, peerID, timeoutMs)
);