From 7203c87ceb23aee9ced88675853548cbef3aa39b Mon Sep 17 00:00:00 2001 From: jin Date: Thu, 4 Jan 2024 02:09:26 +0300 Subject: [PATCH] $mol_key: symbol support --- key/key.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/key/key.ts b/key/key.ts index 9fccf138d7c..92d1e4e658c 100644 --- a/key/key.ts +++ b/key/key.ts @@ -6,12 +6,14 @@ namespace $ { export function $mol_key< Value >( value : Value ) : string { if( typeof value === 'bigint' ) return value.toString() + 'n' + if( typeof value === 'symbol' ) return value.description! if( !value ) return JSON.stringify( value ) if( typeof value !== 'object' && typeof value !== 'function' ) return JSON.stringify( value ) return JSON.stringify( value, ( field, value )=> { if( typeof value === 'bigint' ) return value.toString() + 'n' + if( typeof value === 'symbol' ) return value.description if( !value ) return value if( typeof value !== 'object' && typeof value !== 'function' ) return value if( Array.isArray( value ) ) return value