Skip to content

Commit

Permalink
chore(dependencies): Upgrade Lodash, Remove deep-eql
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWendelborn committed Mar 26, 2022
1 parent 13ff8c2 commit 60d769d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 38 deletions.
4 changes: 2 additions & 2 deletions packages/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@vue/composition-api": "0.6.1",
"core-js": "^3.17.2",
"dayjs": "^1.9.1",
"lodash": "^4.17.19",
"lodash": "^4.17.21",
"marked": "^2.0.0",
"natural-sort": "^1.0.0",
"vue-clipboard2": "^0.3.1"
Expand All @@ -23,7 +23,7 @@
"@nuxtjs/markdownit": "^1.2.7",
"@nuxtjs/markdownit-loader": "^1.1.1",
"@nuxtjs/style-resources": "^1.0.0",
"@types/lodash": "^4.14.157",
"@types/lodash": "^4.14.180",
"@types/marked": "^1.1.0",
"@types/natural-sort": "^0.0.20",
"case-sensitive-paths-webpack-plugin": "^2.3.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/kotti-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
"@popperjs/core": "2.0.6",
"big.js": "^6.1.1",
"color": "3.x",
"deep-eql": "^4.0.0",
"deepmerge": "^4.2.2",
"element-ui": "2.13.1",
"lodash": "^4.17.19",
"lodash": "^4.17.21",
"normalize.css": "^8.0.1",
"tippy.js": "6.x",
"ts-custom-error": "^3.1.1",
Expand All @@ -32,9 +31,9 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.4.0",
"@rollup/plugin-typescript": "^5.0.2",
"@types/big.js": "^6.1.1",
"@types/big.js": "^6.1.3",
"@types/jest": "^27.0.1",
"@types/lodash": "^4.14.157",
"@types/lodash": "^4.14.180",
"@vue/test-utils": "^1.0.3",
"esm": "^3.2.25",
"postcss-flexbugs-fixes": "^4.2.0",
Expand Down
15 changes: 7 additions & 8 deletions packages/kotti-ui/source/kotti-table/KtTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
</template>

