3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-27 11:15:02 +00:00

configPreprocessor => configParser

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-12 00:37:07 +00:00 committed by GitHub
parent cd68a6083c
commit ddec78b929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 26 deletions

View file

@ -91,10 +91,7 @@ export function strictValidationErrorToConfigValidationError(err: StrictValidati
);
}
export function getPluginConfigPreprocessor(
blueprint: ZeppelinPlugin,
customPreprocessor?: ZeppelinPlugin["configPreprocessor"],
) {
export function getPluginConfigParser(blueprint: ZeppelinPlugin, customParser?: ZeppelinPlugin["configParser"]) {
return async (options: PluginOptions<any>, strict?: boolean) => {
// 1. Validate the basic structure of plugin config
const basicOptionsValidation = validate(BasicPluginStructureType, options);
@ -146,8 +143,8 @@ export function getPluginConfigPreprocessor(
}
// 3. Run custom preprocessor, if any
if (customPreprocessor) {
options = await customPreprocessor(options);
if (customParser) {
options = await customParser(options);
}
// 4. Merge with default options and validate/decode the entire config