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:
Nico Rehwaldt
2018-04-02 21:01:53 +02:00
parent 56a644177d
commit d3449ca87c
224 changed files with 2635 additions and 1932 deletions

View File

@ -8,14 +8,12 @@
*
* @return {Boolean}
*/
function is(element, type) {
export function is(element, type) {
var bo = getBusinessObject(element);
return bo && (typeof bo.$instanceOf === 'function') && bo.$instanceOf(type);
}
module.exports.is = is;
/**
* Return the business object for a given element.
@ -24,8 +22,6 @@ module.exports.is = is;
*
* @return {ModdleElement}
*/
function getBusinessObject(element) {
export function getBusinessObject(element) {
return (element && element.businessObject) || element;
}
module.exports.getBusinessObject = getBusinessObject;
}