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

array.includes is undefined in non-ES2015 environments #28

Closed
pmalouin opened this issue Aug 29, 2016 · 1 comment · Fixed by #29
Closed

array.includes is undefined in non-ES2015 environments #28

pmalouin opened this issue Aug 29, 2016 · 1 comment · Fixed by #29

Comments

@pmalouin
Copy link

Trying out the new version 1.2.0, an error is thrown because the includes array instance method is not defined (it is new in ES2015). I'm using node version 4.5.0 (where this ES2015 feature is missing):

TypeError: _this3.jsonColumns.includes is not a function
    at /opt/bitbe/node_modules/bookshelf-json-columns/dist/index.js:100:32
    at Array.forEach (native)
    at save (/opt/bitbe/node_modules/bookshelf-json-columns/dist/index.js:99:31)
    ...

You could maybe rely on the lodash.includes module, or the array-includes module or simply work around bringing an additional dependency by using array.indexOf.

@ricardogama
Copy link
Collaborator

@pmalouin Thanks for the report! A fix was released as 1.2.1.

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

Successfully merging a pull request may close this issue.

2 participants