Closed zayass closed 8 years ago
_.map works strange with array of strings Its looks like they cast array to string and then iterate over string
May be it is bug inside underscore However .each looks better for iteration then .map
Looks like problem is here https://github.com/ddopson/underscore-cli/blob/master/lib/underscore.js#L2
Because console.log(_.map.toString()) prints
function(str, callback) {
str = makeString(str);
if (str.length === 0 || typeof callback !== 'function') return str;
return str.replace(/./g, callback);
};
from here https://github.com/epeli/underscore.string/blob/master/map.js
Strange bug. Thanks for the fix!
This looks like a very safe change.
If you've got an interest in maintaining this tool, let me know. I don't really have much attention span for it these days.
Fix for https://github.com/ddopson/underscore-cli/issues/47