cdn-resolve
Version:
Resolves import paths to their CDN equivalents
20 lines • 545 B
TypeScript
//#region src/parse.d.ts
interface ParsedPackage {
name: string;
version: string;
path?: string;
scope?: string;
full: string;
}
/**
* Parses a package string and returns the parsed package information.
* @param {string} pkg The package string to parse.
* @returns The parsed package information.
* @throws Error if the package name is invalid.
*
* NOTE:
* The version is always set to "latest" if not specified.
*/
declare function parsePackage(pkg: string): ParsedPackage;
//#endregion
export { ParsedPackage, parsePackage };