Skip to content

Commit bce60e0

Browse files
authored
Merge pull request #10 from TurtIeSocks/fix-parse-string
fix: parsing string for display
2 parents 9ce5b92 + e6cdd88 commit bce60e0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/uicons.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ describe('pokestops', () => {
110110
test('invasion', () => {
111111
expect(icons.pokestop(0, 0)).toBe(`${BASE_ICON_URL}/pokestop/0_i.webp`)
112112
})
113+
test('invasion & lure', () => {
114+
expect(icons.pokestop(502, 0, false, false, 0)).toBe(`${BASE_ICON_URL}/pokestop/502_i.webp`)
115+
})
113116
test('quest', () => {
114117
expect(icons.pokestop(0, false, 0)).toBe(
115118
`${BASE_ICON_URL}/pokestop/0_q.webp`
@@ -120,6 +123,16 @@ describe('pokestops', () => {
120123
`${BASE_ICON_URL}/pokestop/504_i_ar.webp`
121124
)
122125
})
126+
test('kecleon', () => {
127+
expect(icons.pokestop(0, '8', false, false, 0)).toBe(
128+
`${BASE_ICON_URL}/pokestop/0_i8.webp`
129+
)
130+
})
131+
test('gold coin', () => {
132+
expect(icons.pokestop(0, 7, false, false, 0)).toBe(
133+
`${BASE_ICON_URL}/pokestop/0_i7.webp`
134+
)
135+
})
123136
})
124137

125138
describe('raid', () => {

src/uicons.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class UICONS<Index extends UiconsIndex = UiconsIndex> {
118118
}
119119

120120
#evalPossiblyEmptyFlag(flag: string, value: boolean | string | number) {
121-
return typeof value === 'number'
121+
return typeof value === 'number' || +value
122122
? [`${flag}${value || ''}`, '']
123123
: value
124124
? [flag, '']

0 commit comments

Comments
 (0)