UNPKG

comment-to-assert

Version:
16 lines (15 loc) 594 B
import { type ParserOptions } from "@babel/parser"; import { type File } from "@babel/types"; import { type wrapAssertOptions } from "./ast-utils.js"; export type toAssertFromSourceOptions = { babel?: ParserOptions; } & wrapAssertOptions; /** * transform code to asserted code * if want to source map, use toAssertFromAST. */ export declare function toAssertFromSource(code: string, options?: toAssertFromSourceOptions): string | null | undefined; /** * transform AST to asserted AST. */ export declare function toAssertFromAST<T extends File>(ast: T, options?: wrapAssertOptions): T;