comment-to-assert
Version:
convert line comment to assert.
16 lines (15 loc) • 594 B
TypeScript
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;