@definitelytyped/utils
Advanced tools
Comparing version 0.0.28-next.0 to 0.0.28-next.1
@@ -42,3 +42,3 @@ import "./types/npm-registry-client"; | ||
} | ||
export declare function withNpmCache<T>(uncachedClient: UncachedNpmInfoClient, cb: (client: CachedNpmInfoClient) => Promise<T>): Promise<T>; | ||
export declare function withNpmCache<T>(uncachedClient: UncachedNpmInfoClient, cb: (client: CachedNpmInfoClient) => Promise<T>, cacheDir?: string): Promise<T>; | ||
export declare class UncachedNpmInfoClient { | ||
@@ -45,0 +45,0 @@ private readonly fetcher; |
@@ -22,3 +22,4 @@ "use strict"; | ||
exports.npmApi = "api.npmjs.org"; | ||
const cacheFile = fs_1.joinPaths(__dirname, "..", "cache", "npmInfo.json"); | ||
const defaultCacheDir = fs_1.joinPaths(__dirname, "..", "cache"); | ||
const cacheFileBasename = "npmInfo.json"; | ||
/** Which registry to publish to */ | ||
@@ -32,4 +33,5 @@ var Registry; | ||
})(Registry = exports.Registry || (exports.Registry = {})); | ||
async function withNpmCache(uncachedClient, cb) { | ||
async function withNpmCache(uncachedClient, cb, cacheDir = defaultCacheDir) { | ||
const log = logging_1.loggerWithErrors()[0]; | ||
const cacheFile = fs_1.joinPaths(cacheDir, cacheFileBasename); | ||
let unroll; | ||
@@ -36,0 +38,0 @@ log.info(`Checking for cache file at ${cacheFile}...`); |
{ | ||
"name": "@definitelytyped/utils", | ||
"version": "0.0.28-next.0", | ||
"version": "0.0.28-next.1", | ||
"description": "Shared utilities for DefinitelyTyped tools", | ||
@@ -40,3 +40,3 @@ "homepage": "https://github.com/DefinitelyTyped/tools#readme", | ||
}, | ||
"gitHead": "8003a4fd5c8d0535967f72159ea108d528d3dde1" | ||
"gitHead": "a73a3b1ef3432eca467a0d5c9bec8b44dcce6376" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131406
2069