How to use the json-bigint 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 gridgain / gridgain / modules / web-console / frontend / app / modules / agent / decompress.worker.js View on Github external
onmessage = function(e) {
    const data = e.data;

    const binaryString = atob(data.payload); // Decode from BASE64

    const unzipped = pako.inflate(binaryString, {to: 'string'});

    const res = data.useBigIntJson
        ? bigIntJSON({storeAsString: true}).parse(unzipped)
        : JSON.parse(unzipped);

    postMessage(_.get(res, 'result', res));
};
github liquality / chainabstractionlayer / dist / index.esm.js View on Github external
// Deliberately forget the last sent value so that we don't
        // accidentally pass it on to the delegate.
        this.arg = undefined;
      }

      return ContinueSentinel;
    }
  };
})(
  // In sloppy mode, unbound `this` refers to the global object, fallback to
  // Function constructor if we're in global strict mode. That is sadly a form
  // of indirect eval which violates Content Security Policy.
  (function() { return this })() || Function("return this")()
);

var _JSONBigInt = JSONBigInt({ storeAsString: true, strict: true }),
    parse = _JSONBigInt.parse;

function prepareRequest(_ref) {
  var method = _ref.method,
      params = _ref.params;

  return JSON.stringify({
    id: Date.now(),
    method: method,
    params: params
  });
}

function praseResponse(body, headers) {
  if (typeof body === 'string' && headers['content-type'] !== 'application/json') {
    throw new Error(body);
github mlflow / mlflow / mlflow / server / js / src / sdk / MlflowService.js View on Github external
/**
 * DO NOT EDIT!!!
 *
 * @NOTE(dli) 12-21-2016
 *   This file is generated. For now, it is a snapshot of the proto services as of
 *   Aug 1, 2018 3:42:41 PM. We will update the generation pipeline to actually
 *   place these generated objects in the correct location shortly.
 */

import $ from 'jquery';
import JsonBigInt from 'json-bigint';
import Utils from "../utils/Utils";

const StrictJsonBigInt = JsonBigInt({ strict: true, storeAsString: true });

export class MlflowService {

  /**
   * @param {CreateExperiment} data: Immutable Record
   * @param {function} success
   * @param {function} error
   * @return {Promise}
   */
  static createExperiment({ data, success, error }) {
    return $.ajax(Utils.getAjaxUrl('ajax-api/2.0/preview/mlflow/experiments/create'), {
      type: 'POST',
      contentType: 'application/json; charset=utf-8',
      dataType: 'json',
      data: JSON.stringify(data),
      jsonp: false,

json-bigint

JSON.parse with bigints support

MIT
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis