MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / isName

Function isName

lib/utils.ts:481–487  ·  view source on GitHub ↗
(string: string)

Source from the content-addressed store, hash-verified

479}
480
481export 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
489function isMoneyValue(str: string): boolean {
490 return /^[$£€]?\d{1,3},(\d\d\d,){0,2}\d{3}(.\d\d)?$/g.test(str);

Callers 2

isID.test.tsFile · 0.90
isIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected