All challenges

TypeScript · easy

Pipe it

#25

Situation

A "temporary" god function now parses and formats in one place, but it skips validation. Invalid input such as "nope" is still formatted instead of being rejected.

Objective

Trim valid digits and format them as a label; invalid input must return null, never a fake VAL:…. processInput(" 42 ")"VAL:42"; processInput("nope")null.

The repo at start

workspace/
└── src/
    └── pipeline.ts   (god function; validate unused)

Checks you will turn green

  • exports processInput
  • valid input formats
  • invalid input is null

Concepts

functions

Play it in your terminal

With sharpen installed, this command opens exactly this challenge in your local arena:

sharpen 25

First time? The full install is right below.

How to play

  1. 1 Install Claude Code if you do not have it yet: claude.com/claude-code
  2. 2 Install sharpen from npm:
    npm install -g @juanwmedia/sharpen
  3. 3 Then launch it; the arena opens in your browser:
    sharpen 25
  4. or Or try it without installing anything:
    npx @juanwmedia/sharpen 25
  5. 4 And to update when a new version ships:
    sharpen update