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

Accepting string numbers in limit, skip, maxScan and batchSize methods #80

Closed
wants to merge 1 commit into from

Conversation

aliveghost04
Copy link

No description provided.

*
* query.comment('feed query');
*/

;['limit', 'skip', 'maxScan', 'batchSize', 'comment'].forEach(function (method) {
Query.prototype[method] = function (v) {
if (method !== 'comment') {
let value = Number(v);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lib still supports node 0.10 and 0.12, so can't use let or Number.isNaN.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, i really didn't know it, by the way how i know which characteristics are available in what version of nodejs, for example, how i know that Number.isNaN isn't available in nodejs 0.12

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General idea is that node 0.10 and 0.12 don't support anything from ECMAScript 2015 / ES6, node 4 supports some, node 5 supports a little more, etc. TBH it's mostly just trial and error for me, just run node v0.10 and try using Number.isNan() :)

@vkarpov15 vkarpov15 closed this Dec 6, 2017
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 this pull request may close these issues.

2 participants