Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 0.0.1 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc