ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/components/forms/submit-form-validation.ts

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/components/forms/submit-form-validation.ts
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/components/forms/submit-form-validation.ts
Original SHA-2564fef24fac2acef4766bea33cc3c4460297539765047bffa8ae958e4b6bc78442
Git blob SHA51f1c9a749c0aaf0218ff0a1e092117c3ba644a5
Reading-copy SHA-2564fef24fac2acef4766bea33cc3c4460297539765047bffa8ae958e4b6bc78442

Original source ↗

Recovered source transcript

import { isSameDomain, normalizeDomain } from './submit-form-utils' /** * Validates that URLs belong to the same domain */ export function validateDomains( websiteUrl: string, llmsUrl: string, llmsFullUrl: string | null, setError: (field: string, error: { type: string; message: string }) => void, clearErrors: (fields: string[]) => void ): boolean { // Clear existing custom errors first clearErrors(['llmsUrl', 'llmsFullUrl']) if (!websiteUrl) return true let isValid = true /** * Validates individual URL */ const validateUrl = (url: string, type: 'llms' | 'llmsFull') => { const cleanedUrl = url.trim().replace(/[\r\n\t]/g, '') if (!cleanedUrl || !websiteUrl) return true if (!isSameDomain(cleanedUrl, websiteUrl)) { const expectedDomain = normalizeDomain(websiteUrl) const actualDomain = normalizeDomain(cleanedUrl) const errorMessage = `Domain mismatch: expected ${expectedDomain}, got ${actualDomain}` const fieldName = type === 'llms' ? 'llmsUrl' : 'llmsFullUrl' setError(fieldName, { type: 'manual', message: errorMessage }) isValid = false return false } return true } // Validate both URLs validateUrl(llmsUrl, 'llms') if (llmsFullUrl) { validateUrl(llmsFullUrl, 'llmsFull') } return isValid }

Search equations, builds, manuscript text, and recovered sources.