-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add caseflip extension #24980
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
base: main
Are you sure you want to change the base?
Add caseflip extension #24980
Conversation
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile OverviewGreptile SummaryThis PR adds a new CaseFlip extension that toggles uppercase and lowercase letters in text from the clipboard. The extension reads text from clipboard, flips the case of all alphabetic characters, then pastes and copies the result. Key Changes:
Issues Found:
Confidence Score: 3/5
Important Files Changed
|
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.
2 files reviewed, 2 comments
| @@ -0,0 +1,24 @@ | |||
| import { Clipboard, showHUD } from "@raycast/api"; | |||
|
|
|||
| // Function to flip upper/lower cases but keep spaces and punctiation | |||
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.
Typo: "punctiation" should be "punctuation"
| // Function to flip upper/lower cases but keep spaces and punctiation | |
| // Function to flip upper/lower cases but keep spaces and punctuation |
| } | ||
|
|
||
| export default async function Command() { | ||
| const originalText: string = await Clipboard.readText(); // read current clipboard |
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.
Clipboard.readText() can return an empty string or potentially fail. The extension will crash if the clipboard is empty or contains non-text content.
Add error handling:
const originalText = (await Clipboard.readText()) || "";
if (!originalText) {
await showHUD("No text in clipboard");
return;
}
Description
Flips lower and upper cases of a string. eg: from "i WILL SEND YOU THIS asap!" to "I will send you this ASAP!"
Simply copy your text, run the extension, and it will replace the selection with the flipped text or write it at the cursor, and keep it in clipboard.
Useful for those who use the caps key and toggle it wrongly.
Screencast
https://share.cleanshot.com/NZh3K1k6
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder