Skip to content

Commit f06b73f

Browse files
authored
refactor: resue NPM_REGISTRY from shared constants file (#1938)
1 parent a682a99 commit f06b73f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

server/utils/npm.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { Packument, NpmSearchResponse } from '#shared/types'
22
import { encodePackageName, fetchLatestVersion } from '#shared/utils/npm'
33
import { maxSatisfying, prerelease } from 'semver'
4-
import { CACHE_MAX_AGE_FIVE_MINUTES, CACHE_MAX_AGE_ONE_DAY } from '#shared/utils/constants'
5-
6-
const NPM_REGISTRY = 'https://registry.npmjs.org'
4+
import {
5+
CACHE_MAX_AGE_FIVE_MINUTES,
6+
CACHE_MAX_AGE_ONE_DAY,
7+
NPM_REGISTRY,
8+
} from '#shared/utils/constants'
79

810
export const fetchNpmPackage = defineCachedFunction(
911
async (name: string): Promise<Packument> => {

0 commit comments

Comments
 (0)