@zelgadis87/utils-core 5.2.7 → 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/CHANGELOG.md +7 -0
- package/dist/Optional.d.ts +6 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/esbuild/index.cjs +4 -4
- package/esbuild/index.cjs.map +2 -2
- package/esbuild/index.mjs +4 -4
- package/esbuild/index.mjs.map +2 -2
- package/package.json +1 -1
- package/src/Optional.ts +11 -7
package/esbuild/index.mjs
CHANGED
|
@@ -401,11 +401,11 @@ var Optional = class _Optional {
|
|
|
401
401
|
}
|
|
402
402
|
ifEmpty(callback) {
|
|
403
403
|
if (this.isEmpty())
|
|
404
|
-
callback();
|
|
404
|
+
return callback();
|
|
405
405
|
}
|
|
406
406
|
ifPresent(callback) {
|
|
407
407
|
if (this.isPresent())
|
|
408
|
-
callback(this.get());
|
|
408
|
+
return callback(this.get());
|
|
409
409
|
}
|
|
410
410
|
ifPresentThenClear(callback) {
|
|
411
411
|
if (this.isPresent()) {
|
|
@@ -415,9 +415,9 @@ var Optional = class _Optional {
|
|
|
415
415
|
}
|
|
416
416
|
apply(callbackIfPresent, callbackIfEmpty) {
|
|
417
417
|
if (this.isEmpty()) {
|
|
418
|
-
callbackIfEmpty();
|
|
418
|
+
return callbackIfEmpty();
|
|
419
419
|
} else {
|
|
420
|
-
callbackIfPresent(this.get());
|
|
420
|
+
return callbackIfPresent(this.get());
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
orElseReturn(newValue) {
|