Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

`undefined` bugfix

  • Loading branch information...
commit 94653dd57d69c943265f55930e81fa66c372133a 1 parent b92d92c
Paul Vorbach authored

Showing 3 changed files with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 1 esc.js
  2. +1 1  package.json
  3. +2 0  test.js
4 esc.js
@@ -3,7 +3,9 @@ var append = require('append'),
3 3 path = require('path');
4 4
5 5 module.exports = function(str, opt) {
6   - if (typeof str !== 'string')
  6 + if (typeof str == 'undefined')
  7 + str = '';
  8 + if (typeof str != 'string')
7 9 str = str.toString();
8 10
9 11 // default options
2  package.json
@@ -2,7 +2,7 @@
2 2 "author": "Paul Vorbach <paul@vorb.de> (http://vorb.de/)",
3 3 "name": "esc",
4 4 "description": "escapes HTML",
5   - "version": "0.0.0",
  5 + "version": "0.0.1",
6 6 "repository": {
7 7 "type": "git",
8 8 "url": "git://github.com/pvorb/node-esc.git"
2  test.js
@@ -8,3 +8,5 @@ fs.writeFileSync('test-1.html', esc(html, { 'uri': 'http://example.com' }));
8 8 fs.writeFileSync('test-2.html', esc(html, { 'uri': 'http://example.com/' }));
9 9
10 10 fs.writeFileSync('test-3.html', esc(html, { 'uri': 'http://example.com/dir/doc.html' }));
  11 +
  12 +esc(undefined);

0 comments on commit 94653dd

Please sign in to comment.
Something went wrong with that request. Please try again.