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 DID format validation
export const didFormatInputs = [ { name: 'did-valid-plc', lexicons: [ { lexicon: 1, id: 'test.format.did', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { did: { type: 'string', format: 'did' }, }, }, }, }, }, ], collection: 'test.format.did', record: { did: 'did:plc:z72i7hdynmk6r22z27h6tvur' }, }, { name: 'did-valid-web', lexicons: [ { lexicon: 1, id: 'test.format.did', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { did: { type: 'string', format: 'did' }, }, }, }, }, }, ], collection: 'test.format.did', record: { did: 'did:web:example.com' }, }, { name: 'did-invalid-empty', lexicons: [ { lexicon: 1, id: 'test.format.did', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { did: { type: 'string', format: 'did' }, }, }, }, }, }, ], collection: 'test.format.did', record: { did: '' }, }, { name: 'did-invalid-ending-percent', lexicons: [ { lexicon: 1, id: 'test.format.did', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { did: { type: 'string', format: 'did' }, }, }, }, }, }, ], collection: 'test.format.did', record: { did: 'did:example:foo%' }, },];