This GitHub account is linked to an AT Protocol (atproto) identity. Passport generated this gist automatically to prove that link — do not edit or delete it.
did=did:plc:5iqboysibcto44njndtbakjl
nonce=passport-ad12ea6a-0d9f-486f-a127-83cc0fec17b5
This GitHub account is linked to an AT Protocol (atproto) identity. Passport generated this gist automatically to prove that link — do not edit or delete it.
did=did:plc:5iqboysibcto44njndtbakjl
| did:plc:5iqboysibcto44njndtbakjl |
| const createFieldProxy = (remote, path = []) => | |
| new Proxy({}, { | |
| get: (target, prop) => { | |
| if (typeof prop === 'symbol') return undefined | |
| if (prop === 'value' || prop === 'set' || prop === 'as' || prop === 'issues') { | |
| let remoteField = remote.fields | |
| for (const key of path) { | |
| remoteField = remoteField?.[key] | |
| if (!remoteField) return undefined |
| <script lang="ts"> | |
| import { draggable, ghost } from '@neodrag/svelte'; | |
| import { droppable } from '@neodrag/svelte/drop'; | |
| let tasks = $state([ | |
| { id: '1', title: 'Task 1', column: 'todo' }, | |
| { id: '2', title: 'Task 2', column: 'todo' }, | |
| { id: '3', title: 'Task 3', column: 'done' }, | |
| ]); |
| import { replaceState } from '$app/navigation'; | |
| import { page } from '$app/state'; | |
| import { tick } from 'svelte'; | |
| export function box<T>(getter: () => T, setter?: (value: T) => void) { | |
| let derived_val = $derived(getter()); | |
| $effect(() => { | |
| setter?.($state.snapshot(derived_val) as T); | |
| }); |
| export class EventEmitter { | |
| #events: Map<string, Set<Function>> = new Map(); | |
| on(event: string, callback: Function): void { | |
| let callbacks = this.#events.get(event); | |
| if (!callbacks) { | |
| callbacks = new Set(); | |
| this.#events.set(event, callbacks); | |
| } | |
| callbacks.add(callback); |
| import { parse, type Literal } from 'acorn'; | |
| import { type Node } from 'estree-walker'; | |
| import { walk } from 'zimmerframe'; | |
| const ast = parse(output, { | |
| ecmaVersion: 2022, | |
| sourceType: 'module', | |
| sourceFile: full_path, | |
| }); |