Merge pull request #3414 from elo7/async-preprocess

Change type of preprocessor functions to include Promise
pull/3416/head
Rich Harris 5 years ago committed by GitHub
commit 17a26edb5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,7 @@ export interface PreprocessorGroup {
markup?: (options: { markup?: (options: {
content: string; content: string;
filename: string; filename: string;
}) => Processed; }) => Processed | Promise<Processed>;
style?: Preprocessor; style?: Preprocessor;
script?: Preprocessor; script?: Preprocessor;
} }
@ -17,7 +17,7 @@ export type Preprocessor = (options: {
content: string; content: string;
attributes: Record<string, string | boolean>; attributes: Record<string, string | boolean>;
filename?: string; filename?: string;
}) => Processed; }) => Processed | Promise<Processed>;
function parse_attributes(str: string) { function parse_attributes(str: string) {
const attrs = {}; const attrs = {};

Loading…
Cancel
Save