retrofit-axios-ts
Version:
A declarative and axios based retrofit implementation for JavaScript and TypeScript.
18 lines (17 loc) • 500 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureMeta = void 0;
/**
* Ensure the `__meta__` attribute is in the target object and `methodName` has been initialized.
* @param target
* @param methodName
*/
const ensureMeta = (target, methodName) => {
if (!target.__meta__) {
target.__meta__ = {};
}
if (!target.__meta__[methodName]) {
target.__meta__[methodName] = {};
}
};
exports.ensureMeta = ensureMeta;