diff --git a/striker-ui-api/src/lib/join.ts b/striker-ui-api/src/lib/join.ts index 51e91783..bdf05e75 100644 --- a/striker-ui-api/src/lib/join.ts +++ b/striker-ui-api/src/lib/join.ts @@ -1,13 +1,13 @@ import call from './call'; -const join = ( - elements: string[] | string | undefined, +const join: JoinFunction = ( + elements, { beforeReturn, elementWrapper = '', onEach = (element: string) => element, separator = '', - }: JoinOptions = {}, + } = {}, ) => { const joinSeparator = `${elementWrapper}${separator}${elementWrapper}`; diff --git a/striker-ui-api/src/types/JoinOptions.d.ts b/striker-ui-api/src/types/JoinFunction.d.ts similarity index 58% rename from striker-ui-api/src/types/JoinOptions.d.ts rename to striker-ui-api/src/types/JoinFunction.d.ts index 6a968f5a..9039e103 100644 --- a/striker-ui-api/src/types/JoinOptions.d.ts +++ b/striker-ui-api/src/types/JoinFunction.d.ts @@ -4,3 +4,8 @@ type JoinOptions = { onEach?: (element: string) => string; separator?: string; }; + +type JoinFunction = ( + elements: string[] | string | undefined, + options?: JoinOptions, +) => string | undefined;