10 lines
231 B
JavaScript
10 lines
231 B
JavaScript
|
var makeString = require('./helper/makeString');
|
||
|
|
||
|
module.exports = function(str, callback) {
|
||
|
str = makeString(str);
|
||
|
|
||
|
if (str.length === 0 || typeof callback !== 'function') return str;
|
||
|
|
||
|
return str.replace(/./g, callback);
|
||
|
};
|