Skip to content

Instantly share code, notes, and snippets.

View snapsnapturtle's full-sized avatar

Jonah Möller snapsnapturtle

View GitHub Profile
const widget = new ListWidget();
const storeInfo = await getClosestStore();
const storeId = storeInfo.storeNumber;
const storeCapacity = await fetchAmountOfPaper();
const mapsAddress = 'https://maps.apple.com/?daddr=' + encodeURIComponent(storeInfo.address.street) + ',' + encodeURIComponent(storeInfo.address.city) + '&dirflg=d'
widget.url = mapsAddress;
await createWidget();
const CC_REGEX = /^[a-z]{2}$/i;
const OFFSET = 127397;
function toEmoji(cc) {
if (!CC_REGEX.test(cc)) {
const type = typeof cc;
throw new TypeError(
`cc argument must be an ISO 3166-1 alpha-2 string, but got '${
type === 'string' ? cc : type
}' instead.`,