ladjs/country-language

[fix] langs is not iterable

Closed this issue · 1 comments

teyou commented

Describe the bug

Node.js version: v18.12.1

OS version: OSX Venture 13.1

Description:
TypeError exception triggered on some countries without languages array within countries object in data.json

Actual behavior

Exception triggered

      for (const l of langs) {
                      ^

TypeError: langs is not iterable

Expected behavior

should just return [] // empty array

Code to reproduce

CountryLanguage.getCountryLanguages("PS")

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

v1.0.3 released to npm (this closes #5)

thanks for your PR @teyou 🙇

https://github.com/ladjs/country-language/releases/tag/v1.0.3