From 9a5e29ae118048f23e2b8ab8a6f63dcc8eb1c687 Mon Sep 17 00:00:00 2001 From: Yonatan Bendahan Date: Tue, 15 Apr 2025 15:13:31 +0300 Subject: [PATCH] make source readonly --- src/input.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/input.ts b/src/input.ts index 33f7ff7..e41631e 100644 --- a/src/input.ts +++ b/src/input.ts @@ -20,7 +20,8 @@ export type InputOptions = { * @public */ export class Input { - source: Source; + /** @internal */ + _source: Source; /** @internal */ _formats: InputFormat[]; /** @internal */ @@ -42,7 +43,7 @@ export class Input { } this._formats = options.formats; - this.source = options.source; + this._source = options.source; this._mainReader = new Reader(options.source); } @@ -63,6 +64,14 @@ export class Input { })(); } + /** + * Returns the source from which this input file reads its data. This is the same source that was passed to there + * constructor. + */ + get source() { + return this._source; + } + /** * Returns the format of the input file. You can compare this result directly to the InputFormat singletons or use * `instanceof` checks for subset-aware logic (for example, `format instanceof MatroskaInputFormat` is true for