RA.padStart, RA.padEnd?
See original GitHub issueJS already has String.prototype.padStart
and String.prototype.padEnd
, it’s only a matter of exposing a functional interface to them.
-
If we used
R.invoker
for that, they’d have signaturetargetLength -> padString -> stringToPad -> paddedString
. I feel like a better signature would bepadString -> targetLength -> stringToPad -> paddedString
. -
How would we name them?
padStart
andpadEnd
?leftPad
andrightPad
?padLeft
andpadRight
?
My preferred choice would probably be
padStart
andpadEnd
, for consistency with JS.
Issue Analytics
- State:
- Created 6 years ago
- Comments:33 (23 by maintainers)
Top Results From Across the Web
String.prototype.padStart() - JavaScript - MDN Web Docs
The padStart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given ...
Read more >padStart.js - Documentation
padStart.js · import padCharsStart from './padCharsStart'; · /** · * Pads string on the left side if it's shorter than length. · *...
Read more >J065: String.padStart(), padEnd() - YouTube
Hi everyone, and welcome to another snore-fest of an edition of Boring JavaScript! Today, I tackle the String.padStart() and String.padEnd() methods.
Read more >padStart and padEnd String Methods in JavaScript
padStart and padEnd are two new methods available on JavaScript strings. As their name implies, they allow for formatting a string by adding ......
Read more >Features Of ES8 - Outsourced Technical Support | ServerAdminz
Two functions are using with string for padding padStart and padEnd.These functions will pad the start or the end of the given string...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Nope, we use methods from String.prototype if present. If not present we provide polyfill.
Ref https://github.com/char0n/ramda-adjunct/blob/8ae9b5fa961217101c70a4d25fcdf6367022d754/src/isFinite.js#L14
I said,
wrapStart
andwrapEnd
sound likeR.concat
, I said nothing aboutwrap
.