diff --git a/src/Array.ts b/src/Array.ts index f8b0158e..a877332d 100644 --- a/src/Array.ts +++ b/src/Array.ts @@ -1,4 +1,4 @@ -export const reorder = (input: unknown[], from: number, to: number) => { +export const move = (input: T[], from: number, to: number) => { "worklet"; const offsets = [...input]; while (from < 0) { diff --git a/src/Paths.ts b/src/Paths.ts index 4c3decfa..02afd89e 100644 --- a/src/Paths.ts +++ b/src/Paths.ts @@ -103,7 +103,7 @@ export const parse = (d: string): Path => { const segments: SVGNormalizedCommands = normalizeSVG(absSVG(parseSVG(d))); return segments.map((segment, index) => { if (segment[0] === "M") { - return move(segment[1], segment[2]); + return moveTo(segment[1], segment[2]); } else if (segment[0] === "Z") { return close(); } else { @@ -248,7 +248,7 @@ export const mixPath = ( /** * @summary Returns a Bèzier curve command. */ -export const move = (x: number, y: number) => { +export const moveTo = (x: number, y: number) => { "worklet"; return { type: SVGCommand.MOVE as const, x, y }; }; diff --git a/src/__tests__/Array.test.ts b/src/__tests__/Array.test.ts index e05e0046..cb1d6447 100644 --- a/src/__tests__/Array.test.ts +++ b/src/__tests__/Array.test.ts @@ -1,6 +1,6 @@ -import { reorder } from "../Array"; +import { move } from "../Array"; test("reorder()", () => { - expect(reorder([0, 1, 2, 3, 4], 2, 0)).toStrictEqual([2, 0, 1, 3, 4]); - expect(reorder([0, 1, 2, 3, 4], 3, 2)).toStrictEqual([0, 1, 3, 2, 4]); + expect(move([0, 1, 2, 3, 4], 2, 0)).toStrictEqual([2, 0, 1, 3, 4]); + expect(move([0, 1, 2, 3, 4], 3, 2)).toStrictEqual([0, 1, 3, 2, 4]); });