Reference · Parsing, formatting and shared types
DIRECTIONAL_MAPconstant
Each directional word, in English or French, in lower case, to its abbreviation (northwest and nord-ouest to
NW and NO).
Import it
import { DIRECTIONAL_MAP } from "@johnmorrisdotca/address-plus";
Definition
const DIRECTIONAL_MAP: Record<string, string> = {
east: "E",
north: "N",
northeast: "NE",
northwest: "NW",
south: "S",
southeast: "SE",
southwest: "SW",
west: "W",
e: "E",
n: "N",
ne: "NE",
nw: "NW",
s: "S",
se: "SE",
sw: "SW",
w: "W",
"e.": "E",
"n.": "N",
"n.e.": "NE",
"ne.": "NE",
"n.w.": "NW",
"nw.": "NW",
"s.": "S",
"s.e.": "SE",
"se.": "SE",
"s.w.": "SW",
"sw.": "SW",
"w.": "W",
"E.": "E",
"N.": "N",
"S.": "S",
"W.": "W",
"S.E.": "SE",
"S.W.": "SW",
"N.E.": "NE",
"N.W.": "NW",
est: "E",
nord: "N",
"nord-est": "NE",
"nord-ouest": "NO",
ouest: "O",
o: "O",
sud: "S",
"sud-est": "SE",
"sud-ouest": "SO",
"o.": "O",
"n.-o.": "NO",
"n.-e.": "NE",
"s.-o.": "SO",
"s.-e.": "SE",
"N.-O.": "NO",
"N.-E.": "NE",
"S.-O.": "SO",
"S.-E.": "SE",
}
Examples
import { DIRECTIONAL_MAP } from "@johnmorrisdotca/address-plus";
console.log(DIRECTIONAL_MAP["northwest"]);
// → "NW"NWWhat it prints (run when this page was built)