@martijnnieuwenhuizen/generate-component
Version:
Automate component generation
20 lines (18 loc) • 441 B
JavaScript
/**
* Generate a empty prepare function.
*
* @returns string
*/
export default () =>
`import type ComponentInterface from "./interface";
import type { PreparedComponentInterface } from "./interface";
import type { WPPost } from "../../../content/api-interfaces";
export default async function prepare(
props: ComponentInterface,
page: WPPost
): Promise<PreparedComponentInterface> {
return {
...props,
};
}
`;