Socket
Socket
Sign inDemoInstall

vue-docgen-api

Package Overview
Dependencies
102
Maintainers
3
Versions
269
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.56.2 to 4.56.4

6

dist/script-setup-handlers/utils/tsUtils.js

@@ -37,2 +37,8 @@ "use strict";

return false;
},
visitTSTypeAliasDeclaration(nodePath) {
if (bt.isIdentifier(nodePath.node.id) && nodePath.node.id.name === typeName) {
typeBody = nodePath.get('typeAnnotation', 'members');
}
return false;
}

@@ -39,0 +45,0 @@ });

39

dist/script-setup-handlers/utils/tsUtils.test.js

@@ -10,9 +10,36 @@ "use strict";

it('resolves an interface in the global scope', () => {
var _a;
const parser = (0, babel_parser_1.default)({ plugins: ['typescript'] });
expect((_a = (0, tsUtils_1.getTypeDefinitionFromIdentifier)(parser.parse(`
interface Foo{
}`), 'Foo')) === null || _a === void 0 ? void 0 : _a.node.loc).toBeDefined();
});
const src = `
interface LocalType {
/**
* describe the local prop
*/
prop1: boolean
prop2: string
}
defineProps<LocalType>()
`;
const astFile = parser.parse(src);
//console.log(astFile)
const nodePath = (0, tsUtils_1.getTypeDefinitionFromIdentifier)(astFile, 'LocalType');
const props = nodePath === null || nodePath === void 0 ? void 0 : nodePath.map((prop) => prop.node.key.name + ' ' + prop.node.typeAnnotation.typeAnnotation.type);
expect(props).toStrictEqual(["prop1 TSBooleanKeyword", "prop2 TSStringKeyword"]);
}),
it('resolves an Type alias in the global scope', () => {
const parser = (0, babel_parser_1.default)({ plugins: ['typescript'] });
const src = `
type LocalType = {
/**
* describe the local prop
*/
prop1: boolean
prop2: string
}
defineProps<LocalType>()
`;
const astFile = parser.parse(src);
const nodePath = (0, tsUtils_1.getTypeDefinitionFromIdentifier)(astFile, 'LocalType');
const props = nodePath === null || nodePath === void 0 ? void 0 : nodePath.map((prop) => prop.node.key.name + ' ' + prop.node.typeAnnotation.typeAnnotation.type);
expect(props).toStrictEqual(["prop1 TSBooleanKeyword", "prop2 TSStringKeyword"]);
});
});

6

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

@@ -36,3 +36,3 @@ "homepage": "https://vue-styleguidist.github.io",

"pug": "^3.0.2",
"recast": "0.21.5",
"recast": "0.22.0",
"ts-map": "^1.0.3",

@@ -51,3 +51,3 @@ "vue-inbrowser-compiler-independent-utils": "^4.56.2"

"vue-property-decorator": "7.3.0",
"vuetify": "2.6.12"
"vuetify": "2.6.13"
},

@@ -54,0 +54,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc