fix(striker-ui-api): add JoinFunction type

This commit is contained in:
Tsu-ba-me 2022-10-19 23:25:38 -04:00
parent e412d615d1
commit 58ef1c04c7
2 changed files with 8 additions and 3 deletions

View File

@ -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}`;

View File

@ -4,3 +4,8 @@ type JoinOptions = {
onEach?: (element: string) => string;
separator?: string;
};
type JoinFunction = (
elements: string[] | string | undefined,
options?: JoinOptions,
) => string | undefined;