UNPKG

@dpkit/table

Version:

Data Package implementation in TypeScript.

13 lines (9 loc) 403 B
import type { Schema } from "@dpkit/core" import type { TableError } from "../error/Table.ts" import type { Table } from "../table/Table.ts" import { checkRowUnique } from "./checks/unique.ts" export function validateRows(schema: Schema, errorTable: Table) { const errors: TableError[] = [] errorTable = checkRowUnique(schema, errorTable) return { valid: !errors.length, errors, errorTable } }