サンプル
baseline-browser-mapping 2.11.13: getTimeline
検証済みサンプル — npm baseline-browser-mapping 2.11.13: getTimeline. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: getTimeline returns chronologically…
sha256:91895f834058df230c60a7b71f9d0324e044f393f1be43c1b969e1296684f465
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| 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-17 |
ケース
HOW- ゴール
- verify baseline-browser-mapping.getTimeline in pkg:npm/baseline-browser-mapping@2.11.13
- シンボル
-
- baseline-browser-mapping.getTimeline
- 環境
- node 22.23.2
- 作成日
- 2026-09-17T13:48:30Z
コントラクト
- getTimeline returns chronologically ordered timeline events with date and changed browsers by default
- getTimeline returns all compatible browsers for each event when listAllBrowsers is true
- getTimeline returns browser history mapping when groupBy is browser
- getTimeline includes downstream browser engines when includeDownstreamBrowsers is true
- getTimeline includes KaiOS when includeKaiOS and includeDownstreamBrowsers are true
- getTimeline throws error when includeKaiOS is enabled without downstream browsers
ファイル
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
ソース
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.getTimeline in pkg:npm/baseline-browser-mapping@2.11.13
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/baseline-browser-mapping@2.11.13
Demonstrate these symbols/APIs:
- baseline-browser-mapping.getTimeline
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:e1b58df3523967889c103ddeb72decee234155c77a62e855e841b2776e258acb","constraints":{"executionContext":"node"},"contract":["getTimeline returns chronologically ordered timeline events with date and changed browsers by default","getTimeline returns all compatible browsers for each event when listAllBrowsers is true","getTimeline returns browser history mapping when groupBy is browser","getTimeline includes downstream browser engines when includeDownstreamBrowsers is true","getTimeline includes KaiOS when includeKaiOS and includeDownstreamBrowsers are true","getTimeline throws error when includeKaiOS is enabled without downstream browsers"],"goal":"verify baseline-browser-mapping.getTimeline in pkg:npm/baseline-browser-mapping@2.11.13","kind":"HOW","packages":["pkg:npm/baseline-browser-mapping@2.11.13"],"schemaVersion":1,"symbols":["baseline-browser-mapping.getTimeline"]},"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.13"],"schemaVersion":1,"subject":"pkg:npm/baseline-browser-mapping@2.11.13","symbols":["baseline-browser-mapping.getTimeline"],"verifierAdapter":"node-typescript@1"}
{
"name": "baseline-browser-mapping-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "baseline-browser-mapping-sample",
"version": "1.0.0",
"dependencies": {
"baseline-browser-mapping": "2.11.13"
}
},
"node_modules/baseline-browser-mapping": {
"version": "2.11.13",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.13.tgz",
"integrity": "sha512-k9HNuUVMlqVjQ9UHzfPjIqiDbWw7WqT1AoT7GL8VwvF3r0ZfArtgiSPAlmupyNquNgOJHTuH4CKYf8ttMTWBTQ==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
},
"engines": {
"node": ">=6.0.0"
}
}
}
}
{
"name": "baseline-browser-mapping-sample",
"version": "1.0.0",
"dependencies": {
"baseline-browser-mapping": "2.11.13"
}
}
{
"schemaVersion": 1,
"goal": "verify baseline-browser-mapping.getTimeline in pkg:npm/baseline-browser-mapping@2.11.13",
"kind": "HOW",
"packages": [
"pkg:npm/baseline-browser-mapping@2.11.13"
],
"symbols": [
"baseline-browser-mapping.getTimeline"
]
}
const { getTimeline } = require('baseline-browser-mapping');
/**
* Retrieves timeline events or browser timelines based on baseline availability data.
*
* @param {import('baseline-browser-mapping/dist/types.js').TimelineOptions} [options]
* @returns {any}
*/
function fetchTimeline(options = {}) {
return getTimeline(options);
}
module.exports = {
fetchTimeline,
getTimeline,
};
const assert = require('node:assert/strict');
const {
fetchTimeline,
getTimeline,
} = require('../src/index.js');
// Contract 1: getTimeline returns chronologically ordered timeline events with date and changed browsers by default
{
const timeline = fetchTimeline();
assert.ok(Array.isArray(timeline), 'getTimeline should return an array by default');
assert.ok(timeline.length > 0, 'timeline should have events');
const firstEvent = timeline[0];
assert.strictEqual(typeof firstEvent.date, 'string');
assert.match(firstEvent.date, /^\d{4}-\d{2}-\d{2}$/);
assert.ok(Array.isArray(firstEvent.browsers), 'event browsers should be an array');
assert.strictEqual(firstEvent.browsers.length, 7, 'first baseline event contains 7 core browsers');
const chrome = firstEvent.browsers.find((b) => b.browser === 'chrome');
assert.ok(chrome, 'chrome should be present in initial event');
assert.strictEqual(chrome.version, '38');
assert.strictEqual(chrome.release_date, '2014-10-07');
const secondEvent = timeline[1];
assert.strictEqual(secondEvent.date, '2015-09-22');
assert.strictEqual(secondEvent.browsers.length, 2, 'second event only contains changed browsers');
const browserNames = secondEvent.browsers.map((b) => b.browser);
assert.deepStrictEqual(browserNames, ['firefox', 'firefox_android']);
}
// Contract 2: getTimeline returns all compatible browsers for each event when listAllBrowsers is true
{
const timeline = fetchTimeline({ listAllBrowsers: true });
assert.ok(Array.isArray(timeline));
const secondEvent = timeline[1];
assert.strictEqual(secondEvent.date, '2015-09-22');
assert.strictEqual(secondEvent.browsers.length, 7, 'should include all 7 core browsers when listAllBrowsers is true');
const chrome = secondEvent.browsers.find((b) => b.browser === 'chrome');
const firefox = secondEvent.browsers.find((b) => b.browser === 'firefox');
assert.ok(chrome && firefox);
assert.strictEqual(chrome.version, '38');
assert.strictEqual(firefox.version, '41');
}
// Contract 3: getTimeline returns browser history mapping when groupBy is browser
{
const browserMap = fetchTimeline({ groupBy: 'browser' });
assert.strictEqual(typeof browserMap, 'object');
assert.ok(!Array.isArray(browserMap));
const coreBrowsers = ['chrome', 'chrome_android', 'edge', 'firefox', 'firefox_android', 'safari', 'safari_ios'];
for (const b of coreBrowsers) {
assert.ok(Array.isArray(browserMap[b]), `browserMap should contain history array for ${b}`);
assert.ok(browserMap[b].length > 0, `history for ${b} should not be empty`);
const firstEntry = browserMap[b][0];
assert.strictEqual(typeof firstEntry.date, 'string');
assert.strictEqual(typeof firstEntry.version, 'string');
assert.ok('release_date' in firstEntry);
}
}
// Contract 4: getTimeline includes downstream browser engines when includeDownstreamBrowsers is true
{
const timeline = fetchTimeline({ includeDownstreamBrowsers: true });
assert.ok(Array.isArray(timeline));
const firstEvent = timeline[0];
assert.ok(firstEvent.browsers.length > 7, 'first event should include downstream browsers');
const opera = firstEvent.browsers.find((b) => b.browser === 'opera');
assert.ok(opera, 'opera should be included in downstream browsers');
assert.strictEqual(opera.engine, 'Blink');
assert.strictEqual(typeof opera.engine_version, 'string');
const browserMap = fetchTimeline({ groupBy: 'browser', includeDownstreamBrowsers: true });
assert.ok(Array.isArray(browserMap.opera));
assert.ok(Array.isArray(browserMap.samsunginternet_android));
assert.ok(Array.isArray(browserMap.webview_android));
}
// Contract 5: getTimeline includes KaiOS when includeKaiOS and includeDownstreamBrowsers are true
{
const browserMap = fetchTimeline({
includeDownstreamBrowsers: true,
includeKaiOS: true,
groupBy: 'browser',
});
assert.ok(Array.isArray(browserMap.kai_os), 'kai_os should be present when includeKaiOS is true');
assert.ok(browserMap.kai_os.length > 0);
const firstKai = browserMap.kai_os[0];
assert.strictEqual(firstKai.version, '2.0');
assert.strictEqual(firstKai.engine, 'Gecko');
}
// Contract 6: getTimeline throws error when includeKaiOS is enabled without downstream browsers
{
assert.throws(
() => {
fetchTimeline({
includeKaiOS: true,
includeDownstreamBrowsers: false,
});
},
/KaiOS is a downstream browser and can only be included if you include other downstream browsers/,
'Should throw when includeKaiOS is true without includeDownstreamBrowsers'
);
}
console.log('All pkg:npm/baseline-browser-mapping@2.11.13 baseline-browser-mapping.getTimeline contracts passed successfully.');
オリジンシーダー
匿名