cmacc-compiler
Advanced tools
Comparing version 1.0.11 to 1.0.12
{ | ||
"name": "cmacc-compiler", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Cmacc Compiler", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -54,5 +54,5 @@ var fs = require('fs'); | ||
if (val) { | ||
res += 'parse(' + JSON.stringify(resolve) + ', string(' + val + ', $$obj$$));'; | ||
res += 'parse(' + JSON.stringify(resolve) + ', string(' + val + ', $$obj$$), ' + JSON.stringify(options) + ');'; | ||
} else { | ||
res += 'parse(' + JSON.stringify(resolve) + ');'; | ||
res += 'parse(' + JSON.stringify(resolve) + ', null, ' + JSON.stringify(options) + ');'; | ||
} | ||
@@ -59,0 +59,0 @@ |
@@ -57,4 +57,3 @@ var fs = require('fs'); | ||
var findRoot = require('find-root'); | ||
var packageRoot = options.path ? findRoot(options.path) : findRoot(process.cwd()); | ||
var packageRoot = options.path ? findRoot(options.path.replace('file://', '')) : findRoot(process.cwd()); | ||
var nodeModules = path.join(packageRoot, 'node_modules') | ||
@@ -64,5 +63,3 @@ var location = path.join(nodeModules, decodeURI(urlObj.host), decodeURI(urlObj.pathname)); | ||
} | ||
} | ||
} | ||
@@ -69,0 +66,0 @@ |
@@ -60,3 +60,3 @@ var assert = require('assert'); | ||
var file = 'ImportFile.cmacc'; | ||
var shouldBe = 'var $$obj$$ = {};var obj = parse(\"file:///User/name/test.cmacc\");;\n\n$$obj$$.obj = obj ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/ImportFile.cmacc\";module.exports = $$obj$$;'; | ||
var shouldBe = 'var $$obj$$ = {};var obj = parse("file:///User/name/test.cmacc", null, undefined);;\n\n$$obj$$.obj = obj ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/ImportFile.cmacc\";module.exports = $$obj$$;'; | ||
importAndConvert(done, file, shouldBe); | ||
@@ -67,3 +67,3 @@ }); | ||
var file = 'ImportHttp.cmacc'; | ||
var shouldBe = 'var $$obj$$ = {};var obj = parse(\"http://test.nl/test.cmacc\");;\n\n$$obj$$.obj = obj ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/ImportHttp.cmacc\";module.exports = $$obj$$;'; | ||
var shouldBe = 'var $$obj$$ = {};var obj = parse(\"http://test.nl/test.cmacc\", null, undefined);;\n\n$$obj$$.obj = obj ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/ImportHttp.cmacc\";module.exports = $$obj$$;'; | ||
importAndConvert(done, file, shouldBe); | ||
@@ -74,3 +74,3 @@ }); | ||
var file = 'ImportRel.cmacc'; | ||
var shouldBe = 'var $$obj$$ = {};var obj = parse(\"file://' + __dirname + '/convert/Test.md\");;\n\n$$obj$$.obj = obj ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/ImportRel.cmacc\";module.exports = $$obj$$;'; | ||
var shouldBe = 'var $$obj$$ = {};var obj = parse(\"file://' + __dirname + '/convert/Test.md\", null, undefined);;\n\n$$obj$$.obj = obj ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/ImportRel.cmacc\";module.exports = $$obj$$;'; | ||
importAndConvert(done, file, shouldBe); | ||
@@ -97,3 +97,3 @@ | ||
console.log(result) | ||
var expect = 'var $$obj$$ = {};var obj2 = parse(\"file://' + __dirname + '/convert/VariableObject.cmacc\");;\n\nobj2.hello1 = string(\"Test\", $$obj$$);;\n\n$$obj$$.obj2 = obj2 ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/SetVar.cmacc\";module.exports = $$obj$$;' | ||
var expect = 'var $$obj$$ = {};var obj2 = parse("file:///Users/wveelenturf/projects/cmacc/cmacc-compiler/test/convert/VariableObject.cmacc", null, undefined);;\n\nobj2.hello1 = string(\"Test\", $$obj$$);;\n\n$$obj$$.obj2 = obj2 ; $$obj$$.$$file$$ = \"file://' + __dirname + '/convert/SetVar.cmacc\";module.exports = $$obj$$;' | ||
assert.equal(result, expect); | ||
@@ -100,0 +100,0 @@ done() |
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
102451
1954