TypeScript · easy
CMS preview crashes when the page is missing, while an intentionally blank heading is replaced with "Untitled". pageTitle needs to distinguish a missing page from an empty heading.
Return "Untitled" only when the page is missing, and preserve an empty heading when the page exists. pageTitle(null) → "Untitled"; pageTitle({ heading: "" }) → ""; pageTitle({ heading: "Hi" }) → "Hi".
workspace/
└── src/
└── title.ts (page can be null; empty heading is legal)With sharpen installed, this command opens exactly this challenge in your local arena:
sharpen 20
First time? The full install is right below.
npm install -g @juanwmedia/sharpen sharpen 20 npx @juanwmedia/sharpen 20 sharpen update