ZeppelinPluginBlueprint.configSchema is now required. Validate deep partial config schema before running config preprocessor.

This commit is contained in:
Dragory 2020-07-30 20:10:50 +03:00
parent 3265a2a8da
commit f6d55f1060
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
10 changed files with 50 additions and 12 deletions

View file

@ -29,7 +29,7 @@ import https from "https";
import tmp from "tmp";
import { helpers } from "knub";
import { SavedMessage } from "./data/entities/SavedMessage";
import { decodeAndValidateStrict, StrictValidationError } from "./validatorUtils";
import { decodeAndValidateStrict, StrictValidationError, validate } from "./validatorUtils";
import { either } from "fp-ts/lib/Either";
import moment from "moment-timezone";
import { SimpleCache } from "./SimpleCache";
@ -103,7 +103,7 @@ export interface TDeepPartialProps<P extends t.Props>
> {}
export function tDeepPartial<T>(type: T): TDeepPartial<T> {
if (type instanceof t.InterfaceType) {
if (type instanceof t.InterfaceType || type instanceof t.PartialType) {
const newProps = {};
for (const [key, prop] of Object.entries(type.props)) {
newProps[key] = tDeepPartial(prop);