From 69ce7cde7d68c5211649c8d19dc883402fe42b41 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 2 Apr 2016 22:49:17 -0700 Subject: [PATCH] Convert methods not found in `aryMethod` mapping. --- fp/_baseConvert.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index a9236f518..22d841664 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -310,7 +310,7 @@ function baseConvert(util, name, func, options) { } var _ = func; - // Iterate over methods for the current ary cap. + // Convert methods by ary cap. var pairs = []; each(aryMethodKeys, function(aryKey) { each(mapping.aryMethod[aryKey], function(key) { @@ -321,6 +321,19 @@ function baseConvert(util, name, func, options) { }); }); + // Convert remaining methods. + each(keys(_), function(key) { + if (typeof _[key] == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + pairs.push([key, wrap(key, _[key])]); + } + }); + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. each(pairs, function(pair) { _[pair[0]] = pair[1]; @@ -330,7 +343,7 @@ function baseConvert(util, name, func, options) { if (setPlaceholder) { _.placeholder = placeholder; } - // Reassign aliases. + // Assign aliases. each(keys(_), function(key) { each(mapping.realToAlias[key] || [], function(alias) { _[alias] = _[key];