@fuzdev/fuz_util 0.55.0 → 0.56.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 (104) hide show
  1. package/dist/args.d.ts +12 -12
  2. package/dist/args.js +11 -11
  3. package/dist/async.d.ts +12 -12
  4. package/dist/async.js +12 -12
  5. package/dist/benchmark.d.ts +24 -24
  6. package/dist/benchmark.js +26 -26
  7. package/dist/benchmark_baseline.d.ts +11 -11
  8. package/dist/benchmark_baseline.js +11 -11
  9. package/dist/benchmark_format.d.ts +15 -15
  10. package/dist/benchmark_format.js +15 -15
  11. package/dist/benchmark_stats.d.ts +5 -5
  12. package/dist/benchmark_stats.js +5 -5
  13. package/dist/benchmark_types.d.ts +7 -7
  14. package/dist/bytes.d.ts +4 -4
  15. package/dist/bytes.js +4 -4
  16. package/dist/dag.d.ts +2 -2
  17. package/dist/dag.js +2 -2
  18. package/dist/deep_equal.d.ts +2 -2
  19. package/dist/deep_equal.js +2 -2
  20. package/dist/diff.d.ts +17 -17
  21. package/dist/diff.js +17 -17
  22. package/dist/dom.d.ts +4 -4
  23. package/dist/dom.js +4 -4
  24. package/dist/fetch.d.ts +1 -1
  25. package/dist/fetch.js +1 -1
  26. package/dist/git.d.ts +1 -1
  27. package/dist/git.js +1 -1
  28. package/dist/hash.d.ts +6 -6
  29. package/dist/hash.js +8 -8
  30. package/dist/hash_blake3.d.ts +1 -1
  31. package/dist/hash_blake3.js +1 -1
  32. package/dist/hex.d.ts +4 -4
  33. package/dist/hex.js +4 -4
  34. package/dist/json.d.ts +2 -2
  35. package/dist/json.js +2 -2
  36. package/dist/log.d.ts +12 -12
  37. package/dist/log.js +11 -11
  38. package/dist/map.d.ts +1 -1
  39. package/dist/map.js +1 -1
  40. package/dist/object.d.ts +1 -1
  41. package/dist/object.js +1 -1
  42. package/dist/package_json.d.ts +1 -1
  43. package/dist/package_json.js +1 -1
  44. package/dist/path.d.ts +5 -5
  45. package/dist/path.js +5 -5
  46. package/dist/process.d.ts +22 -22
  47. package/dist/process.js +22 -22
  48. package/dist/random.d.ts +2 -2
  49. package/dist/random.js +2 -2
  50. package/dist/result.d.ts +6 -6
  51. package/dist/result.js +6 -6
  52. package/dist/sort.d.ts +3 -3
  53. package/dist/sort.js +3 -3
  54. package/dist/source_json.d.ts +3 -3
  55. package/dist/source_json.js +3 -3
  56. package/dist/stats.d.ts +17 -17
  57. package/dist/stats.js +17 -17
  58. package/dist/string.d.ts +6 -6
  59. package/dist/string.js +6 -6
  60. package/dist/svelte_preprocess_helpers.d.ts +42 -42
  61. package/dist/svelte_preprocess_helpers.js +42 -42
  62. package/dist/testing.d.ts +44 -0
  63. package/dist/testing.d.ts.map +1 -0
  64. package/dist/testing.js +59 -0
  65. package/dist/time.d.ts +19 -19
  66. package/dist/time.js +19 -19
  67. package/dist/zod.d.ts +16 -16
  68. package/dist/zod.d.ts.map +1 -1
  69. package/dist/zod.js +24 -24
  70. package/package.json +6 -6
  71. package/src/lib/args.ts +12 -12
  72. package/src/lib/async.ts +12 -12
  73. package/src/lib/benchmark.ts +28 -28
  74. package/src/lib/benchmark_baseline.ts +11 -11
  75. package/src/lib/benchmark_format.ts +15 -15
  76. package/src/lib/benchmark_stats.ts +5 -5
  77. package/src/lib/benchmark_types.ts +7 -7
  78. package/src/lib/bytes.ts +4 -4
  79. package/src/lib/dag.ts +2 -2
  80. package/src/lib/deep_equal.ts +2 -2
  81. package/src/lib/diff.ts +17 -17
  82. package/src/lib/dom.ts +4 -4
  83. package/src/lib/fetch.ts +1 -1
  84. package/src/lib/git.ts +1 -1
  85. package/src/lib/hash.ts +8 -8
  86. package/src/lib/hash_blake3.ts +1 -1
  87. package/src/lib/hex.ts +4 -4
  88. package/src/lib/json.ts +2 -2
  89. package/src/lib/log.ts +12 -12
  90. package/src/lib/map.ts +1 -1
  91. package/src/lib/object.ts +1 -1
  92. package/src/lib/package_json.ts +1 -1
  93. package/src/lib/path.ts +5 -5
  94. package/src/lib/process.ts +22 -22
  95. package/src/lib/random.ts +2 -2
  96. package/src/lib/result.ts +6 -6
  97. package/src/lib/sort.ts +3 -3
  98. package/src/lib/source_json.ts +3 -3
  99. package/src/lib/stats.ts +17 -17
  100. package/src/lib/string.ts +6 -6
  101. package/src/lib/svelte_preprocess_helpers.ts +42 -42
  102. package/src/lib/testing.ts +80 -0
  103. package/src/lib/time.ts +19 -19
  104. package/src/lib/zod.ts +24 -24
