Skip to content

Commit 9d080ef

Browse files
committed
cleanup
1 parent f7acf9c commit 9d080ef

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

src/index.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ function getNodeProps(vnode) {
9393
// we have to patch in Array support, Possible issue in npm.im/pretty-format
9494
let preactPlugin = {
9595
test(object) {
96-
// return object && Object.prototype.toString.call(object)==='[object VNode]';
9796
return object && typeof object==='object' && 'nodeName' in object && 'attributes' in object && 'children' in object && !('nodeType' in object);
9897
},
9998
print(val, print, indent) {
@@ -128,14 +127,6 @@ renderToString.render = renderToString;
128127
let shallowRender = (vnode, context) => renderToString(vnode, context, SHALLOW);
129128

130129

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-
139130
/** The default export is an alias of `render()`. */
140131
export default function renderToString(vnode, context, opts, inner) {
141132
let { nodeName, attributes, children } = vnode || EMPTY;
@@ -240,22 +231,9 @@ export default function renderToString(vnode, context, opts, inner) {
240231
let sub = s.replace(/^\n\s*/, ' ');
241232
if (sub!==s && !~sub.indexOf('\n')) s = sub;
242233
else if (~s.indexOf('\n')) s += '\n';
243-
// s += '>';
244234

245235
s = `<${nodeName}${s}>`;
246236

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-
259237
if (html) {
260238
// if multiline, indent.
261239
if (pretty && isLargeString(html)) {

test/jsx.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import { spy, match } from 'sinon';
55
import sinonChai from 'sinon-chai';
66
chai.use(sinonChai);
77

8-
// remove leading whitespace from tagged template literal
9-
// let dedent = ([str]) => str.replace(/^\n+/g,'').split( '\n'+str.match(/^\n+?(\s+)/)[1] ).join('\n');
8+
// tag to remove leading whitespace from tagged template literal
109
function dedent([str]) {
11-
// str = str.replace(/^\n+/g,'\n');
1210
return str.split( '\n'+str.match(/^\n*(\s+)/)[1] ).join('\n').replace(/(^\n+|\n+\s*$)/g, '');
1311
}
1412

0 commit comments

Comments
 (0)