Nest format-specific constructor params (deprecate at top-level)

- `subifd` -> `tiff.subifd`
- `level` -> `openSlide.level`
- `pdfBackground` -> `pdf.background`
This commit is contained in:
Lovell Fuller
2025-06-16 07:51:36 +01:00
parent 8c53d499f7
commit f92540f134
8 changed files with 163 additions and 69 deletions

View File

@@ -117,14 +117,14 @@ describe('JP2 output', () => {
it('valid JP2 oneshot value does not throw error', () => {
assert.doesNotThrow(
() => sharp(fixtures.inputJp2TileParts, { jp2Oneshot: true })
() => sharp({ jp2: { oneshot: true } })
);
});
it('invalid JP2 oneshot value throws error', () => {
assert.throws(
() => sharp(fixtures.inputJp2TileParts, { jp2Oneshot: 'fail' }),
/Expected boolean for jp2Oneshot but received fail of type string/
() => sharp({ jp2: { oneshot: 'fail' } }),
/Expected boolean for jp2.oneshot but received fail of type string/
);
});
});