@rnaga/wp-node
Version:
👉 **[View Full Documentation at rnaga.github.io/wp-node →](https://rnaga.github.io/wp-node/)**
19 lines (18 loc) • 761 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncInitReflect = void 0;
const constants_1 = require("../constants");
class AsyncInitReflect {
static define(target, propertyKey,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
descriptor) {
Reflect.defineMetadata(constants_1.REFLECT_METADATA_KEY_ASYNC_INIT, propertyKey, target.constructor);
}
static get(instance, target) {
const propertyKey = Reflect.getMetadata(constants_1.REFLECT_METADATA_KEY_ASYNC_INIT, target);
return propertyKey && instance[propertyKey] instanceof Function
? instance[propertyKey].apply(instance)
: undefined;
}
}
exports.AsyncInitReflect = AsyncInitReflect;