chore: remove lodash dependency

This commit is contained in:
多牧 2020-06-24 14:49:26 +08:00 committed by Moyee
parent 7fafd85c89
commit dd63aeacfa

View File

@ -4,7 +4,7 @@
*/ */
import JSON5 from 'json5'; import JSON5 from 'json5';
import lodash from 'lodash'; import get from '@antv/util/lib/get'
/** /**
* *
@ -27,7 +27,7 @@ const keyConvert = str => str.split('-').reduce((a, b) => a + b.charAt(0).toUppe
export const xmlDataRenderer = (xml: string) => data => { export const xmlDataRenderer = (xml: string) => data => {
return xml.split(/{{|}}/g).map(text => { return xml.split(/{{|}}/g).map(text => {
if (/^[\w.]+$/g.test(text.trim())) { if (/^[\w.]+$/g.test(text.trim())) {
return lodash.get(data, text.trim(), text) return get(data, text.trim(), text)
} }
return text; return text;
}).join('') }).join('')