This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _init() | |
| offsetx=240 | |
| offsety=135 | |
| x=0+offsetx | |
| y=0+offsety | |
| radius=50 | |
| theta=0 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script lang="ts"> | |
| import InputError from './InputError.svelte'; | |
| import { actions, type ActionReturnType } from 'astro:actions'; | |
| const { result }: { | |
| result: ActionReturnType<typeof actions.getGreeting> | |
| } = $props(); | |
| let name = $state(result?.data?.fields.name || ''); | |
| let surname = $state(result?.data?.fields.surname || ''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function fetchWithTimeout( | |
| resource: RequestInfo | URL, | |
| options: RequestInit & { timeout?: number } = {}, | |
| ): Promise<Response> { | |
| const { timeout = 3000, ...fetchOptions } = options; | |
| try { | |
| return await fetch(resource, { | |
| ...fetchOptions, | |
| signal: AbortSignal.timeout(timeout), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { z } from "astro/zod"; | |
| export function formDataToObject( | |
| formData: FormData, | |
| ): Record<string, FormDataEntryValue | FormDataEntryValue[]> { | |
| const obj = Object.create(null) as Record<string, FormDataEntryValue | FormDataEntryValue[]>; | |
| for (const [key, value] of formData.entries()) { | |
| if (Object.hasOwn(obj, key)) { | |
| const currentValue = obj[key]; |
OlderNewer