Readme
String.fromCodePoint(@jdan.regionalIndicatorOfLetter("J"));
// => πŸ‡―
1
2
3
4
5
6
7
8
9
10
11
12
import { regionalIndicatorA } from "https://esm.town/v/jdan/regionalIndicatorA";
export const regionalIndicatorOfLetter = (char: string) => {
if (char.length !== 1) {
throw new Error("Must be a single character");
}
if (char < "A" || char > "Z") {
throw new Error("Must be A-Z");
}
return char.charCodeAt(0) - "A".charCodeAt(0) +
regionalIndicatorA;
};
πŸ‘† This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data β€” all from the browser.