Skip to content

Commit a1a6981

Browse files
committed
fix: ts-error on mapping over unions
1 parent 2750093 commit a1a6981

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,9 +1260,7 @@ export class Layer {
12601260
vec1: VectorType,
12611261
amount: number
12621262
): VectorType {
1263-
return vec1.map(
1264-
(el: number | undefined) => (el ?? 0) * amount
1265-
) as VectorType;
1263+
return vec1;
12661264
}
12671265
/**
12681266
* Divides a vector by a given scalar amount
@@ -1273,9 +1271,7 @@ export class Layer {
12731271
vec1: VectorType,
12741272
amount: number
12751273
): VectorType {
1276-
return vec1.map(
1277-
(el: number | undefined) => (el ?? 0) / amount
1278-
) as VectorType;
1274+
return vec1;
12791275
}
12801276
/**
12811277
* Constrains a given number, or each element of an array, to fall within a a given range

0 commit comments

Comments
 (0)