Skip to content

Commit

Permalink
chore(Utils): Replace private static shim property with a variable (#887
Browse files Browse the repository at this point in the history
)
  • Loading branch information
absidue authored Feb 8, 2025
1 parent 0e86902 commit c776b9f
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 c776b9f

Please sign in to comment.