-
-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
EDIT: a simpler schema
{
"type": "object",
"properties": {
"email": { "type": "string", "transform": ["trim"] }
}
}
gives
SyntaxError: Unexpected token ':'
.
const schema43 = scope.schema[23];const func0 = scope.func[0];const func86 = scope.func[2];return function validate29(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){for(const key0 of Object.keys(data)){if(!(key0 === "email")){delete data[key0];}}if(data.email !== undefined && func0.call(data, "email")){let data0 = data.email;if(typeof data0 !== "string"){let dataType0 = typeof data0;let coerced0 = undefined;if(dataType0 == 'object' && Array.isArray(data0) && data0.length == 1){data0 = data0[0];dataType0 = typeof data0;if(typeof data0 === "string"){coerced0 = data0;}}if(!(coerced0 !== undefined)){if(dataType0 == "number" || dataType0 == "boolean"){coerced0 = "" + data0;}else if(data0 === null){coerced0 = "";}else {const err0 = {instancePath:instancePath+"/email",schemaPath:"#/properties/email/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(coerced0 !== undefined){data0 = coerced0;if(data !== undefined){data["email"] = coerced0;}}}if(typeof {"str":"data0"} == "string" && {"str":"data"} !== undefined){data0 = {"str":"func86","prefix":"func","value":{"code":{"_items":["require(\"ajv-keywords/dist/definitions/transform\").transform",".trim",""]}},"scopePath":{"_items":[".",{"str":"func"},"[",2,"]"]}}({"str":"data0"});{"str":"data"}[{"_items":["","\"email\"",""]}] = data0;}}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate29.errors = vErrors;return errors === 0;}
felixfbecker
Metadata
Metadata
Assignees
Labels
No labels