type-fns 1.20.1 → 1.20.2
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/checks/isPresent.assess.d.ts +4 -0
- package/dist/checks/isPresent.assess.js +8 -0
- package/dist/checks/isPresent.assess.js.map +1 -0
- package/dist/checks/isPresent.d.ts +1 -1
- package/dist/checks/isPresent.js +4 -6
- package/dist/checks/isPresent.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +3 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPresentAssess = void 0;
|
|
4
|
+
const isNotNull_1 = require("./isNotNull");
|
|
5
|
+
const isNotUndefined_1 = require("./isNotUndefined");
|
|
6
|
+
const assess = (t) => (0, isNotNull_1.isNotNull)(t) && (0, isNotUndefined_1.isDefined)(t);
|
|
7
|
+
exports.isPresentAssess = assess;
|
|
8
|
+
//# sourceMappingURL=isPresent.assess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPresent.assess.js","sourceRoot":"","sources":["../../src/checks/isPresent.assess.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AACjD,qDAAwD;AAExD,MAAM,MAAM,GAAG,CAAI,CAAI,EAA8B,EAAE,CACrD,IAAA,qBAAS,EAAC,CAAC,CAAC,IAAI,IAAA,0BAAS,EAAC,CAAC,CAAC,CAAC;AAGZ,iCAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NotNull } from './isNotNull';
|
|
2
2
|
import { IsDefined } from './isNotUndefined';
|
|
3
|
-
|
|
3
|
+
import { isPresentAssess as assess } from './isPresent.assess';
|
|
4
4
|
declare const assure: <T>(input: T) => NotNull<IsDefined<T>>;
|
|
5
5
|
interface IsPresentWithAssure {
|
|
6
6
|
<T>(t: T): t is NotNull<IsDefined<T>>;
|
package/dist/checks/isPresent.js
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isPresent = void 0;
|
|
4
4
|
const withAssure_1 = require("../wrappers/withAssure");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const assess = (t) => (0, isNotNull_1.isNotNull)(t) && (0, isNotUndefined_1.isDefined)(t);
|
|
8
|
-
const assure = (0, withAssure_1.asAssure)(assess, { name: 'isPresent' });
|
|
5
|
+
const isPresent_assess_1 = require("./isPresent.assess");
|
|
6
|
+
const assure = (0, withAssure_1.asAssure)(isPresent_assess_1.isPresentAssess, { name: 'isPresent' });
|
|
9
7
|
/**
|
|
10
8
|
* checks whether the value is defined and is not null
|
|
11
9
|
*
|
|
@@ -13,9 +11,9 @@ const assure = (0, withAssure_1.asAssure)(assess, { name: 'isPresent' });
|
|
|
13
11
|
* - https://github.com/microsoft/TypeScript/issues/16069#issuecomment-566222173
|
|
14
12
|
*/
|
|
15
13
|
const isPresentWithAssure = function (...input) {
|
|
16
|
-
return
|
|
14
|
+
return (0, isPresent_assess_1.isPresentAssess)(...input);
|
|
17
15
|
};
|
|
18
16
|
exports.isPresent = isPresentWithAssure;
|
|
19
|
-
isPresentWithAssure.assess =
|
|
17
|
+
isPresentWithAssure.assess = isPresent_assess_1.isPresentAssess;
|
|
20
18
|
isPresentWithAssure.assure = assure;
|
|
21
19
|
//# sourceMappingURL=isPresent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPresent.js","sourceRoot":"","sources":["../../src/checks/isPresent.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;
|
|
1
|
+
{"version":3,"file":"isPresent.js","sourceRoot":"","sources":["../../src/checks/isPresent.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAGlD,yDAA+D;AAE/D,MAAM,MAAM,GAAG,IAAA,qBAAQ,EAAC,kCAAM,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;AAQvD;;;;;GAKG;AACH,MAAM,mBAAmB,GAAwB,UAC/C,GAAG,KAAgC;IAEnC,OAAO,IAAA,kCAAM,EAAC,GAAG,KAAK,CAAC,CAAC;AAC1B,CAGC,CAAC;AAI8B,wCAAS;AAHzC,mBAAmB,CAAC,MAAM,GAAG,kCAAM,CAAC;AACpC,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "type-fns",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "A set of types, type checks, and type guards for simpler, safer, and easier to read code.",
|
|
5
|
-
"version": "1.20.
|
|
5
|
+
"version": "1.20.2",
|
|
6
6
|
"repository": "ehmpathy/type-fns",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/type-fns",
|
|
8
8
|
"keywords": [
|
package/readme.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# type-fns
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
|
|
3
6
|
Narrow your codepaths with generic types, type checks, and type guards for simpler, safer, and easier to read code.
|
|
4
7
|
|
|
5
8
|
# Purpose
|