@hong-coding/helper.string 0.0.2
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/README.md +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.umd.js +15 -0
- package/dist/main.js +9 -0
- package/package.json +21 -0
package/README.md
ADDED
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export declare function getParamFromUrl(url: string, key: any): string;
|
package/dist/index.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.helperString = {}));
|
5
|
+
})(this, (function (exports) { 'use strict';
|
6
|
+
|
7
|
+
function getParamFromUrl(url, key) {
|
8
|
+
const urlObj = new URL(url);
|
9
|
+
const params = new URLSearchParams(urlObj.search);
|
10
|
+
return params.get(key) || '';
|
11
|
+
}
|
12
|
+
|
13
|
+
exports.getParamFromUrl = getParamFromUrl;
|
14
|
+
|
15
|
+
}));
|
package/dist/main.js
ADDED
package/package.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "@hong-coding/helper.string",
|
3
|
+
"version": "0.0.2",
|
4
|
+
"description": "string的处理方法",
|
5
|
+
"keywords": [],
|
6
|
+
"author": "hz",
|
7
|
+
"license": "ISC",
|
8
|
+
"files": [
|
9
|
+
"dist"
|
10
|
+
],
|
11
|
+
"main": "./dist/main.js",
|
12
|
+
"module": "./dist/index.js",
|
13
|
+
"typings": "./dist/index.d.ts",
|
14
|
+
"publishConfig": {
|
15
|
+
"access": "public"
|
16
|
+
},
|
17
|
+
"scripts": {
|
18
|
+
"serve": "rollup -c -w",
|
19
|
+
"build": "rollup -c"
|
20
|
+
}
|
21
|
+
}
|