MCPcopy
hub / github.com/webpack/webpack / objectHasOwn

Method objectHasOwn

lib/RuntimeTemplate.js:429–433  ·  view source on GitHub ↗

* Returns an own-property check, using `Object.hasOwn` when supported and * falling back to `Object.prototype.hasOwnProperty.call` otherwise. * @param {string} object object expression * @param {string} property property expression * @returns {string} own-property check expression

(object, property)

Source from the content-addressed store, hash-verified

427 * @returns {string} own-property check expression
428 */
429 objectHasOwn(object, property) {
430 return this.supportsObjectHasOwn()
431 ? `Object.hasOwn(${object}, ${property})`
432 : `Object.prototype.hasOwnProperty.call(${object}, ${property})`;
433 }
434
435 /**
436 * Returns a self-defaulting assignment, using the `||=` logical assignment

Callers 4

generateMethod · 0.80
generateMethod · 0.80
generateMethod · 0.80

Calls 1

supportsObjectHasOwnMethod · 0.95

Tested by

no test coverage detected