less hacking way of pulling poe data
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user