anyong / bookshelf-page

Simple pagination for Bookshelf.js
MIT License
5 stars 1 forks source link

issue on node 0.10/0.12 #2

Closed jamesdixon closed 8 years ago

jamesdixon commented 8 years ago

Hi again,

I found an issue when using the library on Node 0.10 and 0.12. It appears that Babel isn't polyfilling string.startsWith(), which is causing errors. There are two options: either use a polyfill or just switch to indexOf(). The latter seems simpler.

I'll submit a PR -- if you'd like to go another route, that's fine too!

Best, James

jamesdixon commented 8 years ago

By the way, specifically, the errors are thrown in the orderBy method.

anyong commented 8 years ago

Ah yeah I'm aware of the startsWith polyfill not working. I fixed it on the PR from this package to bookshelf but I guess I forgot to pull those changes here. PR would be great, thanks. On Apr 13, 2016 2:28 PM, "James Dixon" notifications@github.com wrote:

By the way, specifically, the errors are thrown in the orderBy method.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/anyong/bookshelf-page/issues/2#issuecomment-209251691

jamesdixon commented 8 years ago

@anyong thanks! will you be publishing to npm soon?

anyong commented 8 years ago

@jamesdixon I published as soon as you made the PR earlier...

jamesdixon commented 8 years ago

Got it. Sorry, for some reason it wasn't showing immediately