vue-docgen-api
Advanced tools
Comparing version 4.40.0 to 4.41.0
@@ -82,6 +82,3 @@ "use strict"; | ||
// set all the static properties | ||
exportName: obj.exportName, displayName: obj.displayName, props: props, | ||
events: events, | ||
methods: methods, | ||
slots: slots }); | ||
exportName: obj.exportName, displayName: obj.displayName, props: props, events: events, methods: methods, slots: slots }); | ||
}; | ||
@@ -88,0 +85,0 @@ Documentation.prototype.getDescriptor = function (name, map, init) { |
@@ -25,3 +25,3 @@ import * as pug from 'pug'; | ||
alias?: { | ||
[alias: string]: string; | ||
[alias: string]: string | string[]; | ||
}; | ||
@@ -28,0 +28,0 @@ /** |
export default function makePathResolver(refDirName: string, aliases?: { | ||
[alias: string]: string; | ||
[alias: string]: string | string[]; | ||
}, modules?: string[]): (filePath: string, originalDirNameOverride?: string) => string | null; |
@@ -15,3 +15,3 @@ "use strict"; | ||
return function (filePath, originalDirNameOverride) { | ||
return resolvePathFrom_1.default(resolveAliases_1.default(filePath, aliases || {}), __spreadArray([ | ||
return resolvePathFrom_1.default(resolveAliases_1.default(filePath, aliases || {}, refDirName), __spreadArray([ | ||
originalDirNameOverride || refDirName | ||
@@ -18,0 +18,0 @@ ], (modules || []))); |
export default function resolveAliases(filePath: string, aliases: { | ||
[alias: string]: string; | ||
}): string; | ||
[alias: string]: string | string[]; | ||
}, refDirName?: string): string; |
@@ -23,18 +23,35 @@ "use strict"; | ||
var path = __importStar(require("path")); | ||
function resolveAliases(filePath, aliases) { | ||
var fs = __importStar(require("fs")); | ||
function resolveAliases(filePath, aliases, refDirName) { | ||
if (refDirName === void 0) { refDirName = ''; } | ||
var aliasKeys = Object.keys(aliases); | ||
var i = aliasKeys.length; | ||
var aliasFound = false; | ||
var aliasResolved = null; | ||
if (!aliasKeys.length) { | ||
return filePath; | ||
} | ||
while (!aliasFound && i--) { | ||
var aliasValueWithSlash = aliasKeys[i] + '/'; | ||
aliasFound = filePath.substring(0, aliasValueWithSlash.length) === aliasValueWithSlash; | ||
for (var _i = 0, aliasKeys_1 = aliasKeys; _i < aliasKeys_1.length; _i++) { | ||
var aliasKey = aliasKeys_1[_i]; | ||
var aliasValueWithSlash = aliasKey + '/'; | ||
var aliasMatch = filePath.substring(0, aliasValueWithSlash.length) === aliasValueWithSlash; | ||
var aliasValue = aliases[aliasKey]; | ||
if (!aliasMatch) { | ||
continue; | ||
} | ||
if (!Array.isArray(aliasValue)) { | ||
aliasResolved = path.join(aliasValue, filePath.substring(aliasKey.length + 1)); | ||
continue; | ||
} | ||
for (var _a = 0, aliasValue_1 = aliasValue; _a < aliasValue_1.length; _a++) { | ||
var alias = aliasValue_1[_a]; | ||
var absolutePath = path.resolve(refDirName, alias, filePath.substring(aliasKey.length + 1)); | ||
if (fs.existsSync(absolutePath)) { | ||
aliasResolved = absolutePath; | ||
break; | ||
} | ||
} | ||
} | ||
if (!aliasFound) { | ||
return filePath; | ||
} | ||
return path.join(aliases[aliasKeys[i]], filePath.substring(aliasKeys[i].length + 1)); | ||
return aliasResolved === null ? | ||
filePath : | ||
aliasResolved; | ||
} | ||
exports.default = resolveAliases; |
{ | ||
"name": "vue-docgen-api", | ||
"version": "4.40.0", | ||
"version": "4.41.0", | ||
"description": "Toolbox to extract information from Vue component files for documentation generation purposes.", | ||
@@ -39,9 +39,9 @@ "homepage": "https://vue-styleguidist.github.io", | ||
"pug": "^3.0.2", | ||
"recast": "0.20.4", | ||
"recast": "0.20.5", | ||
"ts-map": "^1.0.3", | ||
"vue-inbrowser-compiler-utils": "^4.40.0" | ||
"vue-inbrowser-compiler-utils": "^4.41.0" | ||
}, | ||
"devDependencies": { | ||
"@test-vue-docgen/mixins": "3.15.4", | ||
"@types/pug": "2.0.4", | ||
"@types/pug": "2.0.5", | ||
"globby": "10.0.2", | ||
@@ -52,5 +52,5 @@ "vue": "2.6.14", | ||
"vue-property-decorator": "7.3.0", | ||
"vuetify": "2.5.3" | ||
"vuetify": "2.5.8" | ||
}, | ||
"gitHead": "3d21924976c150f869d165e2b92bb6269e54eaa4" | ||
"gitHead": "06b27b5cb3c3a39ed9d05fa78e9be39b4cd9e518" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
305721
6071
11
+ Addedrecast@0.20.5(transitive)
- Removedrecast@0.20.4(transitive)
Updatedrecast@0.20.5