Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2022-01-29 01:33:45 +00:00
parent 253bc84963
commit 8e07ec6ce2
3 changed files with 16 additions and 7 deletions

6
node_modules/.package-lock.json generated vendored
View file

@ -6019,9 +6019,9 @@
}
},
"node_modules/trim-off-newlines": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.2.tgz",
"integrity": "sha512-DAnbtY4lNoOTLw05HLuvPoBFAGV4zOKQ9d1Q45JB+bcDwYIEkCr0xNgwKtygtKFBbRlFA/8ytkAM1V09QGWksg==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz",
"integrity": "sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg==",
"dev": true,
"engines": {
"node": ">=0.10.0"

View file

@ -1,7 +1,16 @@
'use strict';
var regex = /^(?:\r|\n)+|(?:\r|\n)+$/g;
var regex = /[^\r\n]/;
module.exports = function (str) {
return str.replace(regex, '');
var result = str.match(regex);
if (!result) {
return '';
}
var firstIndex = result.index;
var lastIndex = str.length - 1;
while (str[lastIndex] === '\r' || str[lastIndex] === '\n') {
lastIndex--;
}
return str.substring(firstIndex, lastIndex + 1);
};

View file

@ -1,6 +1,6 @@
{
"name": "trim-off-newlines",
"version": "1.0.2",
"version": "1.0.3",
"description": "Similar to String#trim() but removes only newlines",
"license": "MIT",
"repository": "stevemao/trim-off-newlines",
@ -35,7 +35,7 @@
"delete"
],
"devDependencies": {
"mocha": "*",
"mocha": "^3.5.3",
"xo": "^0.17.1"
},
"xo": {