Skip to content

Commit

Permalink
refactor(common/utils): inline function getType
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed Dec 5, 2023
1 parent fedd4e7 commit f177357
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/common/utils/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

import type { Object as ObjectTypeUtils } from 'ts-toolbelt'

const getType = (value: unknown): string => Object.prototype.toString.call(value).slice(8, -1)

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type PlainObject = Record<string | number | symbol, any>

const isPlainObject = (value: unknown): value is PlainObject => getType(value) === 'Object'
const isPlainObject = (value: unknown): value is PlainObject =>
Object.prototype.toString.call(value) === '[object Object]'

const mergeRecursively = (target: unknown, source: PlainObject): PlainObject => {
const resultObject: PlainObject = {}
Expand Down

0 comments on commit f177357

Please sign in to comment.