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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
/** ES-compatible own-field lookup for schema records, including null prototypes. */
export function hasOwn(value: object, key: PropertyKey): boolean {
return Object.prototype.hasOwnProperty.call(value, key);
}
/** Write a data member on a fresh record without invoking __proto__'s setter. */
export function setOwn(value: Record<string, unknown>, key: string, data: unknown): void {
if (key === '__proto__') {
Object.defineProperty(value, key, { value: data, enumerable: true, writable: true, configurable: true });
} else value[key] = data;
}