@alwatr/resolve-url 5.5.33 → 6.0.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.
package/dist/main.js ADDED
@@ -0,0 +1,5 @@
1
+ /* 📦 @alwatr/resolve-url v6.0.1 */
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=559AA80B155F4BDC64756E2164756E21
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": "559AA80B155F4BDC64756E2164756E21",
9
+ "names": []
10
+ }
package/package.json CHANGED
@@ -1,30 +1,57 @@
1
1
  {
2
2
  "name": "@alwatr/resolve-url",
3
+ "version": "6.0.1",
3
4
  "description": "A tiny TypeScript library to resolve URLs.",
4
- "version": "5.5.33",
5
+ "license": "MPL-2.0",
5
6
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
- "bugs": "https://github.com/Alwatr/nanolib/issues",
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",
12
- "typescript": "^5.9.3"
7
+ "type": "module",
8
+ "repository": {
9
+ "directory": "packages/resolve-url",
10
+ "type": "git",
11
+ "url": "https://github.com/Alwatr/nanolib"
13
12
  },
13
+ "homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/resolve-url#readme",
14
+ "bugs": "https://github.com/Alwatr/nanolib/issues",
14
15
  "exports": {
15
16
  ".": {
16
17
  "types": "./dist/main.d.ts",
17
- "import": "./dist/main.mjs",
18
- "require": "./dist/main.cjs"
18
+ "default": "./dist/main.js"
19
19
  }
20
20
  },
21
+ "sideEffects": false,
22
+ "devDependencies": {
23
+ "@alwatr/nano-build": "7.0.1",
24
+ "@alwatr/prettier-config": "7.0.1",
25
+ "@alwatr/tsconfig-base": "8.0.0",
26
+ "@alwatr/type-helper": "8.0.1",
27
+ "typescript": "^5.9.3"
28
+ },
29
+ "scripts": {
30
+ "b": "bun run build",
31
+ "build": "bun run build:ts && bun run build:es",
32
+ "build:es": "nano-build --preset=module src/main.ts",
33
+ "build:ts": "tsc --build",
34
+ "c": "bun run clean",
35
+ "cb": "bun run clean && bun run build",
36
+ "clean": "rm -rfv dist *.tsbuildinfo",
37
+ "d": "bun run build:es && bun",
38
+ "t": "bun run test",
39
+ "test": "bun test",
40
+ "w": "bun run watch",
41
+ "watch": "bun run watch:ts & bun run watch:es",
42
+ "watch:es": "bun run build:es --watch",
43
+ "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
44
+ },
21
45
  "files": [
22
- "**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
46
+ "**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
47
+ "README.md",
23
48
  "LICENSE",
24
49
  "!demo/**/*",
25
50
  "!**/*.test.js"
26
51
  ],
27
- "homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/resolve-url#readme",
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
28
55
  "keywords": [
29
56
  "alwatr",
30
57
  "browser",
@@ -42,36 +69,6 @@
42
69
  "utility",
43
70
  "utils"
44
71
  ],
45
- "license": "MPL-2.0",
46
- "main": "./dist/main.cjs",
47
- "module": "./dist/main.mjs",
48
72
  "prettier": "@alwatr/prettier-config",
49
- "publishConfig": {
50
- "access": "public"
51
- },
52
- "repository": {
53
- "type": "git",
54
- "url": "https://github.com/Alwatr/nanolib",
55
- "directory": "packages/resolve-url"
56
- },
57
- "scripts": {
58
- "b": "bun run build",
59
- "build": "bun run build:ts && bun run build:es",
60
- "build:es": "nano-build --preset=module",
61
- "build:ts": "tsc --build",
62
- "c": "bun run clean",
63
- "cb": "bun run clean && bun run build",
64
- "clean": "rm -rfv dist *.tsbuildinfo",
65
- "d": "bun run build:es && bun --enable-source-maps --trace-warnings",
66
- "t": "bun run test",
67
- "test": "bun test",
68
- "w": "bun run watch",
69
- "watch": "bun run watch:ts & bun run watch:es",
70
- "watch:es": "bun run build:es --watch",
71
- "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
72
- },
73
- "sideEffects": false,
74
- "type": "module",
75
- "types": "./dist/main.d.ts",
76
- "gitHead": "def1decf8f496f4b0d3d3ab952c346c689c30160"
73
+ "gitHead": "f843742e94d6ebed3921d57b624d9deb35c2c102"
77
74
  }
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,260 +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.33](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.32...@alwatr/resolve-url@5.5.33) (2026-03-18)
7
-
8
- **Note:** Version bump only for package @alwatr/resolve-url
9
-
10
- ## [5.5.32](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.31...@alwatr/resolve-url@5.5.32) (2026-03-16)
11
-
12
- ### 🔨 Code Refactoring
13
-
14
- * migrate build scripts from yarn to bun across multiple packages ([d90e962](https://github.com/Alwatr/nanolib/commit/d90e962f15e5c951e191d5f02341279b6472abc3))
15
-
16
- ## [5.5.31](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.30...@alwatr/resolve-url@5.5.31) (2026-02-18)
17
-
18
- **Note:** Version bump only for package @alwatr/resolve-url
19
-
20
- ## [5.5.30](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.29...@alwatr/resolve-url@5.5.30) (2025-12-23)
21
-
22
- **Note:** Version bump only for package @alwatr/resolve-url
23
-
24
- ## [5.5.29](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.28...@alwatr/resolve-url@5.5.29) (2025-12-13)
25
-
26
- **Note:** Version bump only for package @alwatr/resolve-url
27
-
28
- ## [5.5.28](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.27...@alwatr/resolve-url@5.5.28) (2025-12-10)
29
-
30
- **Note:** Version bump only for package @alwatr/resolve-url
31
-
32
- ## [5.5.27](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.26...@alwatr/resolve-url@5.5.27) (2025-11-18)
33
-
34
- ### 🔨 Code Refactoring
35
-
36
- * remove unnecessary type declarations from tsconfig.json files ([89bcc7d](https://github.com/Alwatr/nanolib/commit/89bcc7db839807110b80f8ba34414ea9734d9c75))
37
-
38
- ## [5.5.26](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.25...@alwatr/resolve-url@5.5.26) (2025-11-15)
39
-
40
- **Note:** Version bump only for package @alwatr/resolve-url
41
-
42
- ## [5.5.25](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.24...@alwatr/resolve-url@5.5.25) (2025-11-15)
43
-
44
- **Note:** Version bump only for package @alwatr/resolve-url
45
-
46
- ## [5.5.24](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.23...@alwatr/resolve-url@5.5.24) (2025-11-12)
47
-
48
- ### 🐛 Bug Fixes
49
-
50
- * improve URL resolution by handling leading and trailing slashes correctly ([c7d4274](https://github.com/Alwatr/nanolib/commit/c7d4274d027240387011b21243ca2a832ed13d56))
51
-
52
- ## [5.5.23](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.22...@alwatr/resolve-url@5.5.23) (2025-11-04)
53
-
54
- **Note:** Version bump only for package @alwatr/resolve-url
55
-
56
- ## [5.5.22](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.21...@alwatr/resolve-url@5.5.22) (2025-10-06)
57
-
58
- ### 🔗 Dependencies update
59
-
60
- * bump the npm-dependencies group with 4 updates ([9825815](https://github.com/Alwatr/nanolib/commit/982581552bbb4b97dca52af5e93a80937f0c3109))
61
-
62
- ## [5.5.21](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.20...@alwatr/resolve-url@5.5.21) (2025-09-27)
63
-
64
- ### 🧹 Miscellaneous Chores
65
-
66
- * exclude test files from package distribution ([86f4f2f](https://github.com/Alwatr/nanolib/commit/86f4f2f5985845c5cf3a3a9398de7b2f98ce53e7))
67
-
68
- ## [5.5.20](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.19...@alwatr/resolve-url@5.5.20) (2025-09-22)
69
-
70
- **Note:** Version bump only for package @alwatr/resolve-url
71
-
72
- ## [5.5.19](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.18...@alwatr/resolve-url@5.5.19) (2025-09-22)
73
-
74
- **Note:** Version bump only for package @alwatr/resolve-url
75
-
76
- ## [5.5.18](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.17...@alwatr/resolve-url@5.5.18) (2025-09-21)
77
-
78
- **Note:** Version bump only for package @alwatr/resolve-url
79
-
80
- ## [5.5.17](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.16...@alwatr/resolve-url@5.5.17) (2025-09-20)
81
-
82
- ### 🐛 Bug Fixes
83
-
84
- * add sideEffects property to package.json files for better tree-shaking ([c7b9e74](https://github.com/Alwatr/nanolib/commit/c7b9e74e1920c8e35b438742de61883ca62da58c))
85
- * add sideEffects property to package.json files for better tree-shaking ([e8402c4](https://github.com/Alwatr/nanolib/commit/e8402c481a14a1f807a37aaa862a936713d26176))
86
-
87
- ### 🧹 Miscellaneous Chores
88
-
89
- * remove duplicate sideEffects property from multiple package.json files ([b123f86](https://github.com/Alwatr/nanolib/commit/b123f86be81481de2314aae9bb2eeb629743d24c))
90
-
91
- ## [5.5.16](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.15...@alwatr/resolve-url@5.5.16) (2025-09-19)
92
-
93
- **Note:** Version bump only for package @alwatr/resolve-url
94
-
95
- ## [5.5.15](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.14...@alwatr/resolve-url@5.5.15) (2025-09-15)
96
-
97
- **Note:** Version bump only for package @alwatr/resolve-url
98
-
99
- ## [5.5.14](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.13...@alwatr/resolve-url@5.5.14) (2025-09-13)
100
-
101
- **Note:** Version bump only for package @alwatr/resolve-url
102
-
103
- ## [5.5.13](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.12...@alwatr/resolve-url@5.5.13) (2025-09-13)
104
-
105
- ### 🧹 Miscellaneous Chores
106
-
107
- * remove package-tracer dependency and related code from fetch package ([96fe4e9](https://github.com/Alwatr/nanolib/commit/96fe4e9552a205f218ceed187c55e4e904a07089))
108
-
109
- ## [5.5.12](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.11...@alwatr/resolve-url@5.5.12) (2025-09-09)
110
-
111
- **Note:** Version bump only for package @alwatr/resolve-url
112
-
113
- ## [5.5.11](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.10...@alwatr/resolve-url@5.5.11) (2025-09-06)
114
-
115
- **Note:** Version bump only for package @alwatr/resolve-url
116
-
117
- ## [5.5.10](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.9...@alwatr/resolve-url@5.5.10) (2025-09-05)
118
-
119
- ### 🔗 Dependencies update
120
-
121
- * update jest to version 30.1.3 and @types/node to version 22.18.1 ([754212b](https://github.com/Alwatr/nanolib/commit/754212b1523cfc4cfe26c9e9f6d634aa8311e0b7))
122
-
123
- ## [5.5.9](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.8...@alwatr/resolve-url@5.5.9) (2025-09-01)
124
-
125
- ### 🔗 Dependencies update
126
-
127
- * update lerna-lite dependencies to version 4.7.3 and jest to 30.1.2 ([95d7870](https://github.com/Alwatr/nanolib/commit/95d7870ec7ad1e6ed2688bafddcabf46857f6981))
128
-
129
- ## [5.5.8](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.7...@alwatr/resolve-url@5.5.8) (2025-08-23)
130
-
131
- **Note:** Version bump only for package @alwatr/resolve-url
132
-
133
- ## [5.5.7](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.5...@alwatr/resolve-url@5.5.7) (2025-08-23)
134
-
135
- ### 🐛 Bug Fixes
136
-
137
- * update license from AGPL-3.0-only to MPL-2.0 ([d20968e](https://github.com/Alwatr/nanolib/commit/d20968e60cc89b1dcdf9b96507178da6ed562f55))
138
- * update package versions in multiple package.json files ([7638b1c](https://github.com/Alwatr/nanolib/commit/7638b1cafee2b4e0f97db7a89ac9fba6384b9b10))
139
-
140
- ### 🔨 Code Refactoring
141
-
142
- * 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))
143
-
144
- ### 🧹 Miscellaneous Chores
145
-
146
- * reformat all package.json files ([ceda45d](https://github.com/Alwatr/nanolib/commit/ceda45de186667790474f729cb4b161a5148ce19))
147
-
148
- ### 🔗 Dependencies update
149
-
150
- * update TypeScript and Jest versions across all packages to improve compatibility and performance ([31baf36](https://github.com/Alwatr/nanolib/commit/31baf366101e92e27db66a21c849fb101f19be47))
151
-
152
- ## [5.5.6](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.5...@alwatr/resolve-url@5.5.6) (2025-08-23)
153
-
154
- ### Code Refactoring
155
-
156
- * 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
157
-
158
- ## [5.5.5](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.4...@alwatr/resolve-url@5.5.5) (2025-04-20)
159
-
160
- ### Bug Fixes
161
-
162
- * **resolve-url:** ensure only non-empty string parts are processed in resolveUrl function ([dcd4009](https://github.com/Alwatr/nanolib/commit/dcd400973ec42cbb81b20e8f3d37dbbee57ea498)) by @alimd
163
-
164
- ## <small>5.5.4 (2025-04-15)</small>
165
-
166
- **Note:** Version bump only for package @alwatr/resolve-url
167
-
168
- ## [5.5.3](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.2...@alwatr/resolve-url@5.5.3) (2025-04-01)
169
-
170
- **Note:** Version bump only for package @alwatr/resolve-url
171
-
172
- ## [5.5.2](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.1...@alwatr/resolve-url@5.5.2) (2025-03-18)
173
-
174
- **Note:** Version bump only for package @alwatr/resolve-url
175
-
176
- ## [5.5.1](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.0...@alwatr/resolve-url@5.5.1) (2025-03-13)
177
-
178
- ### Bug Fixes
179
-
180
- * **resolve-url:** Remove lookbehind regex for Safari/iOS compatibility ([42c4df7](https://github.com/Alwatr/nanolib/commit/42c4df7144f299e6e764e57c442903ca8ba2667b)) by @alimd
181
-
182
- ### Dependencies update
183
-
184
- * add jest version 29.7.0 to resolve-url package ([1f988a2](https://github.com/Alwatr/nanolib/commit/1f988a2382d978ca8f21c68548bb51d7a74d4a73)) by @alimd
185
-
186
- ## [5.5.0](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.4.0...@alwatr/resolve-url@5.5.0) (2025-03-06)
187
-
188
- ### Dependencies update
189
-
190
- * bump the development-dependencies group across 1 directory with 11 updates ([720c395](https://github.com/Alwatr/nanolib/commit/720c3954da55c929fe8fb16957121f4c51fb7f0c)) by @dependabot[bot]
191
-
192
- ## [5.4.0](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@1.0.2...@alwatr/resolve-url@5.4.0) (2025-02-18)
193
-
194
- ## 5.3.0 (2025-02-03)
195
-
196
- ### Miscellaneous Chores
197
-
198
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @
199
-
200
- ### Dependencies update
201
-
202
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @
203
- * 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 @
204
-
205
- ## 5.0.0 (2024-11-02)
206
-
207
- ### ⚠ BREAKING CHANGES
208
-
209
- * 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.
210
-
211
- ### Code Refactoring
212
-
213
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
214
-
215
- ## [5.3.0](https://github.com/Alwatr/nanolib/compare/v5.2.1...v5.3.0) (2025-02-03)
216
-
217
- ### Miscellaneous Chores
218
-
219
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @ArmanAsadian
220
-
221
- ### Dependencies update
222
-
223
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @dependabot[bot]
224
- * 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
225
-
226
- ## 5.0.0 (2024-11-02)
227
-
228
- ### ⚠ BREAKING CHANGES
229
-
230
- * 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.
231
-
232
- ### Features
233
-
234
- * add `resolve-url` package ([a884212](https://github.com/Alwatr/nanolib/commit/a88421233d5cd84dd2fea34c370026b9a81cd887)) by @
235
-
236
- ### Bug Fixes
237
-
238
- * **resolve-url:** version & update `README` ([ea2513a](https://github.com/Alwatr/nanolib/commit/ea2513a374a7841cc8d7f9a4cafcba6efced0299)) by @
239
-
240
- ### Code Refactoring
241
-
242
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
243
-
244
- ## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@1.0.1...@alwatr/resolve-url@1.0.2) (2024-11-02)
245
-
246
- **Note:** Version bump only for package @alwatr/resolve-url
247
-
248
- ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@1.0.0...@alwatr/resolve-url@1.0.1) (2024-10-25)
249
-
250
- **Note:** Version bump only for package @alwatr/resolve-url
251
-
252
- ## 1.0.0 (2024-10-15)
253
-
254
- ### Features
255
-
256
- - add `resolve-url` package ([a884212](https://github.com/Alwatr/nanolib/commit/a88421233d5cd84dd2fea34c370026b9a81cd887)) by @mohammadhonarvar
257
-
258
- ### Bug Fixes
259
-
260
- - **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.33 */
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.33 */
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
- }