• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

project-slippi / slippi-js / 19535476215

20 Nov 2025 11:34AM UTC coverage: 81.464% (+0.07%) from 81.39%
19535476215

Pull #150

github

web-flow
Merge 8cbb96535 into 02a2c65e6
Pull Request #150: Refactor SlippiGame to be web-compatible by default

693 of 926 branches covered (74.84%)

Branch coverage included in aggregate %.

162 of 181 new or added lines in 14 files covered. (89.5%)

1966 of 2338 relevant lines covered (84.09%)

122860.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.48
/src/node/index.ts
1
import { SlippiGame as InternalSlippiGame } from "../common/SlippiGame";
12✔
2
import type { StatOptions } from "../common/stats";
3
import { type BinaryLike, isBufferLike } from "../common/utils/bufferHelpers";
12✔
4
import { SlpBufferInputRef } from "../common/utils/slpInputRef";
12✔
5
import { SlpFileInputRef } from "./utils/slpFileInputRef";
12✔
6

7
export class SlippiGame extends InternalSlippiGame {
12✔
8
  protected readonly filePath: string | null;
9

10
  public constructor(input: string | BinaryLike, opts?: StatOptions) {
11
    if (typeof input === "string") {
78✔
12
      super(new SlpFileInputRef(input), opts);
74✔
13
      this.filePath = input;
74✔
14
    } else if (isBufferLike(input)) {
4!
15
      super(new SlpBufferInputRef(input), opts);
4✔
16
      this.filePath = null;
4✔
17
    } else {
NEW
18
      throw new Error("Cannot create SlippiGame with input of that type");
×
19
    }
20
  }
21

22
  public override getFilePath(): string | null {
23
    return this.filePath;
2✔
24
  }
25
}
26

27
// Export everything that works in both the browser and node
28
export * from "../common/index";
12✔
29

30
// Export everything that is node-specific
31
export * from "./console";
12✔
32
export * from "./utils/slpFile";
12✔
33
export * from "./utils/slpFileWriter";
12✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc