@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 CHANGED
@@ -1,3 +1,7 @@
1
+ # @hzab/utils@1.0.16
2
+
3
+ feat: 图片链接添加 query
4
+
1
5
  # @hzab/utils@1.0.15
2
6
 
3
7
  feat: 二维码,创建路径,区分前缀
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/utils",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "utils",
5
5
  "main": "src",
6
6
  "scripts": {
package/src/img-utils.ts CHANGED
@@ -454,3 +454,5 @@ export function smartImageCompress(blob, maxSize) {
454
454
 
455
455
 
456
456
 
457
+
458
+
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