feat: support old ones too (i think)

This commit is contained in:
Jonny_Bro 2025-03-08 23:10:05 +05:00
parent c3ea45c405
commit 103ed6f533
No known key found for this signature in database
GPG key ID: A18808B38428F7C4

View file

@ -266,8 +266,17 @@ function sanitize(string = "", forceLowercase = true, strict = false) {
* @returns {Boolean} True if the content is a valid course file array
*/
function isCourseFileValid(content) {
if (content.length !== 7) return false;
if (typeof content[0] !== "object" || typeof content[1] !== "object" || typeof content[2] !== "string" || typeof content[3] !== "number" || typeof content[4] !== "string" || typeof content[5] !== "object" || typeof content[6] !== "number") return false;
if (content.length !== 6 || content.length !== 7) return false;
if (
typeof content[0] !== "object" ||
typeof content[1] !== "object" ||
typeof content[2] !== "string" ||
typeof content[3] !== "number" ||
typeof content[4] !== "string" ||
typeof content[5] !== "object" ||
(content[6] && typeof content[6] !== "number")
)
return false;
return true;
}