New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-metadata

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-metadata - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

dist/__tests__/data/genericInFunc.js

9

dist/factories/createCreateCreateGenericTypeMetadata.js

@@ -7,4 +7,11 @@ "use strict";

return function createCreateGenericTypeMetadata(createObjectTypeMetadata) {
return function createGenericTypeMetadata(annotation) {
return function createGenericTypeMetadata(annotation, typeParameters) {
var id = annotation.id;
if (typeParameters) {
for (var i = 0; i < typeParameters.length; i++) {
if (typeParameters[i].name === id.name) {
return t.stringLiteral(id.name);
}
}
}
if (reservedGenerics.has(id.name)) {

@@ -11,0 +18,0 @@ return createGenericTypeMetadata(annotation.typeParameters.params[0]);

4

dist/factories/createTypeForAnnotation.js

@@ -9,3 +9,3 @@ 'use strict';

function typeForAnnotation(annotation) {
function typeForAnnotation(annotation, typeParameters) {
if (!annotation) {

@@ -26,3 +26,3 @@ return null;

case 'GenericTypeAnnotation':
return createGenericTypeMetadata(annotation);
return createGenericTypeMetadata(annotation, typeParameters);
case 'ObjectTypeAnnotation':

@@ -29,0 +29,0 @@ return createObjectTypeMetadata(annotation);

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

function createTypeForAnnotations(typeForAnnotation) {
return function typeForAnnotations(types) {
return function typeForAnnotations(types, typeParameters) {
var result = [];

@@ -12,3 +12,3 @@ for (var i = 0, l = types.length; i < l; i++) {

var typeAnnotation = type.typeAnnotation && type.typeAnnotation.typeAnnotation;
var id = typeForAnnotation(typeAnnotation);
var id = typeForAnnotation(typeAnnotation, typeParameters);
if (id) {

@@ -15,0 +15,0 @@ result.push(id);

@@ -20,3 +20,3 @@ 'use strict';

}
var typeArgs = typeForAnnotations(types);
var typeArgs = typeForAnnotations(types, node.typeParameters ? node.typeParameters.params : null);
if (typeArgs.length) {

@@ -23,0 +23,0 @@ body.push(t.expressionStatement(t.callExpression(metaDataId, [t.stringLiteral(paramKey), t.arrayExpression(typeArgs), target])));

{
"name": "babel-plugin-transform-metadata",
"version": "1.1.3",
"version": "1.1.4",
"description": "Reflection metadata support for classes and functions with flowtype type aliases support",

@@ -5,0 +5,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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