-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix worker issue (missing globalThis) Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
- Loading branch information
1 parent
92aebf3
commit f12f5e2
Showing
6 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Base91 } from "../index"; | ||
|
||
onmessage = async function (e) { | ||
const base91 = await Base91.load(); | ||
const base91Str = base91.encode(e.data); | ||
const data = base91.decode(base91Str); | ||
postMessage(data); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
let _scriptDir = (document?.currentScript as any)?.src ?? ""; | ||
let _scriptDir = (globalThis.document?.currentScript as any)?.src ?? ""; | ||
export const scriptDir = _scriptDir.substring(0, _scriptDir.replace(/[?#].*/, "").lastIndexOf('/') + 1) + "../dist"; |