mirror of
https://github.com/vale981/apollo-server
synced 2025-03-04 17:21:42 -05:00
Use Array.isArray
rather than typeof
... === 'object'
to check Arrayness.
This commit is contained in:
parent
8b1b3d795b
commit
3dfbfcc0d8
1 changed files with 2 additions and 2 deletions
|
@ -125,7 +125,7 @@ export class EngineReportingExtension<TContext = any>
|
|||
for (const [key, value] of o.request.headers) {
|
||||
if (
|
||||
this.options.privateHeaders &&
|
||||
typeof this.options.privateHeaders === 'object' &&
|
||||
Array.isArray(this.options.privateHeaders) &&
|
||||
// We assume that most users only have a few private headers, or will
|
||||
// just set privateHeaders to true; we can change this linear-time
|
||||
// operation if it causes real performance issues.
|
||||
|
@ -164,7 +164,7 @@ export class EngineReportingExtension<TContext = any>
|
|||
Object.keys(o.variables).forEach(name => {
|
||||
if (
|
||||
this.options.privateVariables &&
|
||||
typeof this.options.privateVariables === 'object' &&
|
||||
Array.isArray(this.options.privateVariables) &&
|
||||
// We assume that most users will have only a few private variables,
|
||||
// or will just set privateVariables to true; we can change this
|
||||
// linear-time operation if it causes real performance issues.
|
||||
|
|
Loading…
Add table
Reference in a new issue