New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bem-bl-xjst

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bem-bl-xjst - npm Package Compare versions

Comparing version

to
2.1.1

39

lib/bemhtml/api.js

@@ -167,3 +167,3 @@ var ometajs = require('ometajs'),

ContextReplacer.prototype.isHash = function isHash(node) {
ContextReplacer.prototype.isHash = function isHash(node, kind) {
var val = node.init;

@@ -173,6 +173,10 @@ if (!val)

if (val.type !== 'ObjectExpression' || val.properties.length !== 3)
if (val.type !== 'ObjectExpression')
return false;
var props = val.properties;
if (kind === 'legacy')
if (props.length !== 3)
return false;
return props.every(function(prop) {

@@ -182,7 +186,12 @@ var name = prop.key.name;

if ((name === 'n' || name === 'm') && val.type === 'ObjectExpression')
return true;
if (name === 'd' && val.type === 'FunctionExpression')
return true;
return false;
if (kind === 'legacy') {
if ((name === 'n' || name === 'm') && val.type === 'ObjectExpression')
return true;
if (name === 'd' && val.type === 'FunctionExpression')
return true;
return false;
} else {
return val.type === 'FunctionExpression' ||
val.type === 'Identifier';
}
});

@@ -217,6 +226,12 @@ };

ContextReplacer.prototype.isMap = function isMap(node) {
return this.applyc === null &&
node.type === 'VariableDeclarator' &&
/^__(h|\$m)\d+$/.test(node.id && node.id.name) &&
this.isHash(node);
if (this.applyc !== null || node.type !== 'VariableDeclarator')
return false;
if (/^__(h|\$m)\d+$/.test(node.id && node.id.name))
return this.isHash(node, 'legacy');
if (/^__h\d+_\w$/.test(node.id && node.id.name))
return this.isHash(node, 'new');
return false;
};

@@ -274,3 +289,3 @@

enter: function(node) {
if (node.type === 'Identifier' && /^__(h|\$m)\d+$/.test(node.name)) {
if (node.type === 'Identifier' && /^__(h|\$m)\d+(_\w)?$/.test(node.name)) {
match = true;

@@ -277,0 +292,0 @@ this['break']();

{
"name": "bem-bl-xjst",
"version": "2.0.3",
"version": "2.1.1",
"description": "xjst compiler for bem-bl",
"main": "lib/bemhtml.js",
"dependencies": {
"xjst": "~0.5.24",
"xjst": "~0.10.0",
"ometajs": "~3.3.5",

@@ -9,0 +9,0 @@ "estraverse": "~1.5.0",

Sorry, the diff of this file is not supported yet