@vbarbarosh/node-helpers 3.77.0 → 3.78.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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.js +1 -1
  3. package/dist/index.html +8 -16
  4. package/package.json +5 -5
  5. package/src/crypto_decrypt_aes256.js +43 -7
  6. package/src/crypto_decrypt_aes256.md +15 -10
  7. package/src/crypto_encrypt_aes256.js +23 -9
  8. package/src/crypto_encrypt_aes256.md +20 -10
  9. package/src/escape_content_disposition.js +8 -2
  10. package/src/escape_content_disposition.md +10 -2
  11. package/src/escape_content_disposition_utf8.js +11 -0
  12. package/src/escape_content_disposition_utf8.md +11 -0
  13. package/src/fastdl.js +7 -1
  14. package/src/fastdl.md +5 -0
  15. package/src/format_date_fs.js +8 -0
  16. package/src/format_error_report.js +102 -4
  17. package/src/format_error_report.md +47 -0
  18. package/src/http_get_stream_range.js +5 -1
  19. package/src/http_get_stream_range.md +2 -1
  20. package/src/http_stream_range.js +14 -1
  21. package/src/http_stream_range.md +3 -1
  22. package/src/make_progress.js +16 -9
  23. package/src/make_progress.md +7 -4
  24. package/src/pgid_exists.js +5 -0
  25. package/src/pgid_exists.md +4 -0
  26. package/src/pgid_kill_grace.js +5 -0
  27. package/src/pgid_kill_grace.md +3 -0
  28. package/src/pid_exists.js +5 -0
  29. package/src/pid_exists.md +4 -0
  30. package/src/pid_kill_grace.js +5 -0
  31. package/src/pid_kill_grace.md +3 -0
  32. package/src/redis_poll_zshift_callback_rpush.js +4 -0
  33. package/src/redis_poll_zshift_callback_rpush.md +4 -3
  34. package/src/redis_poll_zshift_spawn_rpush.js +4 -0
  35. package/src/redis_poll_zshift_spawn_rpush.md +4 -3
  36. package/src/shell.js +1 -1
  37. package/src/shell.md +2 -1
  38. package/src/shell_json.js +1 -1
  39. package/src/shell_json.md +2 -1
  40. package/src/stream_strpbrk.js +9 -1
  41. package/src/stream_xml_analyze.js +6 -1
  42. package/src/stream_xml_parse.js +11 -3
  43. package/src/urlmod.md +3 -1
  44. package/src/urlparts.js +111 -15
  45. package/src/urlparts.md +44 -12
package/src/urlparts.md CHANGED
@@ -1,17 +1,49 @@
1
- Splits a URL into a fixed-shape plain object. Accepts a `URL` instance or a
2
- string; strings are parsed against the base `fake://fake/`, so relative paths
3
- work (and non-string input degrades to the bare base instead of throwing).
4
- The keys mirror the `URL` properties, except `pathname` is exposed as `path`.
1
+ Parses an absolute or relative URL-like string into a stable object shape.
2
+ Missing scalar components are `null`. `search` and `hash` preserve their
3
+ delimiters, while `query` and `fragment` are always parsed plain objects.
4
+
5
+ Malformed URL text is accepted and parsed on a best-effort basis. A non-string
6
+ argument returns the empty stable shape instead of throwing.
7
+
8
+ **Warning:** `host` (like every other component) is a tolerant best-effort
9
+ value intended for display and lenient parsing. It is not guaranteed to match
10
+ the host a WHATWG client (browsers, Node's `URL`, Axios) would connect to for
11
+ malformed input, so it must not be used for allow-lists, redirect-target
12
+ validation, or SSRF decisions. Use `new URL(input)` for security checks.
5
13
 
6
14
  ```js
7
- urlparts('https://john:secret@example.com:8080/users/15?page=2#top')
15
+ urlparts('/users?a=1#top')
16
+ // {
17
+ // protocol: null,
18
+ // username: null,
19
+ // password: null,
20
+ // host: null,
21
+ // port: null,
22
+ // path: '/users',
23
+ // search: '?a=1',
24
+ // hash: '#top',
25
+ // query: {a: '1'},
26
+ // fragment: {top: ''},
27
+ // }
28
+
29
+ urlparts('https://john:secret@example.com:8080/users?page=2')
8
30
  // {
9
- // href: 'https://john:secret@example.com:8080/users/15?page=2#top',
10
- // protocol: 'https:', hostname: 'example.com',
11
- // username: 'john', password: 'secret',
12
- // host: 'example.com:8080', port: '8080',
13
- // path: '/users/15', search: '?page=2', hash: '#top',
31
+ // protocol: 'https',
32
+ // username: 'john',
33
+ // password: 'secret',
34
+ // host: 'example.com',
35
+ // port: '8080',
36
+ // path: '/users',
37
+ // search: '?page=2',
38
+ // hash: null,
39
+ // query: {page: '2'},
40
+ // fragment: {},
14
41
  // }
15
- urlparts('/users?page=5').path // '/users'
16
- urlparts('/users?page=5').protocol // 'fake:'
17
42
  ```
43
+
44
+ Duplicate query or fragment parameters use the last value. Parameter values
45
+ without `=` are normalized to `''`, matching explicitly empty values. Missing
46
+ `search` and `hash` values are `null`; present-but-empty delimiters are `'?'`
47
+ and `'#'`. Their parsed `query` and `fragment` objects remain `{}` when empty or
48
+ absent. Special parameter names such as `__proto__` are preserved as ordinary
49
+ own properties without changing the object prototype. An empty path is `null`.