File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ function createStringifier (customOptions) {
53
53
return function stringifyAny ( push , x ) {
54
54
const context = this ;
55
55
let handler = handlerFor ( context . node , options , handlers ) ;
56
- const currentPath = '/' + context . path . join ( '/' ) ;
56
+ const currentPath = '/' + context . path . map ( String ) . join ( '/' ) ;
57
57
const customization = handlers [ currentPath ] ;
58
58
const acc = {
59
59
context : context ,
Original file line number Diff line number Diff line change @@ -244,7 +244,11 @@ function decorateObject () {
244
244
}
245
245
246
246
function sanitizeKey ( key ) {
247
- return / ^ [ A - Z a - z _ ] + $ / . test ( key ) ? key : JSON . stringify ( key ) ;
247
+ if ( typeof key === 'symbol' ) {
248
+ return key . toString ( ) ;
249
+ } else {
250
+ return / ^ [ A - Z a - z _ ] + $ / . test ( key ) ? key : JSON . stringify ( key ) ;
251
+ }
248
252
}
249
253
250
254
function afterAllChildren ( context , push , options ) {
You can’t perform that action at this time.
0 commit comments