How to use the flatted/cjs.stringify function in flatted

To help you get started, we’ve selected a few flatted 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 mvolkmann / redux-easy / src / redux-easy.js View on Github external
export function saveState(state) {
  if (sessionStorageOptOut) return;
  try {
    const json = stringify(replacerFn(state));
    sessionStorage.setItem(STATE_KEY, json);
  } catch (e) {
    // istanbul ignore next
    if (!silent) console.error('redux-util saveState:', e.message);
    throw e;
  }
}
github embark-framework / embark / src / lib / core / ipc.js View on Github external
reply(client, action, error, data) {
    const message = stringify({action, data, error: (error && error.stack)});
    this.server.emit(client, 'message', message);
  }
github embark-framework / embark / src / lib / core / ipc.js View on Github external
request(action, data, cb) {
    if (!this.connected) {
      cb = cb || (() => {});
      return cb();
    }
    if (cb) {
      this.once(action, cb);
    }
    this.client.emit('message', stringify({action: action, data: data}));
  }
github 1cgonza / dddrawings / tasks / hbs-helpers / debug.js View on Github external
export default context => {
  return new SafeString('<pre class="debug"><code class="json">' + stringify(context, null, 2) + '</code></pre>');
};
github embark-framework / embark / src / lib / core / ipc.js View on Github external
broadcast(action, data) {
    ipc.server.broadcast(action, stringify(data));
  }
github Vermonster / fhir-kit-client / lib / logging.js View on Github external
function inspectObject(obj) {
  return stringify(obj);
}
github lonelyhentai / minellius / server / src / auth / services / auth.service.ts View on Github external
async githubSignIn(access_token: string): Promise {
    Logger.log(access_token, AuthService.name + ':githubSignIn');
    const uriToken = `${this.localUri}/api/auth/github/token`;
    try {
      const res = await this.httpService
        .post(uriToken, { access_token })
        .toPromise();
      return res.data;
    } catch (error) {
      const newError = new HttpException(error.response.data, error.response.status);
      Logger.error(stringify(newError), undefined, AuthService.name + ':githubSignIn');
      throw newError;
    }
  }
github WTMBerlin / jscc2019 / week-5 / services / base-service.js View on Github external
return new Promise((resolve, reject) => {
      fs.writeFile(this.dbPath, Flatted.stringify(items), (err, file) => {
        if (err) return reject(err)

        resolve()
      })
    })
  }

flatted

A super light and fast circular JSON parser.

ISC
Latest version published 3 days ago

Package Health Score

77 / 100
Full package analysis