readMapData関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Parse finite choropleth figures; invalid JSON and nested or non-numeric values are rejected.
インポート
import { readMapData } from "@johnmorrisdotca/chizu/element";
ほかのエクスポート元: @johnmorrisdotca/chizu/element/define
定義
function readMapData(text: string | null): Record<string, number> | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | null | The JSON text to read; null means no data. |
戻り値
Record<string, number> | null
Finite values keyed by place code, or null when no data was supplied.
例
import { readMapData } from "@johnmorrisdotca/chizu/element";
console.log(JSON.stringify(readMapData('{"JP":10}')), readMapData('{"JP":"bad"}'));
// {"JP":10} null{"JP":10} null出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。