source: imaps-frontend/node_modules/string.prototype.trimstart/polyfill.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 463 bytes
Line 
1'use strict';
2
3var implementation = require('./implementation');
4
5module.exports = function getPolyfill() {
6 if (!String.prototype.trimStart && !String.prototype.trimLeft) {
7 return implementation;
8 }
9 var zeroWidthSpace = '\u200b';
10 var trimmed = zeroWidthSpace.trimStart ? zeroWidthSpace.trimStart() : zeroWidthSpace.trimLeft();
11 if (trimmed !== zeroWidthSpace) {
12 return implementation;
13 }
14 return String.prototype.trimStart || String.prototype.trimLeft;
15};
Note: See TracBrowser for help on using the repository browser.