estree-util-value-to-estree
Version:
Convert a JavaScript value to an estree expression
28 lines • 824 B
TypeScript
import { type Expression } from 'estree';
export interface Options {
/**
* If true, treat objects that have a prototype as plain objects.
*
* @default false
*/
instanceAsObject?: boolean;
/**
* If true, preserve references to the same object found within the input. This also allows to
* serialize recursive structures. If needed, the resulting expression will be an iife.
*
* @default false
*/
preserveReferences?: boolean;
}
/**
* Convert a value to an ESTree node.
*
* @param value
* The value to convert.
* @param options
* Additional options to configure the output.
* @returns
* The ESTree node.
*/
export declare function valueToEstree(value: unknown, options?: Options): Expression;
//# sourceMappingURL=estree-util-value-to-estree.d.ts.map