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

Function resolve_exports_dot

src/pipeline/pass_pkgmap.c:247–262  ·  view source on GitHub ↗

Resolve JS/TS entry point from exports["."] object. */

Source from the content-addressed store, hash-verified

245
246/* Resolve JS/TS entry point from exports["."] object. */
247static const char *resolve_exports_dot(yyjson_val *dot) {
248 if (yyjson_is_str(dot)) {
249 return yyjson_get_str(dot);
250 }
251 if (!yyjson_is_obj(dot)) {
252 return NULL;
253 }
254 static const char *keys[] = {"import", "default", "require"};
255 for (int i = 0; i < (int)(sizeof(keys) / sizeof(keys[0])); i++) {
256 yyjson_val *v = yyjson_obj_get(dot, keys[i]);
257 if (yyjson_is_str(v)) {
258 return yyjson_get_str(v);
259 }
260 }
261 return NULL;
262}
263
264/* Resolve JS/TS entry point from package.json root. */
265static const char *resolve_pkg_entry(yyjson_val *root) {

Callers 1

resolve_pkg_entryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected