@bleedingdev/modern-js-runtime-utils 3.9.0-ultramodern.1 → 3.9.0-ultramodern.10

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/dist/cjs/url.js CHANGED
@@ -31,12 +31,29 @@ function normalizePathname(pathname) {
31
31
  const normalized = '/' + pathname.replace(/^\/+|\/+$/g, '');
32
32
  return normalized;
33
33
  }
34
+ const splitUrlTarget = (target)=>{
35
+ const hashIndex = target.indexOf('#');
36
+ const hash = hashIndex >= 0 ? target.slice(hashIndex) : '';
37
+ const beforeHash = hashIndex >= 0 ? target.slice(0, hashIndex) : target;
38
+ const searchIndex = beforeHash.indexOf('?');
39
+ const search = searchIndex >= 0 ? beforeHash.slice(searchIndex) : '';
40
+ const pathname = searchIndex >= 0 ? beforeHash.slice(0, searchIndex) : beforeHash;
41
+ return {
42
+ pathname,
43
+ search,
44
+ hash
45
+ };
46
+ };
34
47
  __webpack_require__.d(__webpack_exports__, {
35
48
  normalizePathname: ()=>normalizePathname
49
+ }, {
50
+ splitUrlTarget: splitUrlTarget
36
51
  });
37
52
  exports.normalizePathname = __webpack_exports__.normalizePathname;
53
+ exports.splitUrlTarget = __webpack_exports__.splitUrlTarget;
38
54
  for(var __rspack_i in __webpack_exports__)if (-1 === [
39
- "normalizePathname"
55
+ "normalizePathname",
56
+ "splitUrlTarget"
40
57
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
41
58
  Object.defineProperty(exports, '__esModule', {
42
59
  value: true
package/dist/esm/url.mjs CHANGED
@@ -2,4 +2,17 @@ function normalizePathname(pathname) {
2
2
  const normalized = '/' + pathname.replace(/^\/+|\/+$/g, '');
3
3
  return normalized;
4
4
  }
5
- export { normalizePathname };
5
+ const splitUrlTarget = (target)=>{
6
+ const hashIndex = target.indexOf('#');
7
+ const hash = hashIndex >= 0 ? target.slice(hashIndex) : '';
8
+ const beforeHash = hashIndex >= 0 ? target.slice(0, hashIndex) : target;
9
+ const searchIndex = beforeHash.indexOf('?');
10
+ const search = searchIndex >= 0 ? beforeHash.slice(searchIndex) : '';
11
+ const pathname = searchIndex >= 0 ? beforeHash.slice(0, searchIndex) : beforeHash;
12
+ return {
13
+ pathname,
14
+ search,
15
+ hash
16
+ };
17
+ };
18
+ export { normalizePathname, splitUrlTarget };
@@ -3,4 +3,17 @@ function normalizePathname(pathname) {
3
3
  const normalized = '/' + pathname.replace(/^\/+|\/+$/g, '');
4
4
  return normalized;
5
5
  }
6
- export { normalizePathname };
6
+ const splitUrlTarget = (target)=>{
7
+ const hashIndex = target.indexOf('#');
8
+ const hash = hashIndex >= 0 ? target.slice(hashIndex) : '';
9
+ const beforeHash = hashIndex >= 0 ? target.slice(0, hashIndex) : target;
10
+ const searchIndex = beforeHash.indexOf('?');
11
+ const search = searchIndex >= 0 ? beforeHash.slice(searchIndex) : '';
12
+ const pathname = searchIndex >= 0 ? beforeHash.slice(0, searchIndex) : beforeHash;
13
+ return {
14
+ pathname,
15
+ search,
16
+ hash
17
+ };
18
+ };
19
+ export { normalizePathname, splitUrlTarget };
@@ -9,3 +9,9 @@
9
9
  * pathname3: '/', the nomalizeResult also as '/'
10
10
  */
11
11
  export declare function normalizePathname(pathname: string): string;
12
+ /** Split a relative target without decoding or normalizing its suffix. */
13
+ export declare const splitUrlTarget: (target: string) => {
14
+ pathname: string;
15
+ search: string;
16
+ hash: string;
17
+ };
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.9.0-ultramodern.1",
20
+ "version": "3.9.0-ultramodern.10",
21
21
  "_comment": "Provide ESM and CJS exports, ESM is used by runtime package, for treeshaking",
22
22
  "exports": {
23
23
  "./router": {
@@ -80,7 +80,11 @@
80
80
  },
81
81
  "./url": {
82
82
  "types": "./dist/types/url.d.ts",
83
- "default": "./dist/esm/url.mjs"
83
+ "default": "./dist/esm/url.mjs",
84
+ "node": {
85
+ "import": "./dist/esm-node/url.mjs",
86
+ "require": "./dist/cjs/url.js"
87
+ }
84
88
  },
85
89
  "./merge": {
86
90
  "types": "./dist/types/merge.d.ts",
@@ -143,8 +147,8 @@
143
147
  }
144
148
  },
145
149
  "dependencies": {
146
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.1",
147
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.1",
150
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.10",
151
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.10",
148
152
  "@swc/helpers": "^0.5.23",
149
153
  "lru-cache": "^11.5.2",
150
154
  "react-router": "7.18.2"
@@ -164,10 +168,10 @@
164
168
  "devDependencies": {
165
169
  "@rslib/core": "1.0.0",
166
170
  "@scripts/rstest-config": "2.66.0",
167
- "@types/ioredis-mock": "^8.2.7",
168
- "@types/node": "^26.2.0",
171
+ "@types/ioredis-mock": "^8.2.8",
172
+ "@types/node": "^26.4.1",
169
173
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
170
- "happy-dom": "^20.10.6",
174
+ "happy-dom": "^20.14.0",
171
175
  "ioredis": "^5.11.1",
172
176
  "ioredis-mock": "^8.13.1",
173
177
  "react": "^19.2.8",