Skip to content

Commit 8841673

Browse files
committed
fix: item in map possibly undefined
1 parent b606279 commit 8841673

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ekeys",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"description": "Animation engine for After Effects expressions",
55
"private": true,
66
"main": "dist/eKeys.jsx",

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,17 @@ function animate(
141141
// so we need to provide a fallback
142142
// Array Subtraction
143143
const arrayDelta: Vector = endArray.map((dimension, index) => {
144-
const curKeyDim = dimension || 0;
145-
const nextKeyDim = startArray[index] || 0;
146-
return curKeyDim - nextKeyDim;
144+
const curKeyDim = dimension as number;
145+
const nextKeyDim = startArray[index] as number;
146+
return (curKeyDim - nextKeyDim) as number;
147147
}) as Vector;
148148
// Multiply difference by progress
149149
const deltaProgressed = arrayDelta.map(
150-
item => (item || 0) * progressAmount
150+
item => (item as number) * progressAmount
151151
);
152152
// Add to current key and return
153153
return startArray.map(
154-
(item, index) => item || 0 + deltaProgressed[index]
154+
(item, index) => ((item as number) + deltaProgressed[index]) as number
155155
) as Vector;
156156
}
157157
}

0 commit comments

Comments
 (0)