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