If you need to distinguish between post types in a block editor script, you can use the following code to get the post type:
wp.data.select('core/editor').getCurrentPostType()
Code language: JavaScript (javascript)
If you need to distinguish between post types in a block editor script, you can use the following code to get the post type:
wp.data.select('core/editor').getCurrentPostType()
Code language: JavaScript (javascript)