[improvement] organize type definitions

This commit is contained in:
陈嘉涵
2019-05-13 19:07:04 +08:00
parent 96b1d8f81d
commit 7755b1738e
40 changed files with 111 additions and 121 deletions
+10 -8
View File
@@ -36,12 +36,14 @@ function prefix(name: string, mods: Mods): Mods {
return ret;
}
export const useBEM = (name: string) => (el?: Mods, mods?: Mods): Mods => {
if (el && typeof el !== 'string') {
mods = el;
el = '';
}
el = join(name, el, ELEMENT);
export function useBEM(name: string) {
return function (el?: Mods, mods?: Mods): Mods {
if (el && typeof el !== 'string') {
mods = el;
el = '';
}
el = join(name, el, ELEMENT);
return mods ? [el, prefix(el, mods)] : el;
};
return mods ? [el, prefix(el, mods)] : el;
};
}