@augment-vir/common
Version:
A collection of augments, helpers types, functions, and classes for any JavaScript environment.
32 lines (31 loc) • 728 B
TypeScript
import { type Jsonify } from 'type-fest';
/**
* Creates a JSON compatible version of the value given. Under the hood this is actually the same as
* {@link copyThroughJson}.
*
* @category JSON : Common
* @category Package : @augment-vir/common
* @example
*
* ```ts
* import {jsonify} from '@augment-vir/common';
*
* // `result` is `{b: 'b'}`
* const result = jsonify({
* map: new Map([
* [
* 'q',
* 'r',
* ],
* [
* 's',
* 't',
* ],
* ]),
* b: 'b',
* });
* ```
*
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
*/
export declare function jsonify<T>(value: T): Jsonify<T>;