Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

melody-compiler

Package Overview
Dependencies
Maintainers
3
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

melody-compiler - npm Package Compare versions

Comparing version 1.2.0-commit.e725f50a to 1.2.0-e395b88.5

LICENSE

20

package.json
{
"name": "melody-compiler",
"version": "1.2.0-commit.e725f50a",
"version": "1.2.0-e395b88.5+e395b88",
"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-commit.e725f50a",
"melody-code-frame": "1.2.0-e395b88.5+e395b88",
"random-seed": "^0.3.0"

@@ -28,13 +28,7 @@ },

},
"bundledDependencies": [
"babel-types",
"babel-generator",
"babel-template",
"random-seed"
],
"devDependencies": {
"melody-extension-core": "1.2.0-commit.e725f50a",
"melody-plugin-idom": "1.2.0-commit.e725f50a",
"rollup-plugin-babel": "^2.6.1"
}
"melody-extension-core": "1.2.0-e395b88.5+e395b88",
"melody-plugin-idom": "1.2.0-e395b88.5+e395b88"
},
"gitHead": "e395b8869e8b75fec7b9211e99bdaaf7963a11c7"
}

@@ -249,2 +249,19 @@ /**

exit(path) {
const sourceType = path.node.source.type;
if (sourceType !== 'StringLiteral') {
this.error(
'Dynamic includes are not supported',
path.node.loc.start,
`The Include Statement expected a StringLiteral but got a ${sourceType}.
Includes only support static strings as argument.
To include a template asynchronously you can use the "mount async" statement:
{% mount async './#{ partial }.twig' as 'bar-#{ partial }' with _context %}
{{ err }}
{% catch err %}
Failed to load with {{ err }}
{% endmounts %}`
);
}
const includeName = this.addDefaultImportFrom(

@@ -251,0 +268,0 @@ path.node.source.value,

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc