import {IAdvice, IAspect, IPointcut} from "../../interface" import {ConstructorType} from "../../type" export default class AopAspect implements IAspect{ public cost!: ConstructorType public pointcuts: Array = [] constructor({cost = AopAspect} = {}){ this.cost = cost } public setPointcuts(pointcuts: Array = [], advices: Array = []): void{ pointcuts && pointcuts.forEach((pointcut: IPointcut) => { if(pointcut.cost === this.cost){ pointcut.setAdvices(advices) this.pointcuts.push(pointcut) } }) } }