Describe the bug
Jsonify marks all properties that may be undefined as optional, which breaks when dealing with types that have required, potentially undefined properties.
To Reproduce
Example:
import { type Jsonify } from "inngest/helpers/jsonify";
interface Test {
prop: string | null | undefined;
requiredProp: string;
optionalProp?: string | null;
}
type TestJsonify = Jsonify<Test>;
TestJsonify has the following type:
type TestJsonify = {
prop?: string | null | undefined;
requiredProp: string;
optionalProp?: (string | null) | undefined;
}
This means that values of type Jsonify<Test> can no longer be assigned to values of type Test, as the required, potentially undefined property no longer type checks.
Expected behavior
The type of Jsonify<object> and the object itself should match, for simple interfaces like this.
Code snippets / Logs / Screenshots
If applicable, add screenshots to help explain your problem.
System info (please complete the following information):
- npm package Version: 3.22.0
Additional context
Add any other context about the problem here.
Describe the bug
Jsonify marks all properties that may be undefined as optional, which breaks when dealing with types that have required, potentially undefined properties.
To Reproduce
Example:
TestJsonifyhas the following type:This means that values of type
Jsonify<Test>can no longer be assigned to values of typeTest, as the required, potentially undefined property no longer type checks.Expected behavior
The type of
Jsonify<object>and the object itself should match, for simple interfaces like this.Code snippets / Logs / Screenshots
If applicable, add screenshots to help explain your problem.
System info (please complete the following information):
Additional context
Add any other context about the problem here.