string.prototype.trimright
Version:
ES2019 spec-compliant String.prototype.trimLeft shim.
15 lines (12 loc) • 325 B
JavaScript
var implementation = require('./implementation');
module.exports = function getPolyfill() {
if (!String.prototype.trimRight) {
return implementation;
}
var zeroWidthSpace = '\u200b';
if (zeroWidthSpace.trimRight() !== zeroWidthSpace) {
return implementation;
}
return String.prototype.trimRight;
};
;