chore: remove tag id and value max len

This commit is contained in:
Ricardo Arturo Cabral Mejía 2023-05-05 10:44:41 -04:00
parent eb07f49846
commit e6ca10a0ce
No known key found for this signature in database
GPG Key ID: 5931EBF43A650245
2 changed files with 2 additions and 4 deletions

View File

@ -18,6 +18,6 @@ export const createdAtSchema = Schema.number().min(0).multiple(1).custom(seconds
// [<string>, <string> 0..*]
export const tagSchema = Schema.array()
.ordered(Schema.string().max(255).required().label('identifier'))
.items(Schema.string().allow('').max(1024).label('value'))
.ordered(Schema.string().required().label('identifier'))
.items(Schema.string().allow('').label('value'))
.label('tag')

View File

@ -119,12 +119,10 @@ describe('NIP-01', () => {
],
identifier: [
{ message: 'must be a string', transform: assocPath(['tags', 0, 0], null) },
{ message: 'length must be less than or equal to 255 characters long', transform: assocPath(['tags', 0, 0], ' '.repeat(256)) },
{ message: 'is not allowed to be empty', transform: assocPath(['tags', 0, 0], '') },
],
value: [
{ message: 'must be a string', transform: assocPath(['tags', 0, 1], null) },
{ message: 'length must be less than or equal to 1024 characters long', transform: assocPath(['tags', 0, 1], ' '.repeat(1024 + 1)) },
],
}