MCPcopy Index your code
hub / github.com/refined-github/refined-github / isUsernameAlreadyFullName

Function isUsernameAlreadyFullName

source/github-helpers/index.ts:46–60  ·  view source on GitHub ↗
(username: string, realname: string)

Source from the content-addressed store, hash-verified

44}
45
46export function isUsernameAlreadyFullName(username: string, realname: string): boolean {
47 // Normalize both strings
48 username = username
49 .replaceAll('-', '')
50 .toLowerCase();
51 realname = realname
52 .normalize('NFD')
53 // Remove diacritics, punctuation and spaces
54 // https://stackoverflow.com/a/37511463/288906
55 // https://www.freecodecamp.org/news/what-is-punct-in-regex-how-to-match-all-punctuation-marks-in-regular-expressions/
56 .replaceAll(/[\s\p{Diacritic}\p{Punctuation}]/gu, '')
57 .toLowerCase();
58
59 return username === realname;
60}
61
62const validVersion = /^[rv]?\d+(?:\.\d+)+/;
63const isPrerelease = /^[rv]?\d+(?:\.\d+)+-\d/;

Callers 2

index.test.tsFile · 0.85
updateLinksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected