@murky-web/typebuddy 3.0.0 → 3.1.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.
@@ -21,7 +21,7 @@ function getKeys<T extends Record<string, unknown>>(object: T): (keyof T)[] {
21
21
  */
22
22
  function arrayContainsCommonValue<T>(
23
23
  array1: readonly T[],
24
- array2: readonly T[],
24
+ array2: readonly T[]
25
25
  ): boolean {
26
26
  if (!isArray(array1) || !isArray(array2)) {
27
27
  return false;
package/src/empty.ts CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  isNull,
13
13
  isObject,
14
14
  isString,
15
- isUndefined,
15
+ isUndefined
16
16
  } from "./guards.js";
17
17
 
18
18
  type Container = {
package/src/guards.ts CHANGED
@@ -169,7 +169,7 @@ function fastIsArray(value: unknown): value is readonly unknown[] {
169
169
  * @returns {boolean} True if the value is a finite number.
170
170
  */
171
171
  function isNumber<T extends number>(
172
- value: Nullable<T>,
172
+ value: Nullable<T>
173
173
  ): value is FiniteNumber<T>;
174
174
  function isNumber(value: unknown): value is FiniteNumber;
175
175
  function isNumber(value: unknown): value is FiniteNumber {
@@ -190,7 +190,7 @@ function isNumber(value: unknown): value is FiniteNumber {
190
190
  * @returns {boolean} True if the value is an object.
191
191
  */
192
192
  function isObject<T extends Record<string, unknown>>(
193
- value: Nullable<T>,
193
+ value: Nullable<T>
194
194
  ): value is T;
195
195
  function isObject(value: unknown): value is Record<string, unknown>;
196
196
  function isObject(value: unknown): value is Record<string, unknown> {
@@ -242,7 +242,7 @@ function isFunction(value: unknown): value is UnknownFunction {
242
242
  * @returns {boolean} True if the value is a promise.
243
243
  */
244
244
  function isPromise<T>(
245
- value: Nullable<Readonly<PromiseLike<T>>>,
245
+ value: Nullable<Readonly<PromiseLike<T>>>
246
246
  ): value is PromiseLike<T>;
247
247
  function isPromise(value: unknown): value is PromiseLike<unknown>;
248
248
  function isPromise(value: unknown): value is PromiseLike<unknown> {
@@ -345,7 +345,7 @@ function isEmptyObject(value: unknown): value is EmptyObject {
345
345
  */
346
346
  function isInstanceOf<T>(
347
347
  value: unknown,
348
- constructor: new (...args: unknown[]) => T,
348
+ constructor: new (...args: unknown[]) => T
349
349
  ): value is T {
350
350
  return value instanceof constructor;
351
351
  }
@@ -403,5 +403,5 @@ export {
403
403
  isRegExp,
404
404
  isString,
405
405
  isSymbol,
406
- isUndefined,
406
+ isUndefined
407
407
  };
package/src/parse.ts CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  isNumber,
11
11
  isObject,
12
12
  isString,
13
- isUndefined,
13
+ isUndefined
14
14
  } from "./guards.js";
15
15
  import type { Optional } from "./types/optional.js";
16
16
 
@@ -53,7 +53,7 @@ function withoutNegativeZero(value: number): number {
53
53
  }
54
54
 
55
55
  function cloneDefaultArray(
56
- defaultValue?: readonly unknown[],
56
+ defaultValue?: readonly unknown[]
57
57
  ): unknown[] | undefined {
58
58
  if (!defaultValue) {
59
59
  return defaultValue;
@@ -211,7 +211,7 @@ function parseArray<T>(value: unknown, defaultValue: readonly T[]): T[];
211
211
  function parseArray(value: unknown): unknown[] | undefined;
212
212
  function parseArray(
213
213
  value: unknown,
214
- defaultValue?: readonly unknown[],
214
+ defaultValue?: readonly unknown[]
215
215
  ): unknown[] | undefined {
216
216
  if (isArray(value)) {
217
217
  return [...value];
@@ -290,5 +290,5 @@ export {
290
290
  parseFloat,
291
291
  parseInteger,
292
292
  parseNumber,
293
- parseString,
293
+ parseString
294
294
  };
package/src/public_api.ts CHANGED
@@ -18,5 +18,5 @@ export type {
18
18
  ResolveOptional,
19
19
  Result,
20
20
  Stringified,
21
- Success,
21
+ Success
22
22
  } from "./types/index.js";
package/src/result.ts CHANGED
@@ -27,7 +27,7 @@ import type { Failed, Result, Success } from "./types/maybe_promise.js";
27
27
  * `Success` member when the condition is met.
28
28
  */
29
29
  function isSuccess<R extends Readonly<Result<unknown>>>(
30
- result: R,
30
+ result: R
31
31
  ): result is Extract<R, { isError: false }> {
32
32
  return !result.isError;
33
33
  }
@@ -35,24 +35,22 @@ function isSuccess<R extends Readonly<Result<unknown>>>(
35
35
  /** Creates a successful result object for MaybePromise-style flows. */
36
36
  function ok(): Success<void>;
37
37
  function ok<T>(value: T): Success<T>;
38
- // oxlint-disable-next-line typescript-eslint/prefer-readonly-parameter-types -- ok() intentionally accepts arbitrary payload values, including mutable ones.
39
38
  function ok<T>(...args: readonly [T] | []): Success<T | void> {
40
39
  const [value] = args;
41
40
  return {
42
41
  isError: false,
43
- value,
42
+ value
44
43
  };
45
44
  }
46
45
 
47
46
  /** Creates the default failed result object for MaybePromise-style flows. */
48
47
  function err(): Failed;
49
48
  function err<T extends null>(value: T): Failed<T>;
50
- // oxlint-disable-next-line typescript-eslint/prefer-readonly-parameter-types -- err() mirrors ok() and accepts the caller's payload shape without forcing readonly wrappers.
51
49
  function err<T extends null>(...args: readonly [T] | []): Failed {
52
50
  const [value] = args;
53
51
  return {
54
52
  isError: true,
55
- value: value ?? null,
53
+ value: value ?? null
56
54
  };
57
55
  }
58
56
 
@@ -9,5 +9,5 @@ export type {
9
9
  ResolveNullable,
10
10
  ResolveOptional,
11
11
  Stringified,
12
- Success,
12
+ Success
13
13
  } from "./index.js";
@@ -5,7 +5,7 @@ import type {
5
5
  Failed,
6
6
  MaybePromise,
7
7
  Result,
8
- Success,
8
+ Success
9
9
  } from "./maybe_promise.js";
10
10
  import type { Nullable, ResolveNullable } from "./nullable.js";
11
11
  import type { Optional, ResolveOptional } from "./optional.js";
@@ -24,5 +24,5 @@ export type {
24
24
  ResolveOptional,
25
25
  Result,
26
26
  Stringified,
27
- Success,
27
+ Success
28
28
  };