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

View File

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

View File

@ -1,9 +1,9 @@
'use strict'; 'use strict';
var inherits = require('inherits'), var inherits = require('inherits'),
isObject = require('lodash/lang/isObject'), isObject = require('min-dash').isObject,
assign = require('lodash/object/assign'), assign = require('min-dash').assign,
forEach = require('lodash/collection/forEach'); forEach = require('min-dash').forEach;
var BaseRenderer = require('diagram-js/lib/draw/BaseRenderer'), var BaseRenderer = require('diagram-js/lib/draw/BaseRenderer'),
TextUtil = require('diagram-js/lib/util/Text'), 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, asTRBL = require('diagram-js/lib/layout/LayoutUtil').asTRBL,
getOrientation = require('diagram-js/lib/layout/LayoutUtil').getOrientation; getOrientation = require('diagram-js/lib/layout/LayoutUtil').getOrientation;
var find = require('lodash/collection/find'), var find = require('min-dash').find,
reduce = require('lodash/collection/reduce'); reduce = require('min-dash').reduce;
var DEFAULT_HORIZONTAL_DISTANCE = 50; var DEFAULT_HORIZONTAL_DISTANCE = 50;

View File

@ -4,7 +4,7 @@ var is = require('../../util/ModelUtil').is;
var inherits = require('inherits'); 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'); var AutoResizeProvider = require('diagram-js/lib/features/auto-resize/AutoResizeProvider');

View File

