Skip to content

Commit 39782e2

Browse files
authored
fix: valid JSDoc types, nested objects and order (#308)
* keep type to lowercase * correct order for nested objs
1 parent 6890a7e commit 39782e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: assets/vendor/json-to-jsdoc.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ function getTypeOfValue(value) {
8282
.toLowerCase();
8383

8484
if (!currentType) currentType = "*";
85-
86-
return currentType[0].toUpperCase() + currentType.substr(1);
85+
return currentType;
8786
}
8887
/**
8988
* @param {Array} array - The array that we want to parse
@@ -125,6 +124,12 @@ function parseObject(obj, objectName, doNotReinsert = false) {
125124
const currentPrefix = `${prefix}${propertyName}`;
126125
let result = null;
127126

127+
// Root Object don't have a objectName
128+
if (!doNotReinsert && objectName) {
129+
if (!(objectName in this)) this[objectName] = [];
130+
this[objectName].push("object");
131+
}
132+
128133
// If it's Array, we need the values inside.
129134
if (propertyType === "array")
130135
parseArray.bind(this, currentValue, currentPrefix)();
@@ -136,11 +141,6 @@ function parseObject(obj, objectName, doNotReinsert = false) {
136141
this[currentPrefix].push(result);
137142
}
138143
});
139-
// Root Object don't have a objectName
140-
if (!doNotReinsert && objectName) {
141-
if (!(objectName in this)) this[objectName] = [];
142-
this[objectName].push("object");
143-
}
144144
}
145145

146146
function ParseRootDefinition(obj) {

0 commit comments

Comments
 (0)