UNPKG

@n3okill/utils

Version:
16 lines 685 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isPropertyDefined = isPropertyDefined; const isUndefined_1 = require("../type/isUndefined"); const getProperty_1 = require("./getProperty"); /** * Return true if a property in the given object is not undefined * @param obj Object where to search for the property * @param name The name of the property can be on the form "a.b.c[1].d" * @returns {boolean} */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function isPropertyDefined(obj, name) { return !(0, isUndefined_1.isUndefined)((0, getProperty_1.getProperty)(obj, name)); } //# sourceMappingURL=isPropertyDefined.js.map