import template from 'lodash/template'; import get from 'lodash/get'; // const interpolate = /${([\s\S]+?)}/g; // xuechen:暂时先使用 lodash 的 template export function t(strings, placeholder = {}) { try { return template(strings)(placeholder); } catch (err) { console.error('[template]', err); return strings; } } export function joinText(objArray, keyPath, joint = ', ') { return (objArray || []).map((obj) => get(obj, keyPath)).join(joint); }