UNPKG

@aedart/contracts

Version:

The Ion contracts package. Contains types, interfaces and unique identifiers

33 lines (29 loc) 933 B
/** * @aedart/contracts * * BSD-3-Clause, Copyright (c) 2023-present Alin Eugen Deac <aedart@gmail.com>. */ /** * Default maximum merge depth * * @type {number} */ const DEFAULT_MAX_MERGE_DEPTH = 512; /** * Support Objects identifier * * @type {Symbol} */ const SUPPORT_OBJECTS = Symbol('@aedart/contracts/support/objects'); /** * Properties that are considered dangerous and should be avoided when merging * objects or assigning properties. * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf#description * @see https://cheatsheetseries.owasp.org/cheatsheets/Prototype_Pollution_Prevention_Cheat_Sheet.html * @see https://medium.com/@king.amit95/prototype-pollution-a-deeper-inspection-82a226796966 * * @type {PropertyKey[]} */ const DANGEROUS_PROPERTIES = ['__proto__']; export { DANGEROUS_PROPERTIES, DEFAULT_MAX_MERGE_DEPTH, SUPPORT_OBJECTS };