placesFromText関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The regions a paste names. Order is the paste's, because somebody who wrote them in lesson order meant that order. A name written twice adds the place once.
インポート
import { placesFromText } from "@johnmorrisdotca/chizu";
定義
function placesFromText(text: string, regions: readonly Named[], options?: MatchOptions): PastedPlaces
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | Pasted names or serialized attribute text specified by this signature. |
regions | readonly Named[] | The native regions available for matching or layout. |
options (省略可) | MatchOptions | The optional native drawing, matching, layout or quiz settings described by this signature. |
戻り値
PastedPlaces
The regions a paste names. Order is the paste's, because somebody who wrote them in lesson order meant that order. A name written twice adds the place once.
例
import WORLD from "@johnmorrisdotca/chizu/world";
import { placesFromText } from "@johnmorrisdotca/chizu";
console.log(placesFromText("Japan, フランス\nBrazil, Narnia", WORLD.regions));
// { codes: [ 'JP', 'FR', 'BR' ], missing: [ 'Narnia' ] }{ codes: [ 'JP', 'FR', 'BR' ], missing: [ 'Narnia' ] }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。