@zelgadis87/utils-core 5.2.8 → 5.2.9

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@zelgadis87/utils-core",
4
- "version": "5.2.8",
4
+ "version": "5.2.9",
5
5
  "author": "Zelgadis87",
6
6
  "license": "ISC",
7
7
  "private": false,
package/src/Optional.ts CHANGED
@@ -221,7 +221,7 @@ export type TOptional<T> = {
221
221
 
222
222
  ifEmpty( callback: TVoidFunction ): void;
223
223
  ifPresent( callback: TConsumer<T> ): void;
224
- apply<RP = void, RE = void>( callbackIfPresent: TFunction<T, RP>, callbackIfEmpty: TProducer<RE> ): void;
224
+ apply<RP = void, RE = void>( callbackIfPresent: TFunction<T, RP>, callbackIfEmpty: TProducer<RE> ): RP | RE;
225
225
 
226
226
  throwIfPresent: ( errorGenerator: TFunction<T, Error> ) => TEmptyOptional<T>;
227
227
 
@@ -255,11 +255,13 @@ export type TEmptyOptional<T> = TOptional<T> & {
255
255
  get(): never;
256
256
  isEmpty(): true;
257
257
  isPresent(): false;
258
+ apply<RP = void, RE = void>( callbackIfPresent: TFunction<T, RP>, callbackIfEmpty: TProducer<RE> ): RE;
258
259
  }
259
260
  export type TPresentOptional<T> = TOptional<T> & {
260
261
  get(): T;
261
262
  isEmpty(): false;
262
263
  isPresent(): true;
264
+ apply<RP = void, RE = void>( callbackIfPresent: TFunction<T, RP>, callbackIfEmpty: TProducer<RE> ): RP;
263
265
  }
264
266
 
265
267
  export class ErrorGetEmptyOptional extends Error {