Skip to content

Commit 0446780

Browse files
committed
reject arguments that are not options in apngEncoder
1 parent e3f4bda commit 0446780

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/animation.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ export class Animation {
411411
* @param options See {@link APNGEncodeOptions}, and {@link AnimationOptions.loopCount}
412412
*/
413413
static apngEncoder(width: number, height: number, options: APNGEncodeOptions & AnimationOptions = {}): AnimationEncoder {
414+
checkOptions(options, 'Animation.apngEncoder(width, height, { compression: 9 })');
414415
return AnimationEncoder.__apng__(width, height, options);
415416
}
416417

‎tests/options-objects-all.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const panic = message => {
2626
'Animation.encodeWebP': bad => new Animation([frame]).encodeWebP(bad),
2727
'Animation.webpEncoder': bad => Animation.webpEncoder(8, 8, bad),
2828
'Animation.gifEncoder': bad => Animation.gifEncoder(8, 8, bad),
29+
'Animation.apngEncoder': bad => Animation.apngEncoder(8, 8, bad),
2930
'AnimationEncoder.add': async bad => { const encoder = Animation.gifEncoder(16, 10); await encoder.add(photo, bad); },
3031
'new GainMap': bad => new GainMap(new Image(2, 2), bad),
3132
'new TextLayout': bad => new TextLayout(bad)

0 commit comments

Comments
 (0)