We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 235cfd4 commit d6e8514Copy full SHA for d6e8514
index.js
@@ -5,12 +5,6 @@
5
* Released under the MIT License.
6
*/
7
8
-function trimTabAndSpaces(str) {
9
- const lines = str.split('\n');
10
- const trimmedLines = lines.map((line) => line.trimEnd());
11
- return trimmedLines.join('\n');
12
-}
13
-
14
module.exports = function(str, options) {
15
options = options || {};
16
if (str == null) {
@@ -42,7 +36,7 @@ module.exports = function(str, options) {
42
36
}).join(newline);
43
37
44
38
if (options.trim === true) {
45
- result = trimTabAndSpaces(result);
39
+ result = result.replace(/\s+$/g, '');
46
40
}
47
41
return result;
48
};
0 commit comments