@thisisagile/easy 12.18.0 → 12.18.5
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/types/Constructor.js +2 -1
- package/dist/types/Constructor.js.map +1 -1
- package/dist/types/Falsy.d.ts +4 -0
- package/dist/types/Falsy.js +8 -0
- package/dist/types/Falsy.js.map +1 -0
- package/dist/types/Is.d.ts +1 -2
- package/dist/types/Is.js +1 -3
- package/dist/types/Is.js.map +1 -1
- package/dist/types/IsA.js +2 -2
- package/dist/types/IsA.js.map +1 -1
- package/dist/types/Nullish.d.ts +2 -0
- package/dist/types/Nullish.js +6 -0
- package/dist/types/Nullish.js.map +1 -0
- package/dist/types/Primitive.d.ts +2 -0
- package/dist/types/Primitive.js +9 -0
- package/dist/types/Primitive.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -2
- package/src/types/Constructor.ts +2 -1
- package/src/types/Falsy.ts +5 -0
- package/src/types/Is.ts +1 -3
- package/src/types/IsA.ts +1 -1
- package/src/types/Nullish.ts +3 -0
- package/src/types/Primitive.ts +7 -0
- package/src/types/index.ts +4 -0
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ifA = exports.on = exports.toName = exports.ofConstruct = exports.isConstructor = void 0;
|
|
4
4
|
const Func_1 = require("./Func");
|
|
5
5
|
const Is_1 = require("./Is");
|
|
6
|
+
const Primitive_1 = require("./Primitive");
|
|
6
7
|
const isConstructor = (c) => ((0, Is_1.isDefined)(c) && (0, Func_1.isFunc)(c) && c.prototype && c.prototype.constructor) === c;
|
|
7
8
|
exports.isConstructor = isConstructor;
|
|
8
9
|
const ofConstruct = (c, ...args) => ((0, exports.isConstructor)(c) ? new c(...args) : (0, Func_1.isFunc)(c) ? c(...args) : c);
|
|
@@ -14,6 +15,6 @@ const on = (t, f) => {
|
|
|
14
15
|
return t;
|
|
15
16
|
};
|
|
16
17
|
exports.on = on;
|
|
17
|
-
const ifA = (c, t, alt) => (!(0,
|
|
18
|
+
const ifA = (c, t, alt) => (!(0, Primitive_1.isPrimitive)(t) && t instanceof c ? t : alt ? (0, exports.ifA)(c, alt) : undefined);
|
|
18
19
|
exports.ifA = ifA;
|
|
19
20
|
//# sourceMappingURL=Constructor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constructor.js","sourceRoot":"","sources":["../../src/types/Constructor.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"Constructor.js","sourceRoot":"","sources":["../../src/types/Constructor.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAChC,6BAAiC;AACjC,2CAA0C;AAMnC,MAAM,aAAa,GAAG,CAAI,CAAW,EAAuB,EAAE,CAAC,CAAC,IAAA,cAAS,EAAC,CAAC,CAAC,IAAI,IAAA,aAAM,EAAa,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAAjJ,QAAA,aAAa,iBAAoI;AAEvJ,MAAM,WAAW,GAAG,CAAI,CAAe,EAAE,GAAG,IAAe,EAAK,EAAE,CAAC,CAAC,IAAA,qBAAa,EAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,aAAM,EAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAA7I,QAAA,WAAW,eAAkI;AAEnJ,MAAM,MAAM,GAAG,CAAC,OAAiB,EAAE,OAAO,GAAG,EAAE,EAAU,EAAE,CAAE,OAAe,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;AAApI,QAAA,MAAM,UAA8H;AAE1I,MAAM,EAAE,GAAG,CAAI,CAAI,EAAE,CAAoB,EAAK,EAAE;IACrD,CAAC,CAAC,CAAC,CAAC,CAAC;IACL,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAHW,QAAA,EAAE,MAGb;AAEK,MAAM,GAAG,GAAG,CAAI,CAAiB,EAAE,CAAW,EAAE,GAAa,EAAiB,EAAE,CAAC,CAAC,CAAC,IAAA,uBAAW,EAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,WAAG,EAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAAnJ,QAAA,GAAG,OAAgJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTruthy = exports.isFalsy = void 0;
|
|
4
|
+
const isFalsy = (v) => !v;
|
|
5
|
+
exports.isFalsy = isFalsy;
|
|
6
|
+
const isTruthy = (v) => !(0, exports.isFalsy)(v);
|
|
7
|
+
exports.isTruthy = isTruthy;
|
|
8
|
+
//# sourceMappingURL=Falsy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Falsy.js","sourceRoot":"","sources":["../../src/types/Falsy.ts"],"names":[],"mappings":";;;AAGO,MAAM,OAAO,GAAG,CAAC,CAAW,EAAc,EAAE,CAAC,CAAC,CAAC,CAAC;AAA1C,QAAA,OAAO,WAAmC;AAChD,MAAM,QAAQ,GAAG,CAAC,CAAW,EAAe,EAAE,CAAC,CAAC,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;AAArD,QAAA,QAAQ,YAA6C"}
|
package/dist/types/Is.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const isNotEmpty: <T = unknown>(o?: unknown) => o is NonNullable<
|
|
|
6
6
|
export declare const isString: (o?: unknown) => o is string;
|
|
7
7
|
export declare const isIsoDateString: (o?: unknown) => o is string;
|
|
8
8
|
export declare const isBoolean: (o?: unknown) => o is boolean;
|
|
9
|
-
export declare const isTrue: (o?: unknown) =>
|
|
9
|
+
export declare const isTrue: (o?: unknown) => o is true;
|
|
10
10
|
export declare const isNumber: (o?: unknown) => o is number;
|
|
11
11
|
export declare const isObject: (o?: unknown) => o is Record<string, unknown>;
|
|
12
12
|
export declare const isEmptyObject: (o?: unknown) => boolean;
|
|
@@ -15,5 +15,4 @@ export declare const isArray: <T = any>(o?: unknown) => o is T[];
|
|
|
15
15
|
export declare const isInstance: <T>(ctor: Constructor<T>, o?: unknown) => o is T;
|
|
16
16
|
export declare const isIn: (o: unknown, values: unknown[]) => boolean;
|
|
17
17
|
export declare const isIntersecting: (o?: unknown[], values?: unknown[]) => boolean;
|
|
18
|
-
export declare const isPrimitive: (o?: unknown) => boolean;
|
|
19
18
|
export declare const isError: (e: unknown) => e is Error;
|
package/dist/types/Is.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isError = exports.
|
|
3
|
+
exports.isError = exports.isIntersecting = exports.isIn = exports.isInstance = exports.isArray = exports.isFunction = exports.isEmptyObject = exports.isObject = exports.isNumber = exports.isTrue = exports.isBoolean = exports.isIsoDateString = exports.isString = exports.isNotEmpty = exports.isEmpty = exports.isUndefined = exports.isDefined = void 0;
|
|
4
4
|
const isDefined = (o) => o !== undefined && o !== null;
|
|
5
5
|
exports.isDefined = isDefined;
|
|
6
6
|
const isUndefined = (v) => v === undefined || v === null;
|
|
@@ -33,8 +33,6 @@ const isIn = (o, values) => (0, exports.isArray)(values) && values.some(v => v =
|
|
|
33
33
|
exports.isIn = isIn;
|
|
34
34
|
const isIntersecting = (o, values) => (0, exports.isArray)(o) && (0, exports.isArray)(values) && o.some(ov => (0, exports.isIn)(ov, values));
|
|
35
35
|
exports.isIntersecting = isIntersecting;
|
|
36
|
-
const isPrimitive = (o) => !(0, exports.isObject)(o) && !(0, exports.isFunction)(o) && !(0, exports.isArray)(o);
|
|
37
|
-
exports.isPrimitive = isPrimitive;
|
|
38
36
|
const isError = (e) => (0, exports.isDefined)(e) && e instanceof Error;
|
|
39
37
|
exports.isError = isError;
|
|
40
38
|
//# sourceMappingURL=Is.js.map
|
package/dist/types/Is.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Is.js","sourceRoot":"","sources":["../../src/types/Is.ts"],"names":[],"mappings":";;;AAEO,MAAM,SAAS,GAAG,CAAc,CAAK,EAAuB,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AAAvF,QAAA,SAAS,aAA8E;AAE7F,MAAM,WAAW,GAAG,CAAC,CAAW,EAAc,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AAAzE,QAAA,WAAW,eAA8D;AAE/E,MAAM,OAAO,GAAG,CAAC,CAAW,EAAW,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,IAAA,eAAO,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;AAAhH,QAAA,OAAO,WAAyG;AAEtH,MAAM,UAAU,GAAG,CAAc,CAAW,EAAuB,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,IAAA,eAAO,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAA3I,QAAA,UAAU,cAAiI;AAEjJ,MAAM,QAAQ,GAAG,CAAC,CAAW,EAAe,EAAE,CAAC,CAAC,YAAY,MAAM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|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isAn = exports.isA = void 0;
|
|
4
|
-
const
|
|
5
|
-
const isA = (t, ...properties) => !(0,
|
|
4
|
+
const Primitive_1 = require("./Primitive");
|
|
5
|
+
const isA = (t, ...properties) => !(0, Primitive_1.isPrimitive)(t) && properties.every(p => p.toString() in t);
|
|
6
6
|
exports.isA = isA;
|
|
7
7
|
exports.isAn = exports.isA;
|
|
8
8
|
//# sourceMappingURL=IsA.js.map
|
package/dist/types/IsA.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsA.js","sourceRoot":"","sources":["../../src/types/IsA.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"IsA.js","sourceRoot":"","sources":["../../src/types/IsA.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAEnC,MAAM,GAAG,GAAG,CAAI,CAAW,EAAE,GAAG,UAAuB,EAAU,EAAE,CAAC,CAAC,IAAA,uBAAW,EAAC,CAAC,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAK,CAAS,CAAC,CAAC;AAAnI,QAAA,GAAG,OAAgI;AACnI,QAAA,IAAI,GAAG,WAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nullish.js","sourceRoot":"","sources":["../../src/types/Nullish.ts"],"names":[],"mappings":";;;AAEO,MAAM,SAAS,GAAG,CAAC,CAAW,EAAgB,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;AAArD,QAAA,SAAS,aAA4C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPrimitive = void 0;
|
|
4
|
+
const Is_1 = require("./Is");
|
|
5
|
+
const isPrimitive = (v) => {
|
|
6
|
+
return v === null || v === undefined || (0, Is_1.isIn)(typeof v, ['string', 'number', 'bigint', 'boolean', 'symbol']);
|
|
7
|
+
};
|
|
8
|
+
exports.isPrimitive = isPrimitive;
|
|
9
|
+
//# sourceMappingURL=Primitive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Primitive.js","sourceRoot":"","sources":["../../src/types/Primitive.ts"],"names":[],"mappings":";;;AAAA,6BAA4B;AAIrB,MAAM,WAAW,GAAG,CAAC,CAAW,EAAkB,EAAE;IACzD,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,IAAA,SAAI,EAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC9G,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './Context';
|
|
|
8
8
|
export * from './Enum';
|
|
9
9
|
export * from './ErrorOrigin';
|
|
10
10
|
export * from './Exception';
|
|
11
|
+
export * from './Falsy';
|
|
11
12
|
export * from './Func';
|
|
12
13
|
export * from './Gateway';
|
|
13
14
|
export * from './Get';
|
|
@@ -21,7 +22,9 @@ export * from './Json';
|
|
|
21
22
|
export * from './List';
|
|
22
23
|
export * from './Message';
|
|
23
24
|
export * from './Meta';
|
|
25
|
+
export * from './Nullish';
|
|
24
26
|
export * from './Number';
|
|
27
|
+
export * from './Primitive';
|
|
25
28
|
export * from './Repository';
|
|
26
29
|
export * from './Result';
|
|
27
30
|
export * from './Results';
|
|
@@ -35,3 +38,4 @@ export * from './Uri';
|
|
|
35
38
|
export * from './Uuid';
|
|
36
39
|
export * from './Validatable';
|
|
37
40
|
export * from './Value';
|
|
41
|
+
export { isPrimitive } from './Primitive';
|
package/dist/types/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.isPrimitive = void 0;
|
|
17
18
|
__exportStar(require("./Array"), exports);
|
|
18
19
|
__exportStar(require("./Builder"), exports);
|
|
19
20
|
__exportStar(require("./Cache"), exports);
|
|
@@ -24,6 +25,7 @@ __exportStar(require("./Context"), exports);
|
|
|
24
25
|
__exportStar(require("./Enum"), exports);
|
|
25
26
|
__exportStar(require("./ErrorOrigin"), exports);
|
|
26
27
|
__exportStar(require("./Exception"), exports);
|
|
28
|
+
__exportStar(require("./Falsy"), exports);
|
|
27
29
|
__exportStar(require("./Func"), exports);
|
|
28
30
|
__exportStar(require("./Gateway"), exports);
|
|
29
31
|
__exportStar(require("./Get"), exports);
|
|
@@ -37,7 +39,9 @@ __exportStar(require("./Json"), exports);
|
|
|
37
39
|
__exportStar(require("./List"), exports);
|
|
38
40
|
__exportStar(require("./Message"), exports);
|
|
39
41
|
__exportStar(require("./Meta"), exports);
|
|
42
|
+
__exportStar(require("./Nullish"), exports);
|
|
40
43
|
__exportStar(require("./Number"), exports);
|
|
44
|
+
__exportStar(require("./Primitive"), exports);
|
|
41
45
|
__exportStar(require("./Repository"), exports);
|
|
42
46
|
__exportStar(require("./Result"), exports);
|
|
43
47
|
__exportStar(require("./Results"), exports);
|
|
@@ -51,4 +55,6 @@ __exportStar(require("./Uri"), exports);
|
|
|
51
55
|
__exportStar(require("./Uuid"), exports);
|
|
52
56
|
__exportStar(require("./Validatable"), exports);
|
|
53
57
|
__exportStar(require("./Value"), exports);
|
|
58
|
+
var Primitive_1 = require("./Primitive");
|
|
59
|
+
Object.defineProperty(exports, "isPrimitive", { enumerable: true, get: function () { return Primitive_1.isPrimitive; } });
|
|
54
60
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B;AAC1B,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;AACvB,gDAA8B;AAC9B,4CAA0B;AAC1B,yCAAuB;AACvB,gDAA8B;AAC9B,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,wCAAsB;AACtB,uCAAqB;AACrB,6CAA2B;AAC3B,uCAAqB;AACrB,wCAAsB;AACtB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,8CAA4B;AAC5B,+CAA6B;AAC7B,2CAAyB;AACzB,4CAA0B;AAC1B,wCAAsB;AACtB,6CAA2B;AAC3B,yCAAuB;AACvB,6CAA2B;AAC3B,wCAAsB;AACtB,0CAAwB;AACxB,wCAAsB;AACtB,yCAAuB;AACvB,gDAA8B;AAC9B,0CAAwB;AACxB,yCAA0C;AAAjC,wGAAA,WAAW,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "12.18.
|
|
3
|
+
"version": "12.18.5",
|
|
4
4
|
"description": "Straightforward library for building domain-driven microservice architectures",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@thisisagile/easy-test": "12.18.
|
|
34
|
+
"@thisisagile/easy-test": "12.18.5",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^8.5.9",
|
|
37
37
|
"@types/luxon": "3.1.0",
|
package/src/types/Constructor.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Get } from './Get';
|
|
2
2
|
import { isFunc } from './Func';
|
|
3
|
-
import { isDefined
|
|
3
|
+
import { isDefined } from './Is';
|
|
4
|
+
import { isPrimitive } from './Primitive';
|
|
4
5
|
|
|
5
6
|
export type Constructor<T = unknown> = { new (...args: any[]): T };
|
|
6
7
|
|
package/src/types/Is.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const isIsoDateString = (o?: unknown): o is string =>
|
|
|
15
15
|
|
|
16
16
|
export const isBoolean = (o?: unknown): o is boolean => isDefined(o) && typeof o === 'boolean';
|
|
17
17
|
|
|
18
|
-
export const isTrue = (o?: unknown):
|
|
18
|
+
export const isTrue = (o?: unknown): o is true => (isFunction(o) ? isTrue(o()) : isBoolean(o) ? o : !!o);
|
|
19
19
|
|
|
20
20
|
export const isNumber = (o?: unknown): o is number => isDefined(o) && typeof o === 'number' && !Number.isNaN(o);
|
|
21
21
|
|
|
@@ -33,6 +33,4 @@ export const isIn = (o: unknown, values: unknown[]): boolean => isArray(values)
|
|
|
33
33
|
|
|
34
34
|
export const isIntersecting = (o?: unknown[], values?: unknown[]): boolean => isArray(o) && isArray(values) && o.some(ov => isIn(ov, values));
|
|
35
35
|
|
|
36
|
-
export const isPrimitive = (o?: unknown): boolean => !isObject(o) && !isFunction(o) && !isArray(o);
|
|
37
|
-
|
|
38
36
|
export const isError = (e: unknown): e is Error => isDefined(e) && e instanceof Error;
|
package/src/types/IsA.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { isIn } from './Is';
|
|
2
|
+
|
|
3
|
+
export type Primitive = string | number | bigint | boolean | symbol | null | undefined;
|
|
4
|
+
|
|
5
|
+
export const isPrimitive = (v?: unknown): v is Primitive => {
|
|
6
|
+
return v === null || v === undefined || isIn(typeof v, ['string', 'number', 'bigint', 'boolean', 'symbol']);
|
|
7
|
+
};
|
package/src/types/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './Context';
|
|
|
8
8
|
export * from './Enum';
|
|
9
9
|
export * from './ErrorOrigin';
|
|
10
10
|
export * from './Exception';
|
|
11
|
+
export * from './Falsy';
|
|
11
12
|
export * from './Func';
|
|
12
13
|
export * from './Gateway';
|
|
13
14
|
export * from './Get';
|
|
@@ -21,7 +22,9 @@ export * from './Json';
|
|
|
21
22
|
export * from './List';
|
|
22
23
|
export * from './Message';
|
|
23
24
|
export * from './Meta';
|
|
25
|
+
export * from './Nullish';
|
|
24
26
|
export * from './Number';
|
|
27
|
+
export * from './Primitive';
|
|
25
28
|
export * from './Repository';
|
|
26
29
|
export * from './Result';
|
|
27
30
|
export * from './Results';
|
|
@@ -35,3 +38,4 @@ export * from './Uri';
|
|
|
35
38
|
export * from './Uuid';
|
|
36
39
|
export * from './Validatable';
|
|
37
40
|
export * from './Value';
|
|
41
|
+
export { isPrimitive } from './Primitive';
|