MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / isApplicationImport

Function isApplicationImport

packages/vite/hmr/server/websocket.ts:994–1005  ·  view source on GitHub ↗

* Check if a path is an application module (not node_modules, not vendor, not relative) * This is generic and works for ANY project structure. * * Examples of application imports: /core/v4/store.ts, /src/utils/helper.ts, /custom/module.ts * Examples of NON-application imports: node_modules/...,

(importPath: string)

Source from the content-addressed store, hash-verified

992 * Examples of NON-application imports: node_modules/..., ~/vendor.mjs, ./relative.ts, ../parent.ts
993 */
994function isApplicationImport(importPath: string): boolean {
995 if (!importPath.startsWith('/')) {
996 return false; // Relative paths (./..., ../...) are not application imports
997 }
998
999 // Exclude node_modules and special paths
1000 if (importPath.includes('node_modules') || importPath.startsWith('/@') || importPath.startsWith('~/')) {
1001 return false;
1002 }
1003
1004 return true;
1005}
1006
1007function stripToProjectRelative(importPath: string, projectRoot?: string): string {
1008 if (!importPath) {

Callers 1

replaceVueImportFunction · 0.85

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected