Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "wodge", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "a wodge of functional dough", | ||
@@ -5,0 +5,0 @@ "main": "wodge.js", |
19
wodge.js
@@ -12,2 +12,10 @@ "use strict"; | ||
exports.clone = function(obj){ | ||
var output = {}; | ||
for (var prop in obj){ | ||
output[prop] = obj[prop]; | ||
} | ||
return output; | ||
}; | ||
exports.escapeRegExp = function(string){ | ||
@@ -118,1 +126,12 @@ return string | ||
}; | ||
exports.exists = function(arr, value){ | ||
return arr.indexOf(value) > -1; | ||
} | ||
exports.without = function(arr, toRemove){ | ||
toRemove = exports.arrayify(toRemove); | ||
return arr.filter(function(item){ | ||
return !exports.exists(toRemove, item); | ||
}); | ||
}; |
3905
113