2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function testMutateSemantics2({
5 stateName,
6 mutateExpected,
1export function question() {
2 return "hello";
3}
28
29 console.log(
30 `average e2e user function time: ${(
31 userFuncTimes.reduce((a, b) => a + b, 0) / count
32 ).toFixed(0)}ms (fastest was ${userFuncTimes
7// until it's down, and store the state in
8// @stevekrouse.twitterAPIDown ({ down: boolean, reason: string})
9export async function checkIfTwitterAPIIsDown() {
10 try {
11 // query for something we know will return results
1export function myApi(name) {
2 return "hi " + name;
3}
3 * (c) 2019 Tom Bremmer (https://tbremer.com/) and Chris Ferdinandi (https://gomakethings.com), MIT License,
4 * @param {Array} arr The array to group items from
5 * @param {String|Function} criteria The criteria to group by
6 * @return {Object} The grouped object
7 */
8export function groupBy<A>(arr: A[], criteria: ((a: A) => string) | string) {
9 return arr.reduce(function (obj, item) {
10 // Check if the criteria is a function to run on the item or a property of it
11 var key = typeof criteria === "function" ? criteria(item) : item[criteria];
12
13 // If the key doesn't exist yet, create it
1export function double(x: number) {
2 return 2 * x;
3}
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5export async function openAqNowcastAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +
1import { thisExpressURL } from "https://esm.town/v/stevekrouse/thisExpressURL";
2
3export function testThisExpressUrl(req, res) {
4 let url = thisExpressURL();
5 res.send(`<a href="${url}">${url}</a>`);
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3
4// this function doesn't work yet, I'm still iterating on it
5export function fetchHTML(url: string, options?: any) {
6 return fetchText(url, options)
7 .then(parseHTML);