make source readonly

This commit is contained in:
Yonatan Bendahan
2025-04-15 15:13:31 +03:00
parent 9738329f73
commit 9a5e29ae11
+11 -2
View File
@@ -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