MCPcopy Create free account
hub / github.com/Alfredredbird/CyberKelp / noteFromHash

Function noteFromHash

script.js:429–438  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

427// --- Hash routing ---------------------------------------------
428
429function noteFromHash() {
430 const hash = window.location.hash.slice(1); // strip leading #
431 if (!hash) return null;
432 // Try exact id match first, then slug/title match
433 return (
434 NOTES.find((n) => n.id === hash) ||
435 NOTES.find((n) => n.wikiName.toLowerCase() === hash.toLowerCase()) ||
436 NOTES.find((n) => n.title.toLowerCase().replace(/\s+/g, "-") === hash.toLowerCase())
437 );
438}
439
440function initHashRouting() {
441 // On back/forward navigation update the loaded note

Callers 2

initHashRoutingFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected