@elsikora/cladi
Version:
Zero-dependency TypeScript DI toolkit with typed tokens and scoped lifecycles.
19 lines (16 loc) • 667 B
JavaScript
import { INJECTABLE_METADATA_KEY } from '../../constant/injectable-metadata-key.constant.js';
/**
* Reads injectable metadata from a class constructor.
* @param {Constructor<unknown>} target Constructor to inspect.
* @returns {IInjectableMetadata | undefined} Stored metadata.
*/
function getInjectableMetadata(target) {
const targetWithMetadata = target;
const hasOwnMetadata = Object.prototype.hasOwnProperty.call(targetWithMetadata, INJECTABLE_METADATA_KEY);
if (!hasOwnMetadata) {
return undefined;
}
return targetWithMetadata[INJECTABLE_METADATA_KEY];
}
export { getInjectableMetadata };
//# sourceMappingURL=get.utility.js.map