feat: cleaned node

This commit is contained in:
TresAbhi committed 2023-06-27 17:22:27 +00:00
1 parent 01ed20941d
commit ab5061ba99
28 files changed
+35 -37

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
import { go } from 'fuzzysort';
import errorWithCause from '../node/errorWithCause.js';
import throwError from '../node/throwError.js';
import { TANKS, tankopedia } from './tankopedia.js';
export default function resolveTankId(tank: string) {
@@ -9,7 +9,7 @@ export default function resolveTankId(tank: string) {
const searchResult = go(tank, TANKS, { keys: ['name'], limit: 1 });
if (searchResult.length === 0) {
throw errorWithCause(
throw throwError(
'Tank not found',
`Could not find tank by the name "${tank}".`,
);
@@ -20,7 +20,7 @@ export default function resolveTankId(tank: string) {
if (tankopedia[number]) {
return number;
} else {
throw errorWithCause(
throw throwError(
'Tank not found',
`Could not find tank by the ID "${number}".`,
);