@ -1,9 +1,9 @@
'use strict'; 'use strict';
var assign = require('lodash/object/assign'), var assign = require('min-dash').assign,
forEach = require('lodash/collection/forEach'), forEach = require('min-dash').forEach,
isArray = require('lodash/lang/isArray'), isArray = require('min-dash').isArray,
is = require('../../util/ModelUtil').is, is = require('../../util/ModelUtil').is,
isExpanded = require('../../util/DiUtil').isExpanded, isExpanded = require('../../util/DiUtil').isExpanded,
isAny = require('../modeling/util/ModelingUtil').isAny, 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 IGNORED_PROPERTIES = ModelCloneUtils.IGNORED_PROPERTIES;
var filter = require('lodash/collection/filter'), var filter = require('min-dash').filter,
forEach = require('lodash/collection/forEach'); forEach = require('min-dash').forEach;
function setProperties(descriptor, data, properties) { function setProperties(descriptor, data, properties) {
forEach(properties, function(property) { forEach(properties, function(property) {

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var filter = require('lodash/collection/filter'); var filter = require('min-dash').filter;
var isAny = require('../modeling/util/ModelingUtil').isAny; 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 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; var is = require('../../util/ModelUtil').is;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var forEach = require('lodash/collection/forEach'), var forEach = require('min-dash').forEach,
find = require('lodash/collection/find'), find = require('min-dash').find,
inherits = require('inherits'); inherits = require('inherits');
var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor'); 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 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 isEventSubProcess = require('../../../util/DiUtil').isEventSubProcess;
var is = require('../../../util/ModelUtil').is; var is = require('../../../util/ModelUtil').is;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var any = require('lodash/collection/any'); var any = require('min-dash').any;
var is = require('../../../util/ModelUtil').is; 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 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'; 'use strict';
var assign = require('lodash/object/assign'); var assign = require('min-dash').assign;
/** /**
* A palette provider for BPMN 2.0 elements. * 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, isExpanded = require('../../util/DiUtil').isExpanded,
isDifferentType = require('./util/TypeUtil').isDifferentType; isDifferentType = require('./util/TypeUtil').isDifferentType;
var forEach = require('lodash/collection/forEach'), var forEach = require('min-dash').forEach,
filter = require('lodash/collection/filter'), filter = require('min-dash').filter;
reject = require('lodash/collection/reject');
var replaceOptions = require ('../replace/ReplaceOptions'); var replaceOptions = require ('../replace/ReplaceOptions');
@ -214,8 +213,8 @@ ReplaceMenuProvider.prototype.getEntries = function(element) {
// collapsed SubProcess can not be replaced with itself // collapsed SubProcess can not be replaced with itself
if (is(businessObject, 'bpmn:SubProcess') && !isExpanded(businessObject)) { if (is(businessObject, 'bpmn:SubProcess') && !isExpanded(businessObject)) {
entries = reject(entries, function(entry) { entries = filter(entries, function(entry) {
return entry.label === 'Sub Process (collapsed)'; 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 inherits = require('inherits');
var assign = require('lodash/object/assign'), var assign = require('min-dash').assign,
forEach = require('lodash/collection/forEach'); forEach = require('min-dash').forEach;
var domQuery = require('min-dom').query; var domQuery = require('min-dom').query;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
'use strict'; '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. * These are the properties that should be ignored when cloning elements.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,10 +10,10 @@ var bpmnCopyPasteModule = require('lib/features/copy-paste'),
modelingModule = require('lib/features/modeling'), modelingModule = require('lib/features/modeling'),
coreModule = require('lib/core'); coreModule = require('lib/core');
var map = require('lodash/collection/map'), var map = require('min-dash').map,
filter = require('lodash/collection/filter'), filter = require('min-dash').filter,
forEach = require('lodash/collection/forEach'), forEach = require('min-dash').forEach,
uniq = require('lodash/array/uniq'); uniqueBy = require('min-dash').uniqueBy;
var DescriptorTree = require('./DescriptorTree'); var DescriptorTree = require('./DescriptorTree');
@ -594,7 +594,7 @@ describe('features/copy-paste', function() {
return e.businessObject.processRef.id; 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'; 'use strict';
var forEach = require('lodash/collection/forEach'); var forEach = require('min-dash').forEach;
function DescriptorTree(tree) { function DescriptorTree(tree) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@ require('../../../../TestHelper');
/* global bootstrapModeler, inject */ /* global bootstrapModeler, inject */
var pick = require('lodash/object/pick'); var pick = require('min-dash').pick;
var modelingModule = require('lib/features/modeling'), var modelingModule = require('lib/features/modeling'),
coreModule = require('lib/core'); 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 resizeTRBL = require('diagram-js/lib/features/resize/ResizeUtil').resizeTRBL;
var pick = require('lodash/object/pick'); var pick = require('min-dash').pick;
function getBounds(element) { function getBounds(element) {
return pick(element, [ 'x', 'y', 'width', 'height']); return pick(element, [ 'x', 'y', 'width', 'height']);

View File

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

View File

@ -2,7 +2,7 @@
var TestHelper = require('../../../TestHelper'); 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 // 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 // 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() { function expectZOrder() {

View File

@ -12,8 +12,9 @@ var coreModule = require('lib/core'),
customRulesModule = require('../../../util/custom-rules'); customRulesModule = require('../../../util/custom-rules');
var domQuery = require('min-dom').query, var domQuery = require('min-dom').query,
domClasses = require('min-dom').classes, domClasses = require('min-dom').classes;
find = require('lodash/collection/find');
var find = require('min-dash').find;
var is = require('lib/util/ModelUtil').is, var is = require('lib/util/ModelUtil').is,
isExpanded = require('lib/util/DiUtil').isExpanded; 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 canvasEvent = require('../../../util/MockEvents').createCanvasEvent;
var assign = require('lodash/object/assign'); var assign = require('min-dash').assign;
var svgAttr = require('tiny-svg/lib/attr'), var svgAttr = require('tiny-svg/lib/attr'),
svgClone = require('tiny-svg/lib/clone'), 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 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; var is = require('lib/util/ModelUtil').is;

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var any = require('lodash/collection/any'); var any = require('min-dash').any;
var ALLOWED_TYPES = { var ALLOWED_TYPES = {
FailedJobRetryTimeCycle: [ 'bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity' ], 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'; 'use strict';
var assign = require('lodash/object/assign'); var assign = require('min-dash').assign;
var EventBus = require('diagram-js/lib/core/EventBus'); 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));
};