mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-13 02:55:56 -04:00
12 lines
405 B
TypeScript
12 lines
405 B
TypeScript
import normalizeRegistryUrl from 'normalize-registry-url'
|
|
|
|
export default function getScopeRegistries (rawConfig: Object) {
|
|
const registries = {}
|
|
for (const configKey of Object.keys(rawConfig)) {
|
|
if (configKey[0] === '@' && configKey.endsWith(':registry')) {
|
|
registries[configKey.slice(0, configKey.indexOf(':'))] = normalizeRegistryUrl(rawConfig[configKey])
|
|
}
|
|
}
|
|
return registries
|
|
}
|