How to use the json-bigint.stringify function in json-bigint

To help you get started, we’ve selected a few json-bigint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fireworq / fireworqonsole / client / routing / Container.tsx View on Github external
public async asyncPutRouting(jobCategory: string, queueName: string): Promise {
    this.dispatch(saveStarted(jobCategory));
    try {
      const path = '/api/routing/' + encodeURIComponent(jobCategory);
      const response: Response = await fetch(path, {
        method: 'PUT',
        body: JSON.stringify({ queue_name: queueName })
      });
      if (!response.ok) {
        throw new Error(`Request to ${path} failed with status code ${response.status}`);
      }
    } catch (err) {
      console.error(err);
    } finally {
      this.dispatch(saveFinished(jobCategory, queueName));
      history.push('/routing/' + encodeURIComponent(jobCategory));
      this.asyncGetRouting(jobCategory);
    }
  }
github fireworq / fireworqonsole / client / queue / Container.tsx View on Github external
public async asyncPutQueue(queueName: string, args: any): Promise {
    this.dispatch(saveStarted(queueName));
    try {
      const path = '/api/queue/' + encodeURIComponent(queueName);
      const response: Response = await fetch(path, {
        method: 'PUT',
        body: JSON.stringify(args)
      });
      if (!response.ok) {
        throw new Error(`Request to ${path} failed with status code ${response.status}`);
      }
    } catch (err) {
      console.error(err);
    } finally {
      this.dispatch(saveFinished(queueName));
      history.push('/queue/' + encodeURIComponent(queueName));
      this.asyncGetQueue(queueName);
    }
  }
github mosaicnetworks / evm-babble / demo / nodejs / demo.js View on Github external
contribute = function(from, wei_amount) {
    callData = _cfContract.w3.contribute.getData();
    log(FgMagenta, util.format('contribute() callData: %s', callData))

    tx = {
        from: from.accounts[0].address,
        to: _cfContract.address,
        gaz:1000000,
        gazPrice:0,
        value:wei_amount,
        data: callData
    }
    stx = JSONbig.stringify(tx)
    log(FgBlue, 'Sending Contract-Method Tx: ' + stx)
    
    return from.api.sendTx(stx).then( (res) => {
        log(FgGreen, 'Response: ' + res)
        txHash = JSONbig.parse(res).txHash.replace("\"", "")
        return txHash
    })
    .then( (txHash) => {
        return sleep(2000).then(() => {
            log(FgBlue, 'Requesting Receipt')
            return from.api.getReceipt(txHash)
        })
    }) 
    .then( (receipt) => {
        log(FgGreen, 'Tx Receipt: ' + receipt)
github apache / incubator-superset / superset / assets / src / components / FilterableTable / FilterableTable.jsx View on Github external
const formattedData = data.map(row => {
      const newRow = {};
      for (const k in row) {
        const val = row[k];
        if (['string', 'number'].indexOf(typeof val) >= 0) {
          newRow[k] = val;
        } else {
          newRow[k] = val === null ? null : JSONbig.stringify(val);
        }
      }
      return newRow;
    });
    return formattedData;
github hjespers / teslams / examples / restla.js View on Github external
function pr(stuff) {
        res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
        res.setHeader("Pragma", "no-cache");
        res.setHeader("Expires", 0);
        res.writeHead(200, {'Content-Type': 'application/json'});
        res.end(JSONbig.stringify(stuff));
    }
github mallocator / Elasticsearch-Exporter / drivers / file.driver.js View on Github external
putMeta(env, metadata, callback) {
        let taskParams = [];
        for (let index in metadata.mappings) {
            let types = metadata.mappings[index];
            for (let type in types) {
                let mapping = types[type];
                taskParams.push([index, type, 'mapping', JSON.stringify(mapping, null, 2)]);
            }
        }
        for (let index in metadata.settings) {
            let setting = metadata.settings[index];
            taskParams.push([index, null, 'settings', JSON.stringify(setting, null, 2)]);
        }
        async.map(taskParams, (item, callback) => {
            log.debug('Writing %s for index [%s] type [%s]', item[2], item[0], item[1]);
            this.archive.write(env.options.target.file, true, item[0], item[1], item[2], item[3], callback);
        }, callback);
    }
github pingcap / br / web / src / InfoPage.tsx View on Github external
render() {
        const { classes } = this.props;
        return (
            <div>
                
                    <div>
                    
                        Current
                        {this.props.taskQueue.current !== null &amp;&amp; this.renderListItem(this.props.taskQueue.current, false)}
                        Queue
                        {this.props.taskQueue.queue.map(n =&gt; this.renderListItem(n, true))}
                    
                
                
                    {JSONBigInt.stringify(this.state.taskCfg, undefined, 2)}
                
            </div>
        )
    }
}</div>
github fireworq / fireworqonsole / client / failed-job / FailedJob.tsx View on Github external
<dd><span>{job.url}</span></dd>

          <dt>Status</dt>
          <dd>{job.status}</dd>

          <dt>Claimed at</dt>
          <dd></dd>

          <dt>Failed at</dt>
          <dd></dd>

          <dt>Tried</dt>
          <dd>{job.failCount}</dd>

          <dt>Payload</dt>
          <dd><pre>{JSON.stringify(job.payload)}</pre></dd>

          <dt>HTTP status</dt>
          <dd><span>{job.result.code}</span></dd>

          <dt>HTTP body</dt>
          <dd><pre>{job.result.message}</pre></dd>
        
        <div>
          
          
        </div>
      
    );

    if (this.props.value.loadingCount !== 0) {
      jobInfo = <div><div></div>;</div>
github mosaicnetworks / evm-babble / demo / nodejs / cfdemo.js View on Github external
checkGoalReached = function() {
    callData = cfContract.w3.checkGoalReached.getData();
    log(FgMagenta, util.format('checkGoalReached() callData: %s', callData))

    tx = {
        from: demoNodes[0].accounts[0].Address,
        gaz:1000000,
        gazPrice:0,
        value:0,
        to: cfContract.address,
        data: callData
    }
    stx = JSONbig.stringify(tx)
    log(FgBlue, 'Calling Contract Method: ' + stx)
    return demoNodes[0].api.call(stx).then( (res) => {
        res = JSONbig.parse(res)
        log(FgBlue, 'res: ' + res.Data)
        hexRes = Buffer.from(res.Data).toString()
        log(FgBlue, 'Hex res: ' + hexRes)
        
        unpacked = cfContract.parseOutput('checkGoalReached', hexRes)

        log(FgGreen, 'Parsed res: ' + unpacked.toString())
    })
}
github mosaicnetworks / evm-babble / demo / nodejs / demo.js View on Github external
checkGoalReached = function(from) {
    callData = _cfContract.w3.checkGoalReached.getData();
    log(FgMagenta, util.format('checkGoalReached() callData: %s', callData))

    tx = {
        from: from.accounts[0].address,
        value:0,
        to: _cfContract.address,
        data: callData
    }
    stx = JSONbig.stringify(tx)
    log(FgBlue, 'Calling Contract Method: ' + stx)
    return from.api.call(stx).then( (res) => {
        res = JSONbig.parse(res)
        log(FgBlue, 'res: ' + res.data)
        hexRes = Buffer.from(res.data).toString()

        unpacked = _cfContract.parseOutput('checkGoalReached', hexRes)

        log(FgGreen, 'Parsed res: ' + unpacked.toString())
    })
}

json-bigint

JSON.parse with bigints support

MIT
Latest version published 4 years ago

Package Health Score

69 / 100
Full package analysis