type-fns 0.5.1 → 0.6.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.
- package/changelog.md +7 -0
- package/dist/checks/isNotNull.d.ts +11 -0
- package/dist/checks/isNotNull.js +8 -0
- package/dist/checks/isNotNull.js.map +1 -0
- package/dist/checks/isNotUndefined.d.ts +11 -0
- package/dist/checks/isNotUndefined.js +8 -0
- package/dist/checks/isNotUndefined.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/types/NotUndefined.d.ts +0 -7
- package/dist/types/NotUndefined.js +0 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.0](https://www.github.com/ehmpathy/type-fns/compare/v0.5.1...v0.6.0) (2022-11-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **checks:** add isNotUndefined and isNotNull checks ([e810bdf](https://www.github.com/ehmpathy/type-fns/commit/e810bdf5e2ec6b9caa3e289aa8a7c693524b5e65))
|
|
9
|
+
|
|
3
10
|
### [0.5.1](https://www.github.com/ehmpathy/type-fns/compare/v0.5.0...v0.5.1) (2022-11-25)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* narrows the type to remove undefined
|
|
3
|
+
*
|
|
4
|
+
* ref
|
|
5
|
+
* - https://stackoverflow.com/a/63045455/3068233
|
|
6
|
+
*/
|
|
7
|
+
export declare type NotNull<T> = T extends null ? never : T;
|
|
8
|
+
/**
|
|
9
|
+
* checks whether the value is not undefined
|
|
10
|
+
*/
|
|
11
|
+
export declare const isNotNull: <T>(val: T) => val is NotNull<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNotNull.js","sourceRoot":"","sources":["../../src/checks/isNotNull.ts"],"names":[],"mappings":";;;AAQA;;GAEG;AACU,QAAA,SAAS,GAAG,CAAI,GAAM,EAAqB,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* narrows the type to remove undefined
|
|
3
|
+
*
|
|
4
|
+
* ref
|
|
5
|
+
* - https://stackoverflow.com/a/63045455/3068233
|
|
6
|
+
*/
|
|
7
|
+
export declare type NotUndefined<T> = T extends undefined ? never : T;
|
|
8
|
+
/**
|
|
9
|
+
* checks whether the value is not undefined
|
|
10
|
+
*/
|
|
11
|
+
export declare const isNotUndefined: <T>(val: T) => val is NotUndefined<T>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNotUndefined = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* checks whether the value is not undefined
|
|
6
|
+
*/
|
|
7
|
+
exports.isNotUndefined = (val) => typeof val !== 'undefined';
|
|
8
|
+
//# sourceMappingURL=isNotUndefined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNotUndefined.js","sourceRoot":"","sources":["../../src/checks/isNotUndefined.ts"],"names":[],"mappings":";;;AAQA;;GAEG;AACU,QAAA,cAAc,GAAG,CAAI,GAAM,EAA0B,EAAE,CAAC,OAAO,GAAG,KAAK,WAAW,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export * from './wrappers/withNot';
|
|
|
7
7
|
export * from './checks/isAFunction';
|
|
8
8
|
export * from './checks/isAPromise';
|
|
9
9
|
export * from './types/PickOne';
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './checks/isNotNull';
|
|
11
|
+
export * from './checks/isNotUndefined';
|
package/dist/index.js
CHANGED
|
@@ -19,5 +19,6 @@ __exportStar(require("./wrappers/withNot"), exports);
|
|
|
19
19
|
__exportStar(require("./checks/isAFunction"), exports);
|
|
20
20
|
__exportStar(require("./checks/isAPromise"), exports);
|
|
21
21
|
__exportStar(require("./types/PickOne"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
22
|
+
__exportStar(require("./checks/isNotNull"), exports);
|
|
23
|
+
__exportStar(require("./checks/isNotUndefined"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,mDAAiC;AACjC,uDAAqC;AACrC,qDAAmC;AACnC,oDAAkC;AAClC,qDAAmC;AACnC,uDAAqC;AACrC,sDAAoC;AACpC,kDAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,mDAAiC;AACjC,uDAAqC;AACrC,qDAAmC;AACnC,oDAAkC;AAClC,qDAAmC;AACnC,uDAAqC;AACrC,sDAAoC;AACpC,kDAAgC;AAChC,qDAAmC;AACnC,0DAAwC"}
|