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

vue-docgen-api

Package Overview
Dependencies
Maintainers
3
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-docgen-api - npm Package Compare versions

Comparing version 4.74.2 to 4.75.0

17

dist/script-setup-handlers/setupEventHandler.js

@@ -82,6 +82,13 @@ "use strict";

function buildEventDescriptor(eventName, eventPath) {
var _a;
var eventDescriptor = documentation.getEventDescriptor(eventName);
var typeParam = eventPath.get('parameters', 1, 'typeAnnotation');
var isPropertyEmitSyntax = bt.isTSPropertySignature(eventPath.node);
var typeParam = isPropertyEmitSyntax
? eventPath.get('typeAnnotation')
: eventPath.get('parameters', 1, 'typeAnnotation');
if (bt.isTSTypeAnnotation(typeParam.node)) {
var type = (0, getTypeFromAnnotation_1.default)(typeParam.node);
if (isPropertyEmitSyntax && type) {
type = (_a = type.elements) === null || _a === void 0 ? void 0 : _a[0];
}
if (type) {

@@ -117,2 +124,10 @@ eventDescriptor.type = {

}
else if (bt.isTSPropertySignature(member.node)) {
if (bt.isIdentifier(member.node.key)) {
buildEventDescriptor(member.node.key.name, member);
}
else if (bt.isStringLiteral(member.node.key)) {
buildEventDescriptor(member.node.key.value, member);
}
}
});

@@ -119,0 +134,0 @@ }

@@ -121,3 +121,9 @@ "use strict";

if (bt.isIdentifier(nodePath.node.id) && nodePath.node.id.name === typeName) {
typeBody = nodePath.get('typeAnnotation', 'members');
var typeAnnotation = nodePath.get('typeAnnotation');
if (bt.isTSTypeLiteral(typeAnnotation.node)) {
typeBody = typeAnnotation.get('members');
}
else if (bt.isTSTypeReference(typeAnnotation.node)) {
typeBody = getTypeDefinitionFromIdentifier(astPath, typeAnnotation.node.typeName.name, opt);
}
}

@@ -124,0 +130,0 @@ return false;

27

dist/utils/getTypeFromAnnotation.js

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

TSUnionType: 'union',
TSIntersectionType: 'intersection'
TSIntersectionType: 'intersection',
TSTupleType: 'tuple'
};

@@ -90,7 +91,21 @@ function printType(t) {

function getTypeObjectFromTSType(type) {
return bt.isTSUnionType(type) || bt.isTSIntersectionType(type)
? { name: TS_TYPE_NAME_MAP[type.type], elements: type.types.map(getTypeObjectFromTSType) }
: bt.isTSArrayType(type)
? { name: TS_TYPE_NAME_MAP[type.type], elements: [getTypeObjectFromTSType(type.elementType)] }
: printType(type);
if (bt.isTSUnionType(type) || bt.isTSIntersectionType(type)) {
return { name: TS_TYPE_NAME_MAP[type.type], elements: type.types.map(getTypeObjectFromTSType) };
}
if (bt.isTSArrayType(type)) {
return {
name: TS_TYPE_NAME_MAP[type.type],
elements: [getTypeObjectFromTSType(type.elementType)]
};
}
if (bt.isTSTupleType(type)) {
return {
name: TS_TYPE_NAME_MAP[type.type],
elements: type.elementTypes.map(getTypeObjectFromTSType)
};
}
if (bt.isTSNamedTupleMember(type)) {
return getTypeObjectFromTSType(type.elementType);
}
return printType(type);
}

@@ -97,0 +112,0 @@ var FLOW_TYPE_NAME_MAP = {

{
"name": "vue-docgen-api",
"version": "4.74.2",
"version": "4.75.0",
"description": "Toolbox to extract information from Vue component files for documentation generation purposes.",

@@ -5,0 +5,0 @@ "homepage": "https://vue-styleguidist.github.io",

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