From 62fc10c34934d0b53ea4ce01045806de09522ee6 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Tue, 2 Apr 2019 14:00:20 +0200 Subject: [PATCH 1/4] fix: predicate is a function and not a string --- types/js-yaml/index.d.ts | 4 ++-- types/js-yaml/js-yaml-tests.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index b59741e74e..24a8a7f278 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -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; }; diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 304da7731d..44cf825205 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -23,7 +23,7 @@ const typeConstructorOptions: TypeConstructorOptions = { resolve: fn, construct: fn, instanceOf: obj, - predicate: str, + predicate: (obj) => true, 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; From a96fe9b098d290e8db3d3c8d5cc07d069865f482 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Tue, 2 Apr 2019 14:10:55 +0200 Subject: [PATCH 2/4] fix: lint --- types/js-yaml/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 24a8a7f278..54ae308639 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -15,7 +15,7 @@ export class Type { resolve(data: any): boolean; construct(data: any): any; instanceOf: object | null; - predicate: (data:object) => boolean | 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?: (data:object) => boolean; + predicate?: (data: object) => boolean; represent?: ((data: object) => any) | { [x: string]: (data: object) => any }; defaultStyle?: string; styleAliases?: { [x: string]: any; }; From 1156e25a0e13ccc829b40ad2853e9cfe6fc0efe1 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Tue, 2 Apr 2019 14:17:01 +0200 Subject: [PATCH 3/4] fix: test --- types/js-yaml/js-yaml-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 44cf825205..7421410d5f 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -104,7 +104,7 @@ type.resolve; type.construct; // $ExpectType object | null type.instanceOf; -// $ExpectType (data:object) => boolean | null +// $ExpectType ((data: object) => boolean) | null type.predicate; // $ExpectType ((data: object) => any) | { [x: string]: (data: object) => any; } | null type.represent; From adb8dcbb940db70492964d38566323c4746712a4 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Tue, 2 Apr 2019 14:37:11 +0200 Subject: [PATCH 4/4] test: trigger test again --- types/js-yaml/js-yaml-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 7421410d5f..024054a6fb 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -23,7 +23,7 @@ const typeConstructorOptions: TypeConstructorOptions = { resolve: fn, construct: fn, instanceOf: obj, - predicate: (obj) => true, + predicate: (obj) => false, represent: fn, defaultStyle: str, styleAliases: map