verdaccio
Version:
A lightweight private npm proxy registry
15 lines (14 loc) • 720 B
TypeScript
import { Logger } from '@verdaccio/types';
/**
* Detect a legacy callback-based storage plugin. The new contract's `get()`
* takes no arguments (returns a promise); the legacy `get(cb)` declares a
* trailing callback, and `add(name, cb)` takes two. Arity is a stable signal
* here because both contracts are frozen.
*/
export declare function isLegacyStoragePlugin(plugin: any): boolean;
/**
* Wrap a legacy callback storage plugin in the promise contract expected by
* `@verdaccio/store`. Token methods are exposed only when the legacy plugin
* implements them (store already guards their absence with SERVICE_UNAVAILABLE).
*/
export declare function wrapLegacyStoragePlugin(plugin: any, logger: Logger): any;