Something went wrong. Try again.
A plain JavaScript validator for AT Protocol lexicon schemas
Something went wrong. Try again.
2.1 kB · 96 lines
JavaScript
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697// Test inputs for language tag format validation
export const languageFormatInputs = [ { name: 'language-valid-simple', lexicons: [ { lexicon: 1, id: 'test.format.language', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { lang: { type: 'string', format: 'language' }, }, }, }, }, }, ], collection: 'test.format.language', record: { lang: 'en' }, }, { name: 'language-valid-with-region', lexicons: [ { lexicon: 1, id: 'test.format.language', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { lang: { type: 'string', format: 'language' }, }, }, }, }, }, ], collection: 'test.format.language', record: { lang: 'en-US' }, }, { name: 'language-valid-with-script', lexicons: [ { lexicon: 1, id: 'test.format.language', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { lang: { type: 'string', format: 'language' }, }, }, }, }, }, ], collection: 'test.format.language', record: { lang: 'zh-Hans-CN' }, }, { name: 'language-invalid-empty', lexicons: [ { lexicon: 1, id: 'test.format.language', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { lang: { type: 'string', format: 'language' }, }, }, }, }, }, ], collection: 'test.format.language', record: { lang: '' }, },];