import { container } from '../global.ts' import { isInstantiable } from '../type/Instantiable.ts' import { Injectable } from './Injection.ts' const injectable = Injectable() const Service = (name?: string): ClassDecorator => { return (target) => { if ( isInstantiable(target) ) { if ( name ) container.register_named(name, target) else container.register(target) injectable(target) } } } export { Service }