MCPcopy Create free account
hub / github.com/massCodeIO/massCode / getGistId

Function getGistId

src/main/import/snippets/githubGists.ts:24–35  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

22}
23
24function getGistId(value: string): string | null {
25 const trimmed = value.trim()
26
27 if (/^[\da-f]{20,64}$/i.test(trimmed)) {
28 return trimmed
29 }
30
31 const match = trimmed.match(
32 /gist\.github\.com\/(?:[^/]+\/)?([\da-f]{20,64})/i,
33 )
34 return match?.[1] ?? null
35}
36
37function getLanguage(file: GitHubGistFile): string {
38 if (typeof file.language === 'string' && file.language.trim()) {

Callers 1

fetchGitHubGistImportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected