From 61c12659c60dde7d2463973f8b2fbbf6dd262120 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Sat, 30 Apr 2022 20:36:12 +0200 Subject: [PATCH] =?UTF-8?q?fix(=F0=9F=90=9B):=20remove=20non=20supported?= =?UTF-8?q?=20spread=20operator=20(#488)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Transforms.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Transforms.ts b/src/Transforms.ts index 0687542..21593a1 100644 --- a/src/Transforms.ts +++ b/src/Transforms.ts @@ -12,13 +12,9 @@ export const transformOrigin = ( transformations: RNTransform ): RNTransform => { "worklet"; - return [ - { translateX: x }, - { translateY: y }, - ...transformations, - { translateX: -x }, - { translateY: -y }, - ]; + return ([{ translateX: x }, { translateY: y }] as RNTransform) + .concat(transformations) + .concat([{ translateX: -x }, { translateY: -y }]); }; export const transformOrigin2d = ( @@ -26,13 +22,9 @@ export const transformOrigin2d = ( transformations: Transforms2d ): Transforms2d => { "worklet"; - return [ - { translateX: x }, - { translateY: y }, - ...transformations, - { translateX: -x }, - { translateY: -y }, - ]; + return ([{ translateX: x }, { translateY: y }] as Transforms2d) + .concat(transformations) + .concat([{ translateX: -x }, { translateY: -y }]); }; export const useTranslation = ({