Public
Versions
- Open: VersionChanges from v109 to v110+1-1⦚ 14 unchanged lines ⦚} as const;
type ApiResult = { ok: boolean; data: string[] } | { ok: false; err: unknown };async function generate(opt: keyof typeof opts): Promise<ApiResult> {try {⦚ 19 unchanged lines ⦚⦚ 14 unchanged lines ⦚} as const;type ApiResult = { ok: true; data: string[] } | { ok: false; err: unknown };async function generate(opt: keyof typeof opts): Promise<ApiResult> {try {⦚ 19 unchanged lines ⦚ - Open: VersionChanges from v108 to v109+0-0⦚ 38 unchanged lines ⦚⦚ 38 unchanged lines ⦚
- Open: VersionChanges from v107 to v108+1-1⦚ 15 unchanged lines ⦚type ApiResult = { ok: boolean; data: string[] } | { ok: false; err: unknown };
async function generate(opt: keyof typeof opts): ApiResult {try {const msg = baseMsg(opts[opt]);⦚ 18 unchanged lines ⦚⦚ 15 unchanged lines ⦚type ApiResult = { ok: boolean; data: string[] } | { ok: false; err: unknown };async function generate(opt: keyof typeof opts): Promise<ApiResult> {try {const msg = baseMsg(opts[opt]);⦚ 18 unchanged lines ⦚ - Open: VersionChanges from v106 to v107+2-2⦚ 14 unchanged lines ⦚} as const;
type Response = { ok: boolean; data: string[] } | { ok: false; err: unknown };async function generate(opt: keyof typeof opts) {try {const msg = baseMsg(opts[opt]);⦚ 18 unchanged lines ⦚⦚ 14 unchanged lines ⦚} as const;type ApiResult = { ok: boolean; data: string[] } | { ok: false; err: unknown };async function generate(opt: keyof typeof opts): ApiResult {try {const msg = baseMsg(opts[opt]);⦚ 18 unchanged lines ⦚ - Open: VersionChanges from v105 to v106+1-0⦚ 14 unchanged lines ⦚} as const;async function generate(opt: keyof typeof opts) {try {⦚ 19 unchanged lines ⦚⦚ 14 unchanged lines ⦚} as const;type Response = { ok: boolean; data: string[] } | { ok: false; err: unknown };async function generate(opt: keyof typeof opts) {try {⦚ 19 unchanged lines ⦚
- Open: VersionChanges from v104 to v105+2-2⦚ 24 unchanged lines ⦚const data = res.substring(start, end).split("\n").slice(1, -1);
return { ok: true, data } as const;} catch (err) {return { ok: false, err } as const;}}⦚ 6 unchanged lines ⦚⦚ 24 unchanged lines ⦚const data = res.substring(start, end).split("\n").slice(1, -1);return { ok: true, data };} catch (err) {return { ok: false, err };}}⦚ 6 unchanged lines ⦚ - Open: VersionChanges from v103 to v104+2-2⦚ 24 unchanged lines ⦚const data = res.substring(start, end).split("\n").slice(1, -1);
return { ok: true, data };} catch (err) {return { ok: false, err };}}⦚ 6 unchanged lines ⦚⦚ 24 unchanged lines ⦚const data = res.substring(start, end).split("\n").slice(1, -1);return { ok: true, data } as const;} catch (err) {return { ok: false, err } as const;}}⦚ 6 unchanged lines ⦚ - Open: VersionChanges from v102 to v103+1-0⦚ 24 unchanged lines ⦚const data = res.substring(start, end).split("\n").slice(1, -1);
} catch (err) {return { ok: false, err };}⦚ 7 unchanged lines ⦚⦚ 24 unchanged lines ⦚const data = res.substring(start, end).split("\n").slice(1, -1);return { ok: true, data };} catch (err) {return { ok: false, err };}⦚ 7 unchanged lines ⦚ - Open: Version+36-0import { askAI } from "https://esm.town/v/DFB/askAI";const baseMsg = (extraInfo = "") => `Please generate me a list of 50 unique, memorable strings that Icould use as simple passwords or for unique IDs. Please use a mixof funny words and numbers, but the entries should not be more than12 characters in length. ${extraInfo}Please separate the values into a marked code blockso that I can easily parse them. Please dont number them.`;const opts = {slug: "These values will need to work as slug values, so dont incldue special characters.",password: "These values will be used as passwords, so make sure they satisfy reasonable password requirements.",} as const;async function generate(opt: keyof typeof opts) {try {const msg = baseMsg(opts[opt]);const res = await askAI(msg);const sep = "```"; // Should be THREE backticksconst start = res.indexOf(sep);const end = res.lastIndexOf(sep);const data = res.substring(start, end).split("\n").slice(1, -1);} catch (err) {return { ok: false, err };}}export default async function(req: Request): Promise<Response> {const res = await generate("slug");return Response.json(res);}
dfb-funidorpassword.web.val.run
Updated: August 12, 2024