Socket
Socket
Sign inDemoInstall

macroable

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

macroable - npm Package Compare versions

Comparing version 6.0.4 to 7.0.0

8

build/index.d.ts

@@ -57,3 +57,5 @@ /**

*/
static macro<T extends any>(name: string, callback: MacroFn<T, any[], any>): void;
static macro<T extends any, K extends string>(this: {
new (...args: any): T;
}, name: string, callback: GetMacroFn<T, K>): void;
/**

@@ -87,3 +89,5 @@ * Return the existing macro or null if it doesn't exists

*/
static getter<T extends any = any>(name: string, callback: GetterFn<T, any>, singleton?: boolean): void;
static getter<T extends any, K extends string>(this: {
new (...args: any): T;
}, name: string, callback: GetGetterFn<T, K>, singleton?: boolean): void;
/**

@@ -90,0 +94,0 @@ * Return the existing getter or null if it doesn't exists

@@ -41,3 +41,4 @@ "use strict";

static macro(name, callback) {
this.macros[name] = callback;
const self = this;
self.macros[name] = callback;
this.prototype[name] = callback;

@@ -85,3 +86,4 @@ }

: callback;
this.getters[name] = wrappedCallback;
const self = this;
self.getters[name] = wrappedCallback;
Object.defineProperty(this.prototype, name, {

@@ -88,0 +90,0 @@ get: wrappedCallback,

{
"name": "macroable",
"version": "6.0.4",
"version": "7.0.0",
"description": "A simple ES6 class that can be extended to provide macros and getters functionality",

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

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