fix(striker-ui-api): add JoinFunction type
This commit is contained in:
parent
e412d615d1
commit
58ef1c04c7
@ -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}`;
|
||||
|
||||
|
@ -4,3 +4,8 @@ type JoinOptions = {
|
||||
onEach?: (element: string) => string;
|
||||
separator?: string;
|
||||
};
|
||||
|
||||
type JoinFunction = (
|
||||
elements: string[] | string | undefined,
|
||||
options?: JoinOptions,
|
||||
) => string | undefined;
|
Loading…
Reference in New Issue
Block a user