Skip to content

Commit

Permalink
perf: use optional chaining (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Jan 7, 2025
1 parent b7c89c9 commit 67a6fe5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function isInjection (obj) {
return (
obj instanceof Request ||
obj instanceof Response ||
(obj && obj.constructor && obj.constructor.name === '_CustomLMRRequest')
obj?.constructor?.name === '_CustomLMRRequest'
)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function Request (options) {

{
const payload = this._lightMyRequest.payload
if (payload && payload._readableState) { // does quack like a modern stream
if (payload?._readableState) { // does quack like a modern stream
this._read = readStream

payload.on('error', (err) => {
Expand Down

0 comments on commit 67a6fe5

Please sign in to comment.