@types/serialize-javascript
TypeScript definitions for serialize-javascript
Last updated 7 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/serialize-javascript 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/serialize-javascript

Summary

This package contains type definitions for serialize-javascript (https://github.com/yahoo/serialize-javascript).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serialize-javascript.

index.d.ts

declare namespace serializeJavascript {
    interface SerializeJSOptions {
        /**
         * This option is the same as the space argument that can be passed to JSON.stringify.
         * It can be used to add whitespace and indentation to the serialized output to make it more readable.
         */
        space?: string | number | undefined;
        /**
         * This option is a signal to serialize() that the object being serialized does not contain any function or regexps values.
         * This enables a hot-path that allows serialization to be over 3x faster.
         * If you're serializing a lot of data, and know its pure JSON, then you can enable this option for a speed-up.
         */
        isJSON?: boolean | undefined;
        /**
         * This option is to signal serialize() that we want to do a straight conversion, without the XSS protection.
         * This options needs to be explicitly set to true. HTML characters and JavaScript line terminators will not be escaped.
         * You will have to roll your own.
         */
        unsafe?: true | undefined;
        /**
         * This option is to signal serialize() that we do not want serialize JavaScript function.
         * Just treat function like JSON.stringify do, but other features will work as expected.
         */
        ignoreFunction?: boolean | undefined;
    }
}

/**
 * Serialize JavaScript to a superset of JSON that includes regular expressions and functions.
 * @param input data to serialize
 * @param options optional object
 * @returns serialized data
 */
declare function serializeJavascript(
    input: any,
    options?: serializeJavascript.SerializeJSOptions | number | string,
): string;

export = serializeJavascript;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Pochodaydayup, undefined-moe, and Piotr Błażejewicz.

Current Tags

  • 5.0.4                                ...           latest (2 years ago)
  • 1.5.0                                ...           ts2.0 (7 years ago)
  • 1.5.0                                ...           ts2.1 (7 years ago)
  • 1.5.0                                ...           ts2.2 (7 years ago)
  • 1.5.0                                ...           ts2.3 (7 years ago)
  • 1.5.0                                ...           ts2.4 (7 years ago)
  • 1.5.0                                ...           ts2.5 (7 years ago)
  • 1.5.0                                ...           ts2.6 (7 years ago)
  • 1.5.0                                ...           ts2.7 (7 years ago)
  • 1.5.0                                ...           ts2.8 (7 years ago)
  • 1.5.0                                ...           ts2.9 (7 years ago)
  • 4.0.0                                ...           ts3.0 (6 years ago)
  • 4.0.0                                ...           ts3.1 (6 years ago)
  • 4.0.0                                ...           ts3.2 (6 years ago)
  • 5.0.0                                ...           ts3.3 (5 years ago)
  • 5.0.0                                ...           ts3.4 (5 years ago)
  • 5.0.0                                ...           ts3.5 (5 years ago)
  • 5.0.1                                ...           ts3.6 (5 years ago)
  • 5.0.1                                ...           ts3.7 (5 years ago)
  • 5.0.2                                ...           ts3.8 (4 years ago)
  • 5.0.2                                ...           ts3.9 (4 years ago)
  • 5.0.2                                ...           ts4.0 (4 years ago)
  • 5.0.2                                ...           ts4.1 (4 years ago)
  • 5.0.2                                ...           ts4.2 (4 years ago)
  • 5.0.2                                ...           ts4.3 (4 years ago)
  • 5.0.2                                ...           ts4.4 (4 years ago)
  • 5.0.4                                ...           ts4.5 (2 years ago)
  • 5.0.4                                ...           ts4.6 (2 years ago)
  • 5.0.4                                ...           ts4.7 (2 years ago)
  • 5.0.4                                ...           ts4.8 (2 years ago)
  • 5.0.4                                ...           ts4.9 (2 years ago)
  • 5.0.4                                ...           ts5.0 (2 years ago)
  • 5.0.4                                ...           ts5.1 (2 years ago)
  • 5.0.4                                ...           ts5.2 (2 years ago)
  • 5.0.4                                ...           ts5.3 (2 years ago)
  • 5.0.4                                ...           ts5.4 (2 years ago)
  • 5.0.4                                ...           ts5.5 (2 years ago)
  • 5.0.4                                ...           ts5.6 (2 years ago)
  • 5.0.4                                ...           ts5.7 (2 years ago)

10 Versions

  • 5.0.4                                ...           2 years ago
  • 5.0.3                                ...           2 years ago
  • 5.0.2                                ...           4 years ago
  • 5.0.1                                ...           5 years ago
  • 5.0.0                                ...           5 years ago
  • 4.0.0                                ...           6 years ago
  • 1.5.0                                ...           7 years ago
  • 1.3.2                                ...           8 years ago
  • 1.3.1                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |