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

@plumier/reflect

Package Overview
Dependencies
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plumier/reflect - npm Package Compare versions

Comparing version 1.0.0-canary.knwigz60.0 to 1.0.0-canary.knxxq9sl.0

6

lib/decorators.d.ts

@@ -77,3 +77,3 @@ import "reflect-metadata";

/**
* Get generic type from decorator type("T")
* Get data type of declaration in specific class based on its type specified by type("T")
* @param decorator type() decorator contains generic type information

@@ -88,7 +88,7 @@ * @param typeTarget The current type where the type will be calculated

/**
* Get generic type parameter list by generic type
* Get list of generic arguments used in class
* @param type the class
* @returns List of generic type parameters
*/
function getGenericTypeParameters(type: Class): Class[];
function getArguments(type: Class): Class[];
}

@@ -154,3 +154,3 @@ "use strict";

/**
* Get generic type from decorator type("T")
* Get data type of declaration in specific class based on its type specified by type("T")
* @param decorator type() decorator contains generic type information

@@ -173,8 +173,8 @@ * @param typeTarget The current type where the type will be calculated

throw new Error(`Unable to get type information because ${typeTarget.name} is not inherited from ${decorator.target.name}`);
let templateDec = getTemplate(decorator.target);
if (!templateDec)
throw new Error(`${decorator.target.name} doesn't define @generic.parameter() decorator`);
const [type, isArray] = helpers_1.reflection.getTypeFromDecorator(decorator);
if (typeof type !== "string")
throw new Error("Provided decorator is not a generic type");
let templateDec = getTemplate(decorator.target);
if (!templateDec)
throw new Error(`${decorator.target.name} doesn't have @generic.parameter() decorator required by generic parameter ${type}`);
/*

@@ -215,7 +215,7 @@ get list of parents, for example

/**
* Get generic type parameter list by generic type
* Get list of generic arguments used in class
* @param type the class
* @returns List of generic type parameters
*/
function getGenericTypeParameters(type) {
function getArguments(type) {
const genericDecorator = storage_1.getMetadata(type)

@@ -227,7 +227,7 @@ .find((x) => x.kind == "GenericType" && x.target === type);

throw new Error(`${type.name} is not a generic type`);
return getGenericTypeParameters(parent);
return getArguments(parent);
}
return genericDecorator.types.map(x => x);
}
generic.getGenericTypeParameters = getGenericTypeParameters;
generic.getArguments = getArguments;
})(generic = exports.generic || (exports.generic = {}));
{
"name": "@plumier/reflect",
"version": "1.0.0-canary.knwigz60.0+b7cb2c1",
"version": "1.0.0-canary.knxxq9sl.0+9cdb11b",
"description": "Plumier reflection module",

@@ -42,3 +42,3 @@ "main": "lib/index.js",

},
"gitHead": "b7cb2c12eb1298035917e8d83c27baf4b225f2a1"
"gitHead": "9cdb11b16e22dac8d49244a5823021d4510a33d1"
}
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