Lines Matching refs:base

75  * @param {string} base - The URL of the module that imported the package.
77 function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
84 base ? ` imported from ${fileURLToPath(base)}` :
100 * @param {string} base - The base URL.
103 function emitInvalidSegmentDeprecation(target, request, match, pjsonUrl, internal, base, isTarget) {
112 pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ''}.`,
123 * @param {string | URL} [base] - The base URL for the module being resolved.
126 function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) {
131 const basePath = fileURLToPath(base);
173 * @param {string | URL | undefined} base
176 function legacyMainResolve(packageJSONUrl, packageConfig, base) {
198 emitLegacyIndexDeprecation(guess, packageJSONUrl, base,
214 emitLegacyIndexDeprecation(guess, packageJSONUrl, base, packageConfig.main);
219 fileURLToPath(new URL('.', packageJSONUrl)), fileURLToPath(base));
271 * @param {string | URL | undefined} base - The base URL object.
278 function finalizeResolution(resolved, base, preserveSymlinks) {
282 fileURLToPath(base));
291 setOwnProperty(err, 'module', `${base}`);
307 resolved.pathname, fileURLToPath(base), 'module');
321 throw new ERR_UNSUPPORTED_DIR_IMPORT(path, fileURLToPath(base), String(resolved));
328 path || resolved.pathname, base && fileURLToPath(base), resolved);
349 * @param {string | URL | undefined} base - The base URL to use for resolving relative URLs.
352 function importNotDefined(specifier, packageJSONUrl, base) {
355 fileURLToPath(base));
362 * @param {string | URL | undefined} [base] - The base URL to use for resolving the subpath.
365 function exportsNotFound(subpath, packageJSONUrl, base) {
368 base && fileURLToPath(base));
377 * @param {string | URL | undefined} base - The base URL for the resolution.
380 function throwInvalidSubpath(request, match, packageJSONUrl, internal, base) {
385 base && fileURLToPath(base));
394 * @param {string | URL | undefined} base - The base URL.
398 subpath, target, packageJSONUrl, internal, base) {
406 internal, base && fileURLToPath(base));
420 * @param {string} base - The base URL to resolve the target against.
434 base,
442 throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);
457 throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);
469 emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJSONUrl, internal, base, true);
472 throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);
481 throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);
493 emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJSONUrl, internal, base, false);
496 throwInvalidSubpath(request, match, packageJSONUrl, internal, base);
526 * @param {string} base - The base path to resolve.
534 base, pattern, internal, isPathMap, conditions) {
537 target, subpath, packageSubpath, packageJSONUrl, base, pattern, internal,
550 packageJSONUrl, targetItem, subpath, packageSubpath, base, pattern,
578 fileURLToPath(packageJSONUrl), base,
587 packageJSONUrl, conditionalTarget, subpath, packageSubpath, base,
598 base);
605 * @param {string | URL | undefined} base The base URL.
607 function isConditionalExportsMainSugar(exports, packageJSONUrl, base) {
621 fileURLToPath(packageJSONUrl), base,
635 * @param {string | URL | undefined} base - The base path to resolve from.
640 packageJSONUrl, packageSubpath, packageConfig, base, conditions) {
642 if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) {
651 packageJSONUrl, target, '', packageSubpath, base, false, false, false,
656 throw exportsNotFound(packageSubpath, packageJSONUrl, base);
679 base);
701 base,
708 throw exportsNotFound(packageSubpath, packageJSONUrl, base);
713 throw exportsNotFound(packageSubpath, packageJSONUrl, base);
740 * @param {string | URL | undefined} base - The base URL to resolve the import from.
746 function packageImportsResolve(name, base, conditions) {
750 throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base));
753 const packageConfig = getPackageScopeConfig(base);
761 packageJSONUrl, imports[name], '', name, base, false, true, false,
794 bestMatch, base, true,
803 throw importNotDefined(name, packageJSONUrl, base);
818 * @param {string | URL | undefined} base - The parent URL.
820 function parsePackageName(specifier, base) {
845 specifier, 'is not a valid package name', fileURLToPath(base));
857 * @param {string | URL | undefined} base - The base URL to use for resolution.
861 function packageResolve(specifier, base, conditions) {
867 parsePackageName(specifier, base);
870 const packageConfig = getPackageScopeConfig(base);
875 packageJSONUrl, packageSubpath, packageConfig, base, conditions);
880 new URL('./node_modules/' + packageName + '/package.json', base);
897 const packageConfig = packageJsonReader.read(packageJSONPath, { __proto__: null, specifier, base, isESM: true });
900 packageJSONUrl, packageSubpath, packageConfig, base, conditions);
906 base,
916 throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
954 * @param {string | URL | undefined} base - The base URL to resolve against.
958 function moduleResolve(specifier, base, conditions, preserveSymlinks) {
959 const isRemote = base.protocol === 'http:' ||
960 base.protocol === 'https:';
965 resolved = new URL(specifier, base);
967 resolved = packageImportsResolve(specifier, base, conditions);
973 resolved = packageResolve(specifier, base, conditions);
980 return finalizeResolution(resolved, base, preserveSymlinks);
986 * @param {string} parentURL - The base URL.