@pnp/odata
Version:
pnp - provides shared odata functionality and base classes
18 lines • 569 B
JavaScript
/**
* Adds a property to a target instance
*
* @param target The object to whose prototype we will add a property
* @param name Property name
* @param factory Factory method used to produce the property value
* @param path Any additional path required to produce the value
*/
export function addProp(target, name, factory, path) {
Reflect.defineProperty(target.prototype, name, {
configurable: true,
enumerable: true,
get: function () {
return factory(this, path);
},
});
}
//# sourceMappingURL=add-prop.js.map