Socket
Book a DemoInstallSign in
Socket

decorator-make

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decorator-make

## Property Decorator

1.5.0
latest
npmnpm
Version published
Maintainers
1
Created
Source

decorator-make

Property Decorator

const deco = makePropertyDecorator();

TypeScript with experimentalDecorators & emitDecoratorMetadata

class Target {
  @deco.decorate prop: Type;
}

JavaScript

class Target {
}
deco.decorate(Target.prototype, 'prop', Type);

Get Types

deco.getTypes(Target.prototype);

Method Decorator

const deco = makeMethodDecorator();

TypeScript with experimentalDecorators & emitDecoratorMetadata

class Target {
  @deco.decorate someFunc(type?: Type, ...) {}
}

JavaScript

class Target {
  someFunc(type, ...) {}
}
deco.decorate(Target.prototype, 'someFunc', [Type, ...]);

Get Methods

deco.getMethods(Target.prototype);

Class Decorator

const deco = makeClassDecorator();

TypeScript with experimentalDecorators & emitDecoratorMetadata

@deco.decorate class Target {}

JavaScript

class Target {}
deco.decorate(Target);

Get Value

deco.getValue(Target); // return true

Keywords

reflect-metadata

FAQs

Package last updated on 05 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.