Add an abstract Database class

This commit is contained in:
Oliver-Akins 2025-04-30 21:57:32 -06:00
parent 48b31f7dec
commit 34be2b0626
4 changed files with 126 additions and 7 deletions

View file

@ -3,7 +3,13 @@ import { Logger } from "./Logger.mjs";
const { deepClone } = foundry.utils;
const { StringField, NumberField } = foundry.data.fields;
/**
* @param {unknown} value The value to validate
* @param {BucketConfig} options The bucket config for the table
* @returns Whether or not the value is valid for the table
*/
export function validateValue(value, options) {
/** @type {BucketConfig} */
let opts = deepClone(options);
if (validatorTypes[opts.type] == null) {
Logger.error(`Failed to find type validator for: ${opts.type}`);