@@ -2,9 +2,9 @@ import type { BenchmarkResult, BenchmarkGroup } from './benchmark_types.js';
2
2
  /**
3
3
  * Format results as an ASCII table with percentiles, min/max, and relative performance.
4
4
  * All times use the same unit for easy comparison.
5
- * @param results - Array of benchmark results
6
- * @param baseline - Optional task name to use as baseline for comparison (defaults to fastest)
7
- * @returns Formatted table string with enhanced metrics
5
+ * @param results - array of benchmark results
6
+ * @param baseline - optional task name to use as baseline for comparison (defaults to fastest)
7
+ * @returns formatted table string with enhanced metrics
8
8
  *
9
9
  * @example
10
10
  * ```ts
@@ -21,9 +21,9 @@ export declare const benchmark_format_table: (results: Array<BenchmarkResult>, b
21
21
  /**
22
22
  * Format results as a Markdown table with key metrics.
23
23
  * All times use the same unit for easy comparison.
24
- * @param results - Array of benchmark results
25
- * @param baseline - Optional task name to use as baseline for comparison (defaults to fastest)
26
- * @returns Formatted markdown table string
24
+ * @param results - array of benchmark results
25
+ * @param baseline - optional task name to use as baseline for comparison (defaults to fastest)
26
+ * @returns formatted markdown table string
27
27
  *
28
28
  * @example
29
29
  * ```ts
@@ -37,9 +37,9 @@ export declare const benchmark_format_table: (results: Array<BenchmarkResult>, b
37
37
  export declare const benchmark_format_markdown: (results: Array<BenchmarkResult>, baseline?: string) => string;
38
38
  /**
39
39
  * Format results as grouped Markdown tables with headers between groups.
40
- * @param results - Array of benchmark results
41
- * @param groups - Array of group definitions
42
- * @returns Formatted markdown string with group headers and tables
40
+ * @param results - array of benchmark results
41
+ * @param groups - array of group definitions
42
+ * @returns formatted markdown string with group headers and tables
43
43
  *
44
44
  * @example
45
45
  * ```ts
@@ -68,8 +68,8 @@ export interface BenchmarkFormatJsonOptions {
68
68
  }
69
69
  /**
70
70
  * Format results as JSON.
71
- * @param results - Array of benchmark results
72
- * @param options - Formatting options
71
+ * @param results - array of benchmark results
72
+ * @param options - formatting options
73
73
  * @returns JSON string
74
74
  *
75
75
  * @example
@@ -82,9 +82,9 @@ export interface BenchmarkFormatJsonOptions {
82
82
  export declare const benchmark_format_json: (results: Array<BenchmarkResult>, options?: BenchmarkFormatJsonOptions) => string;
83
83
  /**
84
84
  * Format results as a grouped table with visual separators between groups.
85
- * @param results - Array of benchmark results
86
- * @param groups - Array of group definitions
87
- * @returns Formatted table string with group separators
85
+ * @param results - array of benchmark results
86
+ * @param groups - array of group definitions
87
+ * @returns formatted table string with group separators
88
88
  *
89
89
  * @example
90
90
  * ```ts
@@ -108,7 +108,7 @@ export declare const benchmark_format_json: (results: Array<BenchmarkResult>, op
108
108
  export declare const benchmark_format_table_grouped: (results: Array<BenchmarkResult>, groups: Array<BenchmarkGroup>) => string;
109
109
  /**
110
110
  * Format a number with fixed decimal places and thousands separators.
111
- * @see {@link format_number} in maths.ts for the underlying implementation.
111
+ * @see `format_number` in `maths.ts` for the underlying implementation.
112
112
  */
113
113
  export declare const benchmark_format_number: (n: number, decimals?: number) => string;
