From d8bed393d6db92d621ca75ead63a41b6218c5b8d Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Wed, 11 Dec 2024 21:25:17 -0500 Subject: [PATCH] Fix typescript@next support The newest typescript catches a real proble. This type wasn't correct. You can only use a type predicate if your implementation returns a boolean, but this implementation very deliberately returns its argument if that argument passes a check. --- packages/@ember/-internals/environment/lib/global.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@ember/-internals/environment/lib/global.ts b/packages/@ember/-internals/environment/lib/global.ts index 768dff16886..9744e80da21 100644 --- a/packages/@ember/-internals/environment/lib/global.ts +++ b/packages/@ember/-internals/environment/lib/global.ts @@ -2,7 +2,7 @@ declare const mainContext: object | undefined; // from lodash to catch fake globals -function checkGlobal(value: any | null | undefined): value is object { +function checkGlobal(value: any | null | undefined): object | undefined { return value && value.Object === Object ? value : undefined; }