Skip to content

Commit

Permalink
Fix eslint and drop react-intl
Browse files Browse the repository at this point in the history
* Incorporate eslint for .. in iteration
* Drop react-intl as it is included in @theforeman/vendor
  • Loading branch information
bastian-src committed Jan 12, 2024
1 parent 0c9984a commit dcb634c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
"peerDependencies": {
"@theforeman/vendor": ">= 6.0.0"
},
"dependencies": {
"react-intl": "^2.8.0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@sheerun/mutationobserver-shim": "^0.3.3",
Expand Down
18 changes: 8 additions & 10 deletions webpack/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,22 @@ const areReactElementsEqual = (element1, element2) => {

/**
* Recursively copies values from the source hash (`src`) to the destination hash (`dest`).
* Only keys that are members of dest are actually copied from src.
*
* @param {Object} dest - The destination hash to copy values into.
* @param {Object} src - The source hash from which values are copied.
* @returns {void} - The function modifies the destination hash in place.
*/
function deepCopy(dest, src) {
// eslint-disable-next-line no-unused-vars
for (const key in dest) {
if (dest.hasOwnProperty(key)) {
if (src.hasOwnProperty(key)) {
if (typeof dest[key] === 'object' && typeof src[key] === 'object') {
deepCopy(dest[key], src[key]);
} else if (dest[key] !== src[key]) {
dest[key] = src[key];
}
Object.keys(dest).forEach(key => {
if (src.hasOwnProperty(key)) {
if (typeof dest[key] === 'object' && typeof src[key] === 'object') {
deepCopy(dest[key], src[key]);
} else if (dest[key] !== src[key]) {
dest[key] = src[key];
}
}
}
});
}

/**
Expand Down

0 comments on commit dcb634c

Please sign in to comment.