tssentials 1.0.6 → 1.0.7
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/util.d.ts +1 -0
- package/dist/util.js +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { processIfPresent, ifPresent, apply } from './util.js';
|
|
1
|
+
export { processIfPresent, ifPresent, apply, notEmpty } from './util.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { processIfPresent, ifPresent, apply } from './util.js';
|
|
1
|
+
export { processIfPresent, ifPresent, apply, notEmpty } from './util.js';
|
package/dist/util.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const processIfPresent: <T, R>(v: T | null | undefined, callback: (v: T) => R) => R | undefined;
|
|
2
2
|
export declare const ifPresent: <T, R>(v: T | null | undefined, callback: (v: T) => R) => R | undefined;
|
|
3
3
|
export declare const apply: <T, R>(v: T, callback: (v: T) => R) => R;
|
|
4
|
+
export declare function notEmpty<TValue>(value: TValue | null | undefined): value is TValue;
|
package/dist/util.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export const processIfPresent = (v, callback) => (v != null && v != undefined) ? callback(v) : undefined;
|
|
2
2
|
export const ifPresent = processIfPresent;
|
|
3
3
|
export const apply = (v, callback) => callback(v);
|
|
4
|
+
export function notEmpty(value) {
|
|
5
|
+
return value !== null && value !== undefined;
|
|
6
|
+
}
|