Skip to content

Releases: bharathidas/URLUtilities

URL Utilities

Choose a tag to compare

@bharathidas bharathidas released this 20 Aug 13:03
b8ea44a

URL Utilities — Studio Pro 10.24.17

Fixed

Two Normalize URL parameters were silently inert. URL Parse was unaffected.

forceHTTP did nothing. The option was passed as forceHTTP, but normalize-url reads forceHttp. The case did not match, so HTTPS URLs were never downgraded. Verified against the bundled library:

Option key https://example.com/a becomes
forceHTTP (as shipped) https://example.com/a — unchanged
forceHttp (fixed) http://example.com/a

keepQueryParameters did nothing. The library requires an array and guards with Array.isArray; the action built a string such as '[keep]', which failed the guard and was discarded, so no parameter was ever preserved by name. It now accepts a comma-separated list and passes a real array:

Value …/p?keep=1&drop=2 with removeQueryParameters on
'[keep]' (as shipped) https://example.com/p — everything dropped
['keep'] (fixed) https://example.com/p?keep=1

Leaving the parameter empty previously passed the literal string 'undefined'; it now passes nothing at all.

Usage: enter parameter names separated by commas — id,ref — and leave the field empty to keep all of them.

Both defects predate the 10.24.17 upgrade. Upgrading is recommended.

Notes

Studio Pro 10.24.17, imports with 0 errors. Import URLUtilities.mpk via App Explorer > Import module package.

URL Utilities

Choose a tag to compare

@bharathidas bharathidas released this 20 Aug 08:19
b8ea44a

URL Utilities — now supported on Mendix Studio Pro 10.24.17

Rebuilt from Studio Pro 9.24.18 to 10.24.17 (LTS). No functional changes — this release only updates Studio Pro compatibility.

Import URLUtilities.mpk via App Explorer > Import module package in Studio Pro 10.24.17 or higher.


URL Parse:

Parsing and working with URLs which allows you to take a URL string and break it down into its constituent parts (such as the protocol, hostname, pathname, query parameters, etc.), making it easy to access and manipulate specific components of the URL.

Normalize URL:
Standardizes the URL according to various rules, ensuring that the resulting URL is well-formed and consistent.

Dependencies:
• Mendix modeler 9.12.4.

Features

