function changeObjectKeys(obj, caseType) {
	if (Array.isArray(obj)) {
		return obj.map((p) => changeObjectKeys(p, caseType));
	} else {
		var result = {};
		for (const prop in obj) {
			let val = obj[prop];

			// return the null as is
			if (obj[prop] === null) {
				val = obj[prop];
			} else if (Array.isArray(val)) {
				val = val.map((p) => changeObjectKeys(p, caseType));
			} else {
				// Calculate the property value
				val =
					typeof obj[prop] === "object"
						? changeObjectKeys(obj[prop], caseType)
						: obj[prop];
			}

			result[changePropertyFirstCharCase(prop, caseType)] = val;
		}
		return result;
	}
}
/**
 * Change the first char of all object keys to the selected case type
 *
 * @param {object} obj The object
 * @param {boolean} caseType If true to upper case, otherwise to lower case
 * @returns A new object
 */
Change the first char of all object keys to the selected case type
@param {object} obj The object
@param {boolean} caseType If true to upper case, otherwise to lower case
@returns A new object
Change the first char of all object keys to the selected case type @param { object } obj The object @param { boolean } caseType If true to upper case otherwise to lower case @returns A new object
function changeObjectKeys(obj, caseType) {
	if (Array.isArray(obj)) {
		return obj.map((p) => changeObjectKeys(p, caseType));
	} else {
		var result = {};
		for (const prop in obj) {
			let val = obj[prop];
			if (obj[prop] === null) {
				val = obj[prop];
			} else if (Array.isArray(val)) {
				val = val.map((p) => changeObjectKeys(p, caseType));
			} else {
				val =
					typeof obj[prop] === "object"
						? changeObjectKeys(obj[prop], caseType)
						: obj[prop];
			}
			result[changePropertyFirstCharCase(prop, caseType)] = val;
		}
		return result;
	}
}
function changeObjectKeys ( obj , caseType ) { if ( Array . isArray ( obj ) ) { return obj . map ( ( p ) => changeObjectKeys ( p , caseType ) ) ; } else { var result = { } ; for ( const prop in obj ) { let val = obj [ prop ] ; if ( obj [ prop ] === null ) { val = obj [ prop ] ; } else if ( Array . isArray ( val ) ) { val = val . map ( ( p ) => changeObjectKeys ( p , caseType ) ) ; } else { val = typeof obj [ prop ] === "object" ? changeObjectKeys ( obj [ prop ] , caseType ) : obj [ prop ] ; } result [ changePropertyFirstCharCase ( prop , caseType ) ] = val ; } return result ; } }
Change the first char of all object keys to the selected case type
 @param {object} obj The object
 @param {boolean} caseType If true to upper case, otherwise to lower case
 @returns A new object
Change the first char of all object keys to the selected case type @param { object } obj The object @param { boolean } caseType If true to upper case otherwise to lower case @returns A new object
// return the null as is // Calculate the property value