Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Impressum gateway-entrypoint.ts   Sprache: JAVA

 

import path from "node:path";
import { pathExists } from "../utils.js";

const GATEWAY_DIST_ENTRYPOINT_BASENAMES = [
  "index.js",
  "index.mjs",
  "entry.js",
  "entry.mjs",
] as const;

export function isGatewayDistEntrypointPath(inputPath: string): boolean {
  return /[/\\]dist[/\\].+\.(cjs|js|mjs)$/.test(inputPath);
}

export function buildGatewayInstallEntrypointCandidates(root?: string): string[] {
  if (!root) {
    return [];
  }
  return GATEWAY_DIST_ENTRYPOINT_BASENAMES.map((basename) => path.join(root, "dist", basename));
}

export function buildGatewayDistEntrypointCandidates(...inputs: string[]): string[] {
  const distDirs: string[] = [];
  const seenDirs = new Set<string>();

  for (const inputPath of inputs) {
    if (!isGatewayDistEntrypointPath(inputPath)) {
      continue;
    }
    const distDir = path.dirname(inputPath);
    if (seenDirs.has(distDir)) {
      continue;
    }
    seenDirs.add(distDir);
    distDirs.push(distDir);
  }

  const candidates: string[] = [];
  for (const basename of GATEWAY_DIST_ENTRYPOINT_BASENAMES) {
    for (const distDir of distDirs) {
      candidates.push(path.join(distDir, basename));
    }
  }
  return candidates;
}

export async function findFirstAccessibleGatewayEntrypoint(
  candidates: string[],
  exists: (candidate: string) => Promise<boolean> = pathExists,
): Promise<string | undefined> {
  for (const candidate of candidates) {
    if (await exists(candidate)) {
      return candidate;
    }
  }
  return undefined;
}

export async function resolveGatewayInstallEntrypoint(
  root: string | undefined,
  exists: (candidate: string) => Promise<boolean> = pathExists,
): Promise<string | undefined> {
  return findFirstAccessibleGatewayEntrypoint(
    buildGatewayInstallEntrypointCandidates(root),
    exists,
  );
}

Messung V0.5 in Prozent
C=100 H=79 G=90

¤ 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.0.11Bemerkung:  (vorverarbeitet am  2026-09-28) ¤

*Bot Zugriff






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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126438
#Domains=1897691