@types/json-stable-stringify

  • Version 1.0.36
  • Published
  • 4.67 kB
  • No dependencies
  • MIT license

Install

npm i @types/json-stable-stringify
yarn add @types/json-stable-stringify
pnpm add @types/json-stable-stringify

Overview

TypeScript definitions for json-stable-stringify

Index

Functions

function stringify

stringify: (obj: any, opts?: stringify.Comparator | stringify.Options) => string;
  • Deterministic version of JSON.stringify() so you can get a consistent hash from stringified results.

    Returns

    Deterministic json result.

Interfaces

interface Element

interface Element {}

    property key

    key: string;

      property value

      value: any;

        interface Options

        interface Options {}

          property cmp

          cmp?: Comparator;
          • Custom comparator for key

          property cycles

          cycles?: boolean;
          • true to allow cycles, by marking the entries as __cycle__.

          property replacer

          replacer?: Replacer;
          • Option to replace values to simpler values

          property space

          space?: string | number;
          • Indent the output for pretty-printing.

            Supported is either a string or a number of spaces.

          Type Aliases

          type Comparator

          type Comparator = (a: Element, b: Element) => number;

            type Replacer

            type Replacer = (key: string, value: any) => any;

              Package Files (1)

              Dependencies (0)

              No dependencies.

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.

              Badge

              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/json-stable-stringify.

              • Markdown
                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/json-stable-stringify)
              • HTML
                <a href="https://www.jsdocs.io/package/@types/json-stable-stringify"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>