Foundry 1 - Preliminary #127
@ -16,3 +16,11 @@ export const getSubstringFromKeywordToKeyword = (str: string, keywordBegin: stri
|
||||
const endIndex = str.indexOf(keywordEnd);
|
||||
return str.substring(beginIndex, endIndex + 1);
|
||||
};
|
||||
|
||||
export const getIndexAfter = (str: string, searchWord: string) => {
|
||||
const index = str.indexOf(searchWord);
|
||||
if (index === -1) {
|
||||
return -1;
|
||||
}
|
||||
return index + searchWord.length;
|
||||
};
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { getIndexAfter } from "@/src/helpers/stringHelpers";
|
||||
import { logger } from "@/src/utils/logger";
|
||||
import Items, { Buildable, Category, Item, Warframe, Weapon } from "warframe-items";
|
||||
|
||||
@ -105,14 +106,6 @@ export const getItemCategoryByUniqueName = (uniqueName: string) => {
|
||||
return category;
|
||||
};
|
||||
|
||||
export const getIndexAfter = (str: string, searchWord: string) => {
|
||||
const index = str.indexOf(searchWord);
|
||||
if (index === -1) {
|
||||
return -1;
|
||||
}
|
||||
return index + searchWord.length;
|
||||
};
|
||||
|
||||
export const getItemByUniqueName = (uniqueName: string) => {
|
||||
const item = items.find(item => item.uniqueName === uniqueName);
|
||||
return item;
|
||||
|
Loading…
x
Reference in New Issue
Block a user