2type PR = Parameters<typeof Octokit["rest"]["pulls"]["create"]>;
3
4export async function submitPR(ghToken: string, ...pr: PR) {
5 return new Octokit({ auth: ghToken }).rest.pulls.create(pr);
6}
20## Parameters
21
22The function takes two parameters: your gh access token and an object that's identical to the object submitted to the gh API. See [GH's documentation](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request) for more info!
23
24
1# valToGH
2
3A utility function for programmatically updating a GitHub repository with code retrieved from a Val.
4
5**NOTE**: This function currently does not change the contents of a file if it is already present. I will however be adding that functionality.
6
7## Usage
5)`);
6
7async function getCurrentCount(): Promise<number> {
8 let counter = await sqlite.execute(`select counter from counter where name = 'retro'`);
9 if (counter.rows.length === 0) {
1export function quine() {
2 return `${quine}`;
3}
1import { delay } from "https://deno.land/std/async/delay.ts";
2
3async function write(text: string) {
4 const textEncoder = new TextEncoder();
5 const data = textEncoder.encode(text);
1# SQLite Dump Util
2
3A utility function that generates SQL statements to dump the data and schema of tables in a SQLite database.
4
5## Usage
25```
26
27## Function Signature
28
29```typescript
30function sqliteDump(tables?: string[], callback?: ((result: string) => string | void | Promise<void>) | undefined): Promise<string | void>
31```
32
34
35- `tables`: (Optional) Array of table names to include in the dump. If not provided, all tables will be included.
36- `callback`: (Optional) An (potentially async) callback function to process the dump result. The callback receives the dump string as its argument.
37
29};
30
31export default async function(email: Email) {
32 console.log(email);
33 await sendPDF(email.subject, email.html);
6
7// TODO: implement options
8export async function createServer(db, options: Options & { auth?: { username: string; password: string } } = {}) {
9 const app = new Hono();
10
1export async function handle() {
2 // Schedule work to do later
3 new Promise<void>(async (resolve) => {