Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/extensions/line/src/   (Openclaw AI Version 22©)  Datei vom 26.3.2026 mit Größe 2 kB image not shown  

Quelle  bindings.ts

  Sprache: JAVA
 

function normalizeLineConversationId(raw?: string | null): string | null {
  const trimmed = raw?.trim() ?? "";
  if (!trimmed) {
    return null;
  }
  const prefixed = trimmed.match(/^line:(?:(?:user|group|room):)?(.+)$/i)?.[1];
  return (prefixed ?? trimmed).trim() || null;
}

function resolveLineCommandConversation(params: {
  originatingTo?: string;
  commandTo?: string;
  fallbackTo?: string;
}) {
  const conversationId =
    normalizeLineConversationId(params.originatingTo) ??
    normalizeLineConversationId(params.commandTo) ??
    normalizeLineConversationId(params.fallbackTo);
  return conversationId ? { conversationId } : null;
}

function resolveLineInboundConversation(params: { to?: string; conversationId?: string }) {
  const conversationId =
    normalizeLineConversationId(params.conversationId) ?? normalizeLineConversationId(params.to);
  return conversationId ? { conversationId } : null;
}

export const lineBindingsAdapter = {
  compileConfiguredBinding: ({ conversationId }: { conversationId?: string }) => {
    const normalized = normalizeLineConversationId(conversationId);
    return normalized ? { conversationId: normalized } : null;
  },
  matchInboundConversation: ({
    compiledBinding,
    conversationId,
  }: {
    compiledBinding: { conversationId: string };
    conversationId?: string;
  }) => {
    const normalizedIncoming = normalizeLineConversationId(conversationId);
    if (!normalizedIncoming || compiledBinding.conversationId !== normalizedIncoming) {
      return null;
    }
    return {
      conversationId: normalizedIncoming,
      matchPriority: 2,
    };
  },
  resolveCommandConversation: ({
    originatingTo,
    commandTo,
    fallbackTo,
  }: {
    originatingTo?: string;
    commandTo?: string;
    fallbackTo?: string;
  }) =>
    resolveLineCommandConversation({
      originatingTo,
      commandTo,
      fallbackTo,
    }),
  resolveInboundConversation: ({ to, conversationId }: { to?: string; conversationId?: string }) =>
    resolveLineInboundConversation({ to, conversationId }),
};

Messung V0.5 in Prozent
C=98 H=97 G=97

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-13) ¤

*© 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.