mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 07:20:02 -04:00
refactor: delete codecs/ & self.$scramjet
This commit is contained in:
parent
f8d33a207e
commit
337134bcdc
22 changed files with 148 additions and 206 deletions
26
src/scramjet.ts
Normal file
26
src/scramjet.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { ScramjetConfig } from "./types";
|
||||
|
||||
if (!("$scramjet" in self)) {
|
||||
// @ts-expect-error ts stuff
|
||||
self.$scramjet = {
|
||||
version: {
|
||||
build: COMMITHASH,
|
||||
version: VERSION,
|
||||
},
|
||||
codec: {},
|
||||
};
|
||||
}
|
||||
|
||||
export const $scramjet = self.$scramjet;
|
||||
|
||||
const nativeFunction = Function;
|
||||
export function loadCodecs() {
|
||||
$scramjet.codec.encode = nativeFunction(
|
||||
"url",
|
||||
$scramjet.config.codec.encode
|
||||
) as any;
|
||||
$scramjet.codec.decode = nativeFunction(
|
||||
"url",
|
||||
$scramjet.config.codec.decode
|
||||
) as any;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue