@types/quick-format-unescaped
TypeScript icon, indicating that this package has built-in type declarations

4.0.3 • Public • Published

Installation

npm install --save @types/quick-format-unescaped

Summary

This package contains type definitions for quick-format-unescaped (https://github.com/davidmarkclements/quick-format-unescaped#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/quick-format-unescaped.

index.d.ts

/**
 * Alternative to NodeJS `util.format`. Does not escape strings.
 * @description Uses `JSON.stringify` instead of `util.inspect`, this means functions _will not be serialized_.
 * @param fmt A printf-like format string. Example: `'hello %s %j %d'`
 * @param parameters Values to be inserted into the `fmt` string. Example: `['world', {obj:true}]`
 * @param options Passing an options object as the third parameter with a `stringify` will mean any objects will be passed
 * to the supplied function instead of an the internal `tryStringify` function. This can be useful when using augmented
 * capability serializers such as `fast-safe-stringify` or `fast-redact`.
 * @example
 * format('hello %s %o', ['world', {obj: true}])
 * // 'hello world {"obj": true}'
 */
declare function format(fmt: string, parameters: readonly unknown[], options?: format.Options): string;

declare namespace format {
    interface Options {
        /**
         * Function that stringifies objects.
         */
        stringify: (o: unknown) => string;
    }
}

export = format;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Adam Vigneaux.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/quick-format-unescaped

Weekly Downloads

4,694

Version

4.0.3

License

MIT

Unpacked Size

4.79 kB

Total Files

5

Last publish

Collaborators

  • types