less hacking way of pulling poe data

This commit is contained in:
2018-08-27 23:54:27 -05:00
parent 5423b81c95
commit 97acc0d4fa
34 changed files with 651 additions and 221 deletions

View File

@@ -63,14 +63,16 @@ const getSockets = (sockets: any[]): string => {
return content.trim() + '\n';
};
/** filter unwanted characters from item name */
const filterName = (name: string): string => {
const index = name.lastIndexOf('>');
const newString = name.replace(/>/g, '>');
const index = newString.lastIndexOf('>');
if (index < 0) {
return name;
}
return name
.slice(index + 4, name.length)
.slice(index + 1, name.length)
.replace('{', '')
.replace('}', '');
};
@@ -103,5 +105,6 @@ const getProperties = (p?: any[], precedingText?: string): string => {
};
export const ItemTextService = {
filterName,
parseItem,
};