vue-component-meta
Advanced tools
Comparing version
@@ -359,3 +359,3 @@ "use strict"; | ||
function shouldIgnore(subtype) { | ||
const name = typeChecker.typeToString(subtype); | ||
const name = getFullyQualifiedName(subtype); | ||
if (name === 'any') { | ||
@@ -399,3 +399,3 @@ return true; | ||
required: !(prop.flags & ts.SymbolFlags.Optional), | ||
type: typeChecker.typeToString(subtype), | ||
type: getFullyQualifiedName(subtype), | ||
rawType: rawType ? subtype : undefined, | ||
@@ -419,3 +419,3 @@ get declarations() { | ||
name: prop.getName(), | ||
type: typeChecker.typeToString(subtype), | ||
type: getFullyQualifiedName(subtype), | ||
rawType: rawType ? subtype : undefined, | ||
@@ -437,3 +437,3 @@ description: ts.displayPartsToString(prop.getDocumentationComment(typeChecker)), | ||
name: expose.getName(), | ||
type: typeChecker.typeToString(subtype), | ||
type: getFullyQualifiedName(subtype), | ||
rawType: rawType ? subtype : undefined, | ||
@@ -458,3 +458,3 @@ description: ts.displayPartsToString(expose.getDocumentationComment(typeChecker)), | ||
if (call.parameters[1].valueDeclaration?.dotDotDotToken) { | ||
subtypeStr = typeChecker.typeToString(subtype); | ||
subtypeStr = getFullyQualifiedName(subtype); | ||
getSchema = () => typeChecker.getTypeArguments(subtype).map(resolveSchema); | ||
@@ -465,3 +465,3 @@ } | ||
for (let i = 1; i < call.parameters.length; i++) { | ||
subtypeStr += typeChecker.typeToString(typeChecker.getTypeOfSymbolAtLocation(call.parameters[i], symbolNode)) + ', '; | ||
subtypeStr += getFullyQualifiedName(typeChecker.getTypeOfSymbolAtLocation(call.parameters[i], symbolNode)) + ', '; | ||
} | ||
@@ -511,3 +511,3 @@ subtypeStr = subtypeStr.slice(0, -2) + ']'; | ||
function resolveSchema(subtype) { | ||
const type = typeChecker.typeToString(subtype); | ||
const type = getFullyQualifiedName(subtype); | ||
if (shouldIgnore(subtype)) { | ||
@@ -527,3 +527,2 @@ return type; | ||
} | ||
// @ts-ignore - typescript internal, isArrayLikeType exists | ||
else if (typeChecker.isArrayLikeType(subtype)) { | ||
@@ -555,2 +554,9 @@ let schema; | ||
} | ||
function getFullyQualifiedName(type) { | ||
const str = typeChecker.typeToString(type, undefined, ts.TypeFormatFlags.UseFullyQualifiedType | ts.TypeFormatFlags.NoTruncation); | ||
if (str.includes('import(')) { | ||
return str.replace(/import\(.*?\)\./g, ''); | ||
} | ||
return str; | ||
} | ||
function getDeclarations(declaration) { | ||
@@ -557,0 +563,0 @@ if (noDeclarations) { |
{ | ||
"name": "vue-component-meta", | ||
"version": "3.0.0-alpha.4", | ||
"version": "3.0.0-alpha.6", | ||
"license": "MIT", | ||
@@ -16,6 +16,6 @@ "files": [ | ||
"dependencies": { | ||
"@volar/typescript": "~2.4.11", | ||
"@vue/language-core": "3.0.0-alpha.4", | ||
"@volar/typescript": "~2.4.13", | ||
"@vue/language-core": "3.0.0-alpha.6", | ||
"path-browserify": "^1.0.1", | ||
"vue-component-type-helpers": "3.0.0-alpha.4" | ||
"vue-component-type-helpers": "3.0.0-alpha.6" | ||
}, | ||
@@ -34,3 +34,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "1769cd6b94ec9e0cc2681b8dbba904f35856ba1c" | ||
"gitHead": "a7b5649ab4957cd2228f4bbc9205b2008bff58a2" | ||
} |
45857
0.49%968
0.62%+ Added
+ Added
- Removed
- Removed
Updated