@alwatr/resolve-url 5.5.32 → 6.0.0

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/main.js ADDED
@@ -0,0 +1,5 @@
1
+ /* 📦 @alwatr/resolve-url v6.0.0 */
2
+ function C(...b){if(b=b.filter((j)=>typeof j==="string"&&j.length>0),b.length===0)return"";let q=/^\/+/,v=/\/+$/,y=/\/{2,}/g,z=b[0].charAt(0)==="/"?"/":"",k=b[b.length-1],A=k.charAt(k.length-1)==="/"?"/":"";return(z+b.map((j)=>j.replace(q,"").replace(v,"")).filter((j)=>j).join("/").replace("://","{{PROTOCOL_SLASH}}")+A).replace(y,"/").replace("{{PROTOCOL_SLASH}}","://")}export{C as resolveUrl};
3
+
4
+ //# debugId=F8D9286BBEEBEB9D64756E2164756E21
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/main.ts"],
4
+ "sourcesContent": [
5
+ "export function resolveUrl(...parts: string[]): string {\n parts = parts.filter((part: string): part is string => typeof part === 'string' && part.length > 0);\n\n if (parts.length === 0) {\n return '';\n }\n\n const leadingSlashes = /^\\/+/;\n const trailingSlashes = /\\/+$/;\n const multipleSlashes = /\\/{2,}/g;\n\n const prefix = parts[0].charAt(0) === '/' ? '/' : ''; // Add leading slash if the first part has it\n const lastPart = parts[parts.length - 1];\n const suffix = lastPart.charAt(lastPart.length - 1) === '/' ? '/' : ''; // Add trailing slash if the last part has it\n\n const url = (\n prefix +\n parts\n .map((part) => part.replace(leadingSlashes, '').replace(trailingSlashes, '')) // Remove leading and trailing slashes\n .filter((part) => part) // Remove empty parts\n .join('/')\n // Replace multiple slashes with a single slash, except for protocol\n .replace('://', '{{PROTOCOL_SLASH}}') +\n suffix\n )\n .replace(multipleSlashes, '/')\n .replace('{{PROTOCOL_SLASH}}', '://');\n\n return url;\n}\n"
6
+ ],
7
+ "mappings": ";AAAO,SAAS,CAAU,IAAI,EAAyB,CAGrD,GAFA,EAAQ,EAAM,OAAO,CAAC,IAAiC,OAAO,IAAS,UAAY,EAAK,OAAS,CAAC,EAE9F,EAAM,SAAW,EACnB,MAAO,GAGT,IAAM,EAAiB,OACjB,EAAkB,OAClB,EAAkB,UAElB,EAAS,EAAM,GAAG,OAAO,CAAC,IAAM,IAAM,IAAM,GAC5C,EAAW,EAAM,EAAM,OAAS,GAChC,EAAS,EAAS,OAAO,EAAS,OAAS,CAAC,IAAM,IAAM,IAAM,GAepE,OAZE,EACA,EACG,IAAI,CAAC,IAAS,EAAK,QAAQ,EAAgB,EAAE,EAAE,QAAQ,EAAiB,EAAE,CAAC,EAC3E,OAAO,CAAC,IAAS,CAAI,EACrB,KAAK,GAAG,EAER,QAAQ,MAAO,oBAAoB,EACtC,GAEC,QAAQ,EAAiB,GAAG,EAC5B,QAAQ,qBAAsB,KAAK",
8
+ "debugId": "F8D9286BBEEBEB9D64756E2164756E21",
9
+ "names": []
10
+ }
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@alwatr/resolve-url",
3
3
  "description": "A tiny TypeScript library to resolve URLs.",
