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

express-tsx

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-tsx - npm Package Compare versions

Comparing version 2.2.8 to 2.2.9

7

lib/index.js

@@ -16,2 +16,4 @@ "use strict";

this.renderToJSX = React.createElement;
this.renderToStaticMarkup = ReactDOM.renderToStaticMarkup;
this.renderToString = ReactDOM.renderToString;
this.ssr = false;

@@ -27,3 +29,2 @@ this.path = Compile_1.defaultOutDir;

configExtend(this, options);
this.renderToString = this.ssr ? ReactDOM.renderToString : ReactDOM.renderToStaticMarkup;
}

@@ -40,3 +41,3 @@ }

function render(options) {
let { renderToJSX, renderToString, ssrWrap, compile, path, requirejs, ssr } = new Options(options);
let { renderToJSX, renderToString, renderToStaticMarkup, ssrWrap, compile, path, requirejs, ssr } = new Options(options);
if (path) {

@@ -49,3 +50,3 @@ exports.middleware.use(path_2.join('/', path).replace(/\\/g, '/'), Compile_1.compile.middleware);

let Render = exports && exports.default || exports;
let body = renderToString(renderToJSX(Render, data));
let body = (ssr ? renderToString : renderToStaticMarkup)(renderToJSX(Render, data));
if (ssr) {

@@ -52,0 +53,0 @@ let scriptUrl = path_2.join(data.baseUrl, path, compile(file)).replace(/\\/g, '/');

{
"name": "express-tsx",
"version": "2.2.8",
"version": "2.2.9",
"description": "express view tsx render",

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

@@ -14,7 +14,7 @@

configExtend(this,options)
this.renderToString = this.ssr?ReactDOM.renderToString:ReactDOM.renderToStaticMarkup
}
compile?:(file:string)=>any = c.compile
renderToJSX?:(Render,data:Object)=>JSX.Element = React.createElement
renderToString?:(jsx)=>string
renderToStaticMarkup?:(jsx)=>string = ReactDOM.renderToStaticMarkup
renderToString?:(jsx)=>string = ReactDOM.renderToString
ssr?:boolean = false

@@ -40,3 +40,3 @@ path?:string = defaultOutDir

export function render(options?:Options){
let { renderToJSX,renderToString,ssrWrap,compile,path,requirejs,ssr } = new Options(options)
let { renderToJSX,renderToString,renderToStaticMarkup,ssrWrap,compile,path,requirejs,ssr } = new Options(options)
if(path){

@@ -49,3 +49,3 @@ middleware.use(join('/',path).replace(/\\/g,'/'),c.middleware)

let Render = exports && exports.default || exports
let body = renderToString( renderToJSX(Render,data) )
let body = (ssr?renderToString:renderToStaticMarkup)( renderToJSX(Render,data) )
if(ssr){

@@ -52,0 +52,0 @@ let scriptUrl = join(data.baseUrl,path,compile(file)).replace(/\\/g,'/')

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