expo / vector-icons

https://icons.expo.fyi
MIT License
650 stars 113 forks source link

Include string as a valid type for GlyphMap entries. #156

Closed tylerc closed 3 years ago

tylerc commented 3 years ago

I recently upgraded to Expo SDK v40 (and therefore my version of @expo/vector-icons upgraded along with it) and I started getting type errors on a usage of createIconSet because my glyph map was using strings instead of numbers.

Since my icon set still works, and the docs say:

Returns your own custom font based on the glyphMap where the key is the icon name and the value is either a UTF-8 character or it's character code.

I think this was caused by a simple oversight when the typings were added in.

This pull request changes the type from number to number | string.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/expoio/vector-icons/70czyxdo5
✅ Preview: https://vector-icons-git-fork-tylerc-fix-glyphmap-types.expoio.now.sh

brentvatne commented 3 years ago

lgtm thanks

brentvatne commented 3 years ago

we'll release this with sdk 41 beta or possibly a bit sooner (~mid-late march)

tylerc commented 3 years ago

Excellent, thank you!