isKeyUnsafe
Available since v0.9
Determines if a property key is considered "unsafe".
import { isKeyUnsafe } from '@aedart/support/reflections';
isKeyUnsafe('name'); // false
isKeyUnsafe('length'); // false
isKeyUnsafe('constructor'); // false
isKeyUnsafe('__proto__'); // true
Note
Behind the scene, the isKeyUnsafe()
function matches the given key against values from the predefined DANGEROUS_PROPERTIES
list, which is defined in the @aedart/contracts/support/objects
submodule;
import { DANGEROUS_PROPERTIES } from "@aedart/contracts/support/objects";