🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

custom-decorators

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-decorators - npm Package Compare versions

Comparing version

to
0.0.2

4

package.json
{
"name": "custom-decorators",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -19,3 +19,3 @@ "type": "module",

"author": "",
"license": "ISC"
"license": "MIT"
}

@@ -11,3 +11,3 @@

```js
import custom from '@ali/custom';
import custom from 'custom-decorators';

@@ -42,1 +42,28 @@ class ClassA {

# Features
* 支持同步
```js
class ClassA {
@custom('ClassA.method', { sync: true })
method(name) {
console.log(`hello ${name}`);
}
}
// 注意插件函数也需要是同步,不要添加 async 关键字
custom('ClassA.method', function(context, next) {
const { args } = context;
console.log(this, 'before', args[0]);
next();
console.log(this, 'after', args[0]);
})
```
# Limit
* 仅支持标准 JS 写法, 不支持 TS 写法

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet