Merge pull request #34395 from jaulz/fix/js-yaml

fix(js-yaml): predicate is a function and not a string
This commit is contained in:
Benjamin Lichtman
2019-04-02 16:14:58 -07:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ export class Type {
resolve(data: any): boolean;
construct(data: any): any;
instanceOf: object | null;
predicate: string | null;
predicate: ((data: object) => boolean) | null;
represent: ((data: object) => any) | { [x: string]: (data: object) => any; } | null;
defaultStyle: string | null;
styleAliases: { [x: string]: any; };
@@ -82,7 +82,7 @@ export interface TypeConstructorOptions {
resolve?: (data: any) => boolean;
construct?: (data: any) => any;
instanceOf?: object;
predicate?: string;
predicate?: (data: object) => boolean;
represent?: ((data: object) => any) | { [x: string]: (data: object) => any };
defaultStyle?: string;
styleAliases?: { [x: string]: any; };

View File

@@ -23,7 +23,7 @@ const typeConstructorOptions: TypeConstructorOptions = {
resolve: fn,
construct: fn,
instanceOf: obj,
predicate: str,
predicate: (obj) => false,
represent: fn,
defaultStyle: str,
styleAliases: map
@@ -104,7 +104,7 @@ type.resolve;
type.construct;
// $ExpectType object | null
type.instanceOf;
// $ExpectType string | null
// $ExpectType ((data: object) => boolean) | null
type.predicate;
// $ExpectType ((data: object) => any) | { [x: string]: (data: object) => any; } | null
type.represent;