components/node_modules/vue-docgen-api/dist/script-handlers/extendsHandler.js
/**
 * Returns documentation of the component referenced in the extends property of the component
 * @param {NodePath} astPath
 * @param {Array<NodePath>} componentDefinitions
 * @param {string} originalFilePath
 */
Returns documentation of the component referenced in the extends property of the component
@param {NodePath} astPath
@param {Array} componentDefinitions
@param {string} originalFilePath
Returns documentation of the component referenced in the extends property of the component @param { NodePath } astPath @param { Array } componentDefinitions @param { string } originalFilePath
function extendsHandler(documentation, componentDefinition, astPath, opt) {
    return __awaiter(this, void 0, void 0, function () {
        var extendsVariableName, extendsFilePath, originalDirName, pathResolver;
        var _this = this;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    extendsVariableName = getExtendsVariableName(componentDefinition);
                    if (!extendsVariableName) {
                        return [2 ];
                    }
                    extendsFilePath = resolveRequired_1.default(astPath, [extendsVariableName]);
                    originalDirName = path.dirname(opt.filePath);
                    pathResolver = makePathResolver_1.default(originalDirName, opt.alias);
                    return [4 , adaptExportsToIEV_1.default(pathResolver, extendsFilePath, opt.validExtends)];
                case 1:
                    _a.sent();
                    return [4 , extendsFilePath[extendsVariableName].filePath.reduce(function (_, p) { return __awaiter(_this, void 0, void 0, function () {
                            var fullFilePath, extendsVar, e_1;
                            return __generator(this, function (_a) {
                                switch (_a.label) {
                                    case 0:
                                        fullFilePath = pathResolver(p);
                                        if (!opt.validExtends(fullFilePath)) return [3 , 4];
                                        _a.label = 1;
                                    case 1:
                                        _a.trys.push([1, 3, , 4]);
                                        extendsVar = {
                                            name: extendsFilePath[extendsVariableName].exportName,
                                            path: fullFilePath
                                        };
                                        return [4 , parse_1.parseFile(__assign(__assign({}, opt), { filePath: fullFilePath, nameFilter: [extendsFilePath[extendsVariableName].exportName], extends: extendsVar }), documentation)];
                                    case 2:
                                        _a.sent();
                                        extendsVar.name = documentation.get('displayName');
                                        return [3 , 4];
                                    case 3:
                                        e_1 = _a.sent();
                                        return [3 , 4];
                                    case 4:
                                        documentation.set('displayName', null);
                                        return [2 ];
                                }
                            });
                        }); }, {})];
                case 2:
                    _a.sent();
                    return [2 ];
            }
        });
    });
}
function extendsHandler ( documentation , componentDefinition , astPath , opt ) { return __awaiter ( this , void 0 , void 0 , function ( ) { var extendsVariableName , extendsFilePath , originalDirName , pathResolver ; var _this = this ; return __generator ( this , function ( _a ) { switch ( _a . label ) { case 0 : extendsVariableName = getExtendsVariableName ( componentDefinition ) ; if ( ! extendsVariableName ) { return [ 2 ] ; } extendsFilePath = resolveRequired_1 . default ( astPath , [ extendsVariableName ] ) ; originalDirName = path . dirname ( opt . filePath ) ; pathResolver = makePathResolver_1 . default ( originalDirName , opt . alias ) ; return [ 4 , adaptExportsToIEV_1 . default ( pathResolver , extendsFilePath , opt . validExtends ) ] ; case 1 : _a . sent ( ) ; return [ 4 , extendsFilePath [ extendsVariableName ] . filePath . reduce ( function ( _ , p ) { return __awaiter ( _this , void 0 , void 0 , function ( ) { var fullFilePath , extendsVar , e_1 ; return __generator ( this , function ( _a ) { switch ( _a . label ) { case 0 : fullFilePath = pathResolver ( p ) ; if ( ! opt . validExtends ( fullFilePath ) ) return [ 3 , 4 ] ; _a . label = 1 ; case 1 : _a . trys . push ( [ 1 , 3 , , 4 ] ) ; extendsVar = { name : extendsFilePath [ extendsVariableName ] . exportName , path : fullFilePath } ; return [ 4 , parse_1 . parseFile ( __assign ( __assign ( { } , opt ) , { filePath : fullFilePath , nameFilter : [ extendsFilePath [ extendsVariableName ] . exportName ] , extends : extendsVar } ) , documentation ) ] ; case 2 : _a . sent ( ) ; extendsVar . name = documentation . get ( 'displayName' ) ; return [ 3 , 4 ] ; case 3 : e_1 = _a . sent ( ) ; return [ 3 , 4 ] ; case 4 : documentation . set ( 'displayName' , null ) ; return [ 2 ] ; } } ) ; } ) ; } , { } ) ] ; case 2 : _a . sent ( ) ; return [ 2 ] ; } } ) ; } ) ; }
Returns documentation of the component referenced in the extends property of the component
 @param {NodePath} astPath
 @param {Array<NodePath>} componentDefinitions
 @param {string} originalFilePath
Returns documentation of the component referenced in the extends property of the component @param { NodePath } astPath @param { Array<NodePath > } componentDefinitions @param { string } originalFilePath
// if there is no extends or extends is a direct require /*return*/ /*yield*/ /*yield*/ /*break*/ /*yield*/ /*break*/ /*break*/ // make sure that the parent name does not bleed on the new doc /*return*/ /*return*/