7import { vueSfcInline } from "https://esm.town/v/postpostscript/vue";
89export default function() {
10return htmlResponse`
11${vueSfcInline`
multiFormatmain.tsx14 matches
1import { html, RawHTML } from "https://esm.town/v/postpostscript/html";
23export function multiFormat<R extends MultiFormat = { text: string }>(
4strings: TemplateStringsArray,
5...replacements: (string | R)[]
31};
3233export function combineMultiFormat<R extends MultiFormat>(
34values: (R | string)[],
35transformers = DEFAULT_TRANSFORMERS as Transformers<R>,
67}
6869export function joinMultiFormat<R extends MultiFormat>(values: (R | string)[], join: R | string) {
70if (!values.length) {
71return {
84}
8586export function normalizeMultiFormat<R extends MultiFormat>(value: R | string | number | boolean | null | undefined) {
87if (isString(value)) {
88return { text: value };
94}
9596export function getMultiFormatValue<R extends MultiFormat, K extends keyof R>(
97value: R,
98key: K,
110}
111112function isString(value: unknown): value is string {
113return typeof value === "string" || value instanceof String;
114}
115116function toString(value: unknown) {
117if (isString(value)) {
118return value;
124}
125126export function addStrings(valueA: unknown, valueB: unknown) {
127if (!(isString(valueA) && isString(valueB))) {
128return addStrings(
141}
142143export function wrapHTMLTag(
144tag: string,
145text: string | MultiFormatWithHTML,
161}
162163export function createFormatMethod<R extends MultiFormat>(method: (value: R) => R) {
164return (
165strings: TemplateStringsArray,
170}
171172export function createWrapTagFormatMethod(tag: string, attrs: Record<string, string> = {}) {
173return createFormatMethod<MultiFormatWithHTML>((value) => {
174return wrapHTMLTag(tag, value, attrs);
197});
198199export function ListItem(item: string | MultiFormatWithHTML, i: number | undefined = undefined) {
200return combineMultiFormat([
201{
213}
214215export function OrderedList(items: (string | MultiFormatWithHTML)[]) {
216return joinMultiFormat([
217{
233}
234235export function UnorderedList(items: (string | MultiFormatWithHTML)[]) {
236return joinMultiFormat([
237{
2type PR = Parameters<typeof Octokit["rest"]["pulls"]["create"]>;
34export async function submitPR(ghToken: string, ...pr: PR) {
5return new Octokit({ auth: ghToken }).rest.pulls.create(pr);
6}
githubRestClientmain.tsx1 match
1import { Octokit } from "npm:@octokit/rest";
23export async function githubRestClient(ghToken: string | undefined) {
4return new Octokit({ auth: ghToken || Deno.env.get("GITHUB_TOKEN") }).rest;
5}
githubRestClientREADME.md1 match
1# githubRestClient
23Does what it says! Defaults to using `GITHUB_TOKEN` env var if none is passed to the function.
4
22import { getRedirectUrl } from "https://esm.town/v/postpostscript/moduleHighlightValueLink";
23
24export default async function(req: Request): Promise<Response> {
25return htmlResponse`
26<iframe src="${getRedirectUrl(import.meta.url, "default", true)}" width="100%" height="100%">
maroonLynxmain.tsx1 match
2[key: string]: string;
3};
4export async function parseCalendarEventsTable(html: string): Promise<TableRow[]> {
5const { DOMParser } = await import(
6"https://deno.land/x/deno_dom/deno-dom-wasm.ts"
20## Parameters
2122The 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!
2324
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
23export function alias<P extends Params>(params: P): Promise<Result<P>> {
4const username = params.username;
5let url = `https://api.val.town/v1/alias/${username}`;
ssr_react_minimain.tsx1 match
3536export const hydrate = (importMetaURL: string) =>
37async function(req: Request): Promise<Response> {
38const { author, name } = extractValInfo(importMetaURL);
39const valURL = `https://www.val.town/v/${author}/${name}`;