Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ function validateValueBySchema(value, schema, requiredByParam, bypassRequiredChe
let stringCheck = type === "string" && value
let arrayCheck = type === "array" && Array.isArray(value) && value.length
let arrayListCheck = type === "array" && Im.List.isList(value) && value.count()
let arrayStringCheck = type === "array" && typeof value === "string" && value
let fileCheck = type === "file" && value instanceof win.File
let booleanCheck = type === "boolean" && (value || value === false)
let numberCheck = type === "number" && (value || value === 0)
Expand All @@ -474,7 +475,7 @@ function validateValueBySchema(value, schema, requiredByParam, bypassRequiredChe
let objectStringCheck = type === "object" && typeof value === "string" && value

const allChecks = [
stringCheck, arrayCheck, arrayListCheck, fileCheck,
stringCheck, arrayCheck, arrayListCheck, arrayStringCheck, fileCheck,
booleanCheck, numberCheck, integerCheck, objectCheck, objectStringCheck,
]

Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion test/unit/core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ describe("utils", () => {
type: "array"
}
value = "[1]"
assertValidateParam(param, value, ["Required field is not provided"])
assertValidateParam(param, value, [])

// valid array, items match type
param = {
Expand Down