source: node_modules/ramda-adjunct/lib/padCharsEnd.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.7 KB
Line 
1"use strict";
2
3exports.__esModule = true;
4exports.padEndPonyfill = exports.padEndInvoker = exports["default"] = void 0;
5var _ramda = require("ramda");
6var _String = _interopRequireDefault(require("./internal/ponyfills/String.padEnd"));
7var _isFunction = _interopRequireDefault(require("./isFunction"));
8function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9var padEndPonyfill = (0, _ramda.curry)(_String["default"]);
10exports.padEndPonyfill = padEndPonyfill;
11var padEndInvoker = (0, _ramda.flip)((0, _ramda.invoker)(2, 'padEnd'));
12
13/**
14 * The function pads the current string with a given string
15 * (repeated, if needed) so that the resulting string reaches a given length.
16 * The padding is applied from the end of the current string.
17 *
18 * @func padCharsEnd
19 * @memberOf RA
20 * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
21 * @category String
22 * @sig String -> Number -> String -> String
23 * @param {string} padString The string to pad the current string with
24 * @param {number} targetLength The length of the resulting string once
25 * the current string has been padded
26 * @param {string} value String value to be padded
27 * @return {string} A new string of the specified length with the pad string
28 * applied at the end of the current string
29 * @see {@link RA.padEnd|padEnd}, {@link RA.padCharsStart|padCharsStart}, {@link RA.padStart|padStart}
30 * @example
31 *
32 * RA.padCharsEnd('-', 3, 'a'); // => 'a--'
33 * RA.padCharsEnd('foo', 10, 'abc'); // => 'abcfoofoof'
34 * RA.padCharsEnd('123456', 6, 'abc'); // => 'abc123'
35 */
36exports.padEndInvoker = padEndInvoker;
37var padCharsEnd = (0, _isFunction["default"])(String.prototype.padEnd) ? padEndInvoker : padEndPonyfill;
38var _default = padCharsEnd;
39exports["default"] = _default;
Note: See TracBrowser for help on using the repository browser.