Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

21
node_modules/detect-newline/index.js generated vendored
View File

@@ -1,24 +1,21 @@
'use strict';
module.exports = function (str) {
if (typeof str !== 'string') {
const detectNewline = string => {
if (typeof string !== 'string') {
throw new TypeError('Expected a string');
}
var newlines = (str.match(/(?:\r?\n)/g) || []);
const newlines = string.match(/(?:\r?\n)/g) || [];
if (newlines.length === 0) {
return null;
return;
}
var crlf = newlines.filter(function (el) {
return el === '\r\n';
}).length;
var lf = newlines.length - crlf;
const crlf = newlines.filter(newline => newline === '\r\n').length;
const lf = newlines.length - crlf;
return crlf > lf ? '\r\n' : '\n';
};
module.exports.graceful = function (str) {
return module.exports(str) || '\n';
};
module.exports = detectNewline;
module.exports.graceful = string => (typeof string === 'string' && detectNewline(string)) || '\n';