MCPcopy
hub / github.com/alpic-ai/skybridge / computeViewVersionParam

Method computeViewVersionParam

packages/core/src/server/server.ts:1150–1168  ·  view source on GitHub ↗
(viewName: string)

Source from the content-addressed store, hash-verified

1148 }
1149
1150 private computeViewVersionParam(viewName: string): string {
1151 if (process.env.NODE_ENV !== "production") {
1152 return "";
1153 }
1154 try {
1155 const viewFile = this.lookupViewFile(viewName);
1156 const styleFile = this.lookupDistFile("style.css") ?? "";
1157 const hash = crypto
1158 .createHash("sha256")
1159 .update(viewFile)
1160 .update("\0")
1161 .update(styleFile)
1162 .digest("hex")
1163 .slice(0, 8);
1164 return `?v=${hash}`;
1165 } catch {
1166 return "";
1167 }
1168 }
1169
1170 private lookupViewFile(viewName: string) {
1171 const manifest = this.readManifest();

Callers 1

registerViewResourcesMethod · 0.95

Calls 2

lookupViewFileMethod · 0.95
lookupDistFileMethod · 0.95

Tested by

no test coverage detected