From ae25ad78906179e1448ff7d97957810e2be40206 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 7 Apr 2022 12:17:38 +1000 Subject: nop whitespace formatting change. - ran eglot-format using typescript-language-server on all js files in the repo except those under /hash_script/ - verify only whitespace changed: git diff --word-diff-regex=. 62d6a71 62d6a71~1 --- common/Storage.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'common/Storage.js') diff --git a/common/Storage.js b/common/Storage.js index 62b7b19..47261c5 100644 --- a/common/Storage.js +++ b/common/Storage.js @@ -34,7 +34,7 @@ var Storage = { return array ? new Set(array) : new Set(); }, async save(key, list) { - return await browser.storage.local.set({[key]: [...list]}); + return await browser.storage.local.set({ [key]: [...list] }); }, }, @@ -45,7 +45,7 @@ var Storage = { }, async save(key, list) { - return await browser.storage.local.set({[key]: [...list].join(",")}); + return await browser.storage.local.set({ [key]: [...list].join(",") }); } } }; @@ -70,8 +70,8 @@ class ListStore { // here we simplify and hash inline script references return url.startsWith("inline:") ? url : url.startsWith("view-source:") - && url.replace(/^view-source:[\w-+]+:\/+([^/]+).*#line\d+/,"inline://$1#") - .replace(/\n[^]*/, s => s.replace(/\s+/g, ' ').substring(0, 16) + "…" + hash(s.trim())); + && url.replace(/^view-source:[\w-+]+:\/+([^/]+).*#line\d+/, "inline://$1#") + .replace(/\n[^]*/, s => s.replace(/\s+/g, ' ').substring(0, 16) + "…" + hash(s.trim())); } static hashItem(hash) { return hash.startsWith("(") ? hash : `(${hash})`; @@ -133,10 +133,10 @@ class ListStore { } } -function hash(source){ - var shaObj = new jssha("SHA-256","TEXT") - shaObj.update(source); - return shaObj.getHash("HEX"); +function hash(source) { + var shaObj = new jssha("SHA-256", "TEXT") + shaObj.update(source); + return shaObj.getHash("HEX"); } if (typeof module === "object") { -- cgit v1.2.3