Skip to content

Commit

Permalink
fix: use utils getType
Browse files Browse the repository at this point in the history
  • Loading branch information
hexqi committed May 28, 2024
1 parent 85545da commit b87a2d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/design-core/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import { injectGlobalComponents } from '@opentiny/tiny-engine-common'
import { initHttp } from '@opentiny/tiny-engine-http'
import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
import { tinySmbTheme } from '@opentiny/vue-theme/theme' // SMB 主题
import { utils } from '@opentiny/tiny-engine-utils'
import { defineEntry } from '@opentiny/tiny-engine-entry'
import App from './App.vue'
import defaultRegistry from '../registry.js'

import 'virtual:svg-icons-register'

const type = (obj) => {
return Object.prototype.toString.call(obj).match(/\[object (.*)\]/)[1]
}
const { getType } = utils

const mergeRegistry = (registry) => {
for (const [key, value] of Object.entries(registry)) {
Expand All @@ -43,7 +42,7 @@ const mergeRegistry = (registry) => {
})
}

if (type(value) === 'Object' && defaultConfig) {
if (getType(value) === 'Object' && defaultConfig) {
registry[key] = merge(defaultConfig, registry[key])
}
}
Expand Down

0 comments on commit b87a2d8

Please sign in to comment.