mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 09:41:40 -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) {
|
for (const [key, value] of o.request.headers) {
|
||||||
if (
|
if (
|
||||||
this.options.privateHeaders &&
|
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
|
// We assume that most users only have a few private headers, or will
|
||||||
// just set privateHeaders to true; we can change this linear-time
|
// just set privateHeaders to true; we can change this linear-time
|
||||||
// operation if it causes real performance issues.
|
// operation if it causes real performance issues.
|
||||||
|
@ -164,7 +164,7 @@ export class EngineReportingExtension<TContext = any>
|
||||||
Object.keys(o.variables).forEach(name => {
|
Object.keys(o.variables).forEach(name => {
|
||||||
if (
|
if (
|
||||||
this.options.privateVariables &&
|
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,
|
// We assume that most users will have only a few private variables,
|
||||||
// or will just set privateVariables to true; we can change this
|
// or will just set privateVariables to true; we can change this
|
||||||
// linear-time operation if it causes real performance issues.
|
// linear-time operation if it causes real performance issues.
|
||||||
|
|
Loading…
Add table
Reference in a new issue