feat: support old ones too (i think)
This commit is contained in:
parent
c3ea45c405
commit
103ed6f533
1 changed files with 11 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue