question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is your feature request related to a problem? Please describe.

This function pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end of the current string.

Describe the solution you’d like

RA.padCharsEnd('-', 3, 'a'); // => 'a--'

The function is of arity=3 and is autocurried.

Additional context

The functions should use String.prototype.padEnd() if available. If not polyfill like this should be provided to compensate.

This PR should serve as a model template of PR for padCharsEnd function.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
char0ncommented, Oct 11, 2019

@sanjeevkpandit of course. Issue is now assigned to you.

0reactions
char0ncommented, Oct 20, 2019

@sanjeevkpandit no problem at all, I completely understand.

@dshubhadeep

Does this function belong to string category ?

Yes, String category only

Should the sig for this function be String -> Number -> String -> String ?

Yes, that’s the correct signature

What should be the type for targetLength and padString ?

Number(targetLength), String(padString)

More details can be undestood from polyfill: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd#Polyfill

Read more comments on GitHub >

github_iconTop Results From Across the Web

padCharsEnd.js - Documentation
* The padding is applied from the end of the current string. *; * @func padCharsEnd; * @memberOf RA ...
Read more >
Index of /assets/themes/leonard/node_modules/lodash/fp
... pad.js · padChars.js · padCharsEnd.js · padCharsStart.js · padEnd.js · padStart.js · parseInt.js · partial.js · partialRight.js · partition.js · path.js ...
Read more >
"P" JS File Downloads - Files Directory
Filename Software Name Developer Name Latest... p.js Calibre Kovid Goyal 4.2.0 pa‑in.js Adobe Acrobat DC Adobe Systems Incorporated (not sp... pack‑no‑proprietary.js Facebook Desktop Messenger Netlabs.BG 1.0.1...
Read more >
Index of /jdih/node_modules/lodash/fp/
Name Last Modified Size __.js 1985‑10‑26 08:15 4k _convertBrowser.js 1985‑10‑26 08:15 4k _falseOptions.js 1985‑10‑26 08:15 4k
Read more >
Index of /resources/responsive-static ... - The Northern Echo
... pad.js · padChars.js · padCharsEnd.js · padCharsStart.js · padEnd.js · padStart.js · parseInt.js · partial.js · partialRight.js · partition.js · path.js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found