@symbo.ls/init 2.11.132 → 2.11.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +5 -4
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  appendIconsSprite
9
9
  } from '@symbo.ls/scratch'
10
10
 
11
- import { isObject, deepMerge } from '@domql/utils'
11
+ import { isObject, deepMerge, deepClone } from '@domql/utils'
12
12
 
13
13
  import { emotion as defaultEmotion } from '@symbo.ls/emotion'
14
14
  // import { setClassname } from 'css-in-props'
@@ -19,8 +19,8 @@ const CONFIG = getActiveConfig()
19
19
 
20
20
  const mergeWithLocalFile = (config = CONFIG, RC_FILE) => {
21
21
  const rcfile = isObject(RC_FILE) ? RC_FILE : DYNAMIC_JSON || {}
22
- const fileData = deepMerge(config, rcfile)
23
- return fileData && fileData.designSystem
22
+ const clonedFile = deepClone(rcfile.designSystem || {})
23
+ return deepMerge(config, clonedFile)
24
24
  }
25
25
 
26
26
  const SET_OPTIONS = {
@@ -35,6 +35,7 @@ const SET_OPTIONS = {
35
35
 
36
36
  export const init = (config, options = SET_OPTIONS) => {
37
37
  const emotion = options.emotion || defaultEmotion
38
+ const resultConfig = mergeWithLocalFile(config || {})
38
39
 
39
40
  const conf = set({
40
41
  verbose: options.verbose,
@@ -44,7 +45,7 @@ export const init = (config, options = SET_OPTIONS) => {
44
45
  useSvgSprite: options.useSvgSprite,
45
46
  useDocumentTheme: options.useDocumentTheme,
46
47
  useIconSprite: options.useIconSprite,
47
- ...config
48
+ ...resultConfig
48
49
  }, { newConfig: options.newConfig })
49
50
 
50
51
  const FontFace = getFontFaceString(conf.FONT)
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/init",
3
- "version": "2.11.132",
3
+ "version": "2.11.162",
4
4
  "license": "MIT",
5
- "gitHead": "13027443598f113dd2b79ddf7aaf1adbd46d97d7",
5
+ "gitHead": "fe3359a1d6c14d38f45f5e5db10ef2056947a228",
6
6
  "source": "index.js",
7
7
  "main": "index.js",
8
8
  "dependencies": {