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(
786
786
const type = typeof value ;
787
787
788
788
// Check the key and throw error if it's illegal
789
- if ( ! ignoreKeys . has ( key ) ) {
789
+ if ( typeof key === 'string' && ! ignoreKeys . has ( key ) ) {
790
790
if ( key . match ( regexp ) != null ) {
791
791
// The BSON spec doesn't allow keys with null bytes because keys are
792
792
// null-terminated.
@@ -886,7 +886,7 @@ function serializeInto(
886
886
const type = typeof value ;
887
887
888
888
// Check the key and throw error if it's illegal
889
- if ( ! ignoreKeys . has ( key ) ) {
889
+ if ( typeof key === 'string' && ! ignoreKeys . has ( key ) ) {
890
890
if ( key . match ( regexp ) != null ) {
891
891
// The BSON spec doesn't allow keys with null bytes because keys are
892
892
// null-terminated.
You can’t perform that action at this time.
0 commit comments