mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: cleaned node
This commit is contained in:
1 parent
01ed20941d
commit
ab5061ba99
28 files changed
+35
-37
No files matched your search
@@ -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}".`,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user