t-comm
Version:
专业、稳定、纯粹的工具库
12 lines (11 loc) • 594 B
TypeScript
/**
* @export removeUrlParams
* @description 移除参数
* @param {string} url 地址
* @param {string} removeKeyArr 待移除的参数名集合
* @returns 重新拼接的地址
* @example
* const url = removeUrlParams('http://www.test.com/#/detail?a=1&b=2&c=3', ['a', 'b']); // 'http://www.test.com/#/detail?c=3'
* const url2 = removeUrlParams('http://www.test.com?d=4&f=6#/detail?a=1&b=2&c=3', ['a', 'd']); // 'http://www.test.com/#/detail?b=2&c=3&f=6'
*/
export declare function removeUrlParams(url: string | undefined, removeKeyArr: string[], forceHistoryMode?: boolean): string;