Enable strictNullChecks

This commit is contained in:
segayuu
2017-11-14 11:49:52 +09:00
parent f5c566a7fd
commit 3860b64345
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
export function safeLoad(str: string, opts?: LoadOptions): any;
export function load(str: string, opts?: LoadOptions): any;
export class Type implements TypeConstructorOptions {
export class Type {
constructor(tag: string, opts?: TypeConstructorOptions);
kind: 'sequence' | 'scalar' | 'mapping' | null;
resolve(data: any): boolean;
+5 -5
View File
@@ -87,19 +87,19 @@ dumpOpts = {
// $ExpectType Type
new yaml.Type(str, typeConstructorOptions);
// $ExpectType "sequence" | "scalar" | "mapping"
// $ExpectType "sequence" | "scalar" | "mapping" | null
type.kind;
// $ExpectType (data: any) => boolean
type.resolve;
// $ExpectType (data: any) => any
type.construct;
// $ExpectType object
// $ExpectType object | null
type.instanceOf;
// $ExpectType string
// $ExpectType string | null
type.predicate;
// $ExpectType ((data: object) => any) | { [x: string]: (data: object) => any; }
// $ExpectType ((data: object) => any) | { [x: string]: (data: object) => any; } | null
type.represent;
// $ExpectType string
// $ExpectType string | null
type.defaultStyle;
// $ExpectType { [x: string]: any; }
type.styleAliases;
+2 -2
View File
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
@@ -20,4 +20,4 @@
"index.d.ts",
"js-yaml-tests.ts"
]
}
}