MCPcopy Create free account
hub / github.com/cujojs/poly / checkShims

Function checkShims

string.js:54–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 trimLeftRx = /^\s+/;
53
54 function checkShims () {
55 if (!has('string-trim')) {
56 proto.trim = function trim () {
57 return remove(remove(toString(this), trimLeftRx), trimRightRx);
58 };
59 }
60
61 if (!has('string-trimleft')) {
62 proto.trimLeft = function trimLeft () {
63 return remove(toString(this), trimLeftRx);
64 };
65 }
66
67 if (!has('string-trimright')) {
68 proto.trimRight = function trimRight () {
69 return remove(toString(this), trimRightRx);
70 };
71 }
72
73 }
74
75 checkShims();
76

Callers 1

string.jsFile · 0.85

Calls 2

removeFunction · 0.85
hasFunction · 0.70

Tested by

no test coverage detected