UNPKG

string.prototype.trimleft

Version:

ES2019 spec-compliant String.prototype.trimLeft shim.

15 lines (12 loc) 322 B
'use strict'; var implementation = require('./implementation'); module.exports = function getPolyfill() { if (!String.prototype.trimLeft) { return implementation; } var zeroWidthSpace = '\u200b'; if (zeroWidthSpace.trimLeft() !== zeroWidthSpace) { return implementation; } return String.prototype.trimLeft; };