17 lines
552 B
JavaScript
Raw Normal View History

2026-05-31 13:21:13 +02:00
//#region src/_internal/isUnsafeProperty.ts
/**
* Checks if a property key is unsafe to modify directly.
*
* This function is used in functions like `merge` to prevent prototype pollution attacks
* by identifying property keys that could modify the object's prototype chain or constructor.
*
* @param key - The property key to check
* @returns `true` if the property is unsafe to modify directly, `false` otherwise
* @internal
*/
function isUnsafeProperty(key) {
return key === "__proto__";
}
//#endregion
exports.isUnsafeProperty = isUnsafeProperty;