@fjell/validation
v4.4.6
Published
Validation Logic for Fjell Items and Keys
Downloads
1,887
Readme
@fjell/validation
Validation logic for Fjell items and keys. This package contains validators that can be used on both client and server side.
Installation
npm install @fjell/validationUsage
import { ItemValidator, KeyValidator } from '@fjell/validation';
import { PriKey } from '@fjell/types';
const key: PriKey<'user'> = { kt: 'user', pk: '123' };
// Validate a key
if (KeyValidator.isPriKey(key)) {
console.log('Valid primary key');
}