diff --git a/src/SlippiGame.ts b/src/SlippiGame.ts index 83e8791e..c08a75fd 100644 --- a/src/SlippiGame.ts +++ b/src/SlippiGame.ts @@ -32,7 +32,7 @@ export class SlippiGame { private inputComputer: InputComputer = new InputComputer(); private statsComputer: Stats; - public constructor(input: string | Buffer, opts?: StatOptions) { + public constructor(input: string | Buffer | ArrayBuffer, opts?: StatOptions) { if (_.isString(input)) { this.input = { source: SlpInputSource.FILE, @@ -43,6 +43,11 @@ export class SlippiGame { source: SlpInputSource.BUFFER, buffer: input, }; + } else if (input instanceof ArrayBuffer) { + this.input = { + source: SlpInputSource.BUFFER, + buffer: Buffer.from(input), + }; } else { throw new Error("Cannot create SlippiGame with input of that type"); }