@hzab/utils 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +4 -0
- package/package.json +1 -1
- package/src/img-utils.ts +2 -0
- package/src/url.ts +11 -0
package/changelog.md
CHANGED
package/package.json
CHANGED
package/src/img-utils.ts
CHANGED
package/src/url.ts
CHANGED
|
@@ -119,5 +119,16 @@ export function searchToObj(url) {
|
|
|
119
119
|
return res;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* 添加 url 中的 query 的参数
|
|
124
|
+
* @param url
|
|
125
|
+
* @param params
|
|
126
|
+
* @returns
|
|
127
|
+
*/
|
|
128
|
+
export function addQuery(url, params) {
|
|
129
|
+
const newObj = { ...searchToObj(url), ...params }
|
|
130
|
+
return replaceSearch(url, objToSearch(newObj, !!params))
|
|
131
|
+
}
|
|
132
|
+
|
|
122
133
|
|
|
123
134
|
|