🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@nweb/core

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nweb/core - npm Package Compare versions

Comparing version
1.1.9
to
1.1.10
+4
-4
lib/anno/index.d.ts

@@ -69,9 +69,9 @@ export declare function Readonly(target: any, property: any, descriptor: any): any;

private readonly scope;
private readonly aspect;
private readonly handle;
private component;
constructor(type: AspectType, pattern: string | RegExp, scope: AspectScope, aspect: string);
constructor(type: AspectType, pattern: string | RegExp, scope: AspectScope, handle: string);
bind(component: any): void;
match(component: any, method: string): boolean;
before(target: any, method: string, args: any[]): Promise<boolean>;
after(target: any, method: string, args: any[], result: any): Promise<void>;
before(target: any, method: string, args: any[]): any;
after(target: any, method: string, args: any[], result: any): void;
}

@@ -78,0 +78,0 @@ export declare function Aspect(point: {

@@ -219,9 +219,9 @@ "use strict";

scope;
aspect;
handle;
component;
constructor(type, pattern, scope, aspect) {
constructor(type, pattern, scope, handle) {
this.type = type;
this.pattern = typeof pattern === 'string' ? new RegExp(pattern.replace(/\*/g, '.*')) : pattern;
this.scope = scope;
this.aspect = aspect;
this.handle = handle;
}

@@ -240,11 +240,10 @@ bind(component) {

}
async before(target, method, args) {
before(target, method, args) {
if (this.type === 'before') {
const rs = await this.component[this.aspect]?.call(target, method, args);
return rs !== false;
return this.component[this.handle]?.call(target, method, args);
}
}
async after(target, method, args, result) {
after(target, method, args, result) {
if (this.type === 'after') {
return this.component[this.aspect]?.call(target, method, args, result);
this.component[this.handle]?.call(target, method, args, result);
}

@@ -251,0 +250,0 @@ }

{
"name": "@nweb/core",
"version": "1.1.9",
"version": "1.1.10",
"description": "web核心组件",

@@ -5,0 +5,0 @@ "main": "./lib/index",