validatePackage
validatePackage(
source,options?):Promise<{errors: ({actualBytes:number;bytes:number;resource:string;type:"file/bytes"; } | {actualHash:string;hash:string;resource:string;type:"file/hash"; } | {actualEncoding:string;encoding:string;resource:string;type:"file/encoding"; } | {fieldNames:string[];resource:string;type:"fields/missing"; } | {fieldNames:string[];resource:string;type:"fields/extra"; } | {actualFieldName:string;fieldName:string;resource:string;type:"field/name"; } | {actualFieldType:FieldType;fieldName:string;fieldType:FieldType;resource:string;type:"field/type"; } | {fieldNames:string[];resource:string;rowNumber:number;type:"row/unique"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/type"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/required"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/minimum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/maximum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/exclusiveMinimum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/exclusiveMaximum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/minLength"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/maxLength"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/pattern"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/unique"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/enum"; })[];valid:boolean; } | {errors:object[];valid:boolean; }>
Defined in: lib/package/validate.ts:6
Parameters
Section titled “Parameters”source
Section titled “source”string | Descriptor | Partial<Package>
options?
Section titled “options?”basepath?
Section titled “basepath?”string
Returns
Section titled “Returns”Promise<{ errors: ({ actualBytes: number; bytes: number; resource: string; type: "file/bytes"; } | { actualHash: string; hash: string; resource: string; type: "file/hash"; } | { actualEncoding: string; encoding: string; resource: string; type: "file/encoding"; } | { fieldNames: string[]; resource: string; type: "fields/missing"; } | { fieldNames: string[]; resource: string; type: "fields/extra"; } | { actualFieldName: string; fieldName: string; resource: string; type: "field/name"; } | { actualFieldType: FieldType; fieldName: string; fieldType: FieldType; resource: string; type: "field/type"; } | { fieldNames: string[]; resource: string; rowNumber: number; type: "row/unique"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/type"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/required"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/minimum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/maximum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/exclusiveMinimum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/exclusiveMaximum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/minLength"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/maxLength"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/pattern"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/unique"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/enum"; })[]; valid: boolean; } | { errors: object[]; valid: boolean; }>