git » sdk » commit 2875e25

Replace all occurances not just first

author Stephen Paul Weber
2024-10-11 03:05:38 UTC
committer Stephen Paul Weber
2024-10-11 03:08:41 UTC
parent 1a35af968c880a4400ca72da15a6e80496bcc597

Replace all occurances not just first

snikket/persistence/browser.js +1 -1

diff --git a/snikket/persistence/browser.js b/snikket/persistence/browser.js
index d3dbbfa..caf89bb 100644
--- a/snikket/persistence/browser.js
+++ b/snikket/persistence/browser.js
@@ -49,7 +49,7 @@ const browser = (dbname, tokenize, stemmer) => {
 	caches.open(dbname).then((c) => cache = c);
 
 	function mkNiUrl(hashAlgorithm, hashBytes) {
-		const b64url = btoa(Array.from(new Uint8Array(hashBytes), (x) => String.fromCodePoint(x)).join("")).replace(/\+/, "-").replace(/\//, "_").replace(/=/, "");
+		const b64url = btoa(Array.from(new Uint8Array(hashBytes), (x) => String.fromCodePoint(x)).join("")).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
 		return "/.well-known/ni/" + hashAlgorithm + "/" + b64url;
 	}