fix: valid JSDoc types, nested objects and order (#308)

* keep type to lowercase

* correct order for nested objs
This commit is contained in:
Satwik Gupta authored and GitHub committed 2021-10-20 03:19:01 +05:30
1 parent 6890a7e109
commit 39782e214a
1 file changed
+7 -7
+7 -7
View File
@@ -82,8 +82,7 @@ function getTypeOfValue(value) {
.toLowerCase();
if (!currentType) currentType = "*";
return currentType[0].toUpperCase() + currentType.substr(1);
return currentType;
}
/**
* @param {Array} array - The array that we want to parse
@@ -125,6 +124,12 @@ function parseObject(obj, objectName, doNotReinsert = false) {
const currentPrefix = `${prefix}${propertyName}`;
let result = null;
// Root Object don't have a objectName
if (!doNotReinsert && objectName) {
if (!(objectName in this)) this[objectName] = [];
this[objectName].push("object");
}
// If it's Array, we need the values inside.
if (propertyType === "array")
parseArray.bind(this, currentValue, currentPrefix)();
@@ -136,11 +141,6 @@ function parseObject(obj, objectName, doNotReinsert = false) {
this[currentPrefix].push(result);
}
});
// Root Object don't have a objectName
if (!doNotReinsert && objectName) {
if (!(objectName in this)) this[objectName] = [];
this[objectName].push("object");
}
}
function ParseRootDefinition(obj) {