BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/metro/src/ModuleGraph/worker
Run
Logout
Edit File
Size: 2.48 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/metro/src/ModuleGraph/worker/importLocationsPlugin.js.flow
Text
Base64
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format * @oncall react_native */ 'use strict'; import type {PluginObj} from '@babel/core'; import typeof * as Types from '@babel/types'; import type {MetroBabelFileMetadata} from 'metro-babel-transformer'; const invariant = require('invariant'); type ImportDeclarationLocs = Set<string>; function importLocationsPlugin({types: t}: {types: Types, ...}): PluginObj<> { const importDeclarationLocs: ImportDeclarationLocs = new Set(); return { visitor: { ImportDeclaration(path) { if ( // Ignore type imports path.node.importKind !== 'type' && // loc may not be set if this plugin runs alongside others which // inject imports - eg Babel runtime helpers. We don't regard these // as source import declarations. path.node.loc != null ) { importDeclarationLocs.add(locToKey(path.node.loc)); } }, ExportDeclaration(path) { if ( // If `source` is set, this is a re-export, so it declares an ESM // dependency. path.node.source != null && // Ignore type exports path.node.exportKind !== 'type' && // As above, ignore injected imports. path.node.loc != null ) { importDeclarationLocs.add(locToKey(path.node.loc)); } }, }, pre: ({path, metadata}) => { invariant( path && t.isProgram(path.node), 'path missing or not a program node', ); // $FlowFixMe[prop-missing] Babel `File` is not generically typed const metroMetadata: MetroBabelFileMetadata = metadata; // Set the result on a metadata property if (!metroMetadata.metro) { metroMetadata.metro = { unstable_importDeclarationLocs: importDeclarationLocs, }; } else { metroMetadata.metro.unstable_importDeclarationLocs = importDeclarationLocs; } }, }; } // Very simple serialisation of a source location. This should remain opaque to // the caller. const MISSING_LOC = {line: -1, column: -1}; function locToKey(loc: BabelSourceLocation): string { const {start = MISSING_LOC, end = MISSING_LOC} = loc; return `${start.line},${start.column}:${end.line},${end.column}`; } module.exports = {importLocationsPlugin, locToKey};
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
collectDependencies.d.ts
882 B
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
collectDependencies.js
17.38 KB
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
collectDependencies.js.flow
26.87 KB
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generateImportNames.js
520 B
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generateImportNames.js.flow
922 B
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
importLocationsPlugin.js
1.30 KB
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
importLocationsPlugin.js.flow
2.48 KB
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
JsFileWrapping.js
3.56 KB
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
JsFileWrapping.js.flow
3.94 KB
lrw-r--r--
2025-03-28 11:04:33
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).