Sample
baseline-browser-mapping 2.11.28: getAllVersions
Verified sample for npm baseline-browser-mapping 2.11.28: getAllVersions. The contract ran on node 22 · linux debian/x64 · docker and passed.
sha256:17550b07dfac7e9d8673e232cbc2d628063b3207e597174213457e544fe21f09
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
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
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-11-28 |
Case
HOW- Goal
- verify baseline-browser-mapping.getAllVersions in pkg:npm/baseline-browser-mapping@2.11.28
- Packages
- Symbols
-
- baseline-browser-mapping.getAllVersions
- Environment
- node 22.23.2
- Created
- 2026-11-28T00:41:26Z
Contract
- getAllVersions returns a non-empty array of core browser versions with year, wa_compatible, and release_date by default while excluding downstream browsers
- getAllVersions returns a nested browser-to-version metadata map when outputFormat is object
- getAllVersions returns a quoted CSV string with a wa_compatible header and NULL engine columns for core browsers when outputFormat is csv
- getAllVersions includes downstream browsers with engine and engine_version metadata when includeDownstreamBrowsers is true and adds kai_os when includeKaiOS is also true
- getAllVersions replaces wa_compatible with supports (widely or newly) across array, object, and csv outputs when useSupports is true
- getAllVersions throws an error when includeKaiOS is true without includeDownstreamBrowsers
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
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 baseline-browser-mapping.getAllVersions in pkg:npm/baseline-browser-mapping@2.11.28
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/baseline-browser-mapping@2.11.28
Demonstrate these symbols/APIs:
- baseline-browser-mapping.getAllVersions
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
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:075796c35395d5e7a58749452fac135d2bf1d14642d427f09150c5bb75cb663b","constraints":{"executionContext":"node"},"contract":["getAllVersions returns a non-empty array of core browser versions with year, wa_compatible, and release_date by default while excluding downstream browsers","getAllVersions returns a nested browser-to-version metadata map when outputFormat is object","getAllVersions returns a quoted CSV string with a wa_compatible header and NULL engine columns for core browsers when outputFormat is csv","getAllVersions includes downstream browsers with engine and engine_version metadata when includeDownstreamBrowsers is true and adds kai_os when includeKaiOS is also true","getAllVersions replaces wa_compatible with supports (widely or newly) across array, object, and csv outputs when useSupports is true","getAllVersions throws an error when includeKaiOS is true without includeDownstreamBrowsers"],"goal":"verify baseline-browser-mapping.getAllVersions in pkg:npm/baseline-browser-mapping@2.11.28","kind":"HOW","packages":["pkg:npm/baseline-browser-mapping@2.11.28"],"schemaVersion":1,"symbols":["baseline-browser-mapping.getAllVersions"]},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/baseline-browser-mapping@2.11.28"],"schemaVersion":1,"subject":"pkg:npm/baseline-browser-mapping@2.11.28","symbols":["baseline-browser-mapping.getAllVersions"],"verifierAdapter":"node-typescript@1"}
{
"name": "baseline-browser-mapping-getallversions-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "baseline-browser-mapping-getallversions-sample",
"version": "1.0.0",
"dependencies": {
"baseline-browser-mapping": "2.11.28"
}
},
"node_modules/baseline-browser-mapping": {
"version": "2.11.28",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz",
"integrity": "sha512-br0LOmjJqr6Rt4AEkadbcNf67Zpo7EPwKsWbjnRrJIa1QYFHQBqM4C7F2WTbV8ahTEcg1Eo+Y0aWjjORInYFyA==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
},
"engines": {
"node": ">=6.0.0"
}
}
}
}
{
"name": "baseline-browser-mapping-getallversions-sample",
"version": "1.0.0",
"private": true,
"main": "src/index.js",
"scripts": {
"test": "node test/contract.js"
},
"dependencies": {
"baseline-browser-mapping": "2.11.28"
}
}
{
"schemaVersion": 1,
"goal": "verify baseline-browser-mapping.getAllVersions in pkg:npm/baseline-browser-mapping@2.11.28",
"kind": "HOW",
"packages": [
"pkg:npm/baseline-browser-mapping@2.11.28"
],
"symbols": [
"baseline-browser-mapping.getAllVersions"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
'use strict';
const { getAllVersions } = require('baseline-browser-mapping');
function listAllBrowserVersions(options = {}) {
return getAllVersions({ suppressWarnings: true, ...options });
}
function getAllVersionsAsObject(options = {}) {
return getAllVersions({ suppressWarnings: true, ...options, outputFormat: 'object' });
}
function getAllVersionsAsCsv(options = {}) {
return getAllVersions({ suppressWarnings: true, ...options, outputFormat: 'csv' });
}
module.exports = {
getAllVersions,
listAllBrowserVersions,
getAllVersionsAsObject,
getAllVersionsAsCsv,
};
'use strict';
const assert = require('node:assert/strict');
const {
getAllVersions,
listAllBrowserVersions,
getAllVersionsAsObject,
getAllVersionsAsCsv,
} = require('../src/index.js');
// 1. Default array format returns core browser versions with year, wa_compatible, and release_date
{
const versions = listAllBrowserVersions();
assert.ok(Array.isArray(versions), 'default output must be an array');
assert.ok(versions.length > 0, 'default output must be non-empty');
const browsers = new Set(versions.map((entry) => entry.browser));
for (const coreBrowser of ['chrome', 'chrome_android', 'edge', 'firefox', 'firefox_android', 'safari', 'safari_ios']) {
assert.ok(browsers.has(coreBrowser), `expected core browser ${coreBrowser}`);
}
assert.ok(!browsers.has('opera'), 'downstream browser opera must be excluded by default');
assert.ok(!browsers.has('kai_os'), 'kai_os must be excluded by default');
const chrome1 = versions.find((entry) => entry.browser === 'chrome' && entry.version === '1');
assert.ok(chrome1, 'expected chrome version 1 entry');
assert.strictEqual(chrome1.year, 'pre_baseline');
assert.strictEqual(chrome1.wa_compatible, false);
assert.strictEqual(typeof chrome1.release_date, 'string');
assert.strictEqual('supports' in chrome1, false);
}
// 2. outputFormat: "object" returns nested browser -> version -> metadata map
{
const mapped = getAllVersionsAsObject();
assert.strictEqual(typeof mapped, 'object');
assert.ok(!Array.isArray(mapped), 'object output must not be an array');
assert.ok(mapped.chrome && mapped.edge && mapped.firefox && mapped.safari);
assert.strictEqual(mapped.chrome['1'].year, 'pre_baseline');
assert.strictEqual(mapped.chrome['1'].wa_compatible, false);
assert.strictEqual(typeof mapped.chrome['1'].release_date, 'string');
}
// 3. outputFormat: "csv" returns quoted CSV with wa_compatible header and NULL engine columns for core browsers
{
const csv = getAllVersionsAsCsv();
assert.strictEqual(typeof csv, 'string');
const lines = csv.trim().split('\n');
assert.ok(lines.length > 10, 'CSV should contain header and data rows');
assert.strictEqual(
lines[0],
'"browser","version","year","wa_compatible","release_date","engine","engine_version"'
);
const chrome1Row = lines.find((line) => line.startsWith('"chrome","1",'));
assert.ok(chrome1Row, 'expected chrome 1 row in CSV');
assert.ok(chrome1Row.endsWith(',"NULL","NULL"'), 'core browser rows use NULL for engine columns');
}
// 4. includeDownstreamBrowsers adds downstream browsers with engine metadata, and includeKaiOS adds kai_os
{
const coreOnly = listAllBrowserVersions();
const withDownstream = listAllBrowserVersions({ includeDownstreamBrowsers: true });
assert.ok(withDownstream.length > coreOnly.length);
const downstreamBrowsers = new Set(withDownstream.map((entry) => entry.browser));
assert.ok(downstreamBrowsers.has('opera'), 'opera should be present when downstream browsers are included');
assert.ok(downstreamBrowsers.has('samsunginternet_android'), 'samsunginternet_android should be present');
assert.ok(!downstreamBrowsers.has('kai_os'), 'kai_os should remain excluded unless includeKaiOS is true');
const operaEntry = withDownstream.find((entry) => entry.browser === 'opera');
assert.ok(operaEntry, 'expected an opera entry');
assert.strictEqual(typeof operaEntry.engine, 'string');
assert.strictEqual(typeof operaEntry.engine_version, 'string');
const withKaiOS = listAllBrowserVersions({ includeDownstreamBrowsers: true, includeKaiOS: true });
const kaiOSEntry = withKaiOS.find((entry) => entry.browser === 'kai_os');
assert.ok(kaiOSEntry, 'kai_os should be included when both includeDownstreamBrowsers and includeKaiOS are true');
assert.strictEqual(kaiOSEntry.engine, 'Gecko');
}
// 5. useSupports: true replaces wa_compatible with supports ("widely" / "newly") across formats
{
const arraySupports = listAllBrowserVersions({ useSupports: true });
assert.ok(arraySupports.every((entry) => !('wa_compatible' in entry)), 'wa_compatible must be omitted when useSupports is true');
assert.ok(arraySupports.some((entry) => entry.supports === 'widely'), 'expected at least one widely supported version');
assert.ok(arraySupports.some((entry) => entry.supports === 'newly'), 'expected at least one newly supported version');
const preBaseline = arraySupports.find((entry) => entry.browser === 'chrome' && entry.version === '1');
assert.ok(preBaseline);
assert.strictEqual(preBaseline.supports, undefined);
const objectSupports = getAllVersionsAsObject({ useSupports: true });
assert.strictEqual('wa_compatible' in objectSupports.chrome['1'], false);
const csvSupports = getAllVersionsAsCsv({ useSupports: true });
const csvHeader = csvSupports.trim().split('\n')[0];
assert.strictEqual(
csvHeader,
'"browser","version","year","supports","release_date","engine","engine_version"'
);
}
// 6. includeKaiOS without includeDownstreamBrowsers throws an error
{
assert.throws(
() => {
getAllVersions({ includeKaiOS: true, includeDownstreamBrowsers: false, suppressWarnings: true });
},
/KaiOS is a downstream browser and can only be included if you include other downstream browsers/
);
}
console.log('PASS: baseline-browser-mapping.getAllVersions contract checks passed');
Origin Seeder
anonymous