@tstdl/base 0.91.25 → 0.91.26
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/package.json +3 -3
- package/utils/type-guards.d.ts +6 -6
- package/utils/type-guards.js +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.91.
|
|
3
|
+
"version": "0.91.26",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -152,10 +152,10 @@
|
|
|
152
152
|
"mongodb": "^6.9",
|
|
153
153
|
"nodemailer": "^6.9",
|
|
154
154
|
"pg": "^8.13",
|
|
155
|
-
"playwright": "^1.
|
|
155
|
+
"playwright": "^1.48",
|
|
156
156
|
"preact": "^10.24",
|
|
157
157
|
"preact-render-to-string": "^6.5",
|
|
158
|
-
"undici": "^6.
|
|
158
|
+
"undici": "^6.20",
|
|
159
159
|
"urlpattern-polyfill": "^10.0"
|
|
160
160
|
},
|
|
161
161
|
"peerDependenciesMeta": {
|
package/utils/type-guards.d.ts
CHANGED
|
@@ -35,12 +35,12 @@ export declare const assertNull: AssertFunction<null>;
|
|
|
35
35
|
export declare const assertNotNull: AssertNotFunction<null>;
|
|
36
36
|
export declare const assertNullPass: AssertPassFunction<null>;
|
|
37
37
|
export declare const assertNotNullPass: AssertNotPassFunction<null>;
|
|
38
|
-
export declare const isNullOrUndefined:
|
|
39
|
-
export declare const isNotNullOrUndefined: IsNotFunction<null | undefined>;
|
|
40
|
-
export declare const assertNullOrUndefined:
|
|
41
|
-
export declare const assertNotNullOrUndefined: AssertNotFunction<null | undefined>;
|
|
42
|
-
export declare const assertNullOrUndefinedPass:
|
|
43
|
-
export declare const assertNotNullOrUndefinedPass: AssertNotPassFunction<null | undefined>;
|
|
38
|
+
export declare const isNullOrUndefined: (value: any) => value is null | undefined;
|
|
39
|
+
export declare const isNotNullOrUndefined: IsNotFunction<null | undefined | void>;
|
|
40
|
+
export declare const assertNullOrUndefined: (value: any, message?: AssertionMessage) => asserts value is null | undefined;
|
|
41
|
+
export declare const assertNotNullOrUndefined: AssertNotFunction<null | undefined | void>;
|
|
42
|
+
export declare const assertNullOrUndefinedPass: (value: any, message?: AssertionMessage) => null | undefined;
|
|
43
|
+
export declare const assertNotNullOrUndefinedPass: AssertNotPassFunction<null | undefined | void>;
|
|
44
44
|
export declare const isNumber: IsFunction<number>;
|
|
45
45
|
export declare const isNotNumber: IsNotFunction<number>;
|
|
46
46
|
export declare const assertNumber: AssertFunction<number>;
|
package/utils/type-guards.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* eslint-disable
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
2
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-invalid-void-type */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-type-parameters */
|
|
2
5
|
import { supportsBlob, supportsReadableStream } from '../supports.js';
|
|
3
6
|
import { AssertionError } from '../errors/assertion.error.js';
|
|
4
7
|
export function assert(condition, message = 'assertion failed') {
|
|
@@ -104,14 +107,14 @@ export const assertSymbol = symbolGuards.assertSymbol;
|
|
|
104
107
|
export const assertNotSymbol = symbolGuards.assertNotSymbol;
|
|
105
108
|
export const assertSymbolPass = symbolGuards.assertSymbolPass;
|
|
106
109
|
export const assertNotSymbolPass = symbolGuards.assertNotSymbolPass;
|
|
107
|
-
const literalObjectGuards = createGuards('literal object', (value) => (typeof value == 'object') && (value
|
|
110
|
+
const literalObjectGuards = createGuards('literal object', (value) => (typeof value == 'object') && (value !== null) && (Reflect.getPrototypeOf(value) == Object.prototype) && (Reflect.getPrototypeOf(value).constructor == Object));
|
|
108
111
|
export const isLiteralObject = literalObjectGuards.isLiteralObject;
|
|
109
112
|
export const isNotLiteralObject = literalObjectGuards.isNotLiteralObject;
|
|
110
113
|
export const assertLiteralObject = literalObjectGuards.assertLiteralObject;
|
|
111
114
|
export const assertNotLiteralObject = literalObjectGuards.assertNotLiteralObject;
|
|
112
115
|
export const assertLiteralObjectPass = literalObjectGuards.assertLiteralObjectPass;
|
|
113
116
|
export const assertNotLiteralObjectPass = literalObjectGuards.assertNotLiteralObjectPass;
|
|
114
|
-
const objectGuards = createGuards('object', (value) => (typeof value == 'object') && (value
|
|
117
|
+
const objectGuards = createGuards('object', (value) => (typeof value == 'object') && (value !== null));
|
|
115
118
|
export const isObject = objectGuards.isObject;
|
|
116
119
|
export const isNotObject = objectGuards.isNotObject;
|
|
117
120
|
export const assertObject = objectGuards.assertObject;
|
|
@@ -313,7 +316,7 @@ export const assertPromise = promiseGuards.assertPromise;
|
|
|
313
316
|
export const assertNotPromise = promiseGuards.assertNotPromise;
|
|
314
317
|
export const assertPromisePass = promiseGuards.assertPromisePass;
|
|
315
318
|
export const assertNotPromisePass = promiseGuards.assertNotPromisePass;
|
|
316
|
-
const promiseLikeGuards = createGuards('PromiseLike', (value) => isPromise(value) || ((((typeof value == 'object') && (value
|
|
319
|
+
const promiseLikeGuards = createGuards('PromiseLike', (value) => isPromise(value) || ((((typeof value == 'object') && (value !== null)) || isFunction(value)) && ((typeof value.then) == 'function')));
|
|
317
320
|
export const isPromiseLike = promiseLikeGuards.isPromiseLike;
|
|
318
321
|
export const isNotPromiseLike = promiseLikeGuards.isNotPromiseLike;
|
|
319
322
|
export const assertPromiseLike = promiseLikeGuards.assertPromiseLike;
|