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 23, 2024
1 parent 0c9984a commit 1f08f20
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
18 changes: 14 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"peerDependencies": {
"@theforeman/vendor": ">= 6.0.0"
},
"dependencies": {
"react-intl": "^2.8.0"
},
"dependencies": {},
"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 a member of dest will 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 1f08f20

Please sign in to comment.