Skip to content
HN On Hacker News ↗

GitHub - f/jev-leftpad: Left-pad strings with TypeSafe AI's Jev. For reasons.

▲ 234 points • 87 comments • by fka • 3w ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this entire text is AI.

91 %

AI likelihood · overall

AI
0% human-written 100% AI-generated
SEGMENTS · HUMAN 0 of 1
SEGMENTS · AI 1 of 1
WORD COUNT 197
PEAK AI % 91% · §1
Analyzed
Sep 21
backend: pangram/v3.3
Segments scanned
1 windows
avg 197 words each
Distribution
0 / 100%
human / AI fraction
Verdict
AI
Pangram v3.3

Article text · 197 words · 1 segments analyzed

Human AI-generated
§1 AI · 91%

Left pad a value with Jev. Could this be one line with padStart()? Yes. Does it need a model call? No. Anyway: npm install jev-leftpad import leftPad from 'jev-leftpad'; const result = await leftPad('jev', 8); console.log(JSON.stringify(result)); // " jev" (probably) Set TYPESAFE_API_KEY before using it. jev-leftpad uses jev-latest through TypeSafe's native @typesafe-ai/sdk. It requires Node.js 20 or newer. API await leftPad(value, targetLength) targetLength must be a non-negative safe integer. Jev gets one Choice with criteria named space_0, space_1, space_2, and so on, written directly up to space_10. For the example above, it should choose space_5. JavaScript reads the number, creates five spaces, and puts the value after them. This means the package can add between 0 and 10 spaces. If more than 10 spaces are needed, Jev has no correct option. Which feels appropriate for this project. There is one TypeSafe API request per call and retries are disabled. The request can fail, Jev can choose the wrong option, and it costs more than padStart(). Please don't use this in production. Or anything important. Development npm install npm test The tests mock Jev. They don't need an API key and don't spend any TypeSafe credits. License MIT