@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 ADDED
@@ -0,0 +1,11 @@
1
+ # `@hong-coding/helper.string`
2
+
3
+ > TODO: description
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ const string = require('@hong-coding/helper.string');
9
+
10
+ // TODO: DEMONSTRATE API
11
+ ```
@@ -0,0 +1 @@
1
+ export declare function getParamFromUrl(url: string, key: any): string;
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ function getParamFromUrl(url, key) {
2
+ const urlObj = new URL(url);
3
+ const params = new URLSearchParams(urlObj.search);
4
+ return params.get(key) || '';
5
+ }
6
+
7
+ export { getParamFromUrl };
@@ -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
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ function getParamFromUrl(url, key) {
4
+ const urlObj = new URL(url);
5
+ const params = new URLSearchParams(urlObj.search);
6
+ return params.get(key) || '';
7
+ }
8
+
9
+ exports.getParamFromUrl = getParamFromUrl;
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
+ }