Remove lodash omit

(re: #6087)
This commit is contained in:
Bryan Housel
2019-03-26 14:11:55 -04:00
parent e916d18473
commit 4821bf0a68
10 changed files with 41 additions and 26 deletions
+1
View File
@@ -19,6 +19,7 @@ export { utilHighlightEntities } from './util';
export { utilIdleWorker } from './idle_worker';
export { utilKeybinding } from './keybinding';
export { utilNoAuto } from './util';
export { utilObjectOmit } from './object';
export { utilPrefixCSSProperty } from './util';
export { utilPrefixDOMProperty } from './util';
export { utilPreset } from './util';
+9
View File
@@ -0,0 +1,9 @@
export function utilObjectOmit(obj, omitKeys) {
return Object.keys(obj).reduce(function(result, key) {
if (omitKeys.indexOf(key) === -1) {
result[key] = obj[key]; // keep
}
return result;
}, {});
}
+3 -3
View File
@@ -1,5 +1,3 @@
import _map from 'lodash-es/map';
import { t, textDirection } from './locale';
import { utilDetect } from './detect';
import { remove as removeDiacritics } from 'diacritics';
@@ -7,7 +5,9 @@ import { fixRTLTextForSvg, rtlRegex } from './svg_paths_rtl_fix';
export function utilTagText(entity) {
return _map(entity.tags, function(v, k) {
var obj = (entity && entity.tags) || {};
return Object.keys(obj).map(function(k) {
var v = obj[k];
return k + '=' + v;
}).join(', ');
}