-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use economy model for persona #800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -587,8 +587,12 @@ export const createRulesOnboardingAction = actionClient | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const isSet = ( | ||||||||||||||||||||||||||||||||||||||||||||||||
| value: string | undefined | null, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ): value is "label" | "label_archive" | "label_archive_delayed" => | ||||||||||||||||||||||||||||||||||||||||||||||||
| value !== "none" && value !== undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||
| ): value is | ||||||||||||||||||||||||||||||||||||||||||||||||
| | "label" | ||||||||||||||||||||||||||||||||||||||||||||||||
| | "label_archive" | ||||||||||||||||||||||||||||||||||||||||||||||||
| | "label_archive_delayed" | ||||||||||||||||||||||||||||||||||||||||||||||||
| | "move_folder" | ||||||||||||||||||||||||||||||||||||||||||||||||
| | "move_folder_delayed" => value !== "none" && value !== undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
588
to
596
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type guard bug: null and arbitrary strings pass as “set”.
Use exact membership + include null check; also narrow the param type: - const isSet = (
- value: string | undefined | null,
- ): value is
- | "label"
- | "label_archive"
- | "label_archive_delayed"
- | "move_folder"
- | "move_folder_delayed" => value !== "none" && value !== undefined;
+ const isSet = (
+ value: CategoryAction | "none" | undefined | null,
+ ): value is CategoryAction => {
+ return (
+ value !== null &&
+ value !== undefined &&
+ (value === "label" ||
+ value === "label_archive" ||
+ value === "label_archive_delayed" ||
+ value === "move_folder" ||
+ value === "move_folder_delayed")
+ );
+ };📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| // cold email blocker | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (coldEmail && isSet(coldEmail.action)) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v2.9.45 | ||
| v2.9.46 |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type guard is unsound: value !== "none" && value !== undefined returns true for null and arbitrary strings while claiming to narrow to specific literals. Replace with an explicit membership check and include a null check; also tighten the parameter type to the expected union.
Prompt for AI agents