source: imaps-frontend/node_modules/string.prototype.trim/implementation.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: 1.2 KB
Line 
1'use strict';
2
3var RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
4var ToString = require('es-abstract/2024/ToString');
5var callBound = require('call-bind/callBound');
6var $replace = callBound('String.prototype.replace');
7
8var mvsIsWS = (/^\s$/).test('\u180E');
9/* eslint-disable no-control-regex */
10var leftWhitespace = mvsIsWS
11 ? /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/
12 : /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/;
13var rightWhitespace = mvsIsWS
14 ? /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/
15 : /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;
16/* eslint-enable no-control-regex */
17
18module.exports = function trim() {
19 var S = ToString(RequireObjectCoercible(this));
20 return $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');
21};
Note: See TracBrowser for help on using the repository browser.