diff --git a/package.json b/package.json index 06f6e7b..c8d74e8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "clean": "rimraf ./dist", "prebuild": "npm run lint", "build": "npm run clean && tsc", - "lint": "eslint ./src --ext .ts", + "build:check": "tsc --noEmit", "lint:fix": "npm run lint -- --fix", "db:migrate": "knex migrate:latest", "db:migrate:rollback": "knex migrate:rollback", diff --git a/test/unit/schemas/event-schema.spec.ts b/test/unit/schemas/event-schema.spec.ts index f699249..3623f7d 100644 --- a/test/unit/schemas/event-schema.spec.ts +++ b/test/unit/schemas/event-schema.spec.ts @@ -105,16 +105,16 @@ describe('NIP-01', () => { { message: 'is required', transform: omit(['tags']), }, { message: 'must contain less than or equal to 500 items', transform: assocPath(['tags'], range(0, 501).map(() => (['x', 'x']))) }, ], - 'tags[0]': [ + tag: [ { message: 'must be an array', transform: assocPath(['tags', 0], null), }, { message: 'must contain less than or equal to 10 items', transform: assocPath(['tags', 0], range(0, 11).map(() => 'x')) }, ], - 'tags[0][0]': [ + 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], ''), }, ], - 'tags[0][1]': [ + 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)), }, ], diff --git a/test/unit/schemas/filter-schema.spec.ts b/test/unit/schemas/filter-schema.spec.ts index 5f3ee6f..d05948d 100644 --- a/test/unit/schemas/filter-schema.spec.ts +++ b/test/unit/schemas/filter-schema.spec.ts @@ -33,7 +33,7 @@ describe('NIP-01', () => { { message: 'must be an array', transform: assocPath(['ids'], null), }, { message: 'must contain less than or equal to 256 items', transform: assocPath(['ids'], range(0, 257).map(() => 'f')), }, ], - 'ids[0]': [ + prefixOrId: [ { message: 'length must be less than or equal to 64 characters long', transform: assocPath(['ids', 0], 'f'.repeat(65)), }, { message: 'must only contain hexadecimal characters', transform: assocPath(['ids', 0], 'not hex'), }, { message: 'is not allowed to be empty', transform: assocPath(['ids', 0], ''), }, @@ -42,7 +42,7 @@ describe('NIP-01', () => { { message: 'must be an array', transform: assocPath(['authors'], null), }, { message: 'must contain less than or equal to 256 items', transform: assocPath(['authors'], range(0, 257).map(() => 'f')), }, ], - 'authors[0]': [ + prefixOrAuthor: [ { message: 'length must be less than or equal to 64 characters long', transform: assocPath(['authors', 0], 'f'.repeat(65)), }, { message: 'must only contain hexadecimal characters', transform: assocPath(['authors', 0], 'not hex'), }, { message: 'is not allowed to be empty', transform: assocPath(['authors', 0], ''), }, @@ -51,7 +51,7 @@ describe('NIP-01', () => { { message: 'must be an array', transform: assocPath(['kinds'], null), }, { message: 'must contain less than or equal to 20 items', transform: assocPath(['kinds'], range(0, 21).map(() => 1)), }, ], - 'kinds[0]': [ + kind: [ { message: 'must be greater than or equal to 0', transform: assocPath(['kinds', 0], -1), }, { message: 'must be a number', transform: assocPath(['kinds', 0], null), }, { message: 'must be a multiple of 1', transform: assocPath(['kinds', 0], Math.PI), },