Skip to content

Commit fe288d9

Browse files
authored
Merge pull request #484 from danocmx/fix/strange-elevated
2 parents dabc9c9 + 13acb41 commit fe288d9

2 files changed

Lines changed: 547 additions & 2 deletions

File tree

src/parseEconItem/ParsedEcon/getPropertyAttributes/getElevated.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import { EconItem, TagAttributes } from '../../../types';
22

33
export default function (item: EconItem, tags: TagAttributes): boolean {
4-
return isStrangeType(item) && !isStrangeQuality(tags);
4+
return isStrange(item) && !isStrangeQuality(tags);
5+
}
6+
7+
function isStrange(item: EconItem) {
8+
if (item.type === '') { // Weird case for strange weapons
9+
return item.market_hash_name.includes("Strange ");
10+
}
11+
12+
return isStrangeType(item);
513
}
614

715
function isStrangeType({ type }: EconItem): boolean {
8-
return /( - Kills: |- Points Scored: |- Carnival Kills: )\d+/.test(type);
16+
return /( - Kills: |- Points Scored: |- Carnival Kills: | - Times Performed: )\d+/.test(type);
917
}
1018

1119
function isStrangeQuality({ quality }: TagAttributes): boolean {

0 commit comments

Comments
 (0)