Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
locks: opts.lock ? path.join(opts.storeDir, '_locks') : undefined,
registry: opts.registry || 'https://registry.npmjs.org/',
})
const resolve = createResolver(sopts)
await makeDir(sopts.storeDir)
const fsIsCaseSensitive = await dirIsCaseSensitive(sopts.storeDir)
logger.debug({
// An undefined field would cause a crash of the logger
// so converting it to null
isCaseSensitive: typeof fsIsCaseSensitive === 'boolean'
? fsIsCaseSensitive : null,
store: sopts.storeDir,
})
const fetchers = createFetcher({ ...sopts, fsIsCaseSensitive })
return {
ctrl: await createStore(resolve, fetchers as {}, {
locks: sopts.locks,
lockStaleDuration: sopts.lockStaleDuration,
networkConcurrency: sopts.networkConcurrency,
packageImportMethod: sopts.packageImportMethod,
storeDir: sopts.storeDir,
verifyStoreIntegrity: typeof sopts.verifyStoreIntegrity === 'boolean' ?
sopts.verifyStoreIntegrity : true,
}),
dir: sopts.storeDir,
}
}