114
114
  //# sourceMappingURL=benchmark_format.d.ts.map
@@ -4,9 +4,9 @@ import { format_number } from './maths.js';
4
4
  /**
5
5
  * Format results as an ASCII table with percentiles, min/max, and relative performance.
6
6
  * All times use the same unit for easy comparison.
7
- * @param results - Array of benchmark results
8
- * @param baseline - Optional task name to use as baseline for comparison (defaults to fastest)
9
- * @returns Formatted table string with enhanced metrics
7
+ * @param results - array of benchmark results
8
+ * @param baseline - optional task name to use as baseline for comparison (defaults to fastest)
9
+ * @returns formatted table string with enhanced metrics
10
10
  *
11
11
  * @example
12
12
  * ```ts
@@ -105,9 +105,9 @@ export const benchmark_format_table = (results, baseline) => {
105
105
  /**
106
106
  * Format results as a Markdown table with key metrics.
107
107
  * All times use the same unit for easy comparison.
108
- * @param results - Array of benchmark results
109
- * @param baseline - Optional task name to use as baseline for comparison (defaults to fastest)
110
- * @returns Formatted markdown table string
108
+ * @param results - array of benchmark results
109
+ * @param baseline - optional task name to use as baseline for comparison (defaults to fastest)
110
+ * @returns formatted markdown table string
111
111
  *
112
112
  * @example
113
113
  * ```ts
@@ -200,9 +200,9 @@ export const benchmark_format_markdown = (results, baseline) => {
200
200
  };
201
201
  /**
202
202
  * Format results as grouped Markdown tables with headers between groups.
203
- * @param results - Array of benchmark results
204
- * @param groups - Array of group definitions
205
- * @returns Formatted markdown string with group headers and tables
203
+ * @param results - array of benchmark results
204
+ * @param groups - array of group definitions
205
+ * @returns formatted markdown string with group headers and tables
206
206
  *
207
207
  * @example
208
208
  * ```ts
@@ -248,8 +248,8 @@ export const benchmark_format_markdown_grouped = (results, groups) => {
248
248
  };
249
249
  /**
250
250
  * Format results as JSON.
251
- * @param results - Array of benchmark results
252
- * @param options - Formatting options
251
+ * @param results - array of benchmark results
252
+ * @param options - formatting options
253
253
  * @returns JSON string
254
254
  *
255
255
  * @example
@@ -290,9 +290,9 @@ export const benchmark_format_json = (results, options) => {
290
290
  };
291
291
  /**
292
292
  * Format results as a grouped table with visual separators between groups.
293
- * @param results - Array of benchmark results
294
- * @param groups - Array of group definitions
295
- * @returns Formatted table string with group separators
293
+ * @param results - array of benchmark results
294
+ * @param groups - array of group definitions
295
+ * @returns formatted table string with group separators
296
296
  *
297
297
  * @example
298
298
  * ```ts
@@ -339,6 +339,6 @@ export const benchmark_format_table_grouped = (results, groups) => {
339
339
  };
340
340
  /**
341
341
  * Format a number with fixed decimal places and thousands separators.
342
- * @see {@link format_number} in maths.ts for the underlying implementation.
342
+ * @see `format_number` in `maths.ts` for the underlying implementation.
343
343
  */
344
344
  export const benchmark_format_number = format_number;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Benchmark-specific statistical analysis.
3
- * Uses the general stats utilities from stats.ts for timing/performance analysis.
3
+ * Uses the general stats utilities from `stats.ts` for timing/performance analysis.
4
4
  * All timing values are in nanoseconds.
5
5
  *
6
6
  * @module
@@ -117,10 +117,10 @@ export declare class BenchmarkStats {
117
117
  * calibrated for social science and produce false positives in benchmarking
118
118
  * where within-run variance is tight.
119
119
  *
120
- * @param a - First benchmark stats (or any object with required properties)
121
- * @param b - Second benchmark stats (or any object with required properties)
122
- * @param options - Comparison options
123
- * @returns Comparison result with significance, effect size, and recommendation
120
+ * @param a - first benchmark stats (or any object with required properties)
121
+ * @param b - second benchmark stats (or any object with required properties)
122
+ * @param options - comparison options
123
+ * @returns comparison result with significance, effect size, and recommendation
124
124
  *
125
125
  * @example
126
126
  * ```ts
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Benchmark-specific statistical analysis.
3
- * Uses the general stats utilities from stats.ts for timing/performance analysis.
3
+ * Uses the general stats utilities from `stats.ts` for timing/performance analysis.
4
4
  * All timing values are in nanoseconds.
5
5
  *
6
6
  * @module
@@ -117,10 +117,10 @@ export class BenchmarkStats {
117
117
  * calibrated for social science and produce false positives in benchmarking
118
118
  * where within-run variance is tight.
119
119
  *
120
- * @param a - First benchmark stats (or any object with required properties)
121
- * @param b - Second benchmark stats (or any object with required properties)
122
- * @param options - Comparison options
123
- * @returns Comparison result with significance, effect size, and recommendation
120
+ * @param a - first benchmark stats (or any object with required properties)
121
+ * @param b - second benchmark stats (or any object with required properties)
122
+ * @param options - comparison options
123
+ * @returns comparison result with significance, effect size, and recommendation
124
124
  *
125
125
  * @example
126
126
  * ```ts
@@ -35,7 +35,7 @@ export interface BenchmarkConfig {
35
35
  max_iterations?: number;
36
36
  /**
37
37
  * Custom timer to use for measurements.
38
- * Default: timer_default (auto-detects environment)
38
+ * Default: `timer_default` (auto-detects environment)
39
39
  */
40
40
  timer?: Timer;
41
41
  /**
@@ -47,9 +47,9 @@ export interface BenchmarkConfig {
47
47
  * after the timing capture. However, frequent GC calls will slow overall benchmark
48
48
  * execution time.
49
49
  *
50
- * @param task_name - Name of the current task being benchmarked
51
- * @param iteration - Current iteration number (1-indexed)
52
- * @param abort - Call to stop the benchmark early for this task
50
+ * @param task_name - name of the current task being benchmarked
51
+ * @param iteration - current iteration number (1-indexed)
52
+ * @param abort - call to stop the benchmark early for this task
53
53
  *
54
54
  * @example
55
55
  * ```ts
@@ -82,9 +82,9 @@ export interface BenchmarkConfig {
82
82
  * Callback invoked after each task completes.
83
83
  * Useful for logging progress during long benchmark runs.
84
84
  *
85
- * @param result - The completed benchmark result
86
- * @param index - Zero-based index of the completed task
87
- * @param total - Total number of tasks to run
85
+ * @param result - the completed benchmark result
86
+ * @param index - zero-based index of the completed task
87
+ * @param total - total number of tasks to run
88
88
  *
89
89
  * @example
90
90
  * ```ts
package/dist/bytes.d.ts CHANGED
@@ -7,15 +7,15 @@
7
7
  * Converts string or binary data to a `Uint8Array`.
8
8
  * Strings are UTF-8 encoded. `Uint8Array` inputs are returned as-is.
9
9
  *
10
- * @param data - String or `BufferSource` to convert.
11
- * @returns `Uint8Array` view of the data.
10
+ * @param data - string or `BufferSource` to convert
11
+ * @returns `Uint8Array` view of the data
12
12
  */
13
13
  export declare const to_bytes: (data: BufferSource | string) => Uint8Array;
14
14
  /**
15
15
  * Formats a byte count as a human-readable string.
16
16
  *
17
- * @param n - byte count.
18
- * @returns formatted string like `'1.2 KB'` or `'3.4 MB'`.
17
+ * @param n - byte count
18
+ * @returns formatted string like `'1.2 KB'` or `'3.4 MB'`
19
19
  */
20
20
  export declare const format_bytes: (n: number) => string;
21
21
  //# sourceMappingURL=bytes.d.ts.map
package/dist/bytes.js CHANGED
@@ -8,8 +8,8 @@ const encoder = new TextEncoder();
8
8
  * Converts string or binary data to a `Uint8Array`.
9
9
  * Strings are UTF-8 encoded. `Uint8Array` inputs are returned as-is.
10
10
  *
11
- * @param data - String or `BufferSource` to convert.
12
- * @returns `Uint8Array` view of the data.
11
+ * @param data - string or `BufferSource` to convert
12
+ * @returns `Uint8Array` view of the data
13
13
  */
14
14
  export const to_bytes = (data) => {
15
15
  if (typeof data === 'string')
@@ -23,8 +23,8 @@ export const to_bytes = (data) => {
23
23
  /**
24
24
  * Formats a byte count as a human-readable string.
25
25
  *
26
- * @param n - byte count.
27
- * @returns formatted string like `'1.2 KB'` or `'3.4 MB'`.
26
+ * @param n - byte count
27
+ * @returns formatted string like `'1.2 KB'` or `'3.4 MB'`
28
28
  */
29
29
  export const format_bytes = (n) => {
30
30
  if (n < 1024)
package/dist/dag.d.ts CHANGED
@@ -73,8 +73,8 @@ export interface DagResult {
73
73
  * eligible to start. Failure cascading and stop-on-failure are handled
74
74
  * per the options.
75
75
  *
76
- * @param options - DAG execution options.
77
- * @returns Aggregated result with per-node details.
76
+ * @param options - DAG execution options
77
+ * @returns aggregated result with per-node details
78
78
  */
79
79
  export declare const run_dag: <T extends DagNode>(options: DagOptions<T>) => Promise<DagResult>;
80
80
  //# sourceMappingURL=dag.d.ts.map
package/dist/dag.js CHANGED
@@ -18,8 +18,8 @@ import { topological_sort } from './sort.js';
18
18
  * eligible to start. Failure cascading and stop-on-failure are handled
19
19
  * per the options.
20
20
  *
21
- * @param options - DAG execution options.
22
- * @returns Aggregated result with per-node details.
21
+ * @param options - DAG execution options
22
+ * @returns aggregated result with per-node details
23
23
  */
24
24
  export const run_dag = async (options) => {
25
25
  const { nodes, execute, on_error, on_skip, should_skip, max_concurrency = Infinity, stop_on_failure = true, skip_validation = false, } = options;
@@ -10,8 +10,8 @@
10
10
  * - Promises always return false (cannot be meaningfully compared)
11
11
  * - Maps/Sets compare by reference for object keys/values
12
12
  *
13
- * @param a first value to compare
14
- * @param b second value to compare
13
+ * @param a - first value to compare
14
+ * @param b - second value to compare
15
15
  * @returns true if deeply equal, false otherwise
16
16
  */
17
17
  export declare const deep_equal: (a: unknown, b: unknown) => boolean;
@@ -10,8 +10,8 @@
10
10
  * - Promises always return false (cannot be meaningfully compared)
11
11
  * - Maps/Sets compare by reference for object keys/values
12
12
  *
13
- * @param a first value to compare
14
- * @param b second value to compare
13
+ * @param a - first value to compare
14
+ * @param b - second value to compare
15
15
  * @returns true if deeply equal, false otherwise
16
16
  */
17
17
  export const deep_equal = (a, b) => {
package/dist/diff.d.ts CHANGED
@@ -11,17 +11,17 @@ export interface DiffLine {
11
11
  /**
12
12
  * Generate a line-based diff between two strings using LCS algorithm.
13
13
  *
14
- * @param a - The original/current content.
15
- * @param b - The new/desired content.
16
- * @returns Array of diff lines with type annotations.
14
+ * @param a - the original/current content
15
+ * @param b - the new/desired content
16
+ * @returns array of diff lines with type annotations
17
17
  */
18
18
  export declare const diff_lines: (a: string, b: string) => Array<DiffLine>;
19
19
  /**
20
20
  * Filter diff to only include lines within N lines of context around changes.
21
21
  *
22
- * @param diff - The full diff lines.
23
- * @param context_lines - Number of context lines to show around changes (default: 3).
24
- * @returns Filtered diff with ellipsis markers for skipped regions.
22
+ * @param diff - the full diff lines
23
+ * @param context_lines - number of context lines to show around changes (default: 3)
24
+ * @returns filtered diff with ellipsis markers for skipped regions
25
25
  */
26
26
  export declare const filter_diff_context: (diff: Array<DiffLine>, context_lines?: number) => Array<DiffLine>;
27
27
  /**
@@ -38,24 +38,24 @@ export interface FormatDiffOptions {
38
38
  /**
39
39
  * Format a diff for display.
40
40
  *
41
- * @param diff - The diff lines to format.
42
- * @param current_path - Path label for "current" content.
43
- * @param desired_path - Path label for "desired" content.
44
- * @param options - Formatting options.
45
- * @returns Formatted diff string.
41
+ * @param diff - the diff lines to format
42
+ * @param current_path - path label for "current" content
43
+ * @param desired_path - path label for "desired" content
44
+ * @param options - formatting options
45
+ * @returns formatted diff string
46
46
  */
47
47
  export declare const format_diff: (diff: Array<DiffLine>, current_path: string, desired_path: string, options?: FormatDiffOptions) => string;
48
48
  /**
49
49
  * Generate a formatted diff between two strings.
50
50
  *
51
- * Combines diff_lines, filter_diff_context, and format_diff for convenience.
51
+ * Combines `diff_lines`, `filter_diff_context`, and `format_diff` for convenience.
52
52
  * Returns null if content is binary.
53
53
  *
54
- * @param current - Current content.
55
- * @param desired - Desired content.
56
- * @param path - File path for labels.
57
- * @param options - Formatting options.
58
- * @returns Formatted diff string, or null if binary.
54
+ * @param current - current content
55
+ * @param desired - desired content
56
+ * @param path - file path for labels
57
+ * @param options - formatting options
58
+ * @returns formatted diff string, or null if binary
59
59
  */
60
60
  export declare const generate_diff: (current: string, desired: string, path: string, options?: FormatDiffOptions) => string | null;
61
61
  //# sourceMappingURL=diff.d.ts.map
package/dist/diff.js CHANGED
@@ -7,9 +7,9 @@ import { string_is_binary } from './string.js';
7
7
  /**
8
8
  * Generate a line-based diff between two strings using LCS algorithm.
9
9
  *
10
- * @param a - The original/current content.
11
- * @param b - The new/desired content.
12
- * @returns Array of diff lines with type annotations.
10
+ * @param a - the original/current content
11
+ * @param b - the new/desired content
12
+ * @returns array of diff lines with type annotations
13
13
  */
14
14
  export const diff_lines = (a, b) => {
15
15
  const a_lines = a.split('\n');
@@ -84,9 +84,9 @@ const compute_lcs = (a, b) => {
84
84
  /**
85
85
  * Filter diff to only include lines within N lines of context around changes.
86
86
  *
87
- * @param diff - The full diff lines.
88
- * @param context_lines - Number of context lines to show around changes (default: 3).
89
- * @returns Filtered diff with ellipsis markers for skipped regions.
87
+ * @param diff - the full diff lines
88
+ * @param context_lines - number of context lines to show around changes (default: 3)
89
+ * @returns filtered diff with ellipsis markers for skipped regions
90
90
  */
91
91
  export const filter_diff_context = (diff, context_lines = 3) => {
92
92
  if (diff.length === 0)
@@ -131,11 +131,11 @@ const colors = {
131
131
  /**
132
132
  * Format a diff for display.
133
133
  *
134
- * @param diff - The diff lines to format.
135
- * @param current_path - Path label for "current" content.
136
- * @param desired_path - Path label for "desired" content.
137
- * @param options - Formatting options.
138
- * @returns Formatted diff string.
134
+ * @param diff - the diff lines to format
135
+ * @param current_path - path label for "current" content
136
+ * @param desired_path - path label for "desired" content
137
+ * @param options - formatting options
138
+ * @returns formatted diff string
139
139
  */
140
140
  export const format_diff = (diff, current_path, desired_path, options = {}) => {
141
141
  const { prefix = '', use_color = true, max_lines = 50 } = options;
@@ -165,14 +165,14 @@ export const format_diff = (diff, current_path, desired_path, options = {}) => {
165
165
  /**
166
166
  * Generate a formatted diff between two strings.
167
167
  *
168
- * Combines diff_lines, filter_diff_context, and format_diff for convenience.
168
+ * Combines `diff_lines`, `filter_diff_context`, and `format_diff` for convenience.
169
169
  * Returns null if content is binary.
170
170
  *
171
- * @param current - Current content.
172
- * @param desired - Desired content.
173
- * @param path - File path for labels.
174
- * @param options - Formatting options.
175
- * @returns Formatted diff string, or null if binary.
171
+ * @param current - current content
172
+ * @param desired - desired content
173
+ * @param path - file path for labels
174
+ * @param options - formatting options
175
+ * @returns formatted diff string, or null if binary
176
176
  */
177
177
  export const generate_diff = (current, desired, path, options = {}) => {
178
178
  // Skip binary files
package/dist/dom.d.ts CHANGED
@@ -15,11 +15,11 @@ export declare const inside_editable: (el: Element) => boolean;
15
15
  export declare const is_interactive: (el: any) => boolean;
16
16
  /**
17
17
  * Stops an event from bubbling and doing default behavior.
18
- * @param event
19
- * @param immediate defaults to `true` to use `stopImmediatePropagation` over `stopPropagation`
20
- * @param preventDefault defaults to `true`
18
+ * @param event - the event to swallow
19
+ * @param immediate - defaults to `true` to use `stopImmediatePropagation` over `stopPropagation`
20
+ * @param preventDefault - defaults to `true`
21
+ * @returns the swallowed event
21
22
  * @mutates event - calls preventDefault(), stopPropagation(), or stopImmediatePropagation()
22
- * @returns
23
23
  */
24
24
  export declare const swallow: <T extends Pick<Event, "preventDefault" | "stopPropagation" | "stopImmediatePropagation">>(event: T, immediate?: boolean, preventDefault?: boolean) => T;
25
25
  /**
package/dist/dom.js CHANGED
@@ -52,11 +52,11 @@ export const is_interactive = (el) => {
52
52
  };
53
53
  /**
54
54
  * Stops an event from bubbling and doing default behavior.
55
- * @param event
56
- * @param immediate defaults to `true` to use `stopImmediatePropagation` over `stopPropagation`
57
- * @param preventDefault defaults to `true`
55
+ * @param event - the event to swallow
56
+ * @param immediate - defaults to `true` to use `stopImmediatePropagation` over `stopPropagation`
57
+ * @param preventDefault - defaults to `true`
58
+ * @returns the swallowed event
58
59
  * @mutates event - calls preventDefault(), stopPropagation(), or stopImmediatePropagation()
59
- * @returns
60
60
  */
61
61
  export const swallow = (event, immediate = true, preventDefault = true) => {
62
62
  if (preventDefault)
package/dist/fetch.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface FetchValueOptions<TValue, TParams = undefined> {
26
26
  * (you can still provide headers directly)
27
27
  *
28
28
  * Unlike `fetch`, this throws on ratelimits (status code 429)
29
- * to halt whatever is happpening in its tracks to avoid accidental abuse,
29
+ * to halt whatever is happening in its tracks to avoid accidental abuse,
30
30
  * but returns a `Result` in all other cases.
31
31
  * Handling ratelimit headers with more sophistication gets tricky because behavior
32
32
  * differs across services.
package/dist/fetch.js CHANGED
@@ -14,7 +14,7 @@ const DEFAULT_GITHUB_API_VERSION_HEADER = '2022-11-28';
14
14
  * (you can still provide headers directly)
15
15
  *
16
16
  * Unlike `fetch`, this throws on ratelimits (status code 429)
17
- * to halt whatever is happpening in its tracks to avoid accidental abuse,
17
+ * to halt whatever is happening in its tracks to avoid accidental abuse,
18
18
  * but returns a `Result` in all other cases.
19
19
  * Handling ratelimit headers with more sophistication gets tricky because behavior
20
20
  * differs across services.
package/dist/git.d.ts CHANGED
@@ -62,7 +62,7 @@ export interface GitWorkspaceStatus {
62
62
  * Note: This implementation treats submodules the same as regular files.
63
63
  * Submodule-specific status codes (lowercase m, ?) are interpreted as changes.
64
64
  *
65
- * @param stdout - The raw output from `git status --porcelain -z`
65
+ * @param stdout - the raw output from `git status --porcelain -z`
66
66
  * @returns status object with flags for unstaged changes, staged changes, and untracked files
67
67
  */
68
68
  export declare const git_parse_workspace_status: (stdout: string | null) => GitWorkspaceStatus;
package/dist/git.js CHANGED
@@ -82,7 +82,7 @@ export const git_local_branch_exists = async (branch, options) => {
82
82
  * Note: This implementation treats submodules the same as regular files.
83
83
  * Submodule-specific status codes (lowercase m, ?) are interpreted as changes.
84
84
  *
85
- * @param stdout - The raw output from `git status --porcelain -z`
85
+ * @param stdout - the raw output from `git status --porcelain -z`
86
86
  * @returns status object with flags for unstaged changes, staged changes, and untracked files
87
87
  */
88
88
  export const git_parse_workspace_status = (stdout) => {
package/dist/hash.d.ts CHANGED
@@ -11,28 +11,28 @@
11
11
  * Computes a SHA-1 hash using Web Crypto API.
12
12
  *
13
13
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
14
- * @returns 40-character hexadecimal hash string.
14
+ * @returns 40-character hexadecimal hash string
15
15
  */
16
16
  export declare const hash_sha1: (data: BufferSource | string) => Promise<string>;
17
17
  /**
18
18
  * Computes a SHA-256 hash using Web Crypto API.
19
19
  *
20
20
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
21
- * @returns 64-character hexadecimal hash string.
21
+ * @returns 64-character hexadecimal hash string
22
22
  */
23
23
  export declare const hash_sha256: (data: BufferSource | string) => Promise<string>;
24
24
  /**
25
25
  * Computes a SHA-384 hash using Web Crypto API.
26
26
  *
27
27
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
28
- * @returns 96-character hexadecimal hash string.
28
+ * @returns 96-character hexadecimal hash string
29
29
  */
30
30
  export declare const hash_sha384: (data: BufferSource | string) => Promise<string>;
31
31
  /**
32
32
  * Computes a SHA-512 hash using Web Crypto API.
33
33
  *
34
34
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
35
- * @returns 128-character hexadecimal hash string.
35
+ * @returns 128-character hexadecimal hash string
36
36
  */
37
37
  export declare const hash_sha512: (data: BufferSource | string) => Promise<string>;
38
38
  /**
@@ -42,8 +42,8 @@ export declare const hash_sha512: (data: BufferSource | string) => Promise<strin
42
42
  * Note: Strings use UTF-16 code units, buffers use raw bytes.
43
43
  * For non-ASCII, `hash_insecure(str) !== hash_insecure(encoder.encode(str))`.
44
44
  *
45
- * @param data - String or binary data to hash.
46
- * @returns 8-character hex-encoded unsigned 32-bit hash.
45
+ * @param data - string or binary data to hash
46
+ * @returns 8-character hex-encoded unsigned 32-bit hash
47
47
  */
48
48
  export declare const hash_insecure: (data: BufferSource | string) => string;
49
49
  //# sourceMappingURL=hash.d.ts.map
package/dist/hash.js CHANGED
@@ -12,9 +12,9 @@ const encoder = new TextEncoder();
12
12
  /**
13
13
  * Computes a hash using Web Crypto API.
14
14
  *
15
- * @param algorithm - Web Crypto algorithm name (e.g. `'SHA-256'`).
15
+ * @param algorithm - Web Crypto algorithm name (e.g. `'SHA-256'`)
16
16
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
17
- * @returns hexadecimal hash string.
17
+ * @returns hexadecimal hash string
18
18
  */
19
19
  const hash_webcrypto = async (algorithm, data) => {
20
20
  const buffer = typeof data === 'string' ? encoder.encode(data) : data;
@@ -25,28 +25,28 @@ const hash_webcrypto = async (algorithm, data) => {
25
25
  * Computes a SHA-1 hash using Web Crypto API.
26
26
  *
27
27
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
28
- * @returns 40-character hexadecimal hash string.
28
+ * @returns 40-character hexadecimal hash string
29
29
  */
30
30
  export const hash_sha1 = (data) => hash_webcrypto('SHA-1', data);
31
31
  /**
32
32
  * Computes a SHA-256 hash using Web Crypto API.
33
33
  *
34
34
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
35
- * @returns 64-character hexadecimal hash string.
35
+ * @returns 64-character hexadecimal hash string
36
36
  */
37
37
  export const hash_sha256 = (data) => hash_webcrypto('SHA-256', data);
38
38
  /**
39
39
  * Computes a SHA-384 hash using Web Crypto API.
40
40
  *
41
41
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
42
- * @returns 96-character hexadecimal hash string.
42
+ * @returns 96-character hexadecimal hash string
43
43
  */
44
44
  export const hash_sha384 = (data) => hash_webcrypto('SHA-384', data);
45
45
  /**
46
46
  * Computes a SHA-512 hash using Web Crypto API.
47
47
  *
48
48
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
49
- * @returns 128-character hexadecimal hash string.
49
+ * @returns 128-character hexadecimal hash string
50
50
  */
51
51
  export const hash_sha512 = (data) => hash_webcrypto('SHA-512', data);
52
52
  /**
@@ -56,8 +56,8 @@ export const hash_sha512 = (data) => hash_webcrypto('SHA-512', data);
56
56
  * Note: Strings use UTF-16 code units, buffers use raw bytes.
57
57
  * For non-ASCII, `hash_insecure(str) !== hash_insecure(encoder.encode(str))`.
58
58
  *
59
- * @param data - String or binary data to hash.
60
- * @returns 8-character hex-encoded unsigned 32-bit hash.
59
+ * @param data - string or binary data to hash
60
+ * @returns 8-character hex-encoded unsigned 32-bit hash
61
61
  */
62
62
  export const hash_insecure = (data) => {
63
63
  let hash = 5381; // DJB2 initial value, chosen empirically for good distribution
@@ -18,7 +18,7 @@ export declare const blake3_ready: Promise<void>;
18
18
  * Computes a BLAKE3 hash synchronously.
19
19
  *
20
20
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
21
- * @returns 64-character hexadecimal hash string (32 bytes).
21
+ * @returns 64-character hexadecimal hash string (32 bytes)
22
22
  */
23
23
  export declare const hash_blake3: (data: BufferSource | string) => string;
24
24
  /** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */
@@ -21,7 +21,7 @@ export const blake3_ready = init();
21
21
  * Computes a BLAKE3 hash synchronously.
22
22
  *
23
23
  * @param data - String or binary data to hash. Strings are UTF-8 encoded.
24
- * @returns 64-character hexadecimal hash string (32 bytes).
24
+ * @returns 64-character hexadecimal hash string (32 bytes)
25
25
  */
26
26
  export const hash_blake3 = (data) => to_hex(hash(to_bytes(data)));
27
27
  /** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */