(string: string)
| 479 | } |
| 480 | |
| 481 | export function isName(string: string): boolean { |
| 482 | // Check for strings with no numbers, optionally capitalised first letters |
| 483 | // which have 1-3 words plus optional hyphenation, commas and full stops. |
| 484 | // Allow ,.- because you can have double-barrelled names (Smith-Jones), |
| 485 | // shortenings (Google Inc.) and commas (Smith, Jones and Co.), albeit rarely |
| 486 | return /([A-Z]?[a-z-.,]{1,9}\s){1,2}[A-Z]?[a-z-.,]{1,9}/.test(string); |
| 487 | } |
| 488 | |
| 489 | function isMoneyValue(str: string): boolean { |
| 490 | return /^[$£€]?\d{1,3},(\d\d\d,){0,2}\d{3}(.\d\d)?$/g.test(str); |
no outgoing calls
no test coverage detected