Skip to content

Commit

Permalink
support old node.js versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohansebas committed Oct 23, 2024
1 parent 45cad4b commit ca63979
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Accepts.prototype.types = function (types_) {
Accepts.prototype.encoding =
Accepts.prototype.encodings = function (encodings_, options_) {
var encodings = encodings_
var preferred = arguments[arguments.length - 1]?.preferred || null
var preferred = arguments[arguments.length - 1] == null ? null : arguments[arguments.length - 1].preferred

// support flattened arguments
if (encodings && !Array.isArray(encodings)) {
Expand Down

0 comments on commit ca63979

Please sign in to comment.