source-scraper-core
Version:
Core files for the SourceScraper-Project
22 lines • 744 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const normalize_url_1 = require("normalize-url");
const trim = require("trim-character");
class Source {
constructor({ url, type, codec, resolution }) {
this.type = type;
this.codec = codec;
this.resolution = resolution;
this.url = normalize_url_1.default(url);
}
getNormalizedResolution() {
if (typeof this.resolution === 'undefined')
return;
const i = this.resolution.indexOf('x');
return Number(i !== -1 ?
trim.right(this.resolution.substring(i), 'p') :
this.resolution);
}
}
exports.Source = Source;
//# sourceMappingURL=Source.js.map