@giveitsmaller/sdk 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/file-first.d.ts +3 -2
- package/dist/file-first.js +19 -8
- package/package.json +1 -1
package/dist/file-first.d.ts
CHANGED
|
@@ -335,8 +335,9 @@ export declare class Recipe {
|
|
|
335
335
|
*/
|
|
336
336
|
compress(optimize?: OptimizeFor, options?: Record<string, unknown>): Recipe;
|
|
337
337
|
/**
|
|
338
|
-
* Change format. `format`
|
|
339
|
-
*
|
|
338
|
+
* Change format. The `format` shorthand lowers to the `output_format` wire
|
|
339
|
+
* option (the convert op's wire key per the contract); `options` carries any
|
|
340
|
+
* additional per-op convert options.
|
|
340
341
|
*/
|
|
341
342
|
convert(format: string, options?: Record<string, unknown>): Recipe;
|
|
342
343
|
/**
|
package/dist/file-first.js
CHANGED
|
@@ -436,13 +436,19 @@ export class Recipe {
|
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
438
|
/**
|
|
439
|
-
* Change format. `format`
|
|
440
|
-
*
|
|
439
|
+
* Change format. The `format` shorthand lowers to the `output_format` wire
|
|
440
|
+
* option (the convert op's wire key per the contract); `options` carries any
|
|
441
|
+
* additional per-op convert options.
|
|
441
442
|
*/
|
|
442
443
|
convert(format, options = {}) {
|
|
443
|
-
//
|
|
444
|
-
//
|
|
445
|
-
|
|
444
|
+
// The convert op's wire key is `output_format` (contract: convert.yaml,
|
|
445
|
+
// required, all media), NOT `format`. Spread options FIRST so the explicit
|
|
446
|
+
// shorthand wins over an `output_format` key in the bag.
|
|
447
|
+
// The shorthand owns the format → a stray legacy `format` key in the bag is
|
|
448
|
+
// not a valid convert option; drop it so the wire never carries both keys.
|
|
449
|
+
const rest = { ...options };
|
|
450
|
+
delete rest.format;
|
|
451
|
+
return this.withStep({ opType: 'convert', options: { ...rest, output_format: format } });
|
|
446
452
|
}
|
|
447
453
|
/**
|
|
448
454
|
* Generate a preview. Width and/or height in pixels; any additional per-op
|
|
@@ -1053,9 +1059,14 @@ export class MergedRecipe {
|
|
|
1053
1059
|
}
|
|
1054
1060
|
/** Change the merged output's format. See {@link Recipe.convert}. */
|
|
1055
1061
|
convert(format, options = {}) {
|
|
1056
|
-
//
|
|
1057
|
-
//
|
|
1058
|
-
|
|
1062
|
+
// The convert op's wire key is `output_format` (contract: convert.yaml,
|
|
1063
|
+
// required, all media), NOT `format`. Spread options FIRST so the explicit
|
|
1064
|
+
// shorthand wins over an `output_format` key in the bag.
|
|
1065
|
+
// The shorthand owns the format → a stray legacy `format` key in the bag is
|
|
1066
|
+
// not a valid convert option; drop it so the wire never carries both keys.
|
|
1067
|
+
const rest = { ...options };
|
|
1068
|
+
delete rest.format;
|
|
1069
|
+
return this.withStep({ opType: 'convert', options: { ...rest, output_format: format } });
|
|
1059
1070
|
}
|
|
1060
1071
|
/** Thumbnail the merged output. Omitted dimensions are dropped from the wire options. */
|
|
1061
1072
|
thumbnail(options = {}) {
|