Sample
react-router-dom 6.30.4: createPath
Verified sample for npm react-router-dom 6.30.4: createPath. The contract ran on node 22 · linux debian/x64 · docker and passed.
sha256:42602aaa9822c0cf2564404ded8003ffc4b52203dbcf12bc8dd00d340cd328d6
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
linux 24 · ubuntu · glibc 2.39 x64 npm
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-01 |
Case
HOW- Goal
- verify createPath in pkg:npm/react-router-dom@6.30.4
- Packages
- Symbols
-
- createPath
- Created
- 2026-09-01T15:53:47Z
Contract
- createPath formats a full path string from pathname, search, and hash components
- createPath automatically prefixes '?' to search and '#' to hash when delimiters are omitted
- createPath ignores empty or single-delimiter search '?' and hash '#' strings
- createPath defaults pathname to '/' when an empty object or omitted pathname is provided
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.mjs
- test/contract.mjs
Source
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify createPath in pkg:npm/react-router-dom@6.30.4
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/react-router-dom@6.30.4
Demonstrate these symbols/APIs:
- createPath
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:a03052fecbdb1f1cc761ca9c48ed5453e44b13d7de230a55bfeabf8c9c57fdc5","contract":["createPath formats a full path string from pathname, search, and hash components","createPath automatically prefixes '?' to search and '#' to hash when delimiters are omitted","createPath ignores empty or single-delimiter search '?' and hash '#' strings","createPath defaults pathname to '/' when an empty object or omitted pathname is provided"],"goal":"verify createPath in pkg:npm/react-router-dom@6.30.4","kind":"HOW","packages":["pkg:npm/react-router-dom@6.30.4"],"schemaVersion":1,"symbols":["createPath"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/react-router-dom@6.30.4"],"schemaVersion":1,"subject":"pkg:npm/react-router-dom@6.30.4","symbols":["createPath"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-react-router-dom-create-path",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-react-router-dom-create-path",
"version": "1.0.0",
"dependencies": {
"react-router-dom": "6.30.4"
}
},
"node_modules/@remix-run/router": {
"version": "1.23.3",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.3.tgz",
"integrity": "sha512-4An71tdz9X8+3sI4Qqqd2LWd9vS39J7sqd9EU4Scw7TJE/qB10Flv/UuqbPVgfQV9XoK8Np6jNquZitnZq5i+Q==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/react": {
"version": "19.2.8",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz",
"integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react-dom": {
"version": "19.2.8",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.8.tgz",
"integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"scheduler": "^0.27.0"
},
"peerDependencies": {
"react": "^19.2.8"
}
},
"node_modules/react-router": {
"version": "6.30.4",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.4.tgz",
"integrity": "sha512-SVUsDe+DybHM/WmYKIVYhZh1o5Dcuf16yM6WjG02Q9XVFMZIJyHYhwrr6bFBXZkVP6z69kNkMyBCujt8FaFLJA==",
"license": "MIT",
"dependencies": {
"@remix-run/router": "1.23.3"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"react": ">=16.8"
}
},
"node_modules/react-router-dom": {
"version": "6.30.4",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.4.tgz",
"integrity": "sha512-q4HvNl+mmDdkS0g+MqiBZNteQJCuimWoOyHMy4T/RQLAn9Z29+E91QXRaxOujeMl2HTzRSS0KFPd7lxX3PjV0Q==",
"license": "MIT",
"dependencies": {
"@remix-run/router": "1.23.3",
"react-router": "6.30.4"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
}
},
"node_modules/scheduler": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
"license": "MIT",
"peer": true
}
}
}
{
"name": "sample-react-router-dom-create-path",
"version": "1.0.0",
"type": "module",
"private": true,
"description": "Clean-room verification for createPath in react-router-dom@6.30.4",
"dependencies": {
"react-router-dom": "6.30.4"
}
}
{
"schemaVersion": 1,
"goal": "verify createPath in pkg:npm/react-router-dom@6.30.4",
"kind": "HOW",
"packages": [
"pkg:npm/react-router-dom@6.30.4"
],
"symbols": [
"createPath"
]
}
import { createPath } from 'react-router-dom';
/**
* Builds a URL path string with search params and hash fragment from a location-like object.
*
* @param {object} [location={}] - Partial location object containing pathname, search, and hash.
* @param {string} [location.pathname] - Path component (e.g. '/dashboard').
* @param {string} [location.search] - Query string component (e.g. '?tab=overview').
* @param {string} [location.hash] - Hash fragment component (e.g. '#section1').
* @returns {string} Formatted URL path string.
*/
export function buildPath(location = {}) {
return createPath(location);
}
export { createPath };
import assert from 'node:assert/strict';
import { createPath, buildPath } from '../src/index.mjs';
// Contract 1: createPath formats a full path string from pathname, search, and hash components
{
assert.equal(typeof createPath, 'function', 'createPath must be exported as a function');
assert.equal(typeof buildPath, 'function', 'buildPath helper must be a function');
const path = createPath({
pathname: '/items/123',
search: '?filter=active&sort=asc',
hash: '#details'
});
assert.equal(path, '/items/123?filter=active&sort=asc#details');
const wrappedPath = buildPath({
pathname: '/dashboard',
search: '?view=compact',
hash: '#metrics'
});
assert.equal(wrappedPath, '/dashboard?view=compact#metrics');
}
// Contract 2: createPath automatically prefixes '?' to search and '#' to hash when delimiters are omitted
{
const pathWithSearch = createPath({
pathname: '/search',
search: 'query=react&page=2'
});
assert.equal(pathWithSearch, '/search?query=react&page=2');
const pathWithHash = createPath({
pathname: '/docs/intro',
hash: 'getting-started'
});
assert.equal(pathWithHash, '/docs/intro#getting-started');
const pathWithBoth = createPath({
pathname: '/profile',
search: 'tab=settings',
hash: 'notifications'
});
assert.equal(pathWithBoth, '/profile?tab=settings#notifications');
}
// Contract 3: createPath ignores empty or single-delimiter search '?' and hash '#' strings
{
const emptyDelimiterPath = createPath({
pathname: '/products',
search: '?',
hash: '#'
});
assert.equal(emptyDelimiterPath, '/products');
const emptyStringPath = createPath({
pathname: '/about',
search: '',
hash: ''
});
assert.equal(emptyStringPath, '/about');
}
// Contract 4: createPath defaults pathname to '/' when an empty object or omitted pathname is provided
{
const defaultEmpty = createPath({});
assert.equal(defaultEmpty, '/');
const searchOnly = createPath({ search: '?page=1' });
assert.equal(searchOnly, '/?page=1');
const hashOnly = createPath({ hash: '#anchor' });
assert.equal(hashOnly, '/#anchor');
}
Origin Seeder
anonymous