Skip to content

[fix] langs is not iterable #5

@teyou

Description

@teyou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions