UNPKG

@kubernetes-models/flux-cd

Version:
1 lines 1.98 kB
export const validate=validate0;let schema1_enum=["RemediateOnFailure","RetryOnFailure"];function validate1(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if("string"!=typeof data){let err0={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"string"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}if("RemediateOnFailure"!==data&&"RetryOnFailure"!==data){let err1={instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:schema1_enum}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}return validate1.errors=vErrors,0===errors}function validate3(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if("string"!=typeof data&&null!==data){let err0={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"string"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}return validate3.errors=vErrors,0===errors}function validate0(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if(data&&"object"==typeof data&&!Array.isArray(data)){if(void 0===data.name){let err0={instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}void 0!==data.name&&(validate1(data.name,{instancePath:instancePath+"/name",parentData:data,parentDataProperty:"name",rootData})||(errors=(vErrors=null===vErrors?validate1.errors:vErrors.concat(validate1.errors)).length)),void 0!==data.retryInterval&&(validate3(data.retryInterval,{instancePath:instancePath+"/retryInterval",parentData:data,parentDataProperty:"retryInterval",rootData})||(errors=(vErrors=null===vErrors?validate3.errors:vErrors.concat(validate3.errors)).length))}else{let err1={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"object"}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}return validate0.errors=vErrors,0===errors}