| | |
| | | var uncurryThis = require('../internals/function-uncurry-this'); |
| | | var requireObjectCoercible = require('../internals/require-object-coercible'); |
| | | var toString = require('../internals/to-string'); |
| | | var whitespaces = require('../internals/whitespaces'); |
| | | |
| | | var replace = uncurryThis(''.replace); |
| | | var whitespace = '[' + whitespaces + ']'; |
| | | var ltrim = RegExp('^' + whitespace + whitespace + '*'); |
| | | var rtrim = RegExp(whitespace + whitespace + '*$'); |
| | |
| | | var createMethod = function (TYPE) { |
| | | return function ($this) { |
| | | var string = toString(requireObjectCoercible($this)); |
| | | if (TYPE & 1) string = string.replace(ltrim, ''); |
| | | if (TYPE & 2) string = string.replace(rtrim, ''); |
| | | if (TYPE & 1) string = replace(string, ltrim, ''); |
| | | if (TYPE & 2) string = replace(string, rtrim, ''); |
| | | return string; |
| | | }; |
| | | }; |