devalue

  • Version 5.0.0
  • Published
  • 25.9 kB
  • No dependencies
  • MIT license

Install

npm i devalue
yarn add devalue
pnpm add devalue

Overview

Gets the job done when JSON.stringify can't

Index

Namespaces

namespace devalue

module 'devalue' {}

    function parse

    parse: (
    serialized: string,
    revivers?: Record<string, (value: any) => any>
    ) => any;
    • Revive a value serialized with devalue.stringify

    function stringify

    stringify: (
    value: any,
    reducers?: Record<string, (value: any) => any>
    ) => string;
    • Turn a value into a JSON string that can be parsed with devalue.parse

    function uneval

    uneval: (value: any, replacer?: (value: any) => string | void) => string;
    • Turn a value into the JavaScript that creates an equivalent value

    function unflatten

    unflatten: (
    parsed: number | any[],
    revivers?: Record<string, (value: any) => any>
    ) => any;
    • Revive a value flattened with devalue.stringify

    Package Files (1)

    Dependencies (0)

    No dependencies.

    Dev Dependencies (4)

    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/devalue.

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