@alwatr/resolve-url 5.5.23 → 5.5.25

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/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.5.25](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.24...@alwatr/resolve-url@5.5.25) (2025-11-15)
7
+
8
+ **Note:** Version bump only for package @alwatr/resolve-url
9
+
10
+ ## [5.5.24](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.23...@alwatr/resolve-url@5.5.24) (2025-11-12)
11
+
12
+ ### 🐛 Bug Fixes
13
+
14
+ * improve URL resolution by handling leading and trailing slashes correctly ([c7d4274](https://github.com/Alwatr/nanolib/commit/c7d4274d027240387011b21243ca2a832ed13d56))
15
+
6
16
  ## [5.5.23](https://github.com/Alwatr/nanolib/compare/@alwatr/resolve-url@5.5.22...@alwatr/resolve-url@5.5.23) (2025-11-04)
7
17
 
8
18
  **Note:** Version bump only for package @alwatr/resolve-url
package/dist/main.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /** 📦 @alwatr/resolve-url v5.5.23 */
2
- __dev_mode__: console.debug("📦 @alwatr/resolve-url v5.5.23");
3
- "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].indexOf("/")===0?"/":"";return prefix+parts.map(part=>part.replace(leadingSlashes,"").replace(trailingSlashes,"")).filter(part=>part).join("/").replace("://","{{PROTOCOL_SLASH}}").replace(multipleSlashes,"/").replace("{{PROTOCOL_SLASH}}","://")}0&&(module.exports={resolveUrl});
1
+ /** 📦 @alwatr/resolve-url v5.5.25 */
2
+ __dev_mode__: console.debug("📦 @alwatr/resolve-url v5.5.25");
3
+ "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});
4
4
  //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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].indexOf('/') === 0 ? '/' : ''; // Add leading slash if the first part has it\n\n return (\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 .replace(multipleSlashes, '/')\n .replace('{{PROTOCOL_SLASH}}', '://')\n );\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,QAAQ,GAAG,IAAM,EAAI,IAAM,GAEnD,OACE,OACA,MACG,IAAK,MAAS,KAAK,QAAQ,eAAgB,EAAE,EAAE,QAAQ,gBAAiB,EAAE,CAAC,EAC3E,OAAQ,MAAS,IAAI,EACrB,KAAK,GAAG,EAER,QAAQ,MAAO,oBAAoB,EACnC,QAAQ,gBAAiB,GAAG,EAC5B,QAAQ,qBAAsB,KAAK,CAE1C",
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
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAwBrD"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CA6BrD"}
package/dist/main.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /** 📦 @alwatr/resolve-url v5.5.23 */
2
- __dev_mode__: console.debug("📦 @alwatr/resolve-url v5.5.23");
3
- 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].indexOf("/")===0?"/":"";return prefix+parts.map(part=>part.replace(leadingSlashes,"").replace(trailingSlashes,"")).filter(part=>part).join("/").replace("://","{{PROTOCOL_SLASH}}").replace(multipleSlashes,"/").replace("{{PROTOCOL_SLASH}}","://")}export{resolveUrl};
1
+ /** 📦 @alwatr/resolve-url v5.5.25 */
2
+ __dev_mode__: console.debug("📦 @alwatr/resolve-url v5.5.25");
3
+ 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};
4
4
  //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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].indexOf('/') === 0 ? '/' : ''; // Add leading slash if the first part has it\n\n return (\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 .replace(multipleSlashes, '/')\n .replace('{{PROTOCOL_SLASH}}', '://')\n );\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,QAAQ,GAAG,IAAM,EAAI,IAAM,GAEnD,OACE,OACA,MACG,IAAK,MAAS,KAAK,QAAQ,eAAgB,EAAE,EAAE,QAAQ,gBAAiB,EAAE,CAAC,EAC3E,OAAQ,MAAS,IAAI,EACrB,KAAK,GAAG,EAER,QAAQ,MAAO,oBAAoB,EACnC,QAAQ,gBAAiB,GAAG,EAC5B,QAAQ,qBAAsB,KAAK,CAE1C",
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
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@alwatr/resolve-url",
3
3
  "description": "A tiny TypeScript library to resolve URLs.",
4
- "version": "5.5.23",
4
+ "version": "5.5.25",
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.3.6",
8
+ "@alwatr/nano-build": "6.3.7",
9
9
  "@alwatr/prettier-config": "5.0.5",
10
10
  "@alwatr/tsconfig-base": "6.0.3",
11
- "@alwatr/type-helper": "6.1.5",
11
+ "@alwatr/type-helper": "6.1.6",
12
+ "@jest/globals": "^30.2.0",
12
13
  "jest": "^30.2.0",
13
14
  "typescript": "^5.9.3"
14
15
  },
@@ -74,5 +75,5 @@
74
75
  "sideEffects": false,
75
76
  "type": "module",
76
77
  "types": "./dist/main.d.ts",
77
- "gitHead": "d6abdbdc75d4a2c5e0b3f739c7c3de4193308031"
78
+ "gitHead": "b41774f9b72639235fbbe9d48beb6a1ed612a86c"
78
79
  }