Foundry 1 - Preliminary #127

Merged
OrdisPrime merged 5 commits from foundry into main 2024-01-25 05:49:45 -08:00
2 changed files with 9 additions and 8 deletions
Showing only changes of commit 9e72132886 - Show all commits

View File

@ -16,3 +16,11 @@ export const getSubstringFromKeywordToKeyword = (str: string, keywordBegin: stri
const endIndex = str.indexOf(keywordEnd); const endIndex = str.indexOf(keywordEnd);
return str.substring(beginIndex, endIndex + 1); 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;
};

View File

@ -1,3 +1,4 @@
import { getIndexAfter } from "@/src/helpers/stringHelpers";
import { logger } from "@/src/utils/logger"; import { logger } from "@/src/utils/logger";
import Items, { Buildable, Category, Item, Warframe, Weapon } from "warframe-items"; import Items, { Buildable, Category, Item, Warframe, Weapon } from "warframe-items";
@ -105,14 +106,6 @@ export const getItemCategoryByUniqueName = (uniqueName: string) => {
return category; 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) => { export const getItemByUniqueName = (uniqueName: string) => {
const item = items.find(item => item.uniqueName === uniqueName); const item = items.find(item => item.uniqueName === uniqueName);
return item; return item;