Revert "Changements dans les modules (nouvelle version Express, mysql, ..)"

This reverts commit bdab795506.
This commit is contained in:
2023-11-23 16:13:50 +01:00
parent 756f928ced
commit 5b0d68d66f
818 changed files with 35968 additions and 82263 deletions

29
node_modules/accepts/index.js generated vendored
View File

@@ -29,9 +29,10 @@ module.exports = Accepts
* @public
*/
function Accepts(req) {
if (!(this instanceof Accepts))
function Accepts (req) {
if (!(this instanceof Accepts)) {
return new Accepts(req)
}
this.headers = req.headers
this.negotiator = new Negotiator(req)
@@ -95,12 +96,18 @@ Accepts.prototype.types = function (types_) {
return this.negotiator.mediaTypes()
}
if (!this.headers.accept) return types[0];
var mimes = types.map(extToMime);
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
var first = accepts[0];
if (!first) return false;
return types[mimes.indexOf(first)];
// no accept header, return first given type
if (!this.headers.accept) {
return types[0]
}
var mimes = types.map(extToMime)
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
var first = accepts[0]
return first
? types[mimes.indexOf(first)]
: false
}
/**
@@ -212,7 +219,7 @@ Accepts.prototype.languages = function (languages_) {
* @private
*/
function extToMime(type) {
function extToMime (type) {
return type.indexOf('/') === -1
? mime.lookup(type)
: type
@@ -226,6 +233,6 @@ function extToMime(type) {
* @private
*/
function validMime(type) {
return typeof type === 'string';
function validMime (type) {
return typeof type === 'string'
}