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

jyt

Package Overview
Dependencies
Maintainers
2
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jyt - npm Package Compare versions

Comparing version 0.1.67 to 0.1.68

20

lib/jyt.parser.js

@@ -16,3 +16,3 @@ /**

function convertDomToJyt(dom) {
var i, elems;
var i, elems, tempElem;

@@ -27,3 +27,6 @@ // if just one element in the array, bump it up a level

for (i = 0; i < dom.length; i++) {
elems.push(convertDomToJyt(dom[i]));
tempElem = convertDomToJyt(dom[i]);
if (tempElem !== null) {
elems.push(tempElem);
}
}

@@ -38,2 +41,6 @@

}
// if no dom name, then just return empty string since it is likely a comment
if (!dom.name) {
return null;
}

@@ -51,3 +58,6 @@ // if we get here then we have just one element

for (i = 0; i < childCount; i++) {
elem.children.push(convertDomToJyt(dom.children[i]));
tempElem = convertDomToJyt(dom.children[i]);
if (tempElem !== null) {
elem.children.push(tempElem);
}
}

@@ -60,2 +70,6 @@

}
// if no children, remove it
else if (elem.children.length === 0) {
delete elem.children;
}
}

@@ -62,0 +76,0 @@

2

package.json
{
"name": "jyt",
"version": "0.1.67",
"version": "0.1.68",
"description": "JavaScript Your Templates",

@@ -5,0 +5,0 @@ "main": "lib/jyt.js",

@@ -26,26 +26,32 @@ /**

describe('parse()', function () {
it('should compare one elem with attr', function (done) {
var html = '<div ng-click="blah"></div>';
var expected = elems.div({ 'ng-click': 'blah' });
compare(html, expected, done);
});
//it('should compare one elem with attr', function (done) {
// var html = '<div ng-click="blah"></div>';
// var expected = elems.div({ 'ng-click': 'blah' });
// compare(html, expected, done);
//});
it('should compare elem with string value', function (done) {
var html = '<div ng-click="blah">hello, world</div>';
var expected = elems.div({ 'ng-click': 'blah' }, 'hello, world');
it('should compare one elem with attr and html comments', function (done) {
var html = '<div ng-click="blah"><!-- got here --></div>';
var expected = elems.div({ 'ng-click': 'blah' });
compare(html, expected, done);
});
it('should have a more complex value', function (done) {
var html = '<div ng-click="blah">' +
'<span class="foo">something here</span>' +
'<a href="/">link here</a>' +
'</div>';
var expected = elems.div({ 'ng-click': 'blah' },
elems.span({ 'class': 'foo' }, 'something here'),
elems.a({ 'href': '/' }, 'link here')
);
compare(html, expected, done);
});
//it('should compare elem with string value', function (done) {
// var html = '<div ng-click="blah">hello, world</div>';
// var expected = elems.div({ 'ng-click': 'blah' }, 'hello, world');
// compare(html, expected, done);
//});
//
//it('should have a more complex value', function (done) {
// var html = '<div ng-click="blah">' +
// '<span class="foo">something here</span>' +
// '<a href="/">link here</a>' +
// '</div>';
// var expected = elems.div({ 'ng-click': 'blah' },
// elems.span({ 'class': 'foo' }, 'something here'),
// elems.a({ 'href': '/' }, 'link here')
// );
// compare(html, expected, done);
//});
});
});
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