Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tslang

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslang - npm Package Compare versions

Comparing version 0.1.20 to 0.1.21

12

library/index.d.ts

@@ -10,11 +10,9 @@ import {Constructor} from './types';

/**
* https://www.typescriptlang.org/docs/handbook/mixins.html
* @param targetConstructor Target constructor of which the prototype will be
* applied with properties from other constructors.
* Mixin class decorator, applies properties from other class to the decorator
* target. You still need to use declaration merging to merge mixin interface
* with the target class.
*
* @param constructors Constructors of which the properties will be applied to
* the target constructor.
*/
export function mixin(
targetConstructor: Constructor,
constructors: Constructor[],
): void;
export function mixin(constructors: Function[]): ClassDecorator;

@@ -10,16 +10,19 @@ /* eslint-disable @magicspace/scoped-modules */

/**
* @param targetConstructor {Constructor}
* @param constructors {Constructor[]}
* @returns {ClassDecorator}
*/
exports.mixin = function mixin(targetConstructor, constructors) {
let targetPrototype = targetConstructor.prototype;
exports.mixin = function mixin(constructors) {
return targetConstructor => {
let targetPrototype = targetConstructor.prototype;
for (let constructor of constructors) {
let prototype = constructor.prototype;
for (let constructor of constructors) {
let prototype = constructor.prototype;
Object.defineProperties(
targetPrototype,
Object.getOwnPropertyDescriptors(prototype),
);
}
let descriptors = Object.getOwnPropertyDescriptors(prototype);
delete descriptors.constructor;
Object.defineProperties(targetPrototype, descriptors);
}
};
};
{
"name": "tslang",
"version": "0.1.20",
"version": "0.1.21",
"description": "TypeScript Language Type Utilities.",

@@ -5,0 +5,0 @@ "license": "MIT",

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