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

mithril-node-render

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mithril-node-render - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

14

index.js

@@ -35,3 +35,5 @@ 'use strict';

function createAttrString(attrs, escapeAttributeValue) {
function createAttrString(view, escapeAttributeValue) {
var attrs = view.attrs;
if (!attrs || !Object.keys(attrs).length) {

@@ -61,2 +63,8 @@ return '';

}
// Handle SVG <use> tags specially
if (name === 'href' && view.tag === 'use') {
return ' xlink:href="' + escapeAttributeValue(value, true) + '"';
}
return ' ' + (name === 'className' ? 'class' : name) + '="' + escapeAttributeValue(value, true) + '"';

@@ -119,6 +127,6 @@ }).join('');

if (!children && VOID_TAGS.indexOf(view.tag.toLowerCase()) >= 0) {
return '<' + view.tag + createAttrString(view.attrs, options.escapeAttributeValue) + '>';
return '<' + view.tag + createAttrString(view, options.escapeAttributeValue) + '>';
}
return [
'<', view.tag, createAttrString(view.attrs, options.escapeAttributeValue), '>',
'<', view.tag, createAttrString(view, options.escapeAttributeValue), '>',
children,

@@ -125,0 +133,0 @@ '</', view.tag, '>',

{
"name": "mithril-node-render",
"version": "0.4.2",
"version": "0.5.0",
"description": "Node rending of mithril views",

@@ -26,5 +26,5 @@ "main": "index.js",

"devDependencies": {
"mithril": "0.2.2-rc.1",
"tape": "4.4.0"
"mithril": "0.2.4",
"tape": "4.5.1"
}
}

@@ -63,2 +63,3 @@ 'use strict';

t.equal(render(m('pre', 'var = ' + JSON.stringify({foo: 1}))), '<pre>var = {"foo":1}</pre>');
t.equal(render(m('svg', m('use', { href : "fooga.com" }))), '<svg><use xlink:href="fooga.com"></use></svg>');
t.end();

@@ -65,0 +66,0 @@ });

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