Skip to content

Instantly share code, notes, and snippets.

@fResult
Last active February 22, 2024 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fResult/a6998e0e5d41283cd8d84da2c98f52ee to your computer and use it in GitHub Desktop.
Save fResult/a6998e0e5d41283cd8d84da2c98f52ee to your computer and use it in GitHub Desktop.
Make meme for the `is-odd` module
// Usage:
import isEven from "is-not-odd";
isEven(3); // false
isEven(4); // true
// In index.ts of `is-not-odd` module
import isOdd from "is-odd";
type PredicateFn<T> = (...args: [T, ...any[]]) => boolean;
function not<T = any>(predicate: PredicateFn<T>): Parameters<typeof predicate> {
return function negate(...args) {
return !predicate(...args);
};
}
const isEven = not(isOdd);
export default isEven;
@fResult
Copy link
Author

fResult commented Feb 22, 2024

is-odd memes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment