Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Conversation

lucaskenda
Copy link
Contributor

I tried to use:
var qs = new MongoQS({
string: {
toNumber: false
}
});

But toNumber and toBoolean is always in true.
I propose a change so firstly it checks if it is boolean and then makes the change.

Thanks for this great module! :)

I tried to use:
var qs = new MongoQS({
	string: {
		toNumber: false
	}
});

But toNumber and toBoolean is always in true.
I propose a change so firstly it checks if it is boolean and then makes the change.

Thanks for this great module! :)
Copy link
Contributor

@Starefossen Starefossen left a comment

Choose a reason for hiding this comment

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

LGTM

index.js Outdated
this.string.toBoolean = opts.string.toBoolean || true;
this.string.toNumber = opts.string.toNumber || true;
this.string.toBoolean = (typeof(opts.string.toBoolean) === "boolean") ? opts.string.toBoolean : true;
this.string.toNumber = (typeof(opts.string.toNumber) === "boolean") ? opts.string.toNumber : true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you remove the ( and ) after typeof to make the tests passing?

Copy link
Contributor

@Starefossen Starefossen left a comment

Choose a reason for hiding this comment

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

🎉

@Starefossen Starefossen merged commit 87597ca into Turistforeningen:master May 29, 2017
@Starefossen
Copy link
Contributor

Starefossen commented May 29, 2017

Thansk a lot @lucaskenda 💯 I have added you a as collaborator for mongo-querystring 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants