@@ -93,7 +93,6 @@ function getNodeProps(vnode) {
93
93
// we have to patch in Array support, Possible issue in npm.im/pretty-format
94
94
let preactPlugin = {
95
95
test ( object ) {
96
- // return object && Object.prototype.toString.call(object)==='[object VNode]';
97
96
return object && typeof object === 'object' && 'nodeName' in object && 'attributes' in object && 'children' in object && ! ( 'nodeType' in object ) ;
98
97
} ,
99
98
print ( val , print , indent ) {
@@ -128,14 +127,6 @@ renderToString.render = renderToString;
128
127
let shallowRender = ( vnode , context ) => renderToString ( vnode , context , SHALLOW ) ;
129
128
130
129
131
- /** You can actually skip preact entirely and import this empty Component base class (or not use a base class at all).
132
- * preact-render-to-string doesn't use any of Preact's functionality to do its job.
133
- * @name Component
134
- * @class
135
- */
136
- // renderToString.Component = function Component(){};
137
-
138
-
139
130
/** The default export is an alias of `render()`. */
140
131
export default function renderToString ( vnode , context , opts , inner ) {
141
132
let { nodeName, attributes, children } = vnode || EMPTY ;
@@ -240,22 +231,9 @@ export default function renderToString(vnode, context, opts, inner) {
240
231
let sub = s . replace ( / ^ \n \s * / , ' ' ) ;
241
232
if ( sub !== s && ! ~ sub . indexOf ( '\n' ) ) s = sub ;
242
233
else if ( ~ s . indexOf ( '\n' ) ) s += '\n' ;
243
- // s += '>';
244
234
245
235
s = `<${ nodeName } ${ s } >` ;
246
236
247
- // if (opts && opts.jsx) {
248
- // if (isLargeString(s, 80, true) || s.split('\n').length>3) {
249
- // s = `<${nodeName}${s}\n>`;
250
- // }
251
- // else {
252
- // s = `<${nodeName}${s}\n>`;
253
- // }
254
- // }
255
- // else {
256
- // s = `<${nodeName}${s}>`;
257
- // }
258
-
259
237
if ( html ) {
260
238
// if multiline, indent.
261
239
if ( pretty && isLargeString ( html ) ) {
0 commit comments