openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 807 B
JavaScript
import{l as normalizeOptionalString}from"./string-coerce-CpTFcSwY.mjs";import{o as resolveGlobalSingleton}from"./global-singleton-DolL9xGt.mjs";import{r as canonicalizePathVariant}from"./security-path-Cw01vUc-.mjs";
//!src/plugins/http-path.ts
const canonicalPaths=resolveGlobalSingleton(Symbol.for(`openclaw.pluginHttpRouteCanonicalPaths`),()=>/* @__PURE__ */ new WeakMap);function getPluginHttpRouteCanonicalPath(e){let t=canonicalPaths.get(e);if(!t||t.path!==e.path){t={path:e.path,canonicalPath:canonicalizePathVariant(e.path)};canonicalPaths.set(e,t)}return t.canonicalPath}function normalizePluginHttpPath(e,t){const n=normalizeOptionalString(e)??normalizeOptionalString(t);if(!n)return null;return n.startsWith(`/`)?n:`/${n}`}export{normalizePluginHttpPath as n,getPluginHttpRouteCanonicalPath as t};