mdzhang / us-state-codes

A library to help you search, validate, and convert between US state names and postal codes.
MIT License
15 stars 9 forks source link

Replace lodash dependencies with native code #55

Open andrew-pyle opened 2 years ago

andrew-pyle commented 2 years ago

I would like to use this library on the front-end for parsing USA State abreviations & names, but the 5.5kB (minified & gzipped) size is too large to justify the inclusion.

This PR removes all 3rd party dependencies and replaces them with Javascript built-in functions. ~92% of the npm package's size was from lodash dependencies.

Analysis from https://bundlephobia.com/package/us-state-codes@1.1.2.

All tests passed locally, so I do not believe I've made any inappropriate assumptions about the library's data types.