mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
457 B
16 lines
457 B
10 years ago
|
'use strict';
|
||
|
|
||
|
var toPosInt = require('../../number/to-pos-integer')
|
||
|
, validValue = require('../../object/valid-value')
|
||
|
|
||
|
, reduce = Array.prototype.reduce;
|
||
|
|
||
|
module.exports = function (callSite/*, …substitutions*/) {
|
||
|
var args, rawValue = Object(validValue(Object(validValue(callSite)).raw));
|
||
|
if (!toPosInt(rawValue.length)) return '';
|
||
|
args = arguments;
|
||
|
return reduce.call(rawValue, function (a, b, i) {
|
||
|
return a + String(args[i]) + b;
|
||
|
});
|
||
|
};
|