From a8e856663f8c57c3c89271c1c1948ecdc96b01d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Aeebor=20Rudnicki?= Date: Sun, 19 Sep 2021 15:37:59 +0200 Subject: [PATCH] refactor(guard/type): remove guard function types. --- src/guard/type/guard-array.type.ts | 2 -- src/guard/type/guard-big-int.type.ts | 2 -- src/guard/type/guard-boolean.type.ts | 3 --- src/guard/type/guard-class.type.ts | 2 -- src/guard/type/guard-defined.type.ts | 6 ------ src/guard/type/guard-function.type.ts | 3 --- src/guard/type/guard-instance.type.ts | 3 --- src/guard/type/guard-key.type.ts | 3 --- src/guard/type/guard-null.type.ts | 2 -- src/guard/type/guard-number.type.ts | 3 --- src/guard/type/guard-object-key.type.ts | 4 ---- src/guard/type/guard-object-keys.type.ts | 1 - src/guard/type/guard-object.type.ts | 2 -- src/guard/type/guard-primitive.type.ts | 4 ---- src/guard/type/guard-string.type.ts | 3 --- src/guard/type/guard-symbol.type.ts | 2 -- src/guard/type/guard-type.type.ts | 4 ---- src/guard/type/guard-undefined.type.ts | 2 -- 18 files changed, 51 deletions(-) delete mode 100644 src/guard/type/guard-array.type.ts delete mode 100644 src/guard/type/guard-big-int.type.ts delete mode 100644 src/guard/type/guard-boolean.type.ts delete mode 100644 src/guard/type/guard-class.type.ts delete mode 100644 src/guard/type/guard-defined.type.ts delete mode 100644 src/guard/type/guard-function.type.ts delete mode 100644 src/guard/type/guard-instance.type.ts delete mode 100644 src/guard/type/guard-key.type.ts delete mode 100644 src/guard/type/guard-null.type.ts delete mode 100644 src/guard/type/guard-number.type.ts delete mode 100644 src/guard/type/guard-object-key.type.ts delete mode 100644 src/guard/type/guard-object-keys.type.ts delete mode 100644 src/guard/type/guard-object.type.ts delete mode 100644 src/guard/type/guard-primitive.type.ts delete mode 100644 src/guard/type/guard-string.type.ts delete mode 100644 src/guard/type/guard-symbol.type.ts delete mode 100644 src/guard/type/guard-type.type.ts delete mode 100644 src/guard/type/guard-undefined.type.ts diff --git a/src/guard/type/guard-array.type.ts b/src/guard/type/guard-array.type.ts deleted file mode 100644 index 9599fb30..00000000 --- a/src/guard/type/guard-array.type.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardArray = (value: Array, callback?: ResultCallback) => value is Array; diff --git a/src/guard/type/guard-big-int.type.ts b/src/guard/type/guard-big-int.type.ts deleted file mode 100644 index 25f520e3..00000000 --- a/src/guard/type/guard-big-int.type.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardBigInt = (value: bigint, callback?: ResultCallback) => value is bigint; diff --git a/src/guard/type/guard-boolean.type.ts b/src/guard/type/guard-boolean.type.ts deleted file mode 100644 index 853405e4..00000000 --- a/src/guard/type/guard-boolean.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { AnyBoolean } from '../../type/any-boolean.type'; -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardBoolean = (value: B, callback?: ResultCallback) => value is B; diff --git a/src/guard/type/guard-class.type.ts b/src/guard/type/guard-class.type.ts deleted file mode 100644 index 55baf65f..00000000 --- a/src/guard/type/guard-class.type.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardClass = (value: Class, callback?: ResultCallback) => value is Class; diff --git a/src/guard/type/guard-defined.type.ts b/src/guard/type/guard-defined.type.ts deleted file mode 100644 index c64b1774..00000000 --- a/src/guard/type/guard-defined.type.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Defined } from '../../type/defined.type'; -import { ResultCallback } from '../../type/result-callback.type'; -/** - * guardDefined function type. - */ -export type GuardDefined = (value: Defined, callback?: ResultCallback) => value is Defined; diff --git a/src/guard/type/guard-function.type.ts b/src/guard/type/guard-function.type.ts deleted file mode 100644 index 82f6b8c0..00000000 --- a/src/guard/type/guard-function.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Func } from '../../type/func.type'; -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardFunction = (value: Func, callback?: ResultCallback) => value is Func; diff --git a/src/guard/type/guard-instance.type.ts b/src/guard/type/guard-instance.type.ts deleted file mode 100644 index 1ec6f4a0..00000000 --- a/src/guard/type/guard-instance.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Constructor } from '../../type/constructor.type'; -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardInstance = (value: Obj, constructor: Constructor, callback?: ResultCallback) => value is Obj; diff --git a/src/guard/type/guard-key.type.ts b/src/guard/type/guard-key.type.ts deleted file mode 100644 index 5ae0b94f..00000000 --- a/src/guard/type/guard-key.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Key } from '../../type/key.type'; -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardKey = (value: Key, callback?: ResultCallback) => value is Key; diff --git a/src/guard/type/guard-null.type.ts b/src/guard/type/guard-null.type.ts deleted file mode 100644 index 75643565..00000000 --- a/src/guard/type/guard-null.type.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardNull = (value: null, callback?: ResultCallback) => value is null; diff --git a/src/guard/type/guard-number.type.ts b/src/guard/type/guard-number.type.ts deleted file mode 100644 index 45fafdb1..00000000 --- a/src/guard/type/guard-number.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -import { AnyNumber } from '../../type/any-number.type'; -export type GuardNumber = (value: N, callback?: ResultCallback) => value is N; diff --git a/src/guard/type/guard-object-key.type.ts b/src/guard/type/guard-object-key.type.ts deleted file mode 100644 index 7cbab0d6..00000000 --- a/src/guard/type/guard-object-key.type.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardObjectKey = (value: Obj, key: keyof Obj | (keyof Obj)[], callback?: ResultCallback) => value is Obj; - - diff --git a/src/guard/type/guard-object-keys.type.ts b/src/guard/type/guard-object-keys.type.ts deleted file mode 100644 index adba7c44..00000000 --- a/src/guard/type/guard-object-keys.type.ts +++ /dev/null @@ -1 +0,0 @@ -export type GuardObjectKeys = (value: Obj, ...keys: (keyof Obj | Array)[]) => value is Obj; diff --git a/src/guard/type/guard-object.type.ts b/src/guard/type/guard-object.type.ts deleted file mode 100644 index 761a5e83..00000000 --- a/src/guard/type/guard-object.type.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardObject = (value: Obj, callback?: ResultCallback) => value is Obj; diff --git a/src/guard/type/guard-primitive.type.ts b/src/guard/type/guard-primitive.type.ts deleted file mode 100644 index fc0a2467..00000000 --- a/src/guard/type/guard-primitive.type.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Primitive } from '../../type/primitive.type'; -import { Primitives } from '../../type/primitives.type'; -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardPrimitive = (value: T, type: Primitives, callback?: ResultCallback) => value is T; diff --git a/src/guard/type/guard-string.type.ts b/src/guard/type/guard-string.type.ts deleted file mode 100644 index b9bc2f3e..00000000 --- a/src/guard/type/guard-string.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { AnyString } from '../../type/any-string.type'; -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardString = (value: S, callback?: ResultCallback) => value is S; diff --git a/src/guard/type/guard-symbol.type.ts b/src/guard/type/guard-symbol.type.ts deleted file mode 100644 index 8cd97295..00000000 --- a/src/guard/type/guard-symbol.type.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardSymbol = (value: symbol, callback?: ResultCallback) => value is symbol; diff --git a/src/guard/type/guard-type.type.ts b/src/guard/type/guard-type.type.ts deleted file mode 100644 index 6563c07a..00000000 --- a/src/guard/type/guard-type.type.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -import { Types } from '../../type/types.type'; -import { Type } from '../../type/type.type'; -export type GuardType = (value: T, type: Types, callback?: ResultCallback) => value is T; diff --git a/src/guard/type/guard-undefined.type.ts b/src/guard/type/guard-undefined.type.ts deleted file mode 100644 index 875793e2..00000000 --- a/src/guard/type/guard-undefined.type.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ResultCallback } from '../../type/result-callback.type'; -export type GuardUndefined = (value: undefined, callback?: ResultCallback) => value is undefined;