fix(striker-ui-api): add JoinFunction type
This commit is contained in:
parent
e412d615d1
commit
58ef1c04c7
@ -1,13 +1,13 @@
|
|||||||
import call from './call';
|
import call from './call';
|
||||||
|
|
||||||
const join = (
|
const join: JoinFunction = (
|
||||||
elements: string[] | string | undefined,
|
elements,
|
||||||
{
|
{
|
||||||
beforeReturn,
|
beforeReturn,
|
||||||
elementWrapper = '',
|
elementWrapper = '',
|
||||||
onEach = (element: string) => element,
|
onEach = (element: string) => element,
|
||||||
separator = '',
|
separator = '',
|
||||||
}: JoinOptions = {},
|
} = {},
|
||||||
) => {
|
) => {
|
||||||
const joinSeparator = `${elementWrapper}${separator}${elementWrapper}`;
|
const joinSeparator = `${elementWrapper}${separator}${elementWrapper}`;
|
||||||
|
|
||||||
|
@ -4,3 +4,8 @@ type JoinOptions = {
|
|||||||
onEach?: (element: string) => string;
|
onEach?: (element: string) => string;
|
||||||
separator?: string;
|
separator?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type JoinFunction = (
|
||||||
|
elements: string[] | string | undefined,
|
||||||
|
options?: JoinOptions,
|
||||||
|
) => string | undefined;
|
Loading…
Reference in New Issue
Block a user