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

project-slippi / slippi-js / 20257242476

16 Dec 2025 05:10AM UTC coverage: 80.865% (+0.05%) from 80.813%
20257242476

push

github

web-flow
refactor: prefer undefined over null (#158)

* find and replace null with undefined

* compare against null non type check for checking existence

* simplify undefined declarations

* update tests

* allow Aerials to still have nullable iasa frame data

* make string types more restrictive

* revert back to null in metadata type

* make aerial frame data undefined

* remove unnecessary undefined in optional types

* fix _write() method prototype

* refer T[] over new Array<T>

* revert some typing changes

* revert

* revert type change

* simplify

* remove some comments

690 of 921 branches covered (74.92%)

Branch coverage included in aggregate %.

70 of 90 new or added lines in 21 files covered. (77.78%)

1 existing line in 1 file now uncovered.

1854 of 2225 relevant lines covered (83.33%)

125903.11 hits per line

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

87.5
/src/node/SlippiGameNode.ts
1
import { SlippiGameBase } from "../common/SlippiGameBase";
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 SlippiGameNode extends SlippiGameBase {
12✔
8
  private readonly filePath?: string;
9

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

21
  public override getFilePath(): string | undefined {
22
    return this.filePath;
2✔
23
  }
24
}
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