Spaces:
Running
Running
Download source/teaql-ts/src/core/checker.ts from teaql/browser-sqlite-playground: direct link, hf CLI and curl.
- Browser
- Download file 454 Bytes
-
https://huggingface.co/spaces/teaql/browser-sqlite-playground/resolve/main/source/teaql-ts/src/core/checker.ts
- Command line
-
hf download hf://spaces/teaql/browser-sqlite-playground/source/teaql-ts/src/core/checker.ts
-
curl -L -o checker.ts https://huggingface.co/spaces/teaql/browser-sqlite-playground/resolve/main/source/teaql-ts/src/core/checker.ts
454 Bytes
| import { UserContext } from './context'; | |
| import { CheckResult } from './i18n'; | |
| export interface EntityChecker { | |
| checkAndFix(context: UserContext, mutation: any, results: CheckResult[]): void; | |
| } | |
| export class CheckException extends Error { | |
| constructor(public readonly violations: readonly CheckResult[]) { | |
| super(`Check failed: ${violations.map(v => v.message ?? `${v.ruleId}:${v.location}`).join('; ')}`); | |
| this.name = 'CheckException'; | |
| } | |
| } | |