Something went wrong. Try again.
A plain JavaScript validator for AT Protocol lexicon schemas
Something went wrong. Try again.
2.5 kB · 119 lines
JavaScript
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120// Test inputs for TID format validation
export const tidFormatInputs = [ { name: 'tid-valid-basic', lexicons: [ { lexicon: 1, id: 'test.format.tid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { tid: { type: 'string', format: 'tid' }, }, }, }, }, }, ], collection: 'test.format.tid', record: { tid: '3jui7kd54zh2y' }, }, { name: 'tid-valid-boundary', lexicons: [ { lexicon: 1, id: 'test.format.tid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { tid: { type: 'string', format: 'tid' }, }, }, }, }, }, ], collection: 'test.format.tid', record: { tid: '2zzzzzzzzzzzy' }, }, { name: 'tid-invalid-first-char', lexicons: [ { lexicon: 1, id: 'test.format.tid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { tid: { type: 'string', format: 'tid' }, }, }, }, }, }, ], collection: 'test.format.tid', record: { tid: 'kzzzzzzzzzzzz' }, }, { name: 'tid-invalid-wrong-length-short', lexicons: [ { lexicon: 1, id: 'test.format.tid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { tid: { type: 'string', format: 'tid' }, }, }, }, }, }, ], collection: 'test.format.tid', record: { tid: '3jui7kd54zh2' }, }, { name: 'tid-invalid-wrong-length-long', lexicons: [ { lexicon: 1, id: 'test.format.tid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { tid: { type: 'string', format: 'tid' }, }, }, }, }, }, ], collection: 'test.format.tid', record: { tid: '3jui7kd54zh2yy' }, },];