Reference · The realistic Earth's pure parts
readCountryNamesfunction
Reads the country-names attribute: absent (or off) is none, bare is 40 names at most, a number is that many at most (1 to 120).
Import it
import { readCountryNames } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function readCountryNames(value: string | null): number | null
Parameters
| Name | Type | Description |
|---|---|---|
value | string | null | The attribute's value, or |
Returns
number | null
How many names at most, or null for none.
Examples
import { readCountryNames } from "@johnmorrisdotca/chikyu-earth/realistic";
console.log(readCountryNames(null), readCountryNames(""), readCountryNames("12"), readCountryNames("500"), readCountryNames("off"));null 40 12 120 nullWhat it prints (run when this page was built)