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

es6-class-prototype

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-class-prototype - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

10

index.d.ts

@@ -5,6 +5,10 @@ /**

import { ClassProxyStatic } from 'class-proxy';
declare const _classPrototype: (<T>(target: ClassProxyStatic<T>) => T) & {
default: <T>(target: ClassProxyStatic<T>) => T;
classPrototype: <T>(target: ClassProxyStatic<T>) => T;
declare const _classPrototype: (<T>(target: _classPrototype.IClassProxyStatic<T>, all?: boolean) => T) & {
default: <T>(target: _classPrototype.IClassProxyStatic<T>, all?: boolean) => T;
classPrototype: <T>(target: _classPrototype.IClassProxyStatic<T>, all?: boolean) => T;
};
declare module _classPrototype {
interface IClassProxyStatic<T> extends ClassProxyStatic<T> {
}
}
export = _classPrototype;

@@ -5,7 +5,7 @@ "use strict";

*/
function classPrototype(target) {
function classPrototype(target, all) {
// @ts-ignore
let desc = Object.getOwnPropertyDescriptors(target.prototype);
let prototype = Object.keys(desc).reduce(function (a, b) {
if (!desc[b].get && !desc[b].set) {
if (all || !desc[b].get && !desc[b].set) {
// @ts-ignore

@@ -12,0 +12,0 @@ a[b] = target.prototype[b];

@@ -7,3 +7,3 @@ /**

function classPrototype<T>(target: ClassProxyStatic<T>): T
function classPrototype<T>(target: _classPrototype.IClassProxyStatic<T>, all?: boolean): T
{

@@ -15,3 +15,3 @@ // @ts-ignore

{
if (!desc[b].get && !desc[b].set)
if (all || !desc[b].get && !desc[b].set)
{

@@ -34,4 +34,12 @@ // @ts-ignore

module _classPrototype
{
export interface IClassProxyStatic<T> extends ClassProxyStatic<T>
{
}
}
_classPrototype.default = _classPrototype.classPrototype = _classPrototype;
export = _classPrototype;
{
"name": "es6-class-prototype",
"version": "1.0.2",
"version": "1.0.3",
"description": "get prototype from es6 class, like old way",

@@ -5,0 +5,0 @@ "keywords": [

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