document-write-html
Advanced tools
Comparing version 0.2.0 to 0.2.1
/* jshint quotmark:false*/ | ||
module.exports = function escape(str) { | ||
return str.toString() | ||
return str && str.toString() | ||
.replace(/\\n|\n/g, '\\n') | ||
@@ -5,0 +5,0 @@ .replace(/\\'|'/g, "\\'") |
@@ -23,4 +23,6 @@ var escape = require('./escape.js'); | ||
} | ||
// __MANGLE__ hack ;P | ||
output.push(escape(str).replace(/__MANGLE__/mig, '\'+\'')); | ||
if (str){ | ||
// __MANGLE__ hack ;P | ||
output.push(escape(str).replace(/__MANGLE__/mig, '\'+\'')); | ||
} | ||
if (wrapInTag){ | ||
@@ -30,3 +32,2 @@ output.push('</'+wrapInTag+'>'); | ||
output.push('\');'); | ||
return output.join(''); | ||
@@ -33,0 +34,0 @@ } |
{ | ||
"name": "document-write-html", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Convert a index.html page into document.writes. Why? Because most ad delivery systems do this - so nice to emulate *bad behaviour* for testing.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
28386
566
3