TypeScript: Ensure 'FormatEnum' keys match reality #4475

Renames format.jp2k as format.jp2 for consistency
This commit is contained in:
Lovell Fuller
2026-01-02 08:04:46 +00:00
parent 006d37b2d0
commit d161e45e06
7 changed files with 47 additions and 15 deletions

View File

@@ -76,7 +76,7 @@ function toFile (fileOut, callback) {
err = new Error('Missing output file path');
} else if (is.string(this.options.input.file) && path.resolve(this.options.input.file) === path.resolve(fileOut)) {
err = new Error('Cannot use same file for input and output');
} else if (jp2Regex.test(path.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
} else if (jp2Regex.test(path.extname(fileOut)) && !this.constructor.format.jp2.output.file) {
err = errJp2Save();
}
if (err) {
@@ -950,7 +950,7 @@ function gif (options) {
*/
function jp2 (options) {
/* node:coverage ignore next 41 */
if (!this.constructor.format.jp2k.output.buffer) {
if (!this.constructor.format.jp2.output.buffer) {
throw errJp2Save();
}
if (is.object(options)) {