Fix #4475: Correct FormatEnum type keys jp2→jp2k and v→vips
The `FormatEnum` TypeScript interface declared `jp2` and `v` as keys, but the runtime `sharp.format` object uses `jp2k` and `vips` (matching libvips internal format identifiers).
## Changes
- `lib/index.d.ts`: Renamed `jp2` → `jp2k` and `v` → `vips` in `FormatEnum` interface
- `test/unit/util.js`: Added two test cases verifying the correct keys exist and the old incorrect keys are undefined
## Test
Added `uses jp2k as format key, not jp2 (#4475)` and `uses vips as format key, not v (#4475)` tests that:
1. Verify `sharp.format.jp2k` exists with correct id
2. Verify `sharp.format.vips` exists with correct id
3. Verify `sharp.format.jp2` and `sharp.format.v` are undefined
Full test suite passes on macOS ARM (Apple Silicon).
合并状态:未合并 关闭于 2026-02-18 1 条评论