Reference · Framing, geometry and quiz tools
PastedPlacestype
Matched native places in paste order and the original text items that were not found.
Import it
import type { PastedPlaces } from "@johnmorrisdotca/chizu";
Definition
type PastedPlaces = {
codes: string[];
missing: string[];
};
Members
| Name | Type | Description |
|---|---|---|
codes | string[] | The region codes found, in the order they were written, each once. |
missing | string[] | The lines that matched nothing, said back rather than dropped. |
Examples
import WORLD from "@johnmorrisdotca/chizu/world";
import { placesFromText, type PastedPlaces } from "@johnmorrisdotca/chizu";
const found: PastedPlaces = placesFromText("Japan\nAtlantis", WORLD.regions);
console.log(found.codes, found.missing);
// [ 'JP' ] [ 'Atlantis' ][ 'JP' ] [ 'Atlantis' ]What it prints (run when this page was built)