<script lang="jsx">
import deepEql from 'deep-eql'
import pick from 'lodash/pick'
import { isEqual, pick } from 'lodash'
import { TableBody } from './components/TableBody'
import TableHeader from './components/TableHeader.vue'
Expand Down Expand Up @@ -214,47 +213,47 @@ export default {
selected: {
immediate: true,
handler(value, oldValue) {
if (!deepEql(value, oldValue)) {
if (!isEqual(value, oldValue)) {
this.localStore.commit('setSelected', value)
}
},
},
columns: {
immediate: true,
handler(value, oldValue) {
if (value && !deepEql(value, oldValue)) {
if (value && !isEqual(value, oldValue)) {
this.store.commit('setColumns', value)
}
},
},
sortedColumns: {
immediate: true,
handler(value, oldValue) {
if (value && !deepEql(value, oldValue)) {
if (value && !isEqual(value, oldValue)) {
this.store.commit('setSortedColumns', value)
}
},
},
hiddenColumns: {
immediate: true,
handler(value, oldValue) {
if (value && !deepEql(value, oldValue)) {
if (value && !isEqual(value, oldValue)) {
this.store.commit('setHiddenColumns', value)
}
},
},
filteredColumns: {
immediate: true,
handler(value, oldValue) {
if (value && !deepEql(value, oldValue)) {
if (value && !isEqual(value, oldValue)) {
this.store.commit('setFilteredColumns', value)
}
},
},
orderedColumns: {
immediate: true,
handler(value, oldValue) {
if (value && !deepEql(value, oldValue)) {
if (value && !isEqual(value, oldValue)) {
this.store.commit('setOrderedColumns', value)
}
},
Expand Down
6 changes: 3 additions & 3 deletions packages/kotti-ui/source/kotti-table/logic/expand.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deepEql from 'deep-eql'
import { isEqual } from 'lodash'

export const defaultState = {
expandMultiple: false,
Expand All @@ -7,7 +7,7 @@ export const defaultState = {

function toggleRowExpansion(state, row) {
const expanded = state.expanded
const index = expanded.findIndex((elem) => deepEql(elem, row))
const index = expanded.findIndex((elem) => isEqual(elem, row))
const shouldExpand = index === -1 //if the row is not already included in state.expanded

if (state.expandMultiple) {
Expand All @@ -30,6 +30,6 @@ export const mutations = {

export const getters = {
isExpanded(state, row) {
return state.expanded.some((e) => deepEql(e, row))
return state.expanded.some((e) => isEqual(e, row))
},
}
9 changes: 4 additions & 5 deletions packages/kotti-ui/source/kotti-table/logic/select.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import deepEql from 'deep-eql'
import debounce from 'lodash/debounce'
import { debounce, isEqual } from 'lodash'

export function toggleRowSelection(state, row, selected) {
let changed = false
const selection = state.selection
const index = selection.findIndex((selectedRow) => deepEql(selectedRow, row))
const index = selection.findIndex((selectedRow) => isEqual(selectedRow, row))
if (typeof selected === 'undefined') {
if (index === -1) {
selection.push(row)
Expand Down Expand Up @@ -52,7 +51,7 @@ export function cleanSelection(store) {
state.selection = state.selection.filter((s) => rowsSet.has(s[rowKey]))
} else {
state.selection = state.selection.filter((s) =>
state.rows.some((r) => deepEql(r, s)),
state.rows.some((r) => isEqual(r, s)),
)
}

Expand Down Expand Up @@ -132,6 +131,6 @@ export const getters = {
: row[state.rowKey]
},
isSelected(state, row) {
return state.selection.some((e) => deepEql(e, row))
return state.selection.some((e) => isEqual(e, row))
},
}
25 changes: 9 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4254,10 +4254,10 @@
dependencies:
"@types/babel-types" "*"

"@types/big.js@^6.1.1":
version "6.1.1"
resolved "https://registry.yarnpkg.com/@types/big.js/-/big.js-6.1.1.tgz#c2be5e81e0cf0c1c31704e3b12f750712f647414"
integrity sha512-Zns+nT0hj96ie+GDbL5NeHxhL4wNz8QMxCHqBvxgc4x0hhgQ/o92rPwqxvPBhY3ZYnH8TJGw/8oCkjhOy2Rfzw==
"@types/big.js@^6.1.3":
version "6.1.3"
resolved "https://registry.yarnpkg.com/@types/big.js/-/big.js-6.1.3.tgz#c008dec4dae24c7a338ebb4521c46e9609020807"
integrity sha512-fHh2h1cFlvGP0kFCqoAsnuQoM0n3xHB6HxgZvELt7dji+BtK/j938MRL0nG5AA45EgibuFcPjgLlkqfUPCyoKw==

"@types/body-parser@*":
version "1.19.0"
Expand Down Expand Up @@ -4460,10 +4460,10 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.149.tgz#1342d63d948c6062838fbf961012f74d4e638440"
integrity sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==

"@types/lodash@^4.14.157":
version "4.14.157"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.157.tgz#fdac1c52448861dfde1a2e1515dbc46e54926dc8"
integrity sha512-Ft5BNFmv2pHDgxV5JDsndOWTRJ+56zte0ZpYLowp03tW+K+t8u8YMOzAnpuqPgzX6WO1XpDIUm7u04M8vdDiVQ==
"@types/lodash@^4.14.180":
version "4.14.180"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.180.tgz#4ab7c9ddfc92ec4a887886483bc14c79fb380670"
integrity sha512-XOKXa1KIxtNXgASAnwj7cnttJxS4fksBRywK/9LzRV5YxrF80BXZIGeQSuoESQ/VkUj30Ae0+YcuHc15wJCB2g==

"@types/marked@^1.1.0":
version "1.1.0"
Expand Down Expand Up @@ -8572,13 +8572,6 @@ dedent@^0.7.0:
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=

deep-eql@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.0.0.tgz#c70af2713a4e18d9c2c1203ff9d11abbd51c8fbd"
integrity sha512-GxJC5MOg2KyQlv6WiUF/VAnMj4MWnYiXo4oLgeptOELVoknyErb4Z8+5F/IM/K4g9/80YzzatxmWcyRwUseH0A==
dependencies:
type-detect "^4.0.0"

deep-equal@^1.0.1, deep-equal@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a"
Expand Down Expand Up @@ -19824,7 +19817,7 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

[email protected], type-detect@^4.0.0:
[email protected]:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==
Expand Down

0 comments on commit 60d769d

Please sign in to comment.