Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

357 B
Raw Blame
import * as v from 'valibot';

export const domainListSchema = v.pipe(
  v.union([
    v.pipe(
      v.string(),
      v.transform((value) => value.split(',')),
    ),
    v.array(v.string()),
  ]),
  v.transform(
    (value) => new Set(value.map((v) => v.trim().toLowerCase()).filter((v) => v.length > 0)),
  ),
  v.set(v.pipe(v.string(), v.domain())),
);