Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default async function testDefaults (
opts?: any, // tslint:disable-line
resolveOpts?: any, // tslint:disable-line
fetchOpts?: any, // tslint:disable-line
storeOpts?: any, // tslint:disable-line
): Promise {
let store = opts && opts.store || path.resolve('..', '.store')
store = await storePath(opts && opts.prefix || process.cwd(), store)
const rawNpmConfig = {registry}
const storeController = await createStore(
createResolver({
fullMetadata: true, // temporarily. Till the lifecycle hooks performance issue is solved
metaCache: new Map(),
rawNpmConfig,
store,
strictSsl: true,
...retryOpts,
...resolveOpts,
}),
createFetcher({
alwaysAuth: true,
rawNpmConfig,
registry,
...retryOpts,
...fetchOpts,
}) as {},
{
httpsProxy?: string,
key?: string,
localAddress?: string,
lockfileDir: string,
offline?: boolean,
dir: string,
proxy?: string,
rawConfig: object,
registries: Registries,
storeDir: string,
strictSsl?: boolean,
userAgent?: string,
verifyStoreIntegrity?: boolean,
},
): (packageName: string) => Promise {
const resolve = createResolver(Object.assign(opts, {
fullMetadata: true,
metaCache: new LRU({
max: 10000,
maxAge: 120 * 1000, // 2 minutes
}) as any, // tslint:disable-line:no-any
}))
return mem(getLatestManifest.bind(null, resolve, opts))
}
export default async function testDefaults (
opts?: any, // tslint:disable-line
resolveOpts?: any, // tslint:disable-line
fetchOpts?: any, // tslint:disable-line
storeOpts?: any, // tslint:disable-line
): Promise {
let store = opts && opts.store || tempy.directory()
store = await storePath(opts && opts.prefix || process.cwd(), store)
const rawNpmConfig = {registry}
const storeController = await createStore(
createResolver({
metaCache: new Map(),
rawNpmConfig,
store,
strictSsl: true,
...retryOpts,
...resolveOpts,
}),
createFetcher({
alwaysAuth: true,
rawNpmConfig,
registry,
...retryOpts,
...fetchOpts,
}) as {},
{
locks: path.join(store, '_locks'),
export default function (
opts: CreateResolverOptions,
) {
return createResolver(Object.assign(opts, {
fullMetadata: false,
metaCache: new LRU({
max: 10000,
maxAge: 120 * 1000, // 2 minutes
}) as any, // tslint:disable-line:no-any
}))
}