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

preact-render-to-string

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preact-render-to-string - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

2

dist/index.js

@@ -161,3 +161,3 @@ (function (global, factory) {

var hooked = opts.attributeHook && opts.attributeHook(name, v, context, opts);
if (hooked) {
if (hooked || hooked === '') {
s += hooked;

@@ -164,0 +164,0 @@ continue;

@@ -173,3 +173,3 @@ (function (global, factory) {

var hooked = opts.attributeHook && opts.attributeHook(name, v, context, opts);
if (hooked) {
if (hooked || hooked === '') {
s += hooked;

@@ -631,2 +631,4 @@ continue;

function attributeHook(name, value, context, opts) {
if (value == null) return '';
var indentChar = typeof opts.pretty === 'string' ? opts.pretty : '\t';

@@ -633,0 +635,0 @@ if (typeof value !== 'string') {

{
"name": "preact-render-to-string",
"amdName": "preactRenderToString",
"version": "3.0.4",
"version": "3.0.5",
"description": "Render JSX to an HTML string, with support for Preact components.",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

@@ -111,3 +111,3 @@ import { objectKeys, encodeEntities, falsey, memoize, indent, isLargeString, styleObjToCss, assign, getNodeProps } from './util';

let hooked = opts.attributeHook && opts.attributeHook(name, v, context, opts);
if (hooked) {
if (hooked || hooked==='') {
s += hooked;

@@ -114,0 +114,0 @@ continue;

@@ -24,2 +24,4 @@ import './polyfills';

function attributeHook(name, value, context, opts) {
if (value==null) return '';
let indentChar = typeof opts.pretty==='string' ? opts.pretty : '\t';

@@ -26,0 +28,0 @@ if (typeof value!=='string') {

@@ -73,2 +73,12 @@ import render from '../src/jsx';

it('should skip null and undefined attributes', () => {
expect(renderJsx(
<a b={null}>bar</a>
)).to.equal(`<a>bar</a>`);
expect(renderJsx(
<a b={undefined}>bar</a>
)).to.equal(`<a>bar</a>`);
});
it('should render attributes containing VNodes', () => {

@@ -75,0 +85,0 @@ expect(renderJsx(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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