aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utility.js b/src/utility.js
index 391efb14..5020c911 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -8,7 +8,12 @@ function safeQuote(x) {
function dump(item) {
var CHUNK = 500;
function lineify(text) {
- return text.replace(/.{80}/g, '$&\n');
+ var ret = '';
+ while (text.length > 80) {
+ ret += '// ' + text.substr(0,80) + '\n';
+ text = text.substr(80);
+ }
+ return ret + '// ' + text;
}
try {
return lineify(JSON.stringify(item));