axiodb
Version:
A blazing-fast, lightweight, and scalable nodejs package based DBMS for modern application. Supports schemas, encryption, and advanced query capabilities.
11 lines (10 loc) • 538 B
TypeScript
import { Schema } from "joi";
/**
* Validates the provided data against the given Joi schema.
*
* @param dataSchema - The Joi schema to validate against.
* @param data - The data to be validated.
* @param isUpdate - A boolean flag to indicate if the data is being validated for an update operation.
* @returns A promise that resolves with the validated data if validation is successful, or rejects with a validation error.
*/
export default function schemaValidate(dataSchema: Schema, data: any, isUpdate?: boolean): Promise<any>;