@remotion/vercel 4.0.469 → 4.0.471
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/esm/index.mjs +24 -4
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -196,6 +196,14 @@ function assertValidInterpolateEasingOption(easing, inputRangeLength) {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
+
function assertValidInterpolatePosterizeOption(posterize) {
|
|
200
|
+
if (posterize === undefined) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (typeof posterize !== "number" || !Number.isFinite(posterize) || posterize <= 0) {
|
|
204
|
+
throw new Error(\`posterize must be a positive finite number, but got \${posterize}\`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
199
207
|
function interpolate(input, inputRange, outputRange, options) {
|
|
200
208
|
if (typeof input === "undefined") {
|
|
201
209
|
throw new Error("input can not be undefined");
|
|
@@ -213,6 +221,7 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
213
221
|
checkInfiniteRange("outputRange", outputRange);
|
|
214
222
|
checkValidInputRange(inputRange);
|
|
215
223
|
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
224
|
+
assertValidInterpolatePosterizeOption(options?.posterize);
|
|
216
225
|
const easingOption = options?.easing;
|
|
217
226
|
const defaultEasing = (num) => num;
|
|
218
227
|
const resolveEasingForSegment = (segmentIndex) => {
|
|
@@ -238,8 +247,9 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
238
247
|
if (inputRange.length === 1) {
|
|
239
248
|
return outputRange[0];
|
|
240
249
|
}
|
|
241
|
-
const
|
|
242
|
-
|
|
250
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
251
|
+
const range = findRange(posterizedInput, inputRange);
|
|
252
|
+
return interpolateFunction(posterizedInput, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
243
253
|
easing: resolveEasingForSegment(range),
|
|
244
254
|
extrapolateLeft,
|
|
245
255
|
extrapolateRight
|
|
@@ -1230,6 +1240,14 @@ function assertValidInterpolateEasingOption(easing, inputRangeLength) {
|
|
|
1230
1240
|
}
|
|
1231
1241
|
}
|
|
1232
1242
|
}
|
|
1243
|
+
function assertValidInterpolatePosterizeOption(posterize) {
|
|
1244
|
+
if (posterize === undefined) {
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1247
|
+
if (typeof posterize !== "number" || !Number.isFinite(posterize) || posterize <= 0) {
|
|
1248
|
+
throw new Error(\`posterize must be a positive finite number, but got \${posterize}\`);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1233
1251
|
function interpolate(input, inputRange, outputRange, options) {
|
|
1234
1252
|
if (typeof input === "undefined") {
|
|
1235
1253
|
throw new Error("input can not be undefined");
|
|
@@ -1247,6 +1265,7 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
1247
1265
|
checkInfiniteRange("outputRange", outputRange);
|
|
1248
1266
|
checkValidInputRange(inputRange);
|
|
1249
1267
|
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
1268
|
+
assertValidInterpolatePosterizeOption(options?.posterize);
|
|
1250
1269
|
const easingOption = options?.easing;
|
|
1251
1270
|
const defaultEasing = (num) => num;
|
|
1252
1271
|
const resolveEasingForSegment = (segmentIndex) => {
|
|
@@ -1272,8 +1291,9 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
1272
1291
|
if (inputRange.length === 1) {
|
|
1273
1292
|
return outputRange[0];
|
|
1274
1293
|
}
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1294
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
1295
|
+
const range = findRange(posterizedInput, inputRange);
|
|
1296
|
+
return interpolateFunction(posterizedInput, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
1277
1297
|
easing: resolveEasingForSegment(range),
|
|
1278
1298
|
extrapolateLeft,
|
|
1279
1299
|
extrapolateRight
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/vercel",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.471",
|
|
4
4
|
"description": "Render Remotion videos on Vercel Sandbox",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"remotion": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.471",
|
|
27
|
+
"remotion": "4.0.471"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@vercel/sandbox": ">=1.0.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
41
|
+
"@remotion/eslint-config-internal": "4.0.471",
|
|
42
42
|
"@vercel/blob": "2.3.0",
|
|
43
43
|
"@vercel/sandbox": "1.6.0",
|
|
44
44
|
"eslint": "9.19.0",
|