Skip to content

Commit a9b8104

Browse files
fix: use bracket notation for index signature properties (TS4111)
Fix TypeScript TS4111 errors in frame.ts, series.ts, and style.ts by replacing dot notation with bracket notation for properties accessed from index signatures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bee6e94 commit a9b8104

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/core/frame.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ function isIndexLike(v: unknown): v is Index<Label> {
779779
}
780780
const rec = v as Record<string, unknown>;
781781
return (
782-
typeof rec.size === "number" && typeof rec.at === "function" && typeof rec.getLoc === "function"
782+
typeof rec["size"] === "number" && typeof rec["at"] === "function" && typeof rec["getLoc"] === "function"
783783
);
784784
}
785785

src/core/series.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,6 @@ function isIndexLike(v: unknown): v is Index<Label> {
10361036
}
10371037
const rec = v as Record<string, unknown>;
10381038
return (
1039-
typeof rec.size === "number" && typeof rec.at === "function" && typeof rec.getLoc === "function"
1039+
typeof rec["size"] === "number" && typeof rec["at"] === "function" && typeof rec["getLoc"] === "function"
10401040
);
10411041
}

src/stats/style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function colormapColor(t: number, cmap: string): string {
257257
const parts = cmap.split(":");
258258
return lerpColor(parts[0] ?? "#ffffff", parts[1] ?? "#000000", t);
259259
}
260-
const stops = COLORMAPS[cmap] ?? COLORMAPS.Blues!;
260+
const stops = COLORMAPS[cmap] ?? COLORMAPS["Blues"]!;
261261
// Find surrounding stops
262262
for (let i = 0; i < stops.length - 1; i++) {
263263
const [p0, c0] = stops[i]!;

0 commit comments

Comments
 (0)