Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/extensions/qqbot/src/engine/config/   (Openclaw AI Version 22©)  Datei vom 26.3.2026 mit Größe 1004 B image not shown  

Quelle  allow-from.ts

  Sprache: JAVA
 

/**
 * AllowFrom normalization  zero external dependency version.
 *
 * Extracted from channel-config-shared.ts. The original used
 * `normalizeStringifiedOptionalString` from plugin-sdk, which is
 * just `String(x).trim()` for non-null primitives.
 */


/** Normalize a config entry to a trimmed string (empty string for null/undefined). */
function normalizeEntry(entry: unknown): string {
  if (entry === null || entry === undefined) {
    return "";
  }
  if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean") {
    return String(entry).trim();
  }
  return "";
}

/** Normalize allowFrom entries: strip `qqbot:` prefix, uppercase. */
export function formatAllowFrom(params: { allowFrom: unknown[] | undefined | null }): string[] {
  return (params.allowFrom ?? [])
    .map((entry) => normalizeEntry(entry))
    .filter((entry): entry is string => entry.length > 0)
    .map((entry) => entry.replace(/^qqbot:/i, ""))
    .map((entry) => entry.toUpperCase());
}

Messung V0.5 in Prozent
C=95 H=98 G=96

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.