Add types to this JS code, idiomatically. Don't over-type; don't under-type.
```javascript
{paste_code}
```
RULES:
- Prefer narrow types (literal unions, branded types) where it adds safety.
- Avoid `any`. If forced, comment why.
- Don't add a type when inference is fine.
- Use `as const` where appropriate.
- For function params: prefer interfaces if the object has 3+ fields, inline type otherwise.
- Generic <T> only when re-use is real.
Return: the typed code + a short note on the 2-3 strongest type-safety improvements your changes unlock.0 copies·0 saves·3 views
89 words·549 chars
Parameters
Text generation parameters
FAQ
A coding & development text prompt designed for Claude Sonnet. 89 words long, free to copy and use.
This prompt is written for Claude Sonnet. It's a text/chat prompt — paste it into Claude Sonnet (or compatible LLMs like Claude or GPT-4) to get the expected output.
1. Click the Copy button on this page to copy the full prompt. 2. Open Claude Sonnet. 3. Paste the prompt into a new conversation. 4. Replace any {placeholders} with your specifics, then send. Most prompts produce the right output on the first try; complex ones may need 1-2 iterations.
Yes — every prompt on mycopyprompt is free forever. No paywall, no signup wall for browsing or copying. You can use it for personal or commercial work, just don't redistribute the entire mycopyprompt library.
Absolutely — most prompts are templates. Look for {placeholders} (curly braces) and swap them with your own values. You can also reword sections, add constraints, or chain it with other prompts.
Similar prompts
Matched against every prompt in the catalog by title.