Comparing version 0.5.2 to 0.6.0
@@ -29,3 +29,11 @@ "use strict"; | ||
exports.commonSequence = commonSequence; | ||
exports.escapeForJSON = escapeForJSON; | ||
/** | ||
Merge a list of objects, left to right, into one. | ||
@method | ||
@example | ||
w.extend({}, { one: 1, three: 3 }, { one: "one", two: 2 }, { four: 4 }); | ||
// { one: "one", two: 2, three: 3, four: 4 } | ||
*/ | ||
function extend(){ | ||
@@ -178,5 +186,11 @@ var args = arrayify(arguments); | ||
} | ||
/** | ||
Cross-platform home directory retriever | ||
@method | ||
*/ | ||
function getHomeDir() { | ||
return process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE; | ||
} | ||
function fill(fillWith, len){ | ||
@@ -279,1 +293,13 @@ var buffer = new Buffer(len); | ||
} | ||
function escapeForJSON (str) { | ||
return str | ||
.replace(/[\\]/g, '\\\\') | ||
.replace(/[\/]/g, '\\/') | ||
.replace(/[\b]/g, '\\b') | ||
.replace(/[\f]/g, '\\f') | ||
.replace(/[\n]/g, '\\n') | ||
.replace(/[\r]/g, '\\r') | ||
.replace(/[\"]/g, '\\"') | ||
.replace(/[\t]/g, '\\t'); | ||
} |
{ | ||
"name": "wodge", | ||
"version": "0.5.2", | ||
"version": "0.6.0", | ||
"description": "a wodge of functional dough", | ||
@@ -5,0 +5,0 @@ "main": "lib/wodge.js", |
14529
445