feat: add LMS web client

This commit is contained in:
2026-07-15 13:41:00 +09:00
commit 05ff2644e8
308 changed files with 487923 additions and 0 deletions
@@ -0,0 +1,24 @@
const extractStringRecord = (value: unknown): Record<string, unknown> | null => (
value && typeof value === 'object' && !Array.isArray(value)
? value as Record<string, unknown>
: null
)
export const readNestedString = (value: unknown, keys: string[]): string | null => {
let current: unknown = value
for (const key of keys) {
const record = extractStringRecord(current)
if (!record) return null
current = record[key]
}
return typeof current === 'string' && current.trim() ? current.trim() : null
}
export const parseHostFromUrl = (value?: string | null): string | null => {
if (!value?.trim()) return null
try {
return new URL(value).hostname
} catch {
return value.trim()
}
}