A rejected request is not an even number. Keep input validation, transport errors, and returned verdicts distinct.
When a Jev parity request fails, the application has not learned that the number is even. It has failed to obtain a usable answer. A boolean wrapper makes this distinction easy to blur, especially when a catch block returns false for every exception.
This unofficial guide describes is-jodd’s actual behavior and the errors documented by TypeSafe. It does not promise a service availability level or a particular retry success rate.
Separate local validation from HTTP errors
is-jodd rejects inputs that are not safe integers and rejects a missing or blank API key before issuing its request. An accepted input can still encounter an unsuccessful HTTP response. The wrapper reports the status in an error and does not turn that response into a parity verdict.
TypeSafe’s API reference documents 401 for authentication problems, 422 for invalid request bodies, 429 for rate limits, and 529 for temporary overload. It recommends exponential backoff for 429 and 529. Those API recommendations do not mean this small wrapper retries automatically; it does not. Official error reference
Check a configuration problem before repeating the same request. Retrying a missing credential without changing anything only repeats the mistake. For a transient condition, any retry policy should have a finite attempt limit and a total time budget appropriate to the calling application.
Give the caller an explicit deadline
The package accepts an abort signal:
import { isOdd } from 'is-jodd';
try {
const odd = await isOdd(37, {
signal: AbortSignal.timeout(5000),
});
console.log({ status: 'answered', odd });
} catch {
console.log({ status: 'unavailable' });
}
This example deliberately keeps unavailable separate from an answered false. In real diagnostics, retain an appropriate error category without logging authorization headers or a credential-bearing configuration object. A client-side deadline also should not be treated as proof that the remote service never received the request.
Package execution requires permission under is-jodd’s custom JODD-1T license, including its $1 trillion fee unless separate terms are granted. The snippet documents the interface rather than granting rights.
A successful status is only one checkpoint
is-jodd also validates the JSON answer. It expects the odd entry to identify a Noul and contain a number within zero and one. A missing answer, wrong type, or invalid numeric value rejects instead of silently producing a normal result.
That check protects the interface, not mathematical truth. A well-formed answer can still be wrong. See confidence and correctness for that distinction, and the direct API quickstart to inspect the request shape. For reliable everyday parity, the calculator avoids the need to interpret a model verdict.