mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-04 21:59:29 +08:00
15 lines
458 B
Text
15 lines
458 B
Text
'use strict';
|
|
|
|
var implementation = require('./implementation');
|
|
|
|
module.exports = function getPolyfill() {
|
|
if (!String.prototype.trimEnd && !String.prototype.trimRight) {
|
|
return implementation;
|
|
}
|
|
var zeroWidthSpace = '\u200b';
|
|
var trimmed = zeroWidthSpace.trimEnd ? zeroWidthSpace.trimEnd() : zeroWidthSpace.trimRight();
|
|
if (trimmed !== zeroWidthSpace) {
|
|
return implementation;
|
|
}
|
|
return String.prototype.trimEnd || String.prototype.trimRight;
|
|
};
|