Clone an array
Create a new array without copying the objects inside it.
function clone(values) { return [...values]; }arrayA new edition of 1loc.dev
Useful JavaScript. Practical email recipes.Run the code. Read the edge case.Take a working example back to your project.
Start with the problem in front of you.
01 — The library
Small enough to read in one breath — with the edge case and the limits written down.
Create a new array without copying the objects inside it.
function clone(values) { return [...values]; }arrayKeep the first occurrence of each value, in its original order.
function unique(values) { return [...new Set(values)]; }arrayTurn a nested array into one sequence of values.
function flatten(values) { return values.flat(Infinity); }arrayBuild consecutive chunks without changing the original array.
function chunk({ values, size }) { return Array.from({ length: Math.ceil(values.length / size) …arrayReturn the distinct values that occur in both arrays.
function intersection({ left, right }) { const other = new Set(right); return [...new Set(left)…arraySort a numeric copy instead of using JavaScript’s default string ordering.
function sortNumbers(values) { return [...values].sort((a, b) => a - b); }arrayPrefer it all on one page? Print the one-line sheet — every utility as the code that runs.
02 — Recipes
Complete Node.js/TypeScript starters with tests, failure handling and a local mock. No account is needed to run them.
Build one server-side request, keep its idempotency key across retries, and start with a local mock.
10 files · Node.js 22.23.2 / TypeScriptPersist the business event before the request and reuse its provider key after recoverable failures.
12 files · Node.js 22.23.2 / TypeScriptCreate a draft, publish an explicit version, and send data against that immutable version.
11 files · Node.js 22.23.2 / TypeScriptAuthenticate raw bytes, reject stale signatures, and persist independent state for each recipient.
12 files · Node.js 22.23.2 / TypeScriptAsk about a domain without sending a full address, and keep unavailable results explicitly unknown.
9 files · Node.js 22.23.2 / TypeScriptPick a task and an environment. Get the complete files, prerequisites and a context package for your agent.
Open the recipe builder →03 — Labs
Change the data, follow the states and break a signature on purpose. Everything runs in your browser.
Run a function from a closed registry of curated utilities. Edit JSON, try edge cases and inspect actual output.
Choose a supported task and environment. Get complete files, prerequisites, tests and a context package.
Step through API acceptance, an uncertain response, a retry and a duplicate avoided.
Sign a synthetic delivery event, then watch a re-serialized body, a tampered byte or a late replay fail verification.
04 — Maintained by Oveyon
1loc.dev is maintained by Oveyon: transactional email infrastructure with an API and SMTP for your software, inboxes your agents can read safely, and a record of every send. The recipes here are written against its API.
curl https://api.oveyon.com/v1/send \
-H "Authorization: Bearer $OVEYON_API_KEY" \
-H 'Content-Type: application/json' \
-H 'X-Oveyon-Sandbox: 1' \
-H 'Idempotency-Key: 1loc:welcome:demo-001' \
--data '{"from":"sender@your-verified-domain.example","to":"reader@example.net","subject":"Demo","text":"Synthetic sandbox example"}'
Reuse an Idempotency-Key and a retry inside 24 hours returns the original message instead of a second one.
Inbound messages are evaluated before an agent reads them; a dangerous one waits for a person to release it.
Every webhook carries sha256=HMAC(timestamp.body). Break one in the lab.
Free plan: 1,000 emails a month, no card required — as published on oveyon.com, checked October 28, 2026. Oveyon maintains this site; the relationship is commercial and disclosed.
05 — How we verify
Each utility links to its original source. Each recipe names its runtime, expected result and limits. A local mock is labeled as a local mock.
Transformations, request construction, signatures, persistence and state transitions run against synthetic data.
Examples checked against a captured Oveyon OpenAPI 3.1 document and the official reference.
Requires a test account and a manual job. No badge is shown until it runs.
Even then, recipient-server acceptance would not prove inbox placement.
Changelog · October 28, 2026
Every page of the original 1loc collection by Nguyen Huu Phuoc and contributors lives again at its address: 235 run in the local lab, 78 more as references whose usage runs in Node.js and Chromium. Bugs found in review are fixed and explained on each page.
Read the changelog