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

derby-parsing

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derby-parsing - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

2

lib/index.js

@@ -330,2 +330,3 @@ var htmlUtil = require('html-util');

setContentAttribute(viewAttributes, remaining);
delete viewAttributes.within;
parseNode.content.push(viewInstance);

@@ -561,2 +562,3 @@ }

setContentAttribute(attributes, element.content);
delete attributes.within;
var item = createAttributesValue(attributes);

@@ -563,0 +565,0 @@ var camelName = dashToCamelCase(name);

2

package.json
{
"name": "derby-parsing",
"version": "0.7.0",
"version": "0.7.1",
"description": "Add HTML template parsing to Derby",

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

@@ -83,2 +83,16 @@ var expect = require('expect.js');

function stripContexts(dependencies) {
if (!dependencies) return dependencies;
for (var i = 0; i < dependencies.length; i++) {
var dependency = dependencies[i];
for (var j = 0; j < dependency.length; j++) {
var segment = dependency[j];
if (segment instanceof contexts.Context) {
dependency[j] = {item: segment.item};
}
}
}
return dependencies;
}
describe('template dependencies', function() {

@@ -129,2 +143,39 @@ describe('text', function() {

describe('each block', function() {
it('gets item alias dependencies', function() {
var template = createTemplate(
'{{each _page.keys as #key}}' +
'{{#key}}' +
'{{/each}}');
expect(stripContexts(template.dependencies(context))).to.eql([
['_page', 'keys'],
['_page', 'keys', {item: 0}],
['_page', 'keys', {item: 1}]
]);
expect(template.get(context)).to.equal('redgreen');
});
it('gets index alias dependencies', function() {
var template = createTemplate(
'{{each _page.keys as #key, #i}}' +
'{{#i}}.' +
'{{/each}}');
expect(stripContexts(template.dependencies(context))).to.eql([
['_page', 'keys'],
['_page', 'keys'],
['_page', 'keys'],
]);
expect(template.get(context)).to.equal('0.1.');
});
it('gets alias dependencies from a literal', function() {
var template = createTemplate(
'{{each [33, 77] as #key, #i}}' +
'{{#i}},{{#key}};' +
'{{/each}}');
expect(stripContexts(template.dependencies(context))).to.eql(undefined);
expect(template.get(context)).to.equal('0,33;1,77;');
});
});
describe('HTML', function() {

@@ -131,0 +182,0 @@ it('gets dependencies', function() {

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