INNER CODE UNIT · TypeScript

firstNonEmptyQueryParam

Hash-Studios/Prism · infra/cloudflare/worker/src/index.ts:561

function firstNonEmptyQueryParam(url: URL, keys: readonly string[]): string {
  for (const key of keys) {
    const value = url.searchParams.get(key);
    if (isNonEmptyString(value)) {
      return value.trim();
    }
  }
  return '';
}

function firstNonEmptyValue(payload: Record<string, unknown>, keys: readonly string[]): string {
  for (const key of keys) {
    const value = payload[key];
    if (isNonEmptyString(value)) {
      return value.trim();
    }
  }
  return '';

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…