Resolve JS/TS entry point from exports["."] object. */
| 245 | |
| 246 | /* Resolve JS/TS entry point from exports["."] object. */ |
| 247 | static 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. */ |
| 265 | static const char *resolve_pkg_entry(yyjson_val *root) { |