From 39782e214af93b9fcb38b680437681d4690b5c58 Mon Sep 17 00:00:00 2001 From: Satwik Gupta Date: Wed, 20 Oct 2021 03:19:01 +0530 Subject: [PATCH] fix: valid JSDoc types, nested objects and order (#308) * keep type to lowercase * correct order for nested objs --- assets/vendor/json-to-jsdoc.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/vendor/json-to-jsdoc.js b/assets/vendor/json-to-jsdoc.js index 2956313..b9ff36d 100644 --- a/assets/vendor/json-to-jsdoc.js +++ b/assets/vendor/json-to-jsdoc.js @@ -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) {