Skip to content

Instantly share code, notes, and snippets.

@juntalis
Created October 26, 2014 23:15
Show Gist options
  • Save juntalis/d912af8345ddad879902 to your computer and use it in GitHub Desktop.
Save juntalis/d912af8345ddad879902 to your computer and use it in GitHub Desktop.
mixins.numeric = {
gt: expects('number')
(function gt(value) {
return this.valueOf() > value;
}),
gte: expects('number')
(function gte(value) {
return this.valueOf() >= value;
}),
eq: expects('number')
(function eq(value) {
return this.valueOf() === value;
}),
ne: expects('number')
(function ne(value) {
return this.valueOf() !== value;
}),
lte: expects('number')
(function lte(value) {
return this.valueOf() <= value;
}),
lt: expects('number')
(function lt(value) {
return this.valueOf() < value;
}),
neq: expects('number')
(function neq(value) {
return this.ne(value);
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment