feat: add build:check npm script

This commit is contained in:
Ricardo Arturo Cabral Mejia 2022-08-15 03:17:38 +00:00
parent b18eec513a
commit 2a821b58ec
No known key found for this signature in database
GPG Key ID: 5931EBF43A650245
3 changed files with 7 additions and 7 deletions

View File

@ -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",

View File

@ -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)), },
],

View File

@ -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), },