Skip to content

Commit

Permalink
When converting a library, pass all properties through, but only conv…
Browse files Browse the repository at this point in the history
…ert the speficied ones.
  • Loading branch information
creationix committed Feb 21, 2010
1 parent 650cbd4 commit b9d9a86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/do.js
Expand Up @@ -143,7 +143,10 @@ exports.cont = function (fn) {
// the specified names to continuable style and returns the new library.
exports.convert = function (lib, names) {
var newlib = {};
names.forEach(function (key) {
Object.keys(lib).forEach(function (key) {
if (names.indexOf(key) < 0) {
return newlib[key] = lib[key];
}
newlib[key] = function () {
var args = Array.prototype.slice.call(arguments);
return function (callback, errback) {
Expand Down

0 comments on commit b9d9a86

Please sign in to comment.