Commit 31118f49 authored by Nicolas Biri's avatar Nicolas Biri
Browse files

Dependencies update

parent a46219e6
......@@ -113,7 +113,9 @@ transformation.addRule(Member2Male);
transformation.addRule(Member2FeMale);
//Apply all rules in the models and resolve references, actual transformation execution
// Apply all rules in the models and resolve references, actual transformation execution
transformation.apply(Mi.ma, Mo);
// Useless, used in test to see if debug mode is ok
transformation.apply(Mi.ma, undefined, true)
module.exports.result = Mo;
......@@ -55,7 +55,7 @@ Transformation.prototype.addHelper = function(h) {
if (_.every(['map', 'name'], x => _.has(h, x))) {
this.helpers.push(h)
} else {
throw new Error(`Invalid helper: ${h}`)
throw new TypeError(`Invalid helper: ${h}`)
}
}
......@@ -90,16 +90,14 @@ function Rule(selection, out, name) {
}
function runRule(rule, context, inputModel, outputModel, debug) {
var selection = rule.in.call(context, inputModel)
const selection = rule.in.call(context, inputModel)
_.forEach(selection, function(e) {
var generated = rule.out.call(context, e, inputModel)
const generated = rule.out.call(context, e, inputModel)
const value = (context.generated.get(e) || [])
context.generated.set(e, value.concat(generated))
if (debug) {
_.forEach(generated, function(x) {
const logValue = context.generationLog.get(e) || []
logValue.push({rule, source: e})
context.generationLog.map(x, logValue)
context.generationLog.set(x, {rule, source: e})
})
}
_.forEach(generated, x => outputModel.addModellingElement(x))
......@@ -116,7 +114,7 @@ function Helper(generation, name) {
}
function runHelper(helper, context, inputModel, outputModel) {
var generated = helper.map.call(context, inputModel)
const generated = helper.map.call(context, inputModel)
context.helpers[helper.name] = generated
}
......
{
"name": "jsmf-jstl",
"version": "0.7.0",
"version": "0.8.0",
"description": "Model transformation for JSTL",
"main": "index.js",
"directories": {
......@@ -23,13 +23,12 @@
"author": "Jean-Sebastien Sottet <jean-sebastien.sottet@list.lu> (http://www.list.lu/)",
"license": "MIT",
"dependencies": {
"lodash": "~4.1.0",
"object-hash": "~0.9.2",
"jsmf-core": "git+ssh://git@git.list.lu:jsmf/jsmf-core.git#0.5.0"
"lodash": "^4.1.0",
"jsmf-core": "git+ssh://git@git.list.lu:jsmf/jsmf-core.git#0.6.0"
},
"devDependencies": {
"should": "~7.1.1",
"eyes": "~0.1.8",
"jsmf-magellan": "git+ssh://git@git.list.lu:jsmf/jsmf-magellan.git#0.3.0"
"should": "^7.1.1",
"eyes": "^0.1.8",
"jsmf-magellan": "git+ssh://git@git.list.lu:jsmf/jsmf-magellan.git#0.4.0"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment