Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion types/es-abstract/test/es5.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import ES5 = require("es-abstract/es5");
import { expectType } from "./index.test";

declare const any: unknown;
declare const es5PrimitiveInput: string | number | boolean | object | null | undefined;
const nullableObject: string | object | null | undefined = Math.random() < 0.5
? (Math.random() < 0.5 ? undefined : null)
: Object("foo");
Expand All @@ -27,7 +28,7 @@ ES5.Type([]); // $ExpectType "Object"
expectType<"String" | "Number" | "Boolean" | "Null" | "Undefined" | "Object" | undefined>(ES5.Type(any));
expectType<"String" | "Number" | "Boolean" | "Null" | "Undefined" | "Object" | undefined>(ES5.Type<any>(any));

ES5.ToPrimitive(any); // $ExpectType string | number | bigint | boolean | symbol | null | undefined
expectType<string | number | boolean | null | undefined>(ES5.ToPrimitive(es5PrimitiveInput));
ES5.ToBoolean(any); // $ExpectType boolean
ES5.ToNumber(any); // $ExpectType number
ES5.ToInteger(any); // $ExpectType number
Expand Down