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.41.2 to 4.42.0

16

dist/babel-parser.js

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

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -49,6 +53,6 @@ Object.defineProperty(exports, "__esModule", { value: true });

if (options === void 0) { options = {}; }
options = __assign(__assign(__assign({}, babelParserOptions), options), { plugins: __spreadArray(__spreadArray([], (babelParserOptions.plugins || [])), (options.plugins || [])) });
options = __assign(__assign(__assign({}, babelParserOptions), options), { plugins: __spreadArray(__spreadArray([], (babelParserOptions.plugins || []), true), (options.plugins || []), true) });
return {
parse: function (src) {
return parser_1.parse(src, options);
return (0, parser_1.parse)(src, options);
}

@@ -55,0 +59,0 @@ };

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

switch (_a.label) {
case 0: return [4 /*yield*/, parse_1.parseFile(options)];
case 0: return [4 /*yield*/, (0, parse_1.parseFile)(options)];
case 1: return [2 /*return*/, _a.sent()];

@@ -116,3 +116,3 @@ }

switch (_a.label) {
case 0: return [4 /*yield*/, parse_1.parseFile(options)];
case 0: return [4 /*yield*/, (0, parse_1.parseFile)(options)];
case 1: return [2 /*return*/, _a.sent()];

@@ -136,3 +136,3 @@ }

switch (_a.label) {
case 0: return [4 /*yield*/, parse_1.parseSource(source, options)];
case 0: return [4 /*yield*/, (0, parse_1.parseSource)(source, options)];
case 1: return [2 /*return*/, _a.sent()];

@@ -139,0 +139,0 @@ }

@@ -57,6 +57,10 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -87,9 +91,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

}
ast = cacher_1.default(function () { return recast_1.parse(source, { parser: babel_parser_1.default({ plugins: plugins }) }); }, source);
ast = (0, cacher_1.default)(function () { return (0, recast_1.parse)(source, { parser: (0, babel_parser_1.default)({ plugins: plugins }) }); }, source);
if (!ast) {
throw new Error("Unable to parse empty file \"" + options.filePath + "\"");
}
_a = resolveExportedComponent_1.default(ast), componentDefinitions = _a[0], ievSet = _a[1];
_a = (0, resolveExportedComponent_1.default)(ast), componentDefinitions = _a[0], ievSet = _a[1];
if (!(componentDefinitions.size === 0)) return [3 /*break*/, 2];
return [4 /*yield*/, documentRequiredComponents_1.default(documentation, ievSet, undefined, options)
return [4 /*yield*/, (0, documentRequiredComponents_1.default)(documentation, ievSet, undefined, options)
// if we do not find any compoents throw

@@ -115,3 +119,3 @@ ];

if (forceSingleExport === void 0) { forceSingleExport = false; }
var handlers = options.scriptHandlers || __spreadArray(__spreadArray([], script_handlers_1.default), (options.addScriptHandlers || []));
var handlers = options.scriptHandlers || __spreadArray(__spreadArray([], script_handlers_1.default, true), (options.addScriptHandlers || []), true);
return executeHandlers(options.scriptPreHandlers || script_handlers_1.preHandlers, handlers, componentDefinitions, ast, options, forceSingleExport, documentation);

@@ -118,0 +122,0 @@ }

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

: tpl.content;
var ast_1 = cacher_1.default(function () { return compiler_dom_1.parse(source_1, { comments: true }); }, source_1);
var ast_1 = (0, cacher_1.default)(function () { return (0, compiler_dom_1.parse)(source_1, { comments: true }); }, source_1);
var functional_1 = !!tpl.attrs.functional;

@@ -49,0 +49,0 @@ if (functional_1) {

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

var parseSFC_1 = __importDefault(require("./parseSFC"));
var read = util_1.promisify(fs_1.readFile);
var read = (0, util_1.promisify)(fs_1.readFile);
var ERROR_EMPTY_DOCUMENT = 'The passed source is empty';

@@ -121,3 +121,3 @@ /**

if (!singleFileComponent) return [3 /*break*/, 2];
return [4 /*yield*/, parseSFC_1.default(documentation, source, opt)];
return [4 /*yield*/, (0, parseSFC_1.default)(documentation, source, opt)];
case 1:

@@ -128,3 +128,3 @@ docs = _a.sent();

opt.lang = /\.tsx?$/i.test(path.extname(opt.filePath)) ? 'ts' : 'js';
return [4 /*yield*/, parse_script_1.default(source, opt, documentation, documentation !== undefined)];
return [4 /*yield*/, (0, parse_script_1.default)(source, opt, documentation, documentation !== undefined)];
case 3:

@@ -131,0 +131,0 @@ docs = (_a.sent()) || [];

@@ -57,6 +57,10 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -77,3 +81,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

