mirror of https://github.com/lukechilds/rollup.git
16 lines
384 B
16 lines
384 B
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);
|
|
|