Skip to content

Commit f37a538

Browse files
matmenclaude
andcommitted
hide ImageType's constructor
ImageType only has static methods: a private constructor keeps it out of the documentation and makes `new ImageType()` a type error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
1 parent 165d534 commit f37a538

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/image-type.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function dataView(data: BinaryData): DataView {
2525

2626
/** Detects image formats by their magic numbers */
2727
export class ImageType {
28+
// only static methods
29+
private constructor() {}
30+
2831
/**
2932
* Gets an image's type from its magic number
3033
* @param data The image binary to get the type of

0 commit comments

Comments
 (0)