UNPKG

sussy-util

Version:
17 lines (16 loc) 527 B
"use strict"; 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;