bpmn-moddle
Advanced tools
Comparing version 0.6.0 to 0.7.0
'use strict'; | ||
var assign = require('lodash/object/assign'); | ||
var BpmnModdle = require('./bpmn-moddle'); | ||
@@ -12,4 +14,4 @@ | ||
module.exports = function() { | ||
return new BpmnModdle(packages); | ||
module.exports = function(additionalPackages, options) { | ||
return new BpmnModdle(assign({}, packages, additionalPackages), options); | ||
}; |
{ | ||
"name": "bpmn-moddle", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "A moddle wrapper for BPMN 2.0", | ||
@@ -5,0 +5,0 @@ "scripts": { |
'use strict'; | ||
var fs = require('fs'), | ||
map = require('lodash/collection/map'); | ||
var fs = require('fs'); | ||
var Model = require('moddle'); | ||
var SimpleBpmnModdle = require('../'); | ||
@@ -21,39 +18,7 @@ | ||
function createModelBuilder(base) { | ||
var cache = {}; | ||
if (!base) { | ||
throw new Error('[test-util] must specify a base directory'); | ||
} | ||
function createModel(packageNames) { | ||
var packages = map(packageNames, function(f) { | ||
var pkg = cache[f]; | ||
var file = base + f + '.json'; | ||
if (!pkg) { | ||
try { | ||
pkg = cache[f] = JSON.parse(readFile(base + f + '.json')); | ||
} catch (e) { | ||
throw new Error('[Helper] failed to parse <' + file + '> as JSON: ' + e.message); | ||
} | ||
} | ||
return pkg; | ||
}); | ||
return new Model(packages); | ||
} | ||
return createModel; | ||
} | ||
module.exports.readFile = readFile; | ||
module.exports.ensureDirExists = ensureDirExists; | ||
module.exports.createModelBuilder = createModelBuilder; | ||
module.exports.createModdle = function() { | ||
return new SimpleBpmnModdle(); | ||
module.exports.createModdle = function(additionalPackages, options) { | ||
return new SimpleBpmnModdle(additionalPackages, options); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
897559
83
5637
69462