UNPKG

fontmin-spider

Version:

Analyze which fonts are used on the page and eliminate the ones that are not used to get a smaller font file

47 lines (46 loc) 1.63 kB
/// <reference types="node" /> /** * get Absolute Path * @param { string } basePath You can think of it as the root of the website * @param { string } improtPath import file path * @param { string } sourcePath improtPath improt source path * @returns { string } absolute path */ export declare function getAbsolutePath(basePath: string, improtPath: string, sourcePath: string): string; /** * Remove paired single or double quotes * @param { string } str You need to remove pairs of single - or double-quoted strings * @returns { string } Dispose of paired single- or double-quoted strings */ export declare const getQuoteless: (str: string) => string; /** * Get the resource referenced by url() in css * @param { string } value css property value * @returns { string[] } Content in url() after processing */ export declare function getUrls(value: string): { source: string; before: string; quote: string; value: string; after: string; }[]; /** * File Backup * @param { string } filePath Need to backup file * @returns { string } File path after backup */ export declare function backup(filePath: string): string; /** * Generate hash * @param { string | buffer } data Generate the contents of the hash * @param { number } size The size (length) of the generated hash * @returns { string } hash */ export declare function getHash(data: string | Buffer, size?: number): string; /** * 移除参数以及锚点 * @param { string } param string * @returns { string } string */ export declare const removeParam: (param: string) => string;