サンプル
Show that Marked’s async mode flag is the switch for asynchronous `walkTokens` behavior.
sha256:970f14379510d93cb1a6e7a4b48afac802d6684c271282fc5935ac5716cd3a70
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Show that Marked’s async mode flag is the switch for asynchronous `walkTokens` behavior. HOW
- パッケージ
- marked 18.0.9
- 環境
- node
- 作成日
- 2026-08-17T03:17:31Z
よくある思い込み
As long as a `walkTokens` hook is declared `async`, Marked will apply its token mutations to output even when `async` is not enabled.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- With a `walkTokens` function that mutates heading depth after awaiting, Marked renders `<h1>Heading</h1>` with `async` false, and `<h6>Heading</h6>` only when `async: true` is set.
- The same markdown source returns a string when `async` is false, and a Promise that resolves to HTML when `async` is true.
ファイル
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9