Something went wrong. Try again.
A plain JavaScript validator for AT Protocol lexicon schemas
Something went wrong. Try again.
2.0 kB · 96 lines
JavaScript
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697// Test inputs for NSID format validation
export const nsidFormatInputs = [ { name: 'nsid-valid-basic', lexicons: [ { lexicon: 1, id: 'test.format.nsid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { nsid: { type: 'string', format: 'nsid' }, }, }, }, }, }, ], collection: 'test.format.nsid', record: { nsid: 'app.bsky.feed.post' }, }, { name: 'nsid-valid-three-segments', lexicons: [ { lexicon: 1, id: 'test.format.nsid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { nsid: { type: 'string', format: 'nsid' }, }, }, }, }, }, ], collection: 'test.format.nsid', record: { nsid: 'com.example.record' }, }, { name: 'nsid-invalid-two-segments', lexicons: [ { lexicon: 1, id: 'test.format.nsid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { nsid: { type: 'string', format: 'nsid' }, }, }, }, }, }, ], collection: 'test.format.nsid', record: { nsid: 'example.record' }, }, { name: 'nsid-invalid-empty', lexicons: [ { lexicon: 1, id: 'test.format.nsid', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { nsid: { type: 'string', format: 'nsid' }, }, }, }, }, }, ], collection: 'test.format.nsid', record: { nsid: '' }, },];