mirror of
https://github.com/pnpm/pnpm.git
synced 2026-06-28 09:55:39 -04:00
* build: enable `@typescript-eslint/no-import-type-side-effects` * build: disable `@typescript-eslint/consistent-type-imports` * chore: apply fixes for `no-import-type-side-effects` pnpm exec eslint "**/src/**/*.ts" "**/test/**/*.ts" --fix
18 lines
558 B
TypeScript
18 lines
558 B
TypeScript
import type { Registries } from '@pnpm/types'
|
|
import normalizeRegistryUrl from 'normalize-registry-url'
|
|
import { map as mapValues } from 'ramda'
|
|
|
|
export const DEFAULT_REGISTRIES: Registries = {
|
|
default: 'https://registry.npmjs.org/',
|
|
'@jsr': 'https://npm.jsr.io/',
|
|
}
|
|
|
|
export function normalizeRegistries (registries?: Record<string, string>): Registries {
|
|
if (registries == null) return DEFAULT_REGISTRIES
|
|
const normalizeRegistries = mapValues(normalizeRegistryUrl, registries)
|
|
return {
|
|
...DEFAULT_REGISTRIES,
|
|
...normalizeRegistries,
|
|
}
|
|
}
|