index.js 639 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. var bind = require('function-bind');
  3. var define = require('define-properties');
  4. var ES = require('es-abstract/es7');
  5. var implementation = require('./implementation');
  6. var getPolyfill = require('./polyfill');
  7. var shim = require('./shim');
  8. var bound = bind.call(Function.apply, implementation);
  9. var boundPadEnd = function padEnd(str, maxLength) {
  10. ES.RequireObjectCoercible(str);
  11. var args = [maxLength];
  12. if (arguments.length > 2) {
  13. args.push(arguments[2]);
  14. }
  15. return bound(str, args);
  16. };
  17. define(boundPadEnd, {
  18. getPolyfill: getPolyfill,
  19. implementation: implementation,
  20. shim: shim
  21. });
  22. module.exports = boundPadEnd;