Skip to content

Commit

Permalink
Replace private static shim property with a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Feb 7, 2025
1 parent d0d48bf commit ac18be9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ import type { Node } from 'estree';

const TAG_ = 'Utils';

let shim: PlatformShim | undefined;

export class Platform {
static #shim: PlatformShim | undefined;
static load(platform: PlatformShim): void {
Platform.#shim = platform;
shim = platform;
}
static get shim(): PlatformShim {
if (!Platform.#shim) {
if (!shim) {
throw new Error('Platform is not loaded');
}
return Platform.#shim;
return shim;
}
}
export class InnertubeError extends Error {
Expand Down

0 comments on commit ac18be9

Please sign in to comment.