MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / strip_resolved_ext

Function strip_resolved_ext

src/pipeline/path_alias.c:51–66  ·  view source on GitHub ↗

Strip .ts/.tsx/.js/.jsx in place. Returns its argument. */

Source from the content-addressed store, hash-verified

49
50/* Strip .ts/.tsx/.js/.jsx in place. Returns its argument. */
51static char *strip_resolved_ext(char *path) {
52 if (!path) {
53 return path;
54 }
55 size_t len = strlen(path);
56 if (len > 3 && path[len - 3] == '.' && (path[len - 2] == 't' || path[len - 2] == 'j') &&
57 path[len - 1] == 's') {
58 path[len - 3] = '\0';
59 return path;
60 }
61 if (len > 4 && path[len - 4] == '.' && (path[len - 3] == 't' || path[len - 3] == 'j') &&
62 path[len - 2] == 's' && path[len - 1] == 'x') {
63 path[len - 4] = '\0';
64 }
65 return path;
66}
67
68/* Join dir_prefix with target, collapsing "." and ".." segments so aliases
69 * that climb out of their tsconfig's directory (the common monorepo

Callers 1

cbm_path_alias_resolveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected