File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -786,7 +786,7 @@ function serializeInto(
786786 const type = typeof value ;
787787
788788 // Check the key and throw error if it's illegal
789- if ( ! ignoreKeys . has ( key ) ) {
789+ if ( typeof key === 'string' && ! ignoreKeys . has ( key ) ) {
790790 if ( key . match ( regexp ) != null ) {
791791 // The BSON spec doesn't allow keys with null bytes because keys are
792792 // null-terminated.
@@ -886,7 +886,7 @@ function serializeInto(
886886 const type = typeof value ;
887887
888888 // Check the key and throw error if it's illegal
889- if ( ! ignoreKeys . has ( key ) ) {
889+ if ( typeof key === 'string' && ! ignoreKeys . has ( key ) ) {
890890 if ( key . match ( regexp ) != null ) {
891891 // The BSON spec doesn't allow keys with null bytes because keys are
892892 // null-terminated.
You can’t perform that action at this time.
0 commit comments