mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2025-12-14 20:15:51 +00:00
drop "fromChat"
This commit is contained in:
@@ -68,7 +68,6 @@ class TestItem implements ParsedItem {
|
|||||||
};
|
};
|
||||||
|
|
||||||
rawText: string;
|
rawText: string;
|
||||||
fromChat?: boolean | undefined;
|
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ export interface ParsedItem {
|
|||||||
category?: ItemCategory;
|
category?: ItemCategory;
|
||||||
info: BaseType;
|
info: BaseType;
|
||||||
rawText: string;
|
rawText: string;
|
||||||
fromChat?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: should match option values on trade
|
// NOTE: should match option values on trade
|
||||||
|
|||||||
@@ -120,11 +120,6 @@ const parsers: Array<ParserFn | { virtual: VirtualParserFn }> = [
|
|||||||
|
|
||||||
export function parseClipboard(clipboard: string): Result<ParsedItem, string> {
|
export function parseClipboard(clipboard: string): Result<ParsedItem, string> {
|
||||||
try {
|
try {
|
||||||
const chatRegex = /\[.*?\]|\[.*?\|.*?\]/;
|
|
||||||
const isFromChat = chatRegex.test(clipboard);
|
|
||||||
if (isFromChat) {
|
|
||||||
clipboard = parseAffixStrings(clipboard);
|
|
||||||
}
|
|
||||||
let sections = itemTextToSections(clipboard);
|
let sections = itemTextToSections(clipboard);
|
||||||
|
|
||||||
if (sections[0][2] === _$.CANNOT_USE_ITEM) {
|
if (sections[0][2] === _$.CANNOT_USE_ITEM) {
|
||||||
@@ -156,9 +151,6 @@ export function parseClipboard(clipboard: string): Result<ParsedItem, string> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parsed.isOk() && isFromChat) {
|
|
||||||
parsed.value.fromChat = isFromChat;
|
|
||||||
}
|
|
||||||
return Object.freeze(parsed);
|
return Object.freeze(parsed);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user