Skip to content

Commit

Permalink
Merge pull request #30 from vodyani/beta_8.x
Browse files Browse the repository at this point in the history
fix: validate dictionary class or function
  • Loading branch information
ChoGathK authored Aug 11, 2022
2 parents c22f350 + 0168948 commit 97ce710
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/method/validate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stream } from 'stream';

import { isArray, isBuffer, isFunction, isMap, isNil, isNumber, isObject, isSet, isString, isSymbol } from 'lodash';
import { isArray, isBuffer, isMap, isNil, isNumber, isObject, isSet, isString, isSymbol } from 'lodash';

/**
* Checks if the data is non-empty.
Expand Down Expand Up @@ -82,7 +82,7 @@ export function isValidBuffer(data: Buffer) {
/**
* Checks whether the current object is a dictionary.
*
* Dictionary is not in (`Map`/`Set`/`Symbol`/`Array`/`Function`/`String`/`Number`/`Boolean`).
* Dictionary is not in (`Map`/`Set`/`Symbol`/`Array`/`String`/`Number`/`Boolean`).
*
* @param dict The object to judge.
* @returns boolean
Expand All @@ -95,7 +95,6 @@ export function isValidDict(dict: any) {
&& !isSet(dict)
&& !isArray(dict)
&& !isSymbol(dict)
&& !isFunction(dict)
&& !(dict instanceof String)
&& !(dict instanceof Number)
&& !(dict instanceof Boolean);
Expand Down

0 comments on commit 97ce710

Please sign in to comment.