Reference · Codes, URLs and SVG helpers
FlagUrlOptionstype
Where flagUrl finds the SVG files: a folder holding <code>.svg.
Import it
import type { FlagUrlOptions } from "@johnmorrisdotca/hata";
Definition
interface FlagUrlOptions {
base?: string;
}
Members
| Name | Type | Description |
|---|---|---|
base (optional) | string | undefined | The folder's address, with or without a trailing slash. Left out, it is this major version on the jsDelivr
CDN, |
Examples
import { flagUrl, type FlagUrlOptions } from "@johnmorrisdotca/hata";
const own: FlagUrlOptions = { base: "/static/flags" };
console.log(flagUrl("JP", own)); // "/static/flags/jp.svg"/static/flags/jp.svgWhat it prints (run when this page was built)