2import { api } from "https://esm.town/v/pomdtr/api";
34export function devtools(handler: (req: Request) => Response | Promise<Response>, options?: {
5val?: {
6handle: string;
8};
910export async function sendSMS(phoneNumber: string, message: string, carrier: string): Promise<void> {
11const carrierDomain = carriers[carrier.toLowerCase()];
12if (!carrierDomain) {
22text: message,
23});
24console.log('Email function returned:', result);
25console.log('SMS sent successfully');
26} catch (error) {
Work_Time_Calculatormain.tsx12 matches
1function convertTo24HourFormat(time) {
2if (!time) {
3console.error("Invalid time input:", time);
17}
1819function parseTimeRanges(daySchedule) {
20console.log(`Parsing schedule: ${daySchedule}`);
21const timeRanges = daySchedule.match(/(\d{1,2}:\d{2}(?:am|pm)?)/g);
54}
5556function calculateDuration(startTime, endTime) {
57console.log(`Calculating duration from ${startTime} to ${endTime}`);
58const start24 = convertTo24HourFormat(startTime);
73}
7475function calculateDailyTotal(parsedSchedule) {
76console.log(`Calculating daily total for schedule:`, parsedSchedule);
77let totalMinutes = 0;
89}
9091function calculateWeeklyTotal(dailyTotals) {
92console.log(`Calculating weekly total for daily totals:`, dailyTotals);
93let totalHours = 0;
107}
108109function calculateWorkTime(schedule) {
110const dailyTotals = [];
111const scheduleArray = schedule.split("\n").filter(Boolean);
155calculateWorkTime(schedule);
156157/*function testConvertTo24HourFormat() {
158console.assert(convertTo24HourFormat("10:18am") === "10:18", `Test failed for "10:18am"`);
159console.assert(convertTo24HourFormat("12:35pm") === "12:35", `Test failed for "12:35pm"`);
167}
168169function testParseTimeRanges() {
170const result1 = parseTimeRanges("10:18am-12:35pm lunch 1:25pm-6:38pm");
171console.assert(result1.length === 2, `Test failed for length of result1`);
194}
195196function testCalculateDuration() {
197const duration1 = calculateDuration("10:18am", "12:35pm");
198console.assert(duration1.hours === 2 && duration1.minutes === 17, `Test failed for duration 10:18am-12:35pm`);
210}
211212function testCalculateDailyTotal() {
213const parsedSchedule1 = [
214{ start: "10:18am", end: "12:35pm" },
229}
230231function testCalculateWeeklyTotal() {
232const dailyTotals = [
233{ hours: 7, minutes: 30 },
243}
244245function runTests() {
246try {
247testConvertTo24HourFormat();
5const baseUrl = "agave-astro.netlify.app";
67export default async function(req: Request): Promise<Response> {
8if (req.method === "POST") {
9const comment = await req.json() as Comment;
5const baseUrl = "agave-astro.netlify.app";
67export default async function(req: Request): Promise<Response> {
8if (req.method === "POST") {
9const comment = await req.json() as Comment;
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
SongTaggermain.tsx1 match
125});
126127async function getToken(c) {
128const state = c.req.query("state") as string;
129const authData = await db.select().from(table).where(eq(table.id, state)).limit(1);
dateme_faqmain.tsx1 match
6let linkClass = "text-sky-600 hover:text-sky-500";
78export default function FAQ(c) {
9return c.html(
10<Layout activeTab={new URL(c.req.url).pathname}>
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
processTextInChunksmain.tsx2 matches
345export async function processTextInChunks(inputText, processFn = async (text) => console.log(text), config = {}) {
6const {
7chunkLength = 1000,
4950// just gives information about the chunks; doesn't actually do anything!
51export function preprocessTextChunks(inputText, config = {}) {
52const {
53chunkLength = 1000,