X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils.ts;h=a33758ce64c1ad72890b8d6e8b40b96336316c65;hb=eceaf36f69c97b0376194a849e77f6ea15fb8f7b;hp=d74cfbfd3768592134fce5df367bb15ab299d5d4;hpb=e9ed6eeed0f1c96d89c1506ee342b3000a95b4ba;p=poolifier.git diff --git a/src/utils.ts b/src/utils.ts index d74cfbfd..a33758ce 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -118,24 +118,24 @@ export const round = (num: number, scale = 2): number => { } /** - * Is the given object a plain object? + * Is the given value a plain object? * - * @param obj - The object to check. - * @returns `true` if the given object is a plain object, `false` otherwise. + * @param value - The value to check. + * @returns `true` if the given value is a plain object, `false` otherwise. * @internal */ -export const isPlainObject = (obj: unknown): obj is object => - typeof obj === 'object' && - obj !== null && - obj.constructor === Object && - Object.prototype.toString.call(obj) === '[object Object]' +export const isPlainObject = (value: unknown): value is object => + typeof value === 'object' && + value !== null && + value.constructor === Object && + Object.prototype.toString.call(value) === '[object Object]' /** * Detects whether the given value is a kill behavior or not. * * @typeParam KB - Which specific KillBehavior type to test against. * @param killBehavior - Which kind of kill behavior to detect. - * @param value - Any value. + * @param value - Unknown value. * @returns `true` if `value` was strictly equals to `killBehavior`, otherwise `false`. * @internal */