Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(sdk): drop the redundant ?? null in resolveAssetKey (TS2871 under newer tsc)

yhh387c1f7b566b
diff --git a/sdk/src/asset/resolveAssetKey.ts b/sdk/src/asset/resolveAssetKey.ts
index fb46e12e2..6cc2f1e6c 100644
--- a/sdk/src/asset/resolveAssetKey.ts
+++ b/sdk/src/asset/resolveAssetKey.ts
@@ -19,5 +19,5 @@ import type { AssetsData } from './AssetPlugin';
/** Resolve an authored asset ref to its runtime-store key (or the ref itself). */
export function resolveAssetKey(assets: AssetsData | null | undefined, ref: string): string {
- return (assets?.resolveRef(ref) ?? null) ?? ref;
+ return assets?.resolveRef(ref) ?? ref;
}