first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/**
* 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.
*
*
* @format
* @oncall react_native
*/
/**
* Determine if a file path should be considered an asset file based on the
* given `assetExts`.
*/
declare function isAssetFile(filePath: string, assetExts: ReadonlySet<string>): boolean;
export default isAssetFile;

View File

@@ -0,0 +1 @@
module.exports = require("metro-resolver/private/utils/isAssetFile");

View File

@@ -0,0 +1,18 @@
/**
* 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.
*
*
* @format
* @oncall react_native
*/
/**
* Identifies whether the given subpath is defined in the given "exports"-like
* mapping. Does not reduce exports conditions (therefore does not identify
* whether the subpath is mapped to a value).
*/
import type { NormalizedExportsLikeMap } from "../types";
export declare function isSubpathDefinedInExportsLike(exportsLikeMap: NormalizedExportsLikeMap, subpath: string): boolean;

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-resolver/private/utils/isSubpathDefinedInExportsLike");
module.exports.default = module.exports;

View File

@@ -0,0 +1,22 @@
/**
* 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.
*
*
* @format
* @oncall react_native
*/
import type { NormalizedExportsLikeMap, ResolutionContext } from "../types";
/**
* Get the mapped replacement for the given subpath.
*
* Implements modern package resolution behaviour based on the [Package Entry
* Points spec](https://nodejs.org/docs/latest-v19.x/api/packages.html#package-entry-points).
*/
export declare function matchSubpathFromExportsLike(context: ResolutionContext, subpath: string, exportsLikeMap: NormalizedExportsLikeMap, platform: string | null, createConfigError: (reason: string) => Error): {
readonly target?: string | null;
readonly patternMatch?: string | null;
};

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-resolver/private/utils/matchSubpathFromExportsLike");
module.exports.default = module.exports;

View File

@@ -0,0 +1,18 @@
/**
* 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.
*
*
* @format
* @oncall react_native
*/
/**
* If a subpath pattern expands to the passed subpath, return the subpath match
* (value to substitute for '*'). Otherwise, return `null`.
*
* See https://nodejs.org/docs/latest-v19.x/api/packages.html#subpath-patterns.
*/
export declare function matchSubpathPattern(subpathPattern: string, subpath: string): string | null;

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-resolver/private/utils/matchSubpathPattern");
module.exports.default = module.exports;

View File

@@ -0,0 +1,17 @@
/**
* 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.
*
*
* @format
* @oncall react_native
*/
/**
* Reduce an "exports"-like mapping to a flat subpath mapping after resolving
* conditional exports.
*/
import type { FlattenedExportMap, NormalizedExportsLikeMap } from "../types";
export declare function reduceExportsLikeMap(exportsLikeMap: NormalizedExportsLikeMap, conditionNames: ReadonlySet<string>, createConfigError: (reason: string) => Error): FlattenedExportMap;

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-resolver/private/utils/reduceExportsLikeMap");
module.exports.default = module.exports;

View File

@@ -0,0 +1,17 @@
/**
* 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.
*
*
* @format
* @oncall react_native
*/
/**
* Replace path separators in the passed string to coerce to a POSIX path. This
* is a no-op on POSIX systems.
*/
declare function toPosixPath(relativePathOrSpecifier: string): string;
export default toPosixPath;

View File

@@ -0,0 +1 @@
module.exports = require("metro-resolver/private/utils/toPosixPath");