var makePathResolver_1 = __importDefault(require("./utils/makePathResolver"));
var read = util_1.promisify(fs_1.readFile);
var read = (0, util_1.promisify)(fs_1.readFile);
function parseSFC(initialDoc, source, opt) {

@@ -87,4 +91,4 @@ var _a, _b;

documentation = initialDoc;
pathResolver = makePathResolver_1.default(path.dirname(opt.filePath), opt.alias, opt.modules);
parts = cacher_1.default(function () { return compiler_sfc_1.parse(source, { pad: 'line' }); }, source).descriptor;
pathResolver = (0, makePathResolver_1.default)(path.dirname(opt.filePath), opt.alias, opt.modules);
parts = (0, cacher_1.default)(function () { return (0, compiler_sfc_1.parse)(source, { pad: 'line' }); }, source).descriptor;
if (!parts.template) return [3 /*break*/, 5];

@@ -114,3 +118,3 @@ extTemplSrc = (_b = (_a = parts === null || parts === void 0 ? void 0 : parts.template) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.src;

documentation = initialDoc || new Documentation_1.default(opt.filePath);
parse_template_1.default(parts.template, documentation, __spreadArray(__spreadArray([], template_handlers_1.default), addTemplateHandlers), opt);
(0, parse_template_1.default)(parts.template, documentation, __spreadArray(__spreadArray([], template_handlers_1.default, true), addTemplateHandlers, true), opt);
_f.label = 5;

@@ -159,3 +163,3 @@ case 5:

if (!scriptSource) return [3 /*break*/, 11];
return [4 /*yield*/, parse_script_1.default(scriptSource, opt, documentation, initialDoc !== undefined)];
return [4 /*yield*/, (0, parse_script_1.default)(scriptSource, opt, documentation, initialDoc !== undefined)];
case 10:

@@ -162,0 +166,0 @@ _e = (_f.sent()) || [];

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

if (bt.isClassDeclaration(path.node)) {
var config = getArgFromDecorator_1.default(path.get('decorators'));
var config = (0, getArgFromDecorator_1.default)(path.get('decorators'));
var displayName_1;
if (config && bt.isObjectExpression(config.node)) {
getProperties_1.default(config, 'name').forEach(function (p) {
(0, getProperties_1.default)(config, 'name').forEach(function (p) {
var valuePath = p.get('value');

@@ -41,0 +41,0 @@ if (bt.isStringLiteral(valuePath.node)) {

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

if (bt.isClassDeclaration(path.node)) {
recast_1.visit(path.node, {
(0, recast_1.visit)(path.node, {
visitClassMethod: function (nodePath) {

@@ -47,4 +47,4 @@ if (nodePath.node.decorators &&

// fetch the leading comments on the wrapping expression
var docblock = getDocblock_1.default(nodePath);
var doclets = getDoclets_1.default(docblock || '');
var docblock = (0, getDocblock_1.default)(nodePath);
var doclets = (0, getDoclets_1.default)(docblock || '');
var eventName = void 0;

@@ -60,3 +60,3 @@ var eventTags = doclets.tags ? doclets.tags.filter(function (d) { return d.title === 'event'; }) : [];

if (bt.isIdentifier(firstArg.node)) {
firstArg = resolveIdentifier_1.default(astPath, firstArg);
firstArg = (0, resolveIdentifier_1.default)(astPath, firstArg);
}

@@ -75,3 +75,3 @@ if (!bt.isStringLiteral(firstArg.node)) {

var evtDescriptor = documentation.getEventDescriptor(eventName);
eventHandler_1.setEventDescriptor(evtDescriptor, doclets);
(0, eventHandler_1.setEventDescriptor)(evtDescriptor, doclets);
return false;

@@ -78,0 +78,0 @@ }

@@ -45,4 +45,4 @@ "use strict";

: '<anonymous>';
var docBlock = getDocblock_1.default(bt.isClassMethod(methodPath.node) ? methodPath : methodPath.parentPath);
var jsDoc = docBlock ? getDoclets_1.default(docBlock) : { description: '', tags: [] };
var docBlock = (0, getDocblock_1.default)(bt.isClassMethod(methodPath.node) ? methodPath : methodPath.parentPath);
var jsDoc = docBlock ? (0, getDoclets_1.default)(docBlock) : { description: '', tags: [] };
var jsDocTags = jsDoc.tags ? jsDoc.tags : [];

@@ -57,3 +57,3 @@ // ignore the method if there is no public tag

}
methodHandler_1.setMethodDescriptor(methodDescriptor, methodPath, jsDocTags);
(0, methodHandler_1.setMethodDescriptor)(methodDescriptor, methodPath, jsDocTags);
return true;

@@ -60,0 +60,0 @@ });

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

if (!bt.isClassDeclaration(path.node)) return [3 /*break*/, 3];
config = getArgFromDecorator_1.default(path.get('decorators'));
config = (0, getArgFromDecorator_1.default)(path.get('decorators'));
if (!(config && bt.isObjectExpression(config.node))) return [3 /*break*/, 2];
return [4 /*yield*/, propHandler_1.default(documentation, config, ast, opt)];
return [4 /*yield*/, (0, propHandler_1.default)(documentation, config, ast, opt)];
case 1:

@@ -108,7 +108,7 @@ _a.sent();

// description
var docBlock = getDocblock_1.default(propPath);
var jsDoc = docBlock ? getDoclets_1.default(docBlock) : { description: '', tags: [] };
var docBlock = (0, getDocblock_1.default)(propPath);
var jsDoc = docBlock ? (0, getDoclets_1.default)(docBlock) : { description: '', tags: [] };
var jsDocTags = jsDoc.tags ? jsDoc.tags : [];
if (jsDocTags) {
propDescriptor.tags = transformTagsIntoObject_1.default(jsDocTags);
propDescriptor.tags = (0, transformTagsIntoObject_1.default)(jsDocTags);
}

@@ -118,7 +118,7 @@ if (jsDoc.description) {

}
propHandler_1.extractValuesFromTags(propDescriptor);
(0, propHandler_1.extractValuesFromTags)(propDescriptor);
var litteralType;
if (propPath.node.typeAnnotation) {
var values = !!bt.isTSTypeAnnotation(propPath.node.typeAnnotation) &&
propHandler_1.getValuesFromTypeAnnotation(propPath.node.typeAnnotation.typeAnnotation);
(0, propHandler_1.getValuesFromTypeAnnotation)(propPath.node.typeAnnotation.typeAnnotation);
if (values) {

@@ -131,3 +131,3 @@ propDescriptor.values = values;

// type
propDescriptor.type = getTypeFromAnnotation_1.default(propPath.node.typeAnnotation);
propDescriptor.type = (0, getTypeFromAnnotation_1.default)(propPath.node.typeAnnotation);
}

@@ -150,6 +150,6 @@ }

if (!propPath.node.typeAnnotation) {
litteralType = propHandler_1.describeType(propsPath, propDescriptor);
litteralType = (0, propHandler_1.describeType)(propsPath, propDescriptor);
}
propHandler_1.describeDefault(propsPath, propDescriptor, litteralType || '');
propHandler_1.describeRequired(propsPath, propDescriptor);
(0, propHandler_1.describeDefault)(propsPath, propDescriptor, litteralType || '');
(0, propHandler_1.describeRequired)(propsPath, propDescriptor);
// this compares the node to its supposed args

@@ -159,3 +159,3 @@ // if it finds no args it will return itself

else if (propDecoratorArg.node !== propDecoratorPath.node) {
propDescriptor.type = propHandler_1.getTypeFromTypePath(propDecoratorArg);
propDescriptor.type = (0, propHandler_1.getTypeFromTypePath)(propDecoratorArg);
}

@@ -162,0 +162,0 @@ }

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

if (bt.isObjectExpression(path.node)) {
var functionalPath = getProperties_1.default(path, 'functional');
var functionalPath = (0, getProperties_1.default)(path, 'functional');
if (functionalPath.length) {

@@ -70,3 +70,3 @@ var functionalValue = functionalPath[0].get('value').node;

}
var docBlock = getDocblock_1.default(componentCommentedPath);
var docBlock = (0, getDocblock_1.default)(componentCommentedPath);
// if no prop return

@@ -76,3 +76,3 @@ if (!docBlock || !docBlock.length) {

}
var jsDoc = getDoclets_1.default(docBlock);
var jsDoc = (0, getDoclets_1.default)(docBlock);
documentation.set('description', jsDoc.description);

@@ -85,3 +85,3 @@ if (jsDoc.tags) {

}
var tagsAsObject = transformTagsIntoObject_1.default(jsDoc.tags.filter(function (t) { return t.title !== 'example' && t.title !== 'displayName'; }) || []);
var tagsAsObject = (0, transformTagsIntoObject_1.default)(jsDoc.tags.filter(function (t) { return t.title !== 'example' && t.title !== 'displayName'; }) || []);
var examples = jsDoc.tags.filter(function (t) { return t.title === 'example'; });

@@ -88,0 +88,0 @@ if (examples.length) {

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

if (bt.isObjectExpression(compDef.node)) {
var namePath = getProperties_1.default(compDef, 'name');
var namePath = (0, getProperties_1.default)(compDef, 'name');
// if no prop return

@@ -37,0 +37,0 @@ if (!namePath.length) {

@@ -34,4 +34,4 @@ "use strict";

var _b = _a === void 0 ? { commentIndex: 1 } : _a, commentIndex = _b.commentIndex;
var docBlock = getDocblock_1.default(p, { commentIndex: commentIndex });
return docBlock ? getDoclets_1.default(docBlock) : null;
var docBlock = (0, getDocblock_1.default)(p, { commentIndex: commentIndex });
return docBlock ? (0, getDoclets_1.default)(docBlock) : null;
}

@@ -52,3 +52,3 @@ /**

// browse the entirety of the code inside the component to look for this.$emit
recast_1.visit(path.node, {
(0, recast_1.visit)(path.node, {
visitCallExpression: function (pathExpression) {

@@ -64,4 +64,4 @@ if (bt.isMemberExpression(pathExpression.node.callee) &&

// fetch the leading comments on the wrapping expression
var docblock = getDocblock_1.default(pathExpression.parentPath);
var doclets = getDoclets_1.default(docblock || '');
var docblock = (0, getDocblock_1.default)(pathExpression.parentPath);
var doclets = (0, getDoclets_1.default)(docblock || '');
var eventName = void 0;

@@ -76,3 +76,3 @@ var eventTags = doclets.tags ? doclets.tags.filter(function (d) { return d.title === 'event'; }) : [];

if (bt.isIdentifier(firstArg.node)) {
firstArg = resolveIdentifier_1.default(astPath, firstArg);
firstArg = (0, resolveIdentifier_1.default)(astPath, firstArg);
}

@@ -123,3 +123,3 @@ if (!firstArg || !bt.isStringLiteral(firstArg.node)) {

.get('properties')
.filter(function (p) { return bt.isObjectProperty(p.node) && getPropsFilter_1.default('emits')(p); });
.filter(function (p) { return bt.isObjectProperty(p.node) && (0, getPropsFilter_1.default)('emits')(p); });
// if no emits member return

@@ -135,4 +135,4 @@ if (!emitsPath.length) {

var eventPath = emitsObject.get('elements', i);
var docblock = getDocblock_1.default(eventPath);
var doclets = getDoclets_1.default(docblock || '');
var docblock = (0, getDocblock_1.default)(eventPath);
var doclets = (0, getDoclets_1.default)(docblock || '');
setEventDescriptor(eventDescriptor, doclets);

@@ -152,4 +152,4 @@ }

var eventPath = emitsObject.get('properties', i);
var docblock = getDocblock_1.default(eventPath);
var doclets = getDoclets_1.default(docblock || '');
var docblock = (0, getDocblock_1.default)(eventPath);
var doclets = (0, getDoclets_1.default)(docblock || '');
setEventDescriptor(eventDescriptor, doclets);

@@ -171,3 +171,3 @@ }

.get('properties')
.filter(function (p) { return bt.isObjectProperty(p.node) && getPropsFilter_1.default('methods')(p); });
.filter(function (p) { return bt.isObjectProperty(p.node) && (0, getPropsFilter_1.default)('methods')(p); });
// if no method return

@@ -174,0 +174,0 @@ if (!methodsPath.length) {

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

}
variablesResolvedToCurrentFile = resolveLocal_1.default(astPath, [extendsVariableName]);
variablesResolvedToCurrentFile = (0, resolveLocal_1.default)(astPath, [extendsVariableName]);
if (!variablesResolvedToCurrentFile.get(extendsVariableName)) return [3 /*break*/, 2];
return [4 /*yield*/, parse_script_1.addDefaultAndExecuteHandlers(variablesResolvedToCurrentFile, astPath, __assign(__assign({}, opt), { nameFilter: [extendsVariableName] }), documentation)];
return [4 /*yield*/, (0, parse_script_1.addDefaultAndExecuteHandlers)(variablesResolvedToCurrentFile, astPath, __assign(__assign({}, opt), { nameFilter: [extendsVariableName] }), documentation)];
case 1:

@@ -102,5 +102,5 @@ _a.sent();

case 2:
extendsFilePath = resolveRequired_1.default(astPath, [extendsVariableName]);
extendsFilePath = (0, resolveRequired_1.default)(astPath, [extendsVariableName]);
// get each doc for each mixin using parse
return [4 /*yield*/, documentRequiredComponents_1.default(documentation, extendsFilePath, 'extends', opt)];
return [4 /*yield*/, (0, documentRequiredComponents_1.default)(documentation, extendsFilePath, 'extends', opt)];
case 3:

@@ -107,0 +107,0 @@ // get each doc for each mixin using parse

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

.get('properties')
.filter(function (p) { return bt.isObjectProperty(p.node) && getPropsFilter_1.default('methods')(p); });
.filter(function (p) { return bt.isObjectProperty(p.node) && (0, getPropsFilter_1.default)('methods')(p); });
// if no method return

@@ -60,4 +60,4 @@ if (!methodsPath.length) {

bt.isObjectMethod(p.node) && bt.isIdentifier(p.node.key) ? p.node.key.name : methodName;
var docBlock = getDocblock_1.default(bt.isObjectMethod(p.node) ? p : p.parentPath);
var jsDoc = docBlock ? getDoclets_1.default(docBlock) : { description: '', tags: [] };
var docBlock = (0, getDocblock_1.default)(bt.isObjectMethod(p.node) ? p : p.parentPath);
var jsDoc = docBlock ? (0, getDoclets_1.default)(docBlock) : { description: '', tags: [] };
var jsDocTags = jsDoc.tags ? jsDoc.tags : [];

@@ -85,3 +85,3 @@ // ignore the method if there is no public tag

// tags
methodDescriptor.tags = transformTagsIntoObject_1.default(jsDocTags);
methodDescriptor.tags = (0, transformTagsIntoObject_1.default)(jsDocTags);
return methodDescriptor;

@@ -129,3 +129,3 @@ }

if (!param.type && par.typeAnnotation) {
var type = getTypeFromAnnotation_1.default(par.typeAnnotation);
var type = (0, getTypeFromAnnotation_1.default)(par.typeAnnotation);
if (type) {

@@ -158,3 +158,3 @@ param.type = type;

if (methodNode.returnType) {
var type = getTypeFromAnnotation_1.default(methodNode.returnType);
var type = (0, getTypeFromAnnotation_1.default)(methodNode.returnType);
if (type) {

@@ -161,0 +161,0 @@ methodDescriptor.returns = methodDescriptor.returns || {};

@@ -99,4 +99,4 @@ "use strict";

}
variablesResolvedToCurrentFile = resolveLocal_1.default(astPath, mixinVariableNames);
mixinVarToFilePath = resolveRequired_1.default(astPath, mixinVariableNames);
variablesResolvedToCurrentFile = (0, resolveLocal_1.default)(astPath, mixinVariableNames);
mixinVarToFilePath = (0, resolveRequired_1.default)(astPath, mixinVariableNames);
return [4 /*yield*/, mixinVariableNames.reduce(function (_, varName) { return __awaiter(_this, void 0, void 0, function () {

@@ -109,3 +109,3 @@ return __generator(this, function (_a) {

if (!variablesResolvedToCurrentFile.get(varName)) return [3 /*break*/, 3];
return [4 /*yield*/, parse_script_1.addDefaultAndExecuteHandlers(variablesResolvedToCurrentFile, astPath, __assign(__assign({}, opt), { nameFilter: [varName] }), documentation)];
return [4 /*yield*/, (0, parse_script_1.addDefaultAndExecuteHandlers)(variablesResolvedToCurrentFile, astPath, __assign(__assign({}, opt), { nameFilter: [varName] }), documentation)];
case 2:

@@ -116,3 +116,3 @@ _a.sent();

// get each doc for each mixin using parse
return [4 /*yield*/, documentRequiredComponents_1.default(documentation, mixinVarToFilePath, 'mixin', __assign(__assign({}, opt), { nameFilter: [varName] }))];
return [4 /*yield*/, (0, documentRequiredComponents_1.default)(documentation, mixinVarToFilePath, 'mixin', __assign(__assign({}, opt), { nameFilter: [varName] }))];
case 4:

@@ -137,3 +137,3 @@ // get each doc for each mixin using parse

if (bt.isObjectExpression(compDef.node)) {
var mixinProp = getProperties_1.default(compDef, 'mixins');
var mixinProp = (0, getProperties_1.default)(compDef, 'mixins');
var mixinPath = mixinProp.length ? mixinProp[0] : undefined;

@@ -140,0 +140,0 @@ if (mixinPath) {

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

var ret = body[0];
return ret.argument ? recast_1.print(ret.argument).code : null;
return ret.argument ? (0, recast_1.print)(ret.argument).code : null;
}

@@ -96,3 +96,3 @@ /**

.get('properties')
.filter(function (p) { return bt.isObjectProperty(p.node) && getPropsFilter_1.default('props')(p); });
.filter(function (p) { return bt.isObjectProperty(p.node) && (0, getPropsFilter_1.default)('props')(p); });
// if no prop return

@@ -115,5 +115,5 @@ if (!propsPath.length) {

propNode = prop.node;
docBlock = getDocblock_1.default(prop);
docBlock = (0, getDocblock_1.default)(prop);
jsDoc = docBlock
? getDoclets_1.default(docBlock)
? (0, getDoclets_1.default)(docBlock)
: { description: '', tags: [] };

@@ -137,3 +137,3 @@ jsDocTags = jsDoc.tags ? jsDoc.tags : [];

if (jsDocTags.length) {
propDescriptor.tags = transformTagsIntoObject_1.default(jsDocTags);
propDescriptor.tags = (0, transformTagsIntoObject_1.default)(jsDocTags);
}

@@ -176,3 +176,3 @@ extractValuesFromTags(propDescriptor);

propDescriptor.type = {
name: recast_1.print(prop.get('value')).code,
name: (0, recast_1.print)(prop.get('value')).code,
func: true

@@ -213,9 +213,9 @@ };

function describeType(propPropertiesPath, propDescriptor) {
var typeArray = propPropertiesPath.filter(getPropsFilter_1.default('type'));
var typeArray = propPropertiesPath.filter((0, getPropsFilter_1.default)('type'));
if (propDescriptor.tags && propDescriptor.tags.type) {
var typeDesc = propDescriptor.tags.type[0].type;
if (typeDesc) {
var typedAST = getTemplateExpressionAST_1.default("const a:" + typeDesc.name);
var typedAST = (0, getTemplateExpressionAST_1.default)("const a:" + typeDesc.name);
var typeValues_1;
recast_1.visit(typedAST.program, {
(0, recast_1.visit)(typedAST.program, {
visitVariableDeclaration: function (path) {

@@ -246,3 +246,3 @@ var typeAnnotation = path.get('declarations', 0, 'id', 'typeAnnotation').value.typeAnnotation;

// deduce the type from default expression
var defaultArray = propPropertiesPath.filter(getPropsFilter_1.default('default'));
var defaultArray = propPropertiesPath.filter((0, getPropsFilter_1.default)('default'));
if (defaultArray.length) {

@@ -298,3 +298,3 @@ var typeNode = defaultArray[0].node;

var typeName = bt.isTSTypeReference(typeAnnotation) && typeAnnotation.typeParameters
? recast_1.print(resolveParenthesis(typeAnnotation.typeParameters.params[0])).code
? (0, recast_1.print)(resolveParenthesis(typeAnnotation.typeParameters.params[0])).code
: bt.isArrayExpression(typeNode)

@@ -309,3 +309,3 @@ ? typePath

? typeNode.name.toLowerCase()
: recast_1.print(typeNode).code;
: (0, recast_1.print)(typeNode).code;
return {

@@ -337,3 +337,3 @@ name: typeName === 'function' ? 'func' : typeName

function describeRequired(propPropertiesPath, propDescriptor) {
var requiredArray = propPropertiesPath.filter(getPropsFilter_1.default('required'));
var requiredArray = propPropertiesPath.filter((0, getPropsFilter_1.default)('required'));
var requiredNode = requiredArray.length ? requiredArray[0].get('value').node : undefined;

@@ -348,3 +348,3 @@ var required = requiredNode && bt.isBooleanLiteral(requiredNode) ? requiredNode.value : undefined;

var _a;
var defaultArray = propPropertiesPath.filter(getPropsFilter_1.default('default'));
var defaultArray = propPropertiesPath.filter((0, getPropsFilter_1.default)('default'));
if (defaultArray.length) {

@@ -371,3 +371,3 @@ /**

func: false,
value: recast_1.print(defaultFunction.node).code
value: (0, recast_1.print)(defaultFunction.node).code
};

@@ -396,3 +396,3 @@ return;

bt.isObjectExpression(arrowFunctionBody.node)) {
var rawCode = recast_1.print(arrowFunctionBody.node).code;
var rawCode = (0, recast_1.print)(arrowFunctionBody.node).code;
var value = ((_a = arrowFunctionBody.node.extra) === null || _a === void 0 ? void 0 : _a.parenthesized)

@@ -410,3 +410,3 @@ ? rawCode.slice(1, rawCode.length - 1)

func: true,
value: recast_1.print(defaultFunction).code
value: (0, recast_1.print)(defaultFunction).code
};

@@ -439,3 +439,3 @@ return;

}
var rawValue = recast_1.print(defaultPath).code;
var rawValue = (0, recast_1.print)(defaultPath).code;
propDescriptor.defaultValue = {

@@ -453,3 +453,3 @@ func: bt.isFunction(defaultPath.node),

var defaultBlockStatement = defaultArray[0].get('body');
var rawValue = recast_1.print(defaultBlockStatement).code;
var rawValue = (0, recast_1.print)(defaultBlockStatement).code;
// the function should be reconstructed as "old-school" function, because they have the same handling of "this", whereas arrow functions do not.

@@ -476,6 +476,6 @@ var rawValueParsed = "function(" + params + ") " + rawValue.trim();

}
validatorArray = propPropertiesPath.filter(getPropsFilter_1.default('validator'));
validatorArray = propPropertiesPath.filter((0, getPropsFilter_1.default)('validator'));
if (!validatorArray.length) return [3 /*break*/, 2];
validatorNode = validatorArray[0].get('value').node;
return [4 /*yield*/, parseValidator_1.default(validatorNode, ast, options)];
return [4 /*yield*/, (0, parseValidator_1.default)(validatorNode, ast, options)];
case 1:

@@ -516,3 +516,3 @@ values = _a.sent();

.get('properties')
.filter(function (p) { return bt.isObjectProperty(p.node) && getPropsFilter_1.default('model')(p); });
.filter(function (p) { return bt.isObjectProperty(p.node) && (0, getPropsFilter_1.default)('model')(p); });
if (!modelPath.length) {

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

.get('properties')
.filter(function (p) { return bt.isObjectProperty(p.node) && getPropsFilter_1.default('prop')(p); });
.filter(function (p) { return bt.isObjectProperty(p.node) && (0, getPropsFilter_1.default)('prop')(p); });
if (!modelPropertyNamePath.length) {

@@ -528,0 +528,0 @@ return null;

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

if (bt.isObjectExpression(path.node)) {
var renderPath = getProperties_1.default(path, 'render');
var renderPath = (0, getProperties_1.default)(path, 'render');
// if no prop return

@@ -48,3 +48,3 @@ if (!renderPath.length) {

: renderPath[0];
recast_1.visit(renderValuePath.node, {
(0, recast_1.visit)(renderValuePath.node, {
// this.$slots.default()

@@ -169,4 +169,4 @@ visitCallExpression: function (pathCall) {

var _a;
var docBlock = getDocblock_1.parseDocblock(str).trim();
var jsDoc = getDoclets_1.default(docBlock);
var docBlock = (0, getDocblock_1.parseDocblock)(str).trim();
var jsDoc = (0, getDoclets_1.default)(docBlock);
if (!((_a = jsDoc.tags) === null || _a === void 0 ? void 0 : _a.length)) {

@@ -184,3 +184,3 @@ return undefined;

if (tags.length) {
descriptor.tags = transformTagsIntoObject_1.default(tags);
descriptor.tags = (0, transformTagsIntoObject_1.default)(tags);
}

@@ -199,3 +199,3 @@ return {

var description = prop.leadingComments && prop.leadingComments.length
? getDocblock_1.parseDocblock(prop.leadingComments[prop.leadingComments.length - 1].value)
? (0, getDocblock_1.parseDocblock)(prop.leadingComments[prop.leadingComments.length - 1].value)
: undefined;

@@ -202,0 +202,0 @@ if (!description) {

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

if (bt.isObjectExpression(path.node)) {
var functionalPath = getProperties_1.default(path, 'functional');
var functionalPath = (0, getProperties_1.default)(path, 'functional');
// if no prop return

@@ -43,3 +43,3 @@ if (!functionalPath.length || !functionalPath[0].get('value')) {

}
var renderPath = getProperties_1.default(path, 'render');
var renderPath = (0, getProperties_1.default)(path, 'render');
if (!renderPath || !renderPath.length) {

@@ -55,3 +55,3 @@ return Promise.resolve();

var contextVariableName_1 = contextVariable.value.name;
recast_1.visit(renderValuePath.node, {
(0, recast_1.visit)(renderValuePath.node, {
// context.children

@@ -64,3 +64,3 @@ visitMemberExpression: function (pathMember) {

var doc = documentation.getSlotDescriptor('default');
slotHandler_1.getSlotComment(pathMember, doc);
(0, slotHandler_1.getSlotComment)(pathMember, doc);
return false;

@@ -77,3 +77,3 @@ }

.value.filter(function (a) { return bt.isIdentifier(a.key) && a.key.name === 'children'; })[0]) === null || _a === void 0 ? void 0 : _a.value.name;
recast_1.visit(renderValuePath.node, {
(0, recast_1.visit)(renderValuePath.node, {
// destructured children

@@ -83,3 +83,3 @@ visitIdentifier: function (pathMember) {

var doc = documentation.getSlotDescriptor('default');
slotHandler_1.getSlotComment(pathMember, doc);
(0, slotHandler_1.getSlotComment)(pathMember, doc);
return false;

@@ -86,0 +86,0 @@ }

@@ -36,4 +36,4 @@ "use strict";

if (bt.isObjectExpression(path.node)) {
var renderPath = getProperties_1.default(path, 'render');
var setupPath = getProperties_1.default(path, 'setup');
var renderPath = (0, getProperties_1.default)(path, 'render');
var setupPath = (0, getProperties_1.default)(path, 'setup');
if (!renderPath.length && !setupPath.length) {

@@ -44,3 +44,3 @@ return Promise.resolve();

var i = 0;
var docBlock = getDocblock_1.default(functionPath[0], { commentIndex: i });
var docBlock = (0, getDocblock_1.default)(functionPath[0], { commentIndex: i });
while (docBlock) {

@@ -51,3 +51,3 @@ // if no doc block return

}
var jsDoc = getDoclets_1.default(docBlock);
var jsDoc = (0, getDoclets_1.default)(docBlock);
if (jsDoc.tags) {

@@ -65,3 +65,3 @@ var slotTag = jsDoc.tags.find(function (a) { return a.title === 'slot'; });

}
docBlock = getDocblock_1.default(functionPath[0], { commentIndex: ++i });
docBlock = (0, getDocblock_1.default)(functionPath[0], { commentIndex: ++i });
}

@@ -68,0 +68,0 @@ }

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

case 0:
ast_types_1.visit(ast, {
(0, ast_types_1.visit)(ast, {
visitVariableDeclaration: function (p) {

@@ -106,7 +106,7 @@ p.node.declarations.forEach(function (decl, i) {

}
varToFilePath = resolveRequired_1.default(ast, [identifierName]);
varToFilePath = (0, resolveRequired_1.default)(ast, [identifierName]);
originalDirName = path.dirname(options.filePath);
pathResolver = makePathResolver_1.default(originalDirName, options.alias, options.modules);
pathResolver = (0, makePathResolver_1.default)(originalDirName, options.alias, options.modules);
// resolve where sources are through immediately exported variables
return [4 /*yield*/, recursiveResolveIEV_1.default(pathResolver, varToFilePath, options.validExtends)];
return [4 /*yield*/, (0, recursiveResolveIEV_1.default)(pathResolver, varToFilePath, options.validExtends)];
case 1:

@@ -117,3 +117,3 @@ // resolve where sources are through immediately exported variables

_a = varToFilePath[identifierName], exportName = _a.exportName, filePath = _a.filePath;
return [4 /*yield*/, getPathFromExportedValue_1.default(pathResolver, exportName, filePath, options)];
return [4 /*yield*/, (0, getPathFromExportedValue_1.default)(pathResolver, exportName, filePath, options)];
case 2:

@@ -120,0 +120,0 @@ p = _b.sent();

@@ -33,9 +33,9 @@ "use strict";

function eventHandler(documentation, templateAst, siblings) {
if (guards_1.isBaseElementNode(templateAst)) {
if ((0, guards_1.isBaseElementNode)(templateAst)) {
templateAst.props.forEach(function (prop) {
if (guards_1.isDirectiveNode(prop)) {
if ((0, guards_1.isDirectiveNode)(prop)) {
if (prop.name === 'on') {
// only look at expressions
var expression = prop.exp;
if (guards_1.isSimpleExpressionNode(expression)) {
if ((0, guards_1.isSimpleExpressionNode)(expression)) {
getEventsFromExpression(templateAst, expression.content, documentation, siblings);

@@ -50,5 +50,5 @@ }

function getEventsFromExpression(item, expression, documentation, siblings) {
var ast = getTemplateExpressionAST_1.default(expression);
var ast = (0, getTemplateExpressionAST_1.default)(expression);
var eventsFound = [];
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
visitCallExpression: function (path) {

@@ -68,7 +68,7 @@ var obj = path.node ? path.node.callee : undefined;

if (eventsFound.length) {
var leadingComments_1 = extractLeadingComment_1.default(siblings, item);
var leadingComments_1 = (0, extractLeadingComment_1.default)(siblings, item);
if (leadingComments_1.length) {
eventsFound.forEach(function (evtName) {
leadingComments_1.forEach(function (comment) {
var doclets = getDoclets_1.default(comment);
var doclets = (0, getDoclets_1.default)(comment);
var eventTags = doclets.tags && doclets.tags.filter(function (d) { return d.title === 'event'; });

@@ -81,3 +81,3 @@ if (!(eventTags &&

var e = documentation.getEventDescriptor(evtName);
eventHandler_1.setEventDescriptor(e, doclets);
(0, eventHandler_1.setEventDescriptor)(e, doclets);
});

@@ -84,0 +84,0 @@ });

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

function propsInAttributes(documentation, templateAst, siblings) {
if (guards_1.isBaseElementNode(templateAst)) {
if ((0, guards_1.isBaseElementNode)(templateAst)) {
templateAst.props.forEach(function (prop) {
if (guards_1.isDirectiveNode(prop) && guards_1.isSimpleExpressionNode(prop.exp)) {
if ((0, guards_1.isDirectiveNode)(prop) && (0, guards_1.isSimpleExpressionNode)(prop.exp)) {
getPropsFromExpression(documentation, templateAst, prop.exp, siblings);

@@ -49,3 +49,3 @@ }

function propsInInterpolation(documentation, templateAst, siblings) {
if (guards_1.isInterpolationNode(templateAst) && guards_1.isSimpleExpressionNode(templateAst.content)) {
if ((0, guards_1.isInterpolationNode)(templateAst) && (0, guards_1.isSimpleExpressionNode)(templateAst.content)) {
getPropsFromExpression(documentation, templateAst, templateAst.content, siblings);

@@ -56,5 +56,5 @@ }

var expression = exp.content;
var ast = getTemplateExpressionAST_1.default(expression);
var ast = (0, getTemplateExpressionAST_1.default)(expression);
var propsFound = [];
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
visitMemberExpression: function (path) {

@@ -77,5 +77,5 @@ var obj = path.node ? path.node.object : undefined;

if (propsFound.length) {
var comments = extractLeadingComment_1.default(siblings, item);
var comments = (0, extractLeadingComment_1.default)(siblings, item);
comments.forEach(function (comment) {
var doclets = getDoclets_1.default(comment);
var doclets = (0, getDoclets_1.default)(comment);
var propTags = doclets.tags && doclets.tags.filter(function (d) { return d.title === 'prop'; });

@@ -82,0 +82,0 @@ if (propTags && propTags.length) {

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

var guards_1 = require("../utils/guards");
var parser = babel_parser_1.default({ plugins: ['typescript'] });
var parser = (0, babel_parser_1.default)({ plugins: ['typescript'] });
function slotHandler(documentation, templateAst, siblings) {
if (guards_1.isBaseElementNode(templateAst) && templateAst.tag === 'slot') {
if ((0, guards_1.isBaseElementNode)(templateAst) && templateAst.tag === 'slot') {
var nameProp = templateAst.props.filter(guards_1.isAttributeNode).find(function (b) { return b.name === 'name'; });

@@ -39,3 +39,3 @@ var slotName = nameProp && nameProp.value && nameProp.value.content ? nameProp.value.content : 'default';

// only keep simple binds and static attributes
function (b) { return b.name !== 'name' && (b.name === 'bind' || guards_1.isAttributeNode(b)); });
function (b) { return b.name !== 'name' && (b.name === 'bind' || (0, guards_1.isAttributeNode)(b)); });
var slotDescriptor_1 = documentation.getSlotDescriptor(slotName);

@@ -45,3 +45,3 @@ if (bindings.length) {

}
var comments = extractLeadingComment_1.default(siblings, templateAst);
var comments = (0, extractLeadingComment_1.default)(siblings, templateAst);
var bindingDescriptors_1 = [];

@@ -53,3 +53,3 @@ comments.forEach(function (comment) {

if (comment.length) {
var doclets = slotHandler_1.parseSlotDocBlock(comment, slotDescriptor_1);
var doclets = (0, slotHandler_1.parseSlotDocBlock)(comment, slotDescriptor_1);
if (doclets && doclets.bindings) {

@@ -62,7 +62,7 @@ bindingDescriptors_1 = doclets.bindings;

// deal with v-bind="" props
var simpleVBind = bindings.find(function (b) { return guards_1.isDirectiveNode(b) && !b.arg; });
var simpleVBind = bindings.find(function (b) { return (0, guards_1.isDirectiveNode)(b) && !b.arg; });
var rawVBind_1 = false;
if (simpleVBind && guards_1.isSimpleExpressionNode(simpleVBind.exp)) {
if (simpleVBind && (0, guards_1.isSimpleExpressionNode)(simpleVBind.exp)) {
var ast = parser.parse("() => (" + simpleVBind.exp.content + ")");
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
visitObjectExpression: function (path) {

@@ -72,3 +72,3 @@ path.get('properties').each(function (property) {

if (bt.isProperty(node) || bt.isObjectProperty(node)) {
var name_1 = recast_1.print(property.get('key')).code;
var name_1 = (0, recast_1.print)(property.get('key')).code;
var bindingDesc = bindingDescriptors_1.filter(function (t) { return t.name === name_1; })[0];

@@ -92,9 +92,9 @@ simpleBindings_1.push(bindingDesc

slotDescriptor_1.bindings = simpleBindings_1.concat(bindings.reduce(function (acc, b) {
if (!rawVBind_1 && guards_1.isDirectiveNode(b) && !b.arg) {
if (!rawVBind_1 && (0, guards_1.isDirectiveNode)(b) && !b.arg) {
return acc;
}
// resolve name of binding
var name = guards_1.isDirectiveNode(b) && b.arg && guards_1.isSimpleExpressionNode(b.arg)
var name = (0, guards_1.isDirectiveNode)(b) && b.arg && (0, guards_1.isSimpleExpressionNode)(b.arg)
? b.arg.content
: "" + (guards_1.isDirectiveNode(b) ? 'v-' : '') + b.name;
: "" + ((0, guards_1.isDirectiveNode)(b) ? 'v-' : '') + b.name;
var bindingDesc = bindingDescriptors_1.filter(function (t) { return t.name === name; })[0];

@@ -101,0 +101,0 @@ acc.push(bindingDesc ? bindingDesc : { name: name, title: 'binding' });

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

originalDirName = path.dirname(opt.filePath);
pathResolver = makePathResolver_1.default(originalDirName, opt.alias, opt.modules);
pathResolver = (0, makePathResolver_1.default)(originalDirName, opt.alias, opt.modules);
// resolve where components are through immediately exported variables
return [4 /*yield*/, recursiveResolveIEV_1.default(pathResolver, varToFilePath, opt.validExtends)
return [4 /*yield*/, (0, recursiveResolveIEV_1.default)(pathResolver, varToFilePath, opt.validExtends)
// if we are in a mixin or an extend we want to add

@@ -132,3 +132,3 @@ // all props on the current doc, instead of creating another one

vars = files.get(fullFilePath) || [];
return [4 /*yield*/, parse_1.parseFile(__assign(__assign({}, opt), { filePath: fullFilePath, nameFilter: vars.map(function (v) { return v.exportName; }) }), documentation)
return [4 /*yield*/, (0, parse_1.parseFile)(__assign(__assign({}, opt), { filePath: fullFilePath, nameFilter: vars.map(function (v) { return v.exportName; }) }), documentation)
// update varnames with the original iev names

@@ -192,3 +192,3 @@ ];

_a);
return [4 /*yield*/, parse_1.parseFile(__assign(__assign(__assign({}, opt), { filePath: fullFilePath, nameFilter: [exportName] }), originVar), documentation)];
return [4 /*yield*/, (0, parse_1.parseFile)(__assign(__assign(__assign({}, opt), { filePath: fullFilePath, nameFilter: [exportName] }), originVar), documentation)];
case 2:

@@ -195,0 +195,0 @@ _b.sent();

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

// find the first node that is not a potential comment
var indexLastComment = slotSiblingsBeforeSlot.findIndex(function (sibling) { return !guards_1.isCommentNode(sibling); });
var indexLastComment = slotSiblingsBeforeSlot.findIndex(function (sibling) { return !(0, guards_1.isCommentNode)(sibling); });
// cut the comments array on this index

@@ -30,0 +30,0 @@ var slotLeadingComments = (indexLastComment > 0

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

content = content || '';
var typeSlice = matchRecursiveRegexp_1.default(content, '{', '}')[0] || '';
var typeSlice = (0, matchRecursiveRegexp_1.default)(content, '{', '}')[0] || '';
var param = hasName || typeSlice.length ? { type: getTypeObjectFromTypeString(typeSlice) } : {};

@@ -24,0 +24,0 @@ content = content.replace("{" + typeSlice + "}", '');

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

var cacher_1 = __importDefault(require("./cacher"));
var read = util_1.promisify(fs_1.readFile);
var read = (0, util_1.promisify)(fs_1.readFile);
function getPathOfExportedValue(pathResolver, exportName, filePath, options) {

@@ -96,4 +96,4 @@ return __awaiter(this, void 0, void 0, function () {

source = _b.sent();
ast = cacher_1.default(function () { return recast_1.parse(source, { parser: babel_parser_1.default({ plugins: plugins }) }); }, source);
ast_types_1.visit(ast, {
ast = (0, cacher_1.default)(function () { return (0, recast_1.parse)(source, { parser: (0, babel_parser_1.default)({ plugins: plugins }) }); }, source);
(0, ast_types_1.visit)(ast, {
visitExportNamedDeclaration: function (p) {

@@ -100,0 +100,0 @@ var masterDeclaration = p.node.declaration;

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

var babel_parser_1 = __importDefault(require("../babel-parser"));
var parser = babel_parser_1.default({ plugins: ['typescript'] });
var parser = (0, babel_parser_1.default)({ plugins: ['typescript'] });
function getTemplateExpressionAST(expression) {

@@ -10,0 +10,0 @@ try {

"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -15,7 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

return function (filePath, originalDirNameOverride) {
return resolvePathFrom_1.default(resolveAliases_1.default(filePath, aliases || {}, refDirName), __spreadArray([
return (0, resolvePathFrom_1.default)((0, resolveAliases_1.default)(filePath, aliases || {}, refDirName), __spreadArray([
originalDirNameOverride || refDirName
], (modules || [])));
], (modules || []), true));
};
}
exports.default = makePathResolver;

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

var resolveImmediatelyExported_1 = __importDefault(require("./resolveImmediatelyExported"));
var read = util_1.promisify(fs_1.readFile);
var read = (0, util_1.promisify)(fs_1.readFile);
// eslint-disable-next-line @typescript-eslint/no-var-requires

@@ -166,4 +166,4 @@ var hash = require('hash-sum');

source_1 = _b.sent();
astRemote = cacher_1.default(function () { return recast_1.parse(source_1, { parser: babel_parser_1.default() }); }, source_1);
returnedVariables_1 = resolveImmediatelyExported_1.default(astRemote, exportedVariableNames_1);
astRemote = (0, cacher_1.default)(function () { return (0, recast_1.parse)(source_1, { parser: (0, babel_parser_1.default)() }); }, source_1);
returnedVariables_1 = (0, resolveImmediatelyExported_1.default)(astRemote, exportedVariableNames_1);
if (Object.keys(returnedVariables_1).length) {

@@ -170,0 +170,0 @@ exportToLocal.forEach(function (exported, local) {

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

var returnedObjectPath;
recast_1.visit(realDef.get('body'), {
(0, recast_1.visit)(realDef.get('body'), {
visitReturnStatement: function (rPath) {

@@ -122,3 +122,3 @@ var returnArg = rPath.get('argument');

var _a;
var definitions = resolveExportDeclaration_1.default(path);
var definitions = (0, resolveExportDeclaration_1.default)(path);
// if it is a pure export { compo } from "./compo" load the source here

@@ -139,3 +139,3 @@ var sourcePath = (_a = path.get('source').value) === null || _a === void 0 ? void 0 : _a.value;

}
var realDef = resolveIdentifier_1.default(ast, definition);
var realDef = (0, resolveIdentifier_1.default)(ast, definition);
if (realDef) {

@@ -159,3 +159,3 @@ if (isComponentDefinition(realDef)) {

}
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
// for perf resons,

@@ -181,3 +181,3 @@ // look only at the root,

// `module.exports = ...;`
if (!isExportedAssignment_1.default(path)) {
if (!(0, isExportedAssignment_1.default)(path)) {
return false;

@@ -189,3 +189,3 @@ }

var pathLeft = path.get('left');
var realComp = resolveIdentifier_1.default(ast, pathRight);
var realComp = (0, resolveIdentifier_1.default)(ast, pathRight);
var name = bt.isMemberExpression(pathLeft.node) &&

@@ -213,3 +213,3 @@ bt.isIdentifier(pathLeft.node.property) &&

});
var requiredValues = Object.assign(ievPureExports, resolveRequired_1.default(ast, nonComponentsIdentifiers));
var requiredValues = Object.assign(ievPureExports, (0, resolveRequired_1.default)(ast, nonComponentsIdentifiers));
return [components, requiredValues];

@@ -216,0 +216,0 @@ }

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

var comp = null;
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
// to look only at the root we ignore all traversing

@@ -36,0 +36,0 @@ visitFunctionDeclaration: ignore,

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

// get imported variable names and filepath
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
visitImportDeclaration: function (astPath) {

@@ -50,3 +50,3 @@ if (!astPath.node.source) {

});
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
visitExportNamedDeclaration: function (astPath) {

@@ -53,0 +53,0 @@ var specifiers = astPath.get('specifiers');

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

var variablesMap = new ts_map_1.default();
recast_1.visit(ast, {
(0, recast_1.visit)(ast, {
// for perf resons,

@@ -36,0 +36,0 @@ // look only at the root,

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

try {
finalPath = require.resolve(path_1.join(path, "index" + s), {
finalPath = require.resolve((0, path_1.join)(path, "index" + s), {
paths: from

@@ -36,3 +36,3 @@ });

try {
finalPath = require.resolve(path_1.join(from[i], "" + path + s));
finalPath = require.resolve((0, path_1.join)(from[i], "" + path + s));
if (finalPath.length) {

@@ -49,3 +49,3 @@ break;

try {
var packagePath = require.resolve(path_1.join(path, 'package.json'), {
var packagePath = require.resolve((0, path_1.join)(path, 'package.json'), {
paths: from

@@ -56,3 +56,3 @@ });

// if it is an es6 module use the module instead of commonjs
finalPath = require.resolve(path_1.join(path, pkg.module || pkg.main));
finalPath = require.resolve((0, path_1.join)(path, pkg.module || pkg.main));
}

@@ -59,0 +59,0 @@ catch (e) {

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

var varToFilePath = {};
recast_1.visit(ast.program, {
(0, recast_1.visit)(ast.program, {
visitImportDeclaration: function (astPath) {

@@ -34,0 +34,0 @@ var specifiers = astPath.get('specifiers');

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

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

"ts-map": "^1.0.3",
"vue-inbrowser-compiler-utils": "^4.41.2"
"vue-inbrowser-compiler-utils": "^4.42.0"
},

@@ -55,3 +55,3 @@ "devDependencies": {

},
"gitHead": "e2484a9e230acf07b43565ea4c97e1c2f132d618"
"gitHead": "8ba9d774ec311350937ba1d33d1aa5580c13eb2a"
}
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