function isBuiltInType(type) {
		const builtInTypes = formatters._baseTypes;

		// Early return if the type is directly in baseTypes
		if (includesIgnoreCase(builtInTypes, type)) {
			return true;
		}

		// Check if the type is a union type
		if (type.includes("|")) {
			const unionParts = type.split("|").map((part) => part.trim());
			return unionParts.every((part) => isBuiltInType(part));
		}

		// Handle array notation directly
		if (type.endsWith("[]")) {
			return builtInTypes.includes(type.slice(0, -2));
		}

		// Predefined regex patterns for reuse
		const arrayRegex = /Array<(.+)>/;
		const arrayDotRegex = /Array\.<(.+)>/;
		const objectRegex = /Object<([^,]+),([^>]+)>/;
		const objectDotRegex = /Object\.<([^,]+),([^>]+)>/;

		// Check if the type is a generic Array type
		const arrayMatch = arrayRegex.exec(type);
		if (arrayMatch) {
			const innerType = arrayMatch[1];
			return isBuiltInType(innerType);
		}

		const arrayDotMatch = arrayDotRegex.exec(type);
		if (arrayDotMatch) {
			const innerType = arrayDotMatch[1];
			return isBuiltInType(innerType);
		}

		// Check if the type is a generic Object type
		const objectMatch = objectRegex.exec(type);
		if (objectMatch) {
			const innerTypes = [objectMatch[1], objectMatch[2]].map((t) => t.trim());
			return innerTypes.every((innerType) => isBuiltInType(innerType));
		}

		const objectDotMatch = objectDotRegex.exec(type);
		if (objectDotMatch) {
			const innerTypes = [objectDotMatch[1], objectDotMatch[2]].map((t) => t.trim());
			return innerTypes.every((innerType) => isBuiltInType(innerType));
		}

		// Fallback case: if none of the above matched, return false
		return false;
	}
Check if a type is a built-in type, handling both simple
and compound types gracefully.

@param {string} type A type to check
@returns {boolean} true if the type is built-in, otherwise false