remove SLASH on single_post but KEEP on categories and parent pages

After SO MANY research, I found a Great Simple solution via https://stackoverflow.com/a/54251892/10403689 (vote this ⬆UP⬆)

Your Permalink Structure should be: /%category%/%postname%/

function no_post_slash( $string, $type ){
    if($type == 'single')
        $string = untrailingslashit($string);
   return $string;
}
add_filter('user_trailingslashit', 'no_post_slash', 70, 2);

BUT this is only working on single_post not pages