mirror of https://github.com/lukechilds/rollup.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
384 B
17 lines
384 B
10 years ago
|
import { isEven } from './evens';
|
||
|
|
||
|
export function nextOdd(n) {
|
||
|
return isEven(n) ? n + 1 : n + 2;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* We go through these gymnastics to eager-bind to isEven. This is done to
|
||
|
* ensure that both this module and the 'evens' module eagerly use something
|
||
|
* from the other.
|
||
|
*/
|
||
|
export var isOdd = (function(isEven) {
|
||
|
return function(n) {
|
||
|
return !isEven(n);
|
||
|
};
|
||
|
})(isEven);
|