0
我有以下功能:指定返回類型爲內聯函數與流
const safeNull = fn => (txt: string): string => (isNil(txt) ? '' : fn(txt));
export const stripSpaces: Function = safeNull(txt => txt.replace(/\s/g, ''));
export const safeTrim: Function = safeNull(txt => txt.trim());
我怎麼說stripSpaces
和safeTrim
返回字符串。