Skip to content

Commit

Permalink
refactor(guardIs): freeze the object and add date, false, `number…
Browse files Browse the repository at this point in the history
…Between`, `objectKeyIn`, `objectSomeKeys`, `regexp`, `stringLength`, `true`.
  • Loading branch information
sciborrudnicki committed Sep 19, 2021
1 parent 29bae5e commit 09fb70f
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/guard/lib/guard-is.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,56 @@ import { guardArray } from './guard-array.func';
import { guardBigInt } from './guard-big-int.func';
import { guardBoolean } from './guard-boolean.func';
import { guardClass } from './guard-class.func';
import { guardDate } from './guard-date.func';
import { guardDefined } from './guard-defined.func';
import { guardFalse } from './guard-false.func';
import { guardFunction } from './guard-function.func';
import { guardInstance } from './guard-instance.func';
import { guardKey } from './guard-key.func';
import { guardNull } from './guard-null.func';
import { guardNumber } from './guard-number.func';
import { guardNumberBetween } from './guard-number-between.func';
import { guardObject } from './guard-object.func';
import { guardObjectKey } from './guard-object-key.func';
import { guardObjectKeyIn } from './guard-object-key-in.func';
import { guardObjectKeys } from './guard-object-keys.func';
import { guardObjectSomeKeys } from './guard-object-some-keys.func';
import { guardPrimitive } from './guard-primitive.func';
import { guardRegExp } from './guard-regexp.func';
import { guardString } from './guard-string.func';
import { guardStringLength } from './guard-string-length.func';
import { guardSymbol } from './guard-symbol.func';
import { guardTrue } from './guard-true.func';
import { guardType } from './guard-type.func';
import { guardUndefined } from './guard-undefined.func';
// Interface.
import { GuardIs } from '../interface/guard-is.interface';
// `guardIs`.
export const guardIs: GuardIs = {
export const guardIs: GuardIs = Object.freeze({
array: guardArray,
bigint: guardBigInt,
boolean: guardBoolean,
class: guardClass,
date: guardDate,
defined: guardDefined,
false: guardFalse,
function: guardFunction,
instance: guardInstance,
key: guardKey,
null: guardNull,
number: guardNumber,
numberBetween: guardNumberBetween,
object: guardObject,
objectKey: guardObjectKey,
objectKeyIn: guardObjectKeyIn,
objectKeys: guardObjectKeys,
objectSomeKeys: guardObjectSomeKeys,
primitive: guardPrimitive,
regexp: guardRegExp,
string: guardString,
stringLength: guardStringLength,
symbol: guardSymbol,
true: guardTrue,
type: guardType,
undefined: guardUndefined
};
});

0 comments on commit 09fb70f

Please sign in to comment.