lyb-js 1.6.0 → 1.6.1

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.
@@ -1,4 +1,4 @@
1
1
  /** @description 获取浏览器地址栏参数
2
2
  * @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsPathParams-地址栏参数
3
3
  */
4
- export declare const libJsPathParams: () => Record<string, string>;
4
+ export declare const libJsPathParams: (path?: string) => Record<string, string>;
@@ -1,8 +1,8 @@
1
1
  /** @description 获取浏览器地址栏参数
2
2
  * @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsPathParams-地址栏参数
3
3
  */
4
- export const libJsPathParams = () => {
5
- const v = location.href;
4
+ export const libJsPathParams = (path) => {
5
+ const v = path || location.href;
6
6
  const url = v.split("?")[1];
7
7
  if (!url)
8
8
  return {};
package/libJs.d.ts CHANGED
@@ -39,7 +39,7 @@ export declare const Browser: {
39
39
  /** @description 获取浏览器地址栏参数
40
40
  * @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsPathParams-地址栏参数
41
41
  */
42
- libJsPathParams: () => Record<string, string>;
42
+ libJsPathParams: (path?: string) => Record<string, string>;
43
43
  /** @description 动态设置网站标题及图标
44
44
  * @param title 网站标题
45
45
  * @param url 网站图标地址
package/lyb.js CHANGED
@@ -86,8 +86,8 @@ ${log3.label}:`, log3.value];
86
86
  const isTabletAspectRatio = aspectRatio >= 1.3 && aspectRatio <= 1.6;
87
87
  return isTabletUserAgent || isTabletWidth && isTabletAspectRatio;
88
88
  };
89
- const libJsPathParams = () => {
90
- const v = location.href;
89
+ const libJsPathParams = (path) => {
90
+ const v = path || location.href;
91
91
  const url = v.split("?")[1];
92
92
  if (!url)
93
93
  return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-js",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "自用JS方法库",
5
5
  "license": "ISC",
6
6
  "type": "module",