Blame view

lib/truncate-paragraph/validator.js 278 Bytes
76a4bcfcc   Adhidarma Hadiwinoto   Adaptasi modem baru
1
2
3
4
5
6
7
8
9
10
11
12
  function isSeparator(char) {
      return char.search(/[
  ., ;]/) === 0;
  }
  
  function isSeparatorHead(char) {
      return char.search(/-/) === 0 || isSeparator(char)
  }
  
  module.exports = (head, tail) => {
      return isSeparatorHead(head[head.length - 1]) || isSeparator(tail[0]);
  };