chore(project): upgrade lodash to min-dash

This commit is contained in:
TheSharpieOne Bot 2018-03-14 16:43:53 -04:00 committed by Nico Rehwaldt
parent 52c172edea
commit 245d1d6a96
68 changed files with 158 additions and 132 deletions

View File

@ -6,9 +6,8 @@
*/
'use strict';
var assign = require('lodash/object/assign'),
omit = require('lodash/object/omit'),
isNumber = require('lodash/lang/isNumber');
var assign = require('min-dash').assign,
isNumber = require('min-dash').isNumber;
var domify = require('min-dom').domify,
domQuery = require('min-dom').query,
@ -412,8 +411,9 @@ Viewer.prototype._init = function(container, moddle, options) {
];
var diagramModules = [].concat(staticModules, baseModules, additionalModules);
var diagramOptions = assign(omit(options, 'additionalModules'), {
var optionsWithoutAdditionalModules = assign({}, options);
delete optionsWithoutAdditionalModules.additionalModules;
var diagramOptions = assign(optionsWithoutAdditionalModules, {
canvas: assign({}, options.canvas, { container: container }),
modules: diagramModules
});

View File

@ -1,7 +1,7 @@
'use strict';
var every = require('lodash/collection/every'),
some = require('lodash/collection/some');
var every = require('min-dash').every,
some = require('min-dash').some;
var componentsToPath = require('diagram-js/lib/util/RenderUtil').componentsToPath;

View File

@ -1,9 +1,9 @@
'use strict';
var inherits = require('inherits'),
isObject = require('lodash/lang/isObject'),
assign = require('lodash/object/assign'),
forEach = require('lodash/collection/forEach');
isObject = require('min-dash').isObject,
assign = require('min-dash').assign,
forEach = require('min-dash').forEach;
var BaseRenderer = require('diagram-js/lib/draw/BaseRenderer'),
TextUtil = require('diagram-js/lib/util/Text'),

View File

@ -6,8 +6,8 @@ var getMid = require('diagram-js/lib/layout/LayoutUtil').getMid,
asTRBL = require('diagram-js/lib/layout/LayoutUtil').asTRBL,
getOrientation = require('diagram-js/lib/layout/LayoutUtil').getOrientation;
var find = require('lodash/collection/find'),
reduce = require('lodash/collection/reduce');
var find = require('min-dash').find,
reduce = require('min-dash').reduce;
var DEFAULT_HORIZONTAL_DISTANCE = 50;

View File

@ -4,7 +4,7 @@ var is = require('../../util/ModelUtil').is;
var inherits = require('inherits');
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
var AutoResizeProvider = require('diagram-js/lib/features/auto-resize/AutoResizeProvider');

View File

@ -1,9 +1,9 @@
'use strict';
var assign = require('lodash/object/assign'),
forEach = require('lodash/collection/forEach'),
isArray = require('lodash/lang/isArray'),
var assign = require('min-dash').assign,
forEach = require('min-dash').forEach,
isArray = require('min-dash').isArray,
is = require('../../util/ModelUtil').is,
isExpanded = require('../../util/DiUtil').isExpanded,
isAny = require('../modeling/util/ModelingUtil').isAny,

View File

@ -11,8 +11,8 @@ var ModelCloneUtils = require('../../util/model/ModelCloneUtils'),
var IGNORED_PROPERTIES = ModelCloneUtils.IGNORED_PROPERTIES;
var filter = require('lodash/collection/filter'),
forEach = require('lodash/collection/forEach');
var filter = require('min-dash').filter,
forEach = require('min-dash').forEach;
function setProperties(descriptor, data, properties) {
forEach(properties, function(property) {

View File

@ -1,6 +1,6 @@
'use strict';
var filter = require('lodash/collection/filter');
var filter = require('min-dash').filter;
var isAny = require('../modeling/util/ModelingUtil').isAny;

View File

@ -4,7 +4,7 @@ var inherits = require('inherits');
var EditorActions = require('diagram-js/lib/features/editor-actions/EditorActions');
var filter = require('lodash/collection/filter');
var filter = require('min-dash').filter;
var is = require('../../util/ModelUtil').is;

View File

@ -1,6 +1,6 @@
'use strict';
var assign = require('lodash/object/assign');
var assign = require('min-dash').assign;
var LabelUtil = require('./LabelUtil');

View File

@ -1,8 +1,8 @@
'use strict';
var map = require('lodash/collection/map'),
assign = require('lodash/object/assign'),
pick = require('lodash/object/pick');
var map = require('min-dash').map,
assign = require('min-dash').assign,
pick = require('min-dash').pick;
function BpmnFactory(moddle) {

View File

@ -2,7 +2,7 @@
var inherits = require('inherits');
var assign = require('lodash/object/assign');
var assign = require('min-dash').assign;
var BaseLayouter = require('diagram-js/lib/layout/BaseLayouter'),
ManhattanLayout = require('diagram-js/lib/layout/ManhattanLayout');

View File

@ -1,7 +1,7 @@
'use strict';
var assign = require('lodash/object/assign'),
forEach = require('lodash/collection/forEach'),
var assign = require('min-dash').assign,
forEach = require('min-dash').forEach,
inherits = require('inherits');
var Collections = require('diagram-js/lib/util/Collections'),

View File

@ -1,7 +1,7 @@
'use strict';
var assign = require('lodash/object/assign'),
forEach = require('lodash/collection/forEach'),
var assign = require('min-dash').assign,
forEach = require('min-dash').forEach,
inherits = require('inherits');
var is = require('../../util/ModelUtil').is;

View File

@ -2,7 +2,7 @@
var inherits = require('inherits');
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
var is = require('../../../util/ModelUtil').is;

View File

@ -6,7 +6,7 @@ var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
var Collections = require('diagram-js/lib/util/Collections');
var find = require('lodash/collection/find');
var find = require('min-dash').find;
var is = require('../../../util/ModelUtil').is;

View File

@ -2,8 +2,8 @@
var inherits = require('inherits');
var assign = require('lodash/object/assign'),
find = require('lodash/collection/find');
var assign = require('min-dash').assign,
find = require('min-dash').find;
var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');

View File

@ -1,6 +1,6 @@
'use strict';
var assign = require('lodash/object/assign'),
var assign = require('min-dash').assign,
inherits = require('inherits');
var LabelUtil = require('../../../util/LabelUtil'),

View File

@ -1,7 +1,7 @@
'use strict';
var forEach = require('lodash/collection/forEach'),
find = require('lodash/collection/find'),
var forEach = require('min-dash').forEach,
find = require('min-dash').find,
inherits = require('inherits');
var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');

View File

@ -4,7 +4,7 @@ var inherits = require('inherits');
var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
var isEventSubProcess = require('../../../util/DiUtil').isEventSubProcess;
var is = require('../../../util/ModelUtil').is;

View File

@ -1,6 +1,6 @@
'use strict';
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
var inherits = require('inherits');

View File

@ -1,6 +1,6 @@
'use strict';
var filter = require('lodash/collection/filter');
var filter = require('min-dash').filter;
var Elements = require('diagram-js/lib/util/Elements');

View File

@ -1,7 +1,7 @@
'use strict';
var assign = require('lodash/object/assign'),
forEach = require('lodash/collection/forEach');
var assign = require('min-dash').assign,
forEach = require('min-dash').forEach;
var DEFAULT_COLORS = {
fill: undefined,

View File

@ -1,9 +1,9 @@
'use strict';
var reduce = require('lodash/object/transform'),
keys = require('lodash/object/keys'),
forEach = require('lodash/collection/forEach'),
assign = require('lodash/object/assign');
var reduce = require('min-dash').transform,
keys = require('min-dash').keys,
forEach = require('min-dash').forEach,
assign = require('min-dash').assign;
var getBusinessObject = require('../../../util/ModelUtil').getBusinessObject;

View File

@ -1,6 +1,6 @@
'use strict';
var any = require('lodash/collection/any');
var any = require('min-dash').any;
var is = require('../../../util/ModelUtil').is;

View File

@ -6,9 +6,9 @@ var OrderingProvider = require('diagram-js/lib/features/ordering/OrderingProvide
var isAny = require('../modeling/util/ModelingUtil').isAny;
var findIndex = require('lodash/array/findIndex');
var findIndex = require('min-dash').findIndex;
var find = require('lodash/collection/find');
var find = require('min-dash').find;
/**

View File

@ -1,6 +1,6 @@
'use strict';
var assign = require('lodash/object/assign');
var assign = require('min-dash').assign;
/**
* A palette provider for BPMN 2.0 elements.

View File

@ -6,9 +6,8 @@ var is = require('../../util/ModelUtil').is,
isExpanded = require('../../util/DiUtil').isExpanded,
isDifferentType = require('./util/TypeUtil').isDifferentType;
var forEach = require('lodash/collection/forEach'),
filter = require('lodash/collection/filter'),
reject = require('lodash/collection/reject');
var forEach = require('min-dash').forEach,
filter = require('min-dash').filter;
var replaceOptions = require ('../replace/ReplaceOptions');
@ -214,8 +213,8 @@ ReplaceMenuProvider.prototype.getEntries = function(element) {
// collapsed SubProcess can not be replaced with itself
if (is(businessObject, 'bpmn:SubProcess') && !isExpanded(businessObject)) {
entries = reject(entries, function(entry) {
return entry.label === 'Sub Process (collapsed)';
entries = filter(entries, function(entry) {
return entry.label !== 'Sub Process (collapsed)';
});
}

View File

@ -4,8 +4,8 @@ var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
var inherits = require('inherits');
var assign = require('lodash/object/assign'),
forEach = require('lodash/collection/forEach');
var assign = require('min-dash').assign,
forEach = require('min-dash').forEach;
var domQuery = require('min-dom').query;

View File

@ -1,10 +1,10 @@
'use strict';
var pick = require('lodash/object/pick'),
assign = require('lodash/object/assign'),
intersection = require('lodash/array/intersection'),
filter = require('lodash/collection/filter'),
has = require('lodash/object/has');
var pick = require('min-dash').pick,
assign = require('min-dash').assign,
uniqueBy = require('min-dash').uniqueBy,
findIndex = require('min-dash').findIndex,
filter = require('min-dash').filter;
var is = require('../../util/ModelUtil').is,
isAny = require('../modeling/util/ModelingUtil').isAny,
@ -29,15 +29,15 @@ var CUSTOM_PROPERTIES = [
function toggeling(element, target) {
var oldCollapsed = (
has(element, 'collapsed') ? element.collapsed : !isExpanded(element)
element && hasOwnProperty(element, 'collapsed') ? element.collapsed : !isExpanded(element)
);
var targetCollapsed;
if (has(target, 'collapsed') || has(target, 'isExpanded')) {
if (target && (hasOwnProperty(target, 'collapsed') || hasOwnProperty(target, 'isExpanded'))) {
// property is explicitly set so use it
targetCollapsed = (
has(target, 'collapsed') ? target.collapsed : !target.isExpanded
hasOwnProperty(target, 'collapsed') ? target.collapsed : !target.isExpanded
);
} else {
// keep old state
@ -98,7 +98,9 @@ function BpmnReplace(bpmnFactory, replace, selection, modeling, eventBus) {
var elementProps = getProperties(oldBusinessObject.$descriptor),
newElementProps = getProperties(newBusinessObject.$descriptor, true),
properties = intersection(elementProps, newElementProps);
properties = uniqueBy(function(e) { return e; }, filter(elementProps, function(value) {
return findIndex(newElementProps, value) !== -1;
}));
// initialize special properties defined in target definition
assign(newBusinessObject, pick(target, CUSTOM_PROPERTIES));
@ -139,7 +141,7 @@ function BpmnReplace(bpmnFactory, replace, selection, modeling, eventBus) {
newElement.isExpanded = isExpanded(oldBusinessObject);
}
// else if property is explicitly set, use it
else if (has(target, 'isExpanded')) {
else if (target && hasOwnProperty(target, 'isExpanded')) {
newElement.isExpanded = target.isExpanded;
}

View File

@ -1,10 +1,10 @@
'use strict';
var find = require('lodash/collection/find'),
any = require('lodash/collection/any'),
every = require('lodash/collection/every'),
filter = require('lodash/collection/filter'),
forEach = require('lodash/collection/forEach'),
var find = require('min-dash').find,
any = require('min-dash').any,
every = require('min-dash').every,
filter = require('min-dash').filter,
forEach = require('min-dash').forEach,
inherits = require('inherits');
var is = require('../../util/ModelUtil').is,

View File

@ -1,8 +1,8 @@
'use strict';
var map = require('lodash/collection/map'),
filter = require('lodash/collection/filter'),
sortBy = require('lodash/collection/sortBy');
var map = require('min-dash').map,
filter = require('min-dash').filter,
sortBy = require('min-dash').sortBy;
var labelUtil = require('../label-editing/LabelUtil');

View File

@ -2,8 +2,8 @@
var inherits = require('inherits');
var forEach = require('lodash/collection/forEach'),
assign = require('lodash/object/assign');
var forEach = require('min-dash').forEach,
assign = require('min-dash').assign;
var getBoundingBox = require('diagram-js/lib/util/Elements').getBBox;

View File

@ -1,7 +1,7 @@
'use strict';
var assign = require('lodash/object/assign'),
map = require('lodash/collection/map');
var assign = require('min-dash').assign,
map = require('min-dash').map;
var LabelUtil = require('../util/LabelUtil');

View File

@ -1,8 +1,8 @@
'use strict';
var filter = require('lodash/collection/filter'),
find = require('lodash/collection/find'),
forEach = require('lodash/collection/forEach');
var filter = require('min-dash').filter,
find = require('min-dash').find,
forEach = require('min-dash').forEach;
var Refs = require('object-refs');

View File

@ -3,7 +3,7 @@
var is = require('./ModelUtil').is,
getBusinessObject = require('./ModelUtil').getBusinessObject;
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
module.exports.isExpanded = function(element) {

View File

@ -1,6 +1,6 @@
'use strict';
var assign = require('lodash/object/assign');
var assign = require('min-dash').assign;
var is = require('./ModelUtil').is;

View File

@ -1,10 +1,10 @@
'use strict';
var forEach = require('lodash/collection/forEach'),
filter = require('lodash/collection/filter'),
any = require('lodash/collection/any'),
sort = require('lodash/collection/sortBy'),
isArray = require('lodash/lang/isArray');
var forEach = require('min-dash').forEach,
filter = require('min-dash').filter,
any = require('min-dash').any,
sortBy = require('min-dash').sortBy,
isArray = require('min-dash').isArray;
var IGNORED_PROPERTIES = require('./ModelCloneUtils').IGNORED_PROPERTIES;
@ -47,7 +47,7 @@ ModelCloneHelper.prototype.clone = function(refElement, newElement, properties)
// we want the extensionElements to be cloned last
// so that they can check certain properties
properties = sort(properties, function(prop) {
properties = sortBy(properties, function(prop) {
return prop === 'bpmn:extensionElements';
});

View File

@ -1,6 +1,6 @@
'use strict';
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
/**
* These are the properties that should be ignored when cloning elements.

View File

@ -81,7 +81,7 @@
"diagram-js-direct-editing": "^0.23.0",
"ids": "^0.2.0",
"inherits": "^2.0.1",
"lodash": "^3.0.1",
"min-dash": "^2.0.0",
"min-dom": "^2.0.1",
"object-refs": "^0.1.1",
"tiny-svg": "^0.1.3"

View File

@ -3,8 +3,8 @@
var fs = require('fs');
var path = require('path');
var unique = require('lodash/array/unique');
var sortBy = require('lodash/collection/sortBy');
var uniqueBy = require('min-dash').uniqueBy;
var sortBy = require('min-dash').sortBy;
function TranslationReporter() {
process.env.TRANSLATIONS = 'enabled';
@ -37,8 +37,8 @@ function TranslationReporter() {
this.onRunComplete = function() {
translations = unique(translations);
translations = sortBy(translations);
translations = uniqueBy(function(e) {return e;}, translations);
translations = sortBy(translations, function(e) {return e;});
fs.writeFileSync(outputFile, JSON.stringify(translations, null, 2));
};

View File

@ -28,16 +28,17 @@
* ```
*/
var unique = require('lodash/array/unique'),
isFunction = require('lodash/lang/isFunction'),
merge = require('lodash/object/merge'),
forEach = require('lodash/collection/forEach');
var uniqueBy = require('min-dash').uniqueBy,
isFunction = require('min-dash').isFunction,
forEach = require('min-dash').forEach;
var TestContainer = require('mocha-test-container-support');
var Modeler = require('../../lib/Modeler'),
Viewer = require('../../lib/Viewer');
var merge = require('../util/merge');
var OPTIONS, BPMN_JS;
var translationModule = require('./TranslationCollector');
@ -96,7 +97,7 @@ function bootstrapBpmnJS(BpmnJS, diagram, options, locals) {
_options.modules = [].concat(_options.modules || [], [ mockModule ]);
}
_options.modules = unique(_options.modules);
_options.modules = uniqueBy(function(e) {return e;}, _options.modules);
if (!_options.modules.length) {
_options.modules = undefined;
@ -105,7 +106,7 @@ function bootstrapBpmnJS(BpmnJS, diagram, options, locals) {
// used to extract translations used during tests
if (window.__env__ && window.__env__.TRANSLATIONS === 'enabled') {
_options.additionalModules = [].concat(_options.additionalModules || [], [ translationModule ]);
_options.additionalModules = unique(_options.additionalModules);
_options.additionalModules = uniqueBy(function(e) {return e;}, _options.additionalModules);
}
// clean up old bpmn-js instance

View File

@ -1,6 +1,6 @@
'use strict';
var assign = require('lodash/object/assign'),
var assign = require('min-dash').assign,
inherits = require('inherits');
var BpmnElementFactory = require('lib/features/modeling/ElementFactory'),

View File

@ -1,6 +1,6 @@
'use strict';
var forEach = require('lodash/collection/forEach'),
var forEach = require('min-dash').forEach,
inherits = require('inherits');
var RuleProvider = require('diagram-js/lib/features/rules/RuleProvider');

View File

@ -1,6 +1,6 @@
'use strict';
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
var BOUNDS_ATTRS = [ 'x', 'y', 'width', 'height' ],
POSITION_ATTRS = [ 'x', 'y' ],

View File

@ -1,6 +1,6 @@
'use strict';
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
var POSITION_ATTRS = [ 'x', 'y' ];

View File

@ -4,8 +4,8 @@ require('../../../TestHelper');
/* global bootstrapModeler, inject */
var pick = require('lodash/object/pick'),
assign = require('lodash/object/assign');
var pick = require('min-dash').pick,
assign = require('min-dash').assign;
var autoResizeModule = require('lib/features/auto-resize'),
modelingModule = require('lib/features/modeling'),

View File

@ -10,10 +10,10 @@ var bpmnCopyPasteModule = require('lib/features/copy-paste'),
modelingModule = require('lib/features/modeling'),
coreModule = require('lib/core');
var map = require('lodash/collection/map'),
filter = require('lodash/collection/filter'),
forEach = require('lodash/collection/forEach'),
uniq = require('lodash/array/uniq');
var map = require('min-dash').map,
filter = require('min-dash').filter,
forEach = require('min-dash').forEach,
uniqueBy = require('min-dash').uniqueBy;
var DescriptorTree = require('./DescriptorTree');
@ -594,7 +594,7 @@ describe('features/copy-paste', function() {
return e.businessObject.processRef.id;
});
expect(uniq(processIds)).to.have.length(4);
expect(uniqueBy(function(e) {return e;}, processIds)).to.have.length(4);
}
));

View File

@ -1,6 +1,6 @@
'use strict';
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
function DescriptorTree(tree) {

View File

@ -4,7 +4,7 @@ require('../../../TestHelper');
/* global bootstrapModeler, inject */
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
var getBBox = require('diagram-js/lib/util/Elements').getBBox;

View File

@ -2,7 +2,7 @@
/* global bootstrapViewer, inject */
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
var labelEditingModule = require('lib/features/label-editing'),
coreModule = require('lib/core'),

View File

@ -2,7 +2,7 @@
/* global bootstrapModeler, inject */
var find = require('lodash/collection/find');
var find = require('min-dash').find;
var modelingModule = require('lib/features/modeling'),

View File

@ -5,7 +5,7 @@ require('../../../../TestHelper');
/* global bootstrapModeler, inject */
var find = require('lodash/collection/find');
var find = require('min-dash').find;
var modelingModule = require('lib/features/modeling'),
coreModule = require('lib/core');

View File

@ -4,7 +4,7 @@ require('../../../../TestHelper');
/* global inject, bootstrapModeler */
var find = require('lodash/collection/find');
var find = require('min-dash').find;
var modelingModule = require('lib/features/modeling');

View File

@ -4,7 +4,7 @@ require('../../../../TestHelper');
/* global inject, bootstrapModeler */
var flatten = require('lodash/array/flatten');
var flatten = require('../../../util/flatten');
var coreModule = require('lib/core'),
moveModule = require('diagram-js/lib/features/move'),

View File

@ -5,7 +5,7 @@ require('../../../../TestHelper');
/* global bootstrapModeler, inject */
var is = require('lib/util/ModelUtil').is,
find = require('lodash/collection/find');
find = require('min-dash').find;
var modelingModule = require('lib/features/modeling'),
moveModule = require('diagram-js/lib/features/move'),

View File

@ -5,7 +5,7 @@ require('../../../../TestHelper');
/* global bootstrapModeler, inject */
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
var modelingModule = require('lib/features/modeling'),
coreModule = require('lib/core');

View File

@ -4,7 +4,7 @@ require('../../../../TestHelper');
/* global bootstrapModeler, inject */
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
var modelingModule = require('lib/features/modeling'),
coreModule = require('lib/core');

View File

@ -11,7 +11,7 @@ var modelingModule = require('lib/features/modeling'),
var resizeTRBL = require('diagram-js/lib/features/resize/ResizeUtil').resizeTRBL;
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
function getBounds(element) {
return pick(element, [ 'x', 'y', 'width', 'height']);

View File

@ -4,7 +4,7 @@ require('../../../../TestHelper');
/* global bootstrapModeler, inject */
var pick = require('lodash/object/pick');
var pick = require('min-dash').pick;
var modelingModule = require('lib/features/modeling'),
coreModule = require('lib/core');

View File

@ -2,7 +2,7 @@
var TestHelper = require('../../../TestHelper');
var map = require('lodash/collection/map');
var map = require('min-dash').map;
// polyfill, because Math.sign is not available in PhantomJS, IE and Safari
// https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
@ -199,7 +199,7 @@ function compareZOrder(a, b) {
}
var forEach = require('lodash/collection/forEach');
var forEach = require('min-dash').forEach;
function expectZOrder() {

View File

@ -12,8 +12,9 @@ var coreModule = require('lib/core'),
customRulesModule = require('../../../util/custom-rules');
var domQuery = require('min-dom').query,
domClasses = require('min-dom').classes,
find = require('lodash/collection/find');
domClasses = require('min-dom').classes;
var find = require('min-dash').find;
var is = require('lib/util/ModelUtil').is,
isExpanded = require('lib/util/DiUtil').isExpanded;

View File

@ -11,7 +11,7 @@ var replacePreviewModule = require('lib/features/replace-preview'),
var canvasEvent = require('../../../util/MockEvents').createCanvasEvent;
var assign = require('lodash/object/assign');
var assign = require('min-dash').assign;
var svgAttr = require('tiny-svg/lib/attr'),
svgClone = require('tiny-svg/lib/clone'),

View File

@ -11,7 +11,7 @@ var domMatches = require('min-dom').matches;
var getChildrenGfx = require('diagram-js/lib/util/GraphicsUtil').getChildren;
var find = require('lodash/collection/find');
var find = require('min-dash').find;
var is = require('lib/util/ModelUtil').is;

View File

@ -1,6 +1,6 @@
'use strict';
var any = require('lodash/collection/any');
var any = require('min-dash').any;
var ALLOWED_TYPES = {
FailedJobRetryTimeCycle: [ 'bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity' ],

View File

@ -0,0 +1,3 @@
module.exports = function(array) {
return [].concat.apply([], array);
};

View File

@ -1,6 +1,6 @@
'use strict';
var assign = require('lodash/object/assign');
var assign = require('min-dash').assign;
var EventBus = require('diagram-js/lib/core/EventBus');

20
test/util/merge.js Normal file
View File

@ -0,0 +1,20 @@
var isObject = require('min-dash').isObject;
var forEach = require('min-dash').forEach;
module.exports = function merge(target) {
var sources = [].slice.call(arguments, 1);
if (!sources.length) return target;
var source = sources.shift();
if (isObject(target) && isObject(source)) {
forEach(source, function(val, key) {
if (isObject(val) && isObject(target[key])) {
merge(target[key], val);
} else {
target[key] = val;
}
});
}
return merge.apply(this, [target].concat(sources));
};