shim.js 473 B

1234567891011121314
  1. "use strict";
  2. var toPosInt = require("../../number/to-pos-integer")
  3. , validValue = require("../../object/valid-value")
  4. , reduce = Array.prototype.reduce;
  5. module.exports = function (callSite /*, …substitutions*/) {
  6. var args, rawValue = Object(validValue(Object(validValue(callSite)).raw));
  7. if (!toPosInt(rawValue.length)) return "";
  8. args = arguments;
  9. return reduce.call(rawValue, function (str1, str2, i) {
  10. return str1 + String(args[i]) + str2;
  11. });
  12. };