Skip to content

Commit

Permalink
$mol_dev_format: error proof
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Nov 21, 2023
1 parent 3d3607c commit 5e0fbdb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dev/format/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ namespace $ {
if( !val ) return null

if( $mol_dev_format_head in val ) {
return val[ $mol_dev_format_head ]()
try {
return val[ $mol_dev_format_head ]()
} catch( error ) {
return $mol_dev_format_accent( $mol_dev_format_native( val ), '💨', $mol_dev_format_native( error ), '' )
}
}

if( typeof val === 'function' ) {
return $mol_dev_format_native( val )
}

return null

} ,
Expand Down

0 comments on commit 5e0fbdb

Please sign in to comment.