astro-ghostcms/.pnpm-store/v3/files/e0/0eac72f5a2e1bcd1cf01ca51464...

24 lines
689 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Manually “tree shaken” from:
// <https://github.com/nodejs/node/blob/45f5c9b/lib/internal/modules/esm/resolve.js>
// Last checked on: Nov 2, 2023.
//
// This file solves a circular dependency.
// In Node.js, `getPackageType` is in `resolve.js`.
// `resolve.js` imports `get-format.js`, which needs `getPackageType`.
// We split that up so that bundlers dont fail.
/**
* @typedef {import('./package-json-reader.js').PackageType} PackageType
*/
import {getPackageScopeConfig} from './package-config.js'
/**
* @param {URL} url
* @returns {PackageType}
*/
export function getPackageType(url) {
const packageConfig = getPackageScopeConfig(url)
return packageConfig.type
}