fix typings for parse option
This commit is contained in:
parent
c6ba1e536b
commit
7abd77d8d4
|
@ -6,10 +6,7 @@
|
|||
|
||||
export interface JsonModulesPluginParserOptions {
|
||||
/**
|
||||
* Function that executes for a module source string and should return json-compatible string or JS object
|
||||
* Function that executes for a module source string and should return json-compatible data
|
||||
*/
|
||||
parse?: (
|
||||
input: string,
|
||||
module: import("../../lib/Module")
|
||||
) => string | object;
|
||||
parse?: (input: string) => any;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ class JsonParser extends Parser {
|
|||
source = source.toString("utf-8");
|
||||
}
|
||||
|
||||
/** @type {JsonModulesPluginParserOptions["parse"]} */
|
||||
const parseFn =
|
||||
typeof this.options.parse === "function" ? this.options.parse : parseJson;
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"parse": {
|
||||
"description": "Function that executes for a module source string and should return json-compatible string or JS object",
|
||||
"description": "Function that executes for a module source string and should return json-compatible data",
|
||||
"instanceof": "Function",
|
||||
"tsType": "((input: string, module: import('../../lib/Module')) => string|object)"
|
||||
"tsType": "((input: string) => any)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue