Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: str.toLowerCase is not a function #103

Open
waitingcheung opened this issue Aug 22, 2017 · 0 comments
Open

TypeError: str.toLowerCase is not a function #103

waitingcheung opened this issue Aug 22, 2017 · 0 comments

Comments

@waitingcheung
Copy link

I am trying to detect a phone number as a Number and it seems that Knwl.js accepts only strings and the following TypeError occurs.

TypeError: str.toLowerCase is not a function
    at Knwl.init (/path/knwl.js:1154:23)

Here is a test case that reproduces the problem.

var knwl = new Knwl();
var phone = 5555555555;
knwl.init(phone);
console.log(knwl.get('phones'));

To fix the problem, we may change line 1154 to the following

var lowercase = String(str).toLowerCase();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant