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:
458 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var implementation = require('./implementation');
|
---|
4 |
|
---|
5 | module.exports = function getPolyfill() {
|
---|
6 | if (!String.prototype.trimEnd && !String.prototype.trimRight) {
|
---|
7 | return implementation;
|
---|
8 | }
|
---|
9 | var zeroWidthSpace = '\u200b';
|
---|
10 | var trimmed = zeroWidthSpace.trimEnd ? zeroWidthSpace.trimEnd() : zeroWidthSpace.trimRight();
|
---|
11 | if (trimmed !== zeroWidthSpace) {
|
---|
12 | return implementation;
|
---|
13 | }
|
---|
14 | return String.prototype.trimEnd || String.prototype.trimRight;
|
---|
15 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.