* actually using result from deepMerge when updating settings
* replacing merge from lodash with merge from deepmerge

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
This commit is contained in:
Leonardo Salgueiro
2023-08-29 23:15:45 -07:00
committed by GitHub
parent 10caacd830
commit 5e1117ef92
5 changed files with 13 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import { SettingSchemaDesc, StyleString, UIOptions } from './LSPlugin'
import { PluginLocal } from './LSPlugin.core'
import * as nodePath from 'path'
import DOMPurify from 'dompurify'
import { merge } from 'lodash-es'
import merge from 'deepmerge';
import { snakeCase } from 'snake-case'
import * as callables from './callable.apis'
import EventEmitter from 'eventemitter3'
@@ -52,7 +52,10 @@ export function isObject(item: any) {
return item === Object(item) && !Array.isArray(item)
}
export const deepMerge = merge
export function deepMerge<T>(a: Partial<T>, b: Partial<T>): T {
const overwriteArrayMerge = (destinationArray, sourceArray) => sourceArray
return merge(a, b, { arrayMerge: overwriteArrayMerge })
}
export class PluginLogger extends EventEmitter<'change'> {
private _logs: Array<[type: string, payload: any]> = []