@socketsecurity/lib 5.15.0 → 5.16.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +2 -2
  3. package/dist/abort.d.ts +13 -0
  4. package/dist/agent.d.ts +81 -0
  5. package/dist/ansi.d.ts +13 -0
  6. package/dist/archives.d.ts +31 -0
  7. package/dist/argv/flags.d.ts +91 -0
  8. package/dist/argv/parse.d.ts +31 -0
  9. package/dist/bin.d.ts +54 -0
  10. package/dist/cacache.d.ts +38 -0
  11. package/dist/cache-with-ttl.d.ts +7 -0
  12. package/dist/colors.d.ts +12 -0
  13. package/dist/cover/formatters.d.ts +18 -0
  14. package/dist/debug.d.ts +6 -0
  15. package/dist/dlx/binary.d.ts +84 -0
  16. package/dist/dlx/cache.d.ts +6 -0
  17. package/dist/dlx/detect.d.ts +33 -0
  18. package/dist/dlx/dir.d.ts +34 -0
  19. package/dist/dlx/manifest.d.ts +16 -0
  20. package/dist/dlx/package.d.ts +43 -0
  21. package/dist/dlx/packages.d.ts +36 -0
  22. package/dist/dlx/paths.d.ts +20 -0
  23. package/dist/dlx/paths.js +1 -1
  24. package/dist/effects/pulse-frames.d.ts +6 -0
  25. package/dist/effects/text-shimmer.d.ts +9 -0
  26. package/dist/effects/ultra.d.ts +6 -0
  27. package/dist/env/ci.d.ts +14 -0
  28. package/dist/env/debug.d.ts +13 -0
  29. package/dist/env/github.d.ts +80 -0
  30. package/dist/env/helpers.d.ts +45 -0
  31. package/dist/env/home.d.ts +13 -0
  32. package/dist/env/locale.d.ts +30 -0
  33. package/dist/env/node-auth-token.d.ts +13 -0
  34. package/dist/env/node-env.d.ts +13 -0
  35. package/dist/env/npm.d.ts +50 -0
  36. package/dist/env/path.d.ts +13 -0
  37. package/dist/env/pre-commit.d.ts +14 -0
  38. package/dist/env/rewire.d.ts +38 -0
  39. package/dist/env/shell.d.ts +13 -0
  40. package/dist/env/socket-cli-shadow.d.ts +43 -0
  41. package/dist/env/socket-cli.d.ts +116 -0
  42. package/dist/env/socket.d.ts +153 -0
  43. package/dist/env/temp-dir.d.ts +30 -0
  44. package/dist/env/term.d.ts +13 -0
  45. package/dist/env/test.d.ts +32 -0
  46. package/dist/env/windows.d.ts +40 -0
  47. package/dist/env/xdg.d.ts +30 -0
  48. package/dist/env.d.ts +40 -0
  49. package/dist/external/npm-pack.js +202 -291
  50. package/dist/external/tar-fs.js +27 -7
  51. package/dist/fs.d.ts +13 -0
  52. package/dist/functions.d.ts +30 -0
  53. package/dist/globs.d.ts +27 -0
  54. package/dist/http-request.d.ts +16 -0
  55. package/dist/json/format.d.ts +18 -0
  56. package/dist/memoization.d.ts +5 -0
  57. package/dist/packages/edit.d.ts +28 -0
  58. package/dist/packages/exports.d.ts +40 -0
  59. package/dist/packages/licenses.d.ts +59 -0
  60. package/dist/packages/manifest.d.ts +18 -0
  61. package/dist/packages/normalize.d.ts +22 -0
  62. package/dist/packages/operations.d.ts +51 -0
  63. package/dist/packages/provenance.d.ts +11 -0
  64. package/dist/packages/specs.d.ts +30 -0
  65. package/dist/packages/validation.d.ts +18 -0
  66. package/dist/paths/normalize.d.ts +49 -5
  67. package/dist/paths/normalize.js +13 -0
  68. package/dist/paths/rewire.js +12 -3
  69. package/dist/regexps.d.ts +7 -0
  70. package/dist/releases/github.d.ts +63 -0
  71. package/dist/releases/socket-btm.d.ts +31 -0
  72. package/dist/sea.d.ts +15 -0
  73. package/dist/shadow.d.ts +7 -0
  74. package/dist/signal-exit.d.ts +27 -0
  75. package/dist/sorts.d.ts +33 -0
  76. package/dist/spawn.d.ts +9 -0
  77. package/dist/stdio/mask.d.ts +26 -0
  78. package/dist/streams.d.ts +28 -0
  79. package/dist/suppress-warnings.d.ts +7 -0
  80. package/dist/temporary-executor.d.ts +7 -0
  81. package/dist/url.d.ts +59 -0
  82. package/dist/versions.d.ts +119 -0
  83. package/dist/words.d.ts +20 -0
  84. package/package.json +7 -57
package/dist/env.d.ts CHANGED
@@ -35,16 +35,56 @@
35
35
  export declare function createEnvProxy(base: NodeJS.ProcessEnv, overrides?: Record<string, string | undefined>): NodeJS.ProcessEnv;
36
36
  /**
37
37
  * Convert an environment variable value to a boolean.
38
+ *
39
+ * @param value - The value to convert
40
+ * @param defaultValue - Default when value is null/undefined (default: `false`)
41
+ * @returns `true` if value is '1' or 'true' (case-insensitive), `false` otherwise
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * import { envAsBoolean } from '@socketsecurity/lib/env'
46
+ *
47
+ * envAsBoolean('true') // true
48
+ * envAsBoolean('1') // true
49
+ * envAsBoolean('false') // false
50
+ * envAsBoolean(undefined) // false
51
+ * ```
38
52
  */
39
53
  /*@__NO_SIDE_EFFECTS__*/
40
54
  export declare function envAsBoolean(value: unknown, defaultValue?: boolean): boolean;
41
55
  /**
42
56
  * Convert an environment variable value to a number.
57
+ *
58
+ * @param value - The value to convert
59
+ * @param defaultValue - Default when value is not a finite number (default: `0`)
60
+ * @returns The parsed integer, or the default value if parsing fails
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * import { envAsNumber } from '@socketsecurity/lib/env'
65
+ *
66
+ * envAsNumber('3000') // 3000
67
+ * envAsNumber('abc') // 0
68
+ * envAsNumber(undefined) // 0
69
+ * ```
43
70
  */
44
71
  /*@__NO_SIDE_EFFECTS__*/
45
72
  export declare function envAsNumber(value: unknown, defaultValue?: number): number;
46
73
  /**
47
74
  * Convert an environment variable value to a trimmed string.
75
+ *
76
+ * @param value - The value to convert
77
+ * @param defaultValue - Default when value is null/undefined (default: `''`)
78
+ * @returns The trimmed string value, or the default value
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * import { envAsString } from '@socketsecurity/lib/env'
83
+ *
84
+ * envAsString(' hello ') // 'hello'
85
+ * envAsString(undefined) // ''
86
+ * envAsString(null, 'n/a') // 'n/a'
87
+ * ```
48
88
  */
49
89
  /*@__NO_SIDE_EFFECTS__*/
50
90
  export declare function envAsString(value: unknown, defaultValue?: string): string;