mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-14 19:25:06 +08:00
chore(project): es6ify source code
* use ES6 import / export * UTILS: export individual utilities * TESTS: localize TestHelper includes BREAKING CHANGE: * all utilities export independent functions * library sources got ported to ES6. You must now use a ES module bundler such as Browserify + babelify or Webpack to consume this library (or parts of it).
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var some = require('min-dash').some;
|
||||
import {
|
||||
some
|
||||
} from 'min-dash';
|
||||
|
||||
var is = require('../../../util/ModelUtil').is;
|
||||
import { is } from '../../../util/ModelUtil';
|
||||
|
||||
|
||||
/**
|
||||
@ -13,14 +15,12 @@ var is = require('../../../util/ModelUtil').is;
|
||||
*
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function isAny(element, types) {
|
||||
export function isAny(element, types) {
|
||||
return some(types, function(t) {
|
||||
return is(element, t);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.isAny = isAny;
|
||||
|
||||
|
||||
/**
|
||||
* Return the parent of the element with any of the given types.
|
||||
@ -30,7 +30,7 @@ module.exports.isAny = isAny;
|
||||
*
|
||||
* @return {djs.model.Base}
|
||||
*/
|
||||
function getParent(element, anyType) {
|
||||
export function getParent(element, anyType) {
|
||||
|
||||
if (typeof anyType === 'string') {
|
||||
anyType = [ anyType ];
|
||||
@ -43,6 +43,4 @@ function getParent(element, anyType) {
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
module.exports.getParent = getParent;
|
||||
}
|
Reference in New Issue
Block a user