4
- "version": "5.5.32",
4
+ "version": "6.0.0",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "bugs": "https://github.com/Alwatr/nanolib/issues",
7
7
  "devDependencies": {
8
- "@alwatr/nano-build": "6.4.2",
9
- "@alwatr/prettier-config": "6.0.2",
10
- "@alwatr/tsconfig-base": "6.0.4",
11
- "@alwatr/type-helper": "7.0.2",
8
+ "@alwatr/nano-build": "7.0.0",
9
+ "@alwatr/prettier-config": "7.0.0",
10
+ "@alwatr/tsconfig-base": "7.0.0",
11
+ "@alwatr/type-helper": "8.0.0",
12
12
  "typescript": "^5.9.3"
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
16
  "types": "./dist/main.d.ts",
17
- "import": "./dist/main.mjs",
18
- "require": "./dist/main.cjs"
17
+ "default": "./dist/main.js"
19
18
  }
20
19
  },
21
20
  "files": [
22
- "**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
21
+ "**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
22
+ "README.md",
23
23
  "LICENSE",
24
24
  "!demo/**/*",
25
25
  "!**/*.test.js"
@@ -43,8 +43,6 @@
43
43
  "utils"
44
44
  ],
45
45
  "license": "MPL-2.0",
46
- "main": "./dist/main.cjs",
47
- "module": "./dist/main.mjs",
48
46
  "prettier": "@alwatr/prettier-config",
49
47
  "publishConfig": {
50
48
  "access": "public"
@@ -57,14 +55,14 @@
57
55
  "scripts": {
58
56
  "b": "bun run build",
59
57
  "build": "bun run build:ts && bun run build:es",
60
- "build:es": "nano-build --preset=module",
58
+ "build:es": "nano-build --preset=module src/main.ts",
61
59
  "build:ts": "tsc --build",
62
60
  "c": "bun run clean",
63
61
  "cb": "bun run clean && bun run build",
64
62
  "clean": "rm -rfv dist *.tsbuildinfo",
65
- "d": "bun run build:es && bun --enable-source-maps --trace-warnings",
63
+ "d": "bun run build:es && bun",
66
64
  "t": "bun run test",
67
- "test": "echo test-skipped",
65
+ "test": "bun test",
68
66
  "w": "bun run watch",
69
67
  "watch": "bun run watch:ts & bun run watch:es",
70
68
  "watch:es": "bun run build:es --watch",
@@ -73,5 +71,5 @@
73
71
  "sideEffects": false,
74
72
  "type": "module",
75
73
  "types": "./dist/main.d.ts",
76
- "gitHead": "c3889e3756b0a0f9b935a1b702a1373ac52cb379"
74
+ "gitHead": "056102a1c8a563bbae8a290b6830450f467322a3"
77
75
  }
package/src/main.ts ADDED
@@ -0,0 +1,30 @@
1
+ export function resolveUrl(...parts: string[]): string {
2
+ parts = parts.filter((part: string): part is string => typeof part === 'string' && part.length > 0);
3
+
4
+ if (parts.length === 0) {
5
+ return '';
6
+ }
7
+
8
+ const leadingSlashes = /^\/+/;
9
+ const trailingSlashes = /\/+$/;
10
+ const multipleSlashes = /\/{2,}/g;
11
+
12
+ const prefix = parts[0].charAt(0) === '/' ? '/' : ''; // Add leading slash if the first part has it
13
+ const lastPart = parts[parts.length - 1];
14
+ const suffix = lastPart.charAt(lastPart.length - 1) === '/' ? '/' : ''; // Add trailing slash if the last part has it
15
+
16
+ const url = (
17
+ prefix +
18
+ parts
19
+ .map((part) => part.replace(leadingSlashes, '').replace(trailingSlashes, '')) // Remove leading and trailing slashes
20
+ .filter((part) => part) // Remove empty parts
21
+ .join('/')
22
+ // Replace multiple slashes with a single slash, except for protocol
23
+ .replace('://', '{{PROTOCOL_SLASH}}') +
24
+ suffix
25
+ )
26
+ .replace(multipleSlashes, '/')
27
+ .replace('{{PROTOCOL_SLASH}}', '://');
28
+
29
+ return url;
30
+ }
package/CHANGELOG.md DELETED
@@ -1,256 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [5.5.32](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.31...@alwatr/resolve-url@5.5.32) (2026-03-16)
7
-
8
- ### 🔨 Code Refactoring
9
-
10
- * migrate build scripts from yarn to bun across multiple packages ([d90e962](https://github.com/Alwatr/nanolib/commit/d90e962f15e5c951e191d5f02341279b6472abc3))
11
-
12
- ## [5.5.31](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.30...@alwatr/resolve-url@5.5.31) (2026-02-18)
13
-
14
- **Note:** Version bump only for package @alwatr/resolve-url
15
-
16
- ## [5.5.30](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.29...@alwatr/resolve-url@5.5.30) (2025-12-23)
17
-
18
- **Note:** Version bump only for package @alwatr/resolve-url
19
-
20
- ## [5.5.29](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.28...@alwatr/resolve-url@5.5.29) (2025-12-13)
21
-
22
- **Note:** Version bump only for package @alwatr/resolve-url
23
-
24
- ## [5.5.28](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.27...@alwatr/resolve-url@5.5.28) (2025-12-10)
25
-
26
- **Note:** Version bump only for package @alwatr/resolve-url
27
-
28
- ## [5.5.27](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.26...@alwatr/resolve-url@5.5.27) (2025-11-18)
29
-
30
- ### 🔨 Code Refactoring
31
-
32
- * remove unnecessary type declarations from tsconfig.json files ([89bcc7d](https://github.com/Alwatr/nanolib/commit/89bcc7db839807110b80f8ba34414ea9734d9c75))
33
-
34
- ## [5.5.26](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.25...@alwatr/resolve-url@5.5.26) (2025-11-15)
35
-
36
- **Note:** Version bump only for package @alwatr/resolve-url
37
-
38
- ## [5.5.25](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.24...@alwatr/resolve-url@5.5.25) (2025-11-15)
39
-
40
- **Note:** Version bump only for package @alwatr/resolve-url
41
-
42
- ## [5.5.24](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.23...@alwatr/resolve-url@5.5.24) (2025-11-12)
43
-
44
- ### 🐛 Bug Fixes
45
-
46
- * improve URL resolution by handling leading and trailing slashes correctly ([c7d4274](https://github.com/Alwatr/nanolib/commit/c7d4274d027240387011b21243ca2a832ed13d56))
47
-
48
- ## [5.5.23](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.22...@alwatr/resolve-url@5.5.23) (2025-11-04)
49
-
50
- **Note:** Version bump only for package @alwatr/resolve-url
51
-
52
- ## [5.5.22](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.21...@alwatr/resolve-url@5.5.22) (2025-10-06)
53
-
54
- ### 🔗 Dependencies update
55
-
56
- * bump the npm-dependencies group with 4 updates ([9825815](https://github.com/Alwatr/nanolib/commit/982581552bbb4b97dca52af5e93a80937f0c3109))
57
-
58
- ## [5.5.21](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.20...@alwatr/resolve-url@5.5.21) (2025-09-27)
59
-
60
- ### 🧹 Miscellaneous Chores
61
-
62
- * exclude test files from package distribution ([86f4f2f](https://github.com/Alwatr/nanolib/commit/86f4f2f5985845c5cf3a3a9398de7b2f98ce53e7))
63
-
64
- ## [5.5.20](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.19...@alwatr/resolve-url@5.5.20) (2025-09-22)
65
-
66
- **Note:** Version bump only for package @alwatr/resolve-url
67
-
68
- ## [5.5.19](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.18...@alwatr/resolve-url@5.5.19) (2025-09-22)
69
-
70
- **Note:** Version bump only for package @alwatr/resolve-url
71
-
72
- ## [5.5.18](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.17...@alwatr/resolve-url@5.5.18) (2025-09-21)
73
-
74
- **Note:** Version bump only for package @alwatr/resolve-url
75
-
76
- ## [5.5.17](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.16...@alwatr/resolve-url@5.5.17) (2025-09-20)
77
-
78
- ### 🐛 Bug Fixes
79
-
80
- * add sideEffects property to package.json files for better tree-shaking ([c7b9e74](https://github.com/Alwatr/nanolib/commit/c7b9e74e1920c8e35b438742de61883ca62da58c))
81
- * add sideEffects property to package.json files for better tree-shaking ([e8402c4](https://github.com/Alwatr/nanolib/commit/e8402c481a14a1f807a37aaa862a936713d26176))
82
-
83
- ### 🧹 Miscellaneous Chores
84
-
85
- * remove duplicate sideEffects property from multiple package.json files ([b123f86](https://github.com/Alwatr/nanolib/commit/b123f86be81481de2314aae9bb2eeb629743d24c))
86
-
87
- ## [5.5.16](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.15...@alwatr/resolve-url@5.5.16) (2025-09-19)
88
-
89
- **Note:** Version bump only for package @alwatr/resolve-url
90
-
91
- ## [5.5.15](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.14...@alwatr/resolve-url@5.5.15) (2025-09-15)
92
-
93
- **Note:** Version bump only for package @alwatr/resolve-url
94
-
95
- ## [5.5.14](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.13...@alwatr/resolve-url@5.5.14) (2025-09-13)
96
-
97
- **Note:** Version bump only for package @alwatr/resolve-url
98
-
99
- ## [5.5.13](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.12...@alwatr/resolve-url@5.5.13) (2025-09-13)
100
-
101
- ### 🧹 Miscellaneous Chores
102
-
103
- * remove package-tracer dependency and related code from fetch package ([96fe4e9](https://github.com/Alwatr/nanolib/commit/96fe4e9552a205f218ceed187c55e4e904a07089))
104
-
105
- ## [5.5.12](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.11...@alwatr/resolve-url@5.5.12) (2025-09-09)
106
-
107
- **Note:** Version bump only for package @alwatr/resolve-url
108
-
109
- ## [5.5.11](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.10...@alwatr/resolve-url@5.5.11) (2025-09-06)
110
-
111
- **Note:** Version bump only for package @alwatr/resolve-url
112
-
113
- ## [5.5.10](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.9...@alwatr/resolve-url@5.5.10) (2025-09-05)
114
-
115
- ### 🔗 Dependencies update
116
-
117
- * update jest to version 30.1.3 and @types/node to version 22.18.1 ([754212b](https://github.com/Alwatr/nanolib/commit/754212b1523cfc4cfe26c9e9f6d634aa8311e0b7))
118
-
119
- ## [5.5.9](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.8...@alwatr/resolve-url@5.5.9) (2025-09-01)
120
-
121
- ### 🔗 Dependencies update
122
-
123
- * update lerna-lite dependencies to version 4.7.3 and jest to 30.1.2 ([95d7870](https://github.com/Alwatr/nanolib/commit/95d7870ec7ad1e6ed2688bafddcabf46857f6981))
124
-
125
- ## [5.5.8](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.7...@alwatr/resolve-url@5.5.8) (2025-08-23)
126
-
127
- **Note:** Version bump only for package @alwatr/resolve-url
128
-
129
- ## [5.5.7](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.5...@alwatr/resolve-url@5.5.7) (2025-08-23)
130
-
131
- ### 🐛 Bug Fixes
132
-
133
- * update license from AGPL-3.0-only to MPL-2.0 ([d20968e](https://github.com/Alwatr/nanolib/commit/d20968e60cc89b1dcdf9b96507178da6ed562f55))
134
- * update package versions in multiple package.json files ([7638b1c](https://github.com/Alwatr/nanolib/commit/7638b1cafee2b4e0f97db7a89ac9fba6384b9b10))
135
-
136
- ### 🔨 Code Refactoring
137
-
138
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3))
139
-
140
- ### 🧹 Miscellaneous Chores
141
-
142
- * reformat all package.json files ([ceda45d](https://github.com/Alwatr/nanolib/commit/ceda45de186667790474f729cb4b161a5148ce19))
143
-
144
- ### 🔗 Dependencies update
145
-
146
- * update TypeScript and Jest versions across all packages to improve compatibility and performance ([31baf36](https://github.com/Alwatr/nanolib/commit/31baf366101e92e27db66a21c849fb101f19be47))
147
-
148
- ## [5.5.6](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.5...@alwatr/resolve-url@5.5.6) (2025-08-23)
149
-
150
- ### Code Refactoring
151
-
152
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3)) by @alimd
153
-
154
- ## [5.5.5](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.4...@alwatr/resolve-url@5.5.5) (2025-04-20)
155
-
156
- ### Bug Fixes
157
-
158
- * **resolve-url:** ensure only non-empty string parts are processed in resolveUrl function ([dcd4009](https://github.com/Alwatr/nanolib/commit/dcd400973ec42cbb81b20e8f3d37dbbee57ea498)) by @alimd
159
-
160
- ## <small>5.5.4 (2025-04-15)</small>
161
-
162
- **Note:** Version bump only for package @alwatr/resolve-url
163
-
164
- ## [5.5.3](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.2...@alwatr/resolve-url@5.5.3) (2025-04-01)
165
-
166
- **Note:** Version bump only for package @alwatr/resolve-url
167
-
168
- ## [5.5.2](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.1...@alwatr/resolve-url@5.5.2) (2025-03-18)
169
-
170
- **Note:** Version bump only for package @alwatr/resolve-url
171
-
172
- ## [5.5.1](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.0...@alwatr/resolve-url@5.5.1) (2025-03-13)
173
-
174
- ### Bug Fixes
175
-
176
- * **resolve-url:** Remove lookbehind regex for Safari/iOS compatibility ([42c4df7](https://github.com/Alwatr/nanolib/commit/42c4df7144f299e6e764e57c442903ca8ba2667b)) by @alimd
177
-
178
- ### Dependencies update
179
-
180
- * add jest version 29.7.0 to resolve-url package ([1f988a2](https://github.com/Alwatr/nanolib/commit/1f988a2382d978ca8f21c68548bb51d7a74d4a73)) by @alimd
181
-
182
- ## [5.5.0](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.4.0...@alwatr/resolve-url@5.5.0) (2025-03-06)
183
-
184
- ### Dependencies update
185
-
186
- * bump the development-dependencies group across 1 directory with 11 updates ([720c395](https://github.com/Alwatr/nanolib/commit/720c3954da55c929fe8fb16957121f4c51fb7f0c)) by @dependabot[bot]
187
-
188
- ## [5.4.0](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@1.0.2...@alwatr/resolve-url@5.4.0) (2025-02-18)
189
-
190
- ## 5.3.0 (2025-02-03)
191
-
192
- ### Miscellaneous Chores
193
-
194
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @
195
-
196
- ### Dependencies update
197
-
198
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @
199
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @
200
-
201
- ## 5.0.0 (2024-11-02)
202
-
203
- ### ⚠ BREAKING CHANGES
204
-
205
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
206
-
207
- ### Code Refactoring
208
-
209
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
210
-
211
- ## [5.3.0](https://github.com/Alwatr/nanolib/compare/v5.2.1...v5.3.0) (2025-02-03)
212
-
213
- ### Miscellaneous Chores
214
-
215
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @ArmanAsadian
216
-
217
- ### Dependencies update
218
-
219
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @dependabot[bot]
220
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @alimd
221
-
222
- ## 5.0.0 (2024-11-02)
223
-
224
- ### ⚠ BREAKING CHANGES
225
-
226
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
227
-
228
- ### Features
229
-
230
- * add `resolve-url` package ([a884212](https://github.com/Alwatr/nanolib/commit/a88421233d5cd84dd2fea34c370026b9a81cd887)) by @
231
-
232
- ### Bug Fixes
233
-
234
- * **resolve-url:** version & update `README` ([ea2513a](https://github.com/Alwatr/nanolib/commit/ea2513a374a7841cc8d7f9a4cafcba6efced0299)) by @
235
-
236
- ### Code Refactoring
237
-
238
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
239
-
240
- ## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@1.0.1...@alwatr/resolve-url@1.0.2) (2024-11-02)
241
-
242
- **Note:** Version bump only for package @alwatr/resolve-url
243
-
244
- ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@1.0.0...@alwatr/resolve-url@1.0.1) (2024-10-25)
245
-
246
- **Note:** Version bump only for package @alwatr/resolve-url
247
-
248
- ## 1.0.0 (2024-10-15)
249
-
250
- ### Features
251
-
252
- - add `resolve-url` package ([a884212](https://github.com/Alwatr/nanolib/commit/a88421233d5cd84dd2fea34c370026b9a81cd887)) by @mohammadhonarvar
253
-
254
- ### Bug Fixes
255
-
256
- - **resolve-url:** version & update `README` ([ea2513a](https://github.com/Alwatr/nanolib/commit/ea2513a374a7841cc8d7f9a4cafcba6efced0299)) by @mohammadhonarvar
package/dist/main.cjs DELETED
@@ -1,3 +0,0 @@
1
- /** 📦 @alwatr/resolve-url v5.5.32 */
2
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{resolveUrl:()=>resolveUrl});module.exports=__toCommonJS(main_exports);function resolveUrl(...parts){parts=parts.filter(part=>typeof part==="string"&&part.length>0);if(parts.length===0){return""}const leadingSlashes=/^\/+/;const trailingSlashes=/\/+$/;const multipleSlashes=/\/{2,}/g;const prefix=parts[0].charAt(0)==="/"?"/":"";const lastPart=parts[parts.length-1];const suffix=lastPart.charAt(lastPart.length-1)==="/"?"/":"";const url=(prefix+parts.map(part=>part.replace(leadingSlashes,"").replace(trailingSlashes,"")).filter(part=>part).join("/").replace("://","{{PROTOCOL_SLASH}}")+suffix).replace(multipleSlashes,"/").replace("{{PROTOCOL_SLASH}}","://");return url}0&&(module.exports={resolveUrl});
3
- //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["export function resolveUrl(...parts: string[]): string {\n parts = parts.filter((part: string): part is string => typeof part === 'string' && part.length > 0);\n\n if (parts.length === 0) {\n return '';\n }\n\n const leadingSlashes = /^\\/+/;\n const trailingSlashes = /\\/+$/;\n const multipleSlashes = /\\/{2,}/g;\n\n const prefix = parts[0].charAt(0) === '/' ? '/' : ''; // Add leading slash if the first part has it\n const lastPart = parts[parts.length - 1];\n const suffix = lastPart.charAt(lastPart.length - 1) === '/' ? '/' : ''; // Add trailing slash if the last part has it\n\n const url = (\n prefix +\n parts\n .map((part) => part.replace(leadingSlashes, '').replace(trailingSlashes, '')) // Remove leading and trailing slashes\n .filter((part) => part) // Remove empty parts\n .join('/')\n // Replace multiple slashes with a single slash, except for protocol\n .replace('://', '{{PROTOCOL_SLASH}}') +\n suffix\n )\n .replace(multipleSlashes, '/')\n .replace('{{PROTOCOL_SLASH}}', '://');\n\n return url;\n}\n"],
5
- "mappings": ";qqBAAA,iHAAO,SAAS,cAAc,MAAyB,CACrD,MAAQ,MAAM,OAAQ,MAAiC,OAAO,OAAS,UAAY,KAAK,OAAS,CAAC,EAElG,GAAI,MAAM,SAAW,EAAG,CACtB,MAAO,EACT,CAEA,MAAM,eAAiB,OACvB,MAAM,gBAAkB,OACxB,MAAM,gBAAkB,UAExB,MAAM,OAAS,MAAM,CAAC,EAAE,OAAO,CAAC,IAAM,IAAM,IAAM,GAClD,MAAM,SAAW,MAAM,MAAM,OAAS,CAAC,EACvC,MAAM,OAAS,SAAS,OAAO,SAAS,OAAS,CAAC,IAAM,IAAM,IAAM,GAEpE,MAAM,KACJ,OACA,MACG,IAAK,MAAS,KAAK,QAAQ,eAAgB,EAAE,EAAE,QAAQ,gBAAiB,EAAE,CAAC,EAC3E,OAAQ,MAAS,IAAI,EACrB,KAAK,GAAG,EAER,QAAQ,MAAO,oBAAoB,EACtC,QAEC,QAAQ,gBAAiB,GAAG,EAC5B,QAAQ,qBAAsB,KAAK,EAEtC,OAAO,GACT",
6
- "names": []
7
- }
package/dist/main.mjs DELETED
@@ -1,3 +0,0 @@
1
- /** 📦 @alwatr/resolve-url v5.5.32 */
2
- function resolveUrl(...parts){parts=parts.filter(part=>typeof part==="string"&&part.length>0);if(parts.length===0){return""}const leadingSlashes=/^\/+/;const trailingSlashes=/\/+$/;const multipleSlashes=/\/{2,}/g;const prefix=parts[0].charAt(0)==="/"?"/":"";const lastPart=parts[parts.length-1];const suffix=lastPart.charAt(lastPart.length-1)==="/"?"/":"";const url=(prefix+parts.map(part=>part.replace(leadingSlashes,"").replace(trailingSlashes,"")).filter(part=>part).join("/").replace("://","{{PROTOCOL_SLASH}}")+suffix).replace(multipleSlashes,"/").replace("{{PROTOCOL_SLASH}}","://");return url}export{resolveUrl};
3
- //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["export function resolveUrl(...parts: string[]): string {\n parts = parts.filter((part: string): part is string => typeof part === 'string' && part.length > 0);\n\n if (parts.length === 0) {\n return '';\n }\n\n const leadingSlashes = /^\\/+/;\n const trailingSlashes = /\\/+$/;\n const multipleSlashes = /\\/{2,}/g;\n\n const prefix = parts[0].charAt(0) === '/' ? '/' : ''; // Add leading slash if the first part has it\n const lastPart = parts[parts.length - 1];\n const suffix = lastPart.charAt(lastPart.length - 1) === '/' ? '/' : ''; // Add trailing slash if the last part has it\n\n const url = (\n prefix +\n parts\n .map((part) => part.replace(leadingSlashes, '').replace(trailingSlashes, '')) // Remove leading and trailing slashes\n .filter((part) => part) // Remove empty parts\n .join('/')\n // Replace multiple slashes with a single slash, except for protocol\n .replace('://', '{{PROTOCOL_SLASH}}') +\n suffix\n )\n .replace(multipleSlashes, '/')\n .replace('{{PROTOCOL_SLASH}}', '://');\n\n return url;\n}\n"],
5
- "mappings": ";AAAO,SAAS,cAAc,MAAyB,CACrD,MAAQ,MAAM,OAAQ,MAAiC,OAAO,OAAS,UAAY,KAAK,OAAS,CAAC,EAElG,GAAI,MAAM,SAAW,EAAG,CACtB,MAAO,EACT,CAEA,MAAM,eAAiB,OACvB,MAAM,gBAAkB,OACxB,MAAM,gBAAkB,UAExB,MAAM,OAAS,MAAM,CAAC,EAAE,OAAO,CAAC,IAAM,IAAM,IAAM,GAClD,MAAM,SAAW,MAAM,MAAM,OAAS,CAAC,EACvC,MAAM,OAAS,SAAS,OAAO,SAAS,OAAS,CAAC,IAAM,IAAM,IAAM,GAEpE,MAAM,KACJ,OACA,MACG,IAAK,MAAS,KAAK,QAAQ,eAAgB,EAAE,EAAE,QAAQ,gBAAiB,EAAE,CAAC,EAC3E,OAAQ,MAAS,IAAI,EACrB,KAAK,GAAG,EAER,QAAQ,MAAO,oBAAoB,EACtC,QAEC,QAAQ,gBAAiB,GAAG,EAC5B,QAAQ,qBAAsB,KAAK,EAEtC,OAAO,GACT",
6
- "names": []
7
- }