melody-compiler
Advanced tools
Comparing version 1.1.1-51765e5.51 to 1.1.1-acd74e5.57
{ | ||
"name": "melody-compiler", | ||
"version": "1.1.1-51765e5.51+51765e5", | ||
"version": "1.1.1-acd74e5.57+acd74e5", | ||
"description": "", | ||
@@ -17,3 +17,3 @@ "main": "./lib/index.js", | ||
"lodash": "^4.12.0", | ||
"melody-code-frame": "1.1.1-51765e5.51+51765e5", | ||
"melody-code-frame": "1.1.1-acd74e5.57+acd74e5", | ||
"random-seed": "^0.3.0" | ||
@@ -29,6 +29,6 @@ }, | ||
"devDependencies": { | ||
"melody-extension-core": "1.1.1-51765e5.51+51765e5", | ||
"melody-plugin-idom": "1.1.1-51765e5.51+51765e5" | ||
"melody-extension-core": "1.1.1-acd74e5.57+acd74e5", | ||
"melody-plugin-idom": "1.1.1-acd74e5.57+acd74e5" | ||
}, | ||
"gitHead": "51765e5cfb50b051cf15014e6862d90597bfe258" | ||
"gitHead": "acd74e52bb4bbcc0fcca972d10983b2db1759b94" | ||
} |
@@ -26,3 +26,3 @@ /** | ||
import * as t from 'babel-types'; | ||
import generate from 'babel-generator'; | ||
import { CodeGenerator } from 'babel-generator'; | ||
@@ -126,3 +126,15 @@ // workaround for https://github.com/rollup/rollup/issues/430 | ||
export function toString(jsAst, code) { | ||
return generate(jsAst, {}, code); | ||
const g = new CodeGenerator(jsAst, {}, code); | ||
// Babel sanitises strings to not contain complex characters | ||
// however we need them in order to be able to render complex strings | ||
g._generator.StringLiteral = function (node, parent) { | ||
var raw = this.getPossibleRaw(node); | ||
if (!this.format.minified && raw != null) { | ||
this.token(raw); | ||
return; | ||
} | ||
return this.token(JSON.stringify(node.value)); | ||
}; | ||
return g.generate(); | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
178161
3618
3