URL Parse:

  • protocol: The protocol scheme of the URL (e.g. http:).
  • slashes: A boolean which indicates whether the protocol is followed by two forward slashes (//).
  • auth: Authentication information portion (e.g. username:password).
  • username: Username of basic authentication.
  • password: Password of basic authentication.
  • host: Host name with port number. The hostname might be invalid.
  • hostname: Host name without port number. This might be an invalid hostname.
  • port: Optional port number.
  • pathname: URL path.
  • query: Parsed object containing query string, unless parsing is set to false.
  • hash: The "fragment" portion of the URL including the pound-sign (#).
  • href: The full URL.
  • origin: The origin of the URL.

Normalize URL:

  • defaultProtocol: 'https' | 'http'
  • normalizeProtocol: Prepend defaultProtocol to the URL if it's protocol-relative.
  • forceHTTP: Normalize HTTPS to HTTP.
  • forceHttps: Normalize HTTP to HTTPS.
  • stripAuthentication: Strip the authentication part of the URL.
  • stripHash: Strip the hash part of the URL.
  • stripProtocol: Remove the protocol from the URL.
  • stripTextFragment: Strip the text fragment part of the URL.
  • stripWWW: Remove www. from the URL.
  • removeQueryParameters: If a boolean is provided, true will remove all the query parameters.
  • keepQueryParameters: Keeps only query parameters that matches any of the provided strings or regexes.
  • removeTrailingSlash: Remove trailing slash.
  • removeSingleSlash: Remove a sole / pathname in the output. This option is independent of removeTrailingSlash.
  • removeDirectoryIndex: Removes the default directory index file from path. When true, the regex /^index.[a-z]+$/ is used.
  • removeExplicitPort: Removes an explicit port number from the URL.
    Port 443 is always removed from HTTPS URLs and 80 is always removed from HTTP URLs regardless of this option.
  • sortQueryParameters: Sorts the query parameters alphabetically by key.

Issues, suggestions and feature requests
https://github.com/bharathidas/URLUtilities/issues

Screenshot_1

Screenshot_2

Screenshot_3

URL Utilities

Choose a tag to compare

@bharathidas bharathidas released this 21 May 10:22
b8ea44a

URL Parse:

Parsing and working with URLs which allows you to take a URL string and break it down into its constituent parts (such as the protocol, hostname, pathname, query parameters, etc.), making it easy to access and manipulate specific components of the URL.

Normalize URL:
Standardizes the URL according to various rules, ensuring that the resulting URL is well-formed and consistent.

Dependencies:
• Mendix modeler 9.12.4.

Features

URL Parse:

  • protocol: The protocol scheme of the URL (e.g. http:).
  • slashes: A boolean which indicates whether the protocol is followed by two forward slashes (//).
  • auth: Authentication information portion (e.g. username:password).
  • username: Username of basic authentication.
  • password: Password of basic authentication.
  • host: Host name with port number. The hostname might be invalid.
  • hostname: Host name without port number. This might be an invalid hostname.
  • port: Optional port number.
  • pathname: URL path.
  • query: Parsed object containing query string, unless parsing is set to false.
  • hash: The "fragment" portion of the URL including the pound-sign (#).
  • href: The full URL.
  • origin: The origin of the URL.

Normalize URL:

  • defaultProtocol: 'https' | 'http'
  • normalizeProtocol: Prepend defaultProtocol to the URL if it's protocol-relative.
  • forceHTTP: Normalize HTTPS to HTTP.
  • forceHttps: Normalize HTTP to HTTPS.
  • stripAuthentication: Strip the authentication part of the URL.
  • stripHash: Strip the hash part of the URL.
  • stripProtocol: Remove the protocol from the URL.
  • stripTextFragment: Strip the text fragment part of the URL.
  • stripWWW: Remove www. from the URL.
  • removeQueryParameters: If a boolean is provided, true will remove all the query parameters.
  • keepQueryParameters: Keeps only query parameters that matches any of the provided strings or regexes.
  • removeTrailingSlash: Remove trailing slash.
  • removeSingleSlash: Remove a sole / pathname in the output. This option is independent of removeTrailingSlash.
  • removeDirectoryIndex: Removes the default directory index file from path. When true, the regex /^index.[a-z]+$/ is used.
  • removeExplicitPort: Removes an explicit port number from the URL.
    Port 443 is always removed from HTTPS URLs and 80 is always removed from HTTP URLs regardless of this option.
  • sortQueryParameters: Sorts the query parameters alphabetically by key.

Issues, suggestions and feature requests
https://github.com/bharathidas/URLUtilities/issues

Screenshot_1

Screenshot_2

Screenshot_3

URL Utilities

Choose a tag to compare

@bharathidas bharathidas released this 21 Sep 11:59
b8ea44a

URL Parse:

Parsing and working with URLs which allows you to take a URL string and break it down into its constituent parts (such as the protocol, hostname, pathname, query parameters, etc.), making it easy to access and manipulate specific components of the URL.

Normalize URL:
Standardizes the URL according to various rules, ensuring that the resulting URL is well-formed and consistent.

Dependencies:
• Mendix modeler 9.12.4.

Features

URL Parse:

  • protocol: The protocol scheme of the URL (e.g. http:).
  • slashes: A boolean which indicates whether the protocol is followed by two forward slashes (//).
  • auth: Authentication information portion (e.g. username:password).
  • username: Username of basic authentication.
  • password: Password of basic authentication.
  • host: Host name with port number. The hostname might be invalid.
  • hostname: Host name without port number. This might be an invalid hostname.
  • port: Optional port number.
  • pathname: URL path.
  • query: Parsed object containing query string, unless parsing is set to false.
  • hash: The "fragment" portion of the URL including the pound-sign (#).
  • href: The full URL.
  • origin: The origin of the URL.

Normalize URL:

  • defaultProtocol: 'https' | 'http'
  • normalizeProtocol: Prepend defaultProtocol to the URL if it's protocol-relative.
  • forceHTTP: Normalize HTTPS to HTTP.
  • forceHttps: Normalize HTTP to HTTPS.
  • stripAuthentication: Strip the authentication part of the URL.
  • stripHash: Strip the hash part of the URL.
  • stripProtocol: Remove the protocol from the URL.
  • stripTextFragment: Strip the text fragment part of the URL.
  • stripWWW: Remove www. from the URL.
  • removeQueryParameters: If a boolean is provided, true will remove all the query parameters.
  • keepQueryParameters: Keeps only query parameters that matches any of the provided strings or regexes.
  • removeTrailingSlash: Remove trailing slash.
  • removeSingleSlash: Remove a sole / pathname in the output. This option is independent of removeTrailingSlash.
  • removeDirectoryIndex: Removes the default directory index file from path. When true, the regex /^index.[a-z]+$/ is used.
  • removeExplicitPort: Removes an explicit port number from the URL.
    Port 443 is always removed from HTTPS URLs and 80 is always removed from HTTP URLs regardless of this option.
  • sortQueryParameters: Sorts the query parameters alphabetically by key.

Issues, suggestions and feature requests
https://github.com/bharathidas/URLUtilities/issues

Screenshot_1

Screenshot_2

Screenshot_3