How to limit meta description of an article to 150 characters in Drupal 8

By default meta tag, module  use node summary/body token to populate meta description of the content type having body field. It does not follow the standard practice of meta description of length between 135 to 150 characters. Even if you set summary length between 135 and 150, your meta description might end with incomplete word and provide a bad search engine preview. You can create a custom token which meets both the criteria i.e 1. The length between 135 and 150 and  2. The last word might be incomplete because of the character limit. You can create a custom token in following way: 

/**
 * Implements hook_token_info(). 
 */
function custom_module_token_info() {
  $info = [];
  $info['tokens']['custom_module']['node_body_summary'][] = 'A token to extract desired characters from
  Node body to be used in meta descriptions';
  return $info;
}
/**
 * Implements hook_tokens(). 
 */
function custom_modules_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata)
{
$replacements = [];
if ($type == 'custom_module'){
  foreach ($tokens as $name => $original)
  {
    // Find the desired token by name.
    switch ($name) {
      case 'node_body_summary': 
      $replacements[$original] = get_node_body_summary();
       break;
    }
  }
}
return $replacements;
}
/** 
 *Implements function to get node body summary.
 */
function get_node_body_summary(){
  $node = \Drupal::routeMatch()->getParameter('node');
  $type = $node->getType(); $summary = "";
  if ($type != 'article') {
    $text = strip_tags($node->body->value);
    $text = substr($text, 0, 150);
    $summary = substr($text, 0, strrpos($text, ".") + 1);
    if (strlen($summary) < 135) {
      $summary = substr($text, 0, 145) . "...";
    }
  } 
  return $summary;
}