melody-compiler
Advanced tools
Comparing version 1.2.0-21.2 to 1.2.0-04d171a.4
{ | ||
"name": "melody-compiler", | ||
"version": "1.2.0-21.2", | ||
"version": "1.2.0-04d171a.4+04d171a", | ||
"description": "", | ||
@@ -13,7 +13,7 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"babel-generator": "6.10.x", | ||
"babel-generator": "^6.10.0", | ||
"babel-template": "^6.8.0", | ||
"babel-types": "^6.8.1", | ||
"lodash": "^4.12.0", | ||
"melody-code-frame": "1.2.0-21.2", | ||
"melody-code-frame": "1.2.0-04d171a.4+04d171a", | ||
"random-seed": "^0.3.0" | ||
@@ -29,6 +29,6 @@ }, | ||
"devDependencies": { | ||
"melody-extension-core": "1.2.0-21.2", | ||
"melody-plugin-idom": "1.2.0-21.2", | ||
"rollup-plugin-babel": "^2.6.1" | ||
} | ||
"melody-extension-core": "1.2.0-04d171a.4+04d171a", | ||
"melody-plugin-idom": "1.2.0-04d171a.4+04d171a" | ||
}, | ||
"gitHead": "04d171a1547d5dd95966e4a4b416db6cec429bd2" | ||
} |
@@ -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, null, 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
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
217787
2
16
5053
1
+ Addedbabel-generator@6.26.1(transitive)
+ Addeddetect-indent@4.0.0(transitive)
+ Addedjsesc@1.3.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedtrim-right@1.0.1(transitive)
- Removedbabel-generator@6.10.2(transitive)
- Removeddetect-indent@3.0.1(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedmelody-code-frame@1.2.0-21.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedrepeating@1.1.3(transitive)
Updatedbabel-generator@^6.10.0