sussy-util
Version:
Util package made by me
17 lines (16 loc) • 527 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @param obj - MutableObject<any> - This is the object that we want to add a property to.
* @param {string} prop - string - The property to add to the object
* @param {any} value - any - The value to add to the object
* @returns The object that was passed in.
*/
const addProperty = (obj, prop, value) => {
if (typeof obj !== 'object') {
return obj;
}
obj[prop] = value;
return obj;
};
exports.default = addProperty;