Skip to content

Commit e6b62e2

Browse files
refactor(guardIs): preserve the guard object only.
1 parent d8d7222 commit e6b62e2

File tree

2 files changed

+68
-77
lines changed

2 files changed

+68
-77
lines changed

src/lib/guard-is.object.ts

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/lib/guard.object.ts

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,68 @@
1-
// Import: Object.
2-
import { guardIs } from './guard-is.object';
3-
// Import: Interface.
4-
import { Guard } from '../interface/guard-interface';
5-
/**
6-
* @description
7-
* @type {Guard}
8-
*/
9-
export const guard: Guard = Object.freeze({ ...guardIs });
1+
// Function.
2+
import {
3+
guardArray,
4+
guardBigInt,
5+
guardBoolean,
6+
guardClass,
7+
guardDate,
8+
guardDefined,
9+
guardFalse,
10+
guardFunction,
11+
guardInstance,
12+
guardKey,
13+
guardNull,
14+
guardNumber,
15+
guardNumberBetween,
16+
guardObject,
17+
guardObjectKey,
18+
guardObjectKeyIn,
19+
guardObjectKeys,
20+
guardObjectKeysIn,
21+
guardObjectSomeKeys,
22+
guardPrimitive,
23+
guardRegExp,
24+
guardString,
25+
guardStringIncludes,
26+
guardStringIncludesSome,
27+
guardStringLength,
28+
guardStringLengthBetween,
29+
guardSymbol,
30+
guardTrue,
31+
guardType,
32+
guardUndefined
33+
} from './index';
34+
// Interface.
35+
import { Guard } from '../interface';
36+
// `guardIs`.
37+
export const guard: Guard = Object.freeze({
38+
array: guardArray,
39+
bigint: guardBigInt,
40+
boolean: guardBoolean,
41+
class: guardClass,
42+
date: guardDate,
43+
defined: guardDefined,
44+
false: guardFalse,
45+
function: guardFunction,
46+
instance: guardInstance,
47+
key: guardKey,
48+
null: guardNull,
49+
number: guardNumber,
50+
numberBetween: guardNumberBetween,
51+
object: guardObject,
52+
objectKey: guardObjectKey,
53+
objectKeyIn: guardObjectKeyIn,
54+
objectKeys: guardObjectKeys,
55+
objectKeysIn: guardObjectKeysIn,
56+
objectSomeKeys: guardObjectSomeKeys,
57+
primitive: guardPrimitive,
58+
regexp: guardRegExp,
59+
string: guardString,
60+
stringIncludes: guardStringIncludes,
61+
stringIncludesSome: guardStringIncludesSome,
62+
stringLength: guardStringLength,
63+
stringLengthBetween: guardStringLengthBetween,
64+
symbol: guardSymbol,
65+
true: guardTrue,
66+
type: guardType,
67+
undefined: guardUndefined
68+
});

0 commit comments

Comments
 (0)