static-module
Advanced tools
Comparing version 1.4.0 to 1.5.0
17
index.js
@@ -300,2 +300,19 @@ var fs = require('fs'); | ||
} | ||
else if (node.parent.type === 'UnaryExpression') { | ||
var xvars = copy(vars); | ||
xvars[node.name] = val; | ||
var res = evaluate(node.parent, xvars); | ||
if (res !== undefined) { | ||
updates.push({ | ||
start: node.parent.start, | ||
offset: node.parent.end - node.parent.start, | ||
stream: isStream(res) ? wrapStream(res) : st(String(res)) | ||
}); | ||
} else { | ||
output.emit('error', new Error( | ||
'unsupported unary operator: ' + node.parent.operator | ||
)); | ||
} | ||
} | ||
else { | ||
@@ -302,0 +319,0 @@ output.emit('error', new Error( |
{ | ||
"name": "static-module", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "convert module usage to inline expressions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
52034
81
1349
47
32