Fixed bug in makefile due to renaming the tool script before, bumped version, made factories for easier schema definition
This commit is contained in:
9
experiments/config2.mjs
Normal file
9
experiments/config2.mjs
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as F from '@efforting.tech/data/field-configuration-factories';
|
||||
|
||||
const s = new F.Schema({
|
||||
foo: F.value(123, 'The value'),
|
||||
bar: F.factory((t) => `Field ${t.field_name} was not set`, 'The factory'),
|
||||
});
|
||||
|
||||
|
||||
console.log(s.load()) // { foo: 123, bar: 'Field bar was not set' }
|
||||
Reference in New Issue
Block a user