Skip to content

Commit

Permalink
refactor: run deep equal test with dequal
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Sep 7, 2023
1 parent fb3bbcf commit 290a697
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion create.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const path = require('path');
const ezspawn = require('@jsdevtools/ez-spawn');
const { PathScurry } = require('path-scurry');
const colors = require('picocolors');
const { dequal } = require('dequal');

const currentPackageJson = require('./package.json');

Expand Down Expand Up @@ -740,7 +741,7 @@ async function writePackage(pkg) {
: {};

// exclude version from comparison
if (JSON.stringify({ ...existingPackageJson, version: undefined }) !== JSON.stringify({ ...pkg.packageJson, version: undefined })) {
if (!dequal({ ...existingPackageJson, version: undefined }, { ...pkg.packageJson, version: undefined })) {
hasChanged = true;
}
})());
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"bumpp": "^9.2.0",
"dequal": "2.0.3",
"eslint": "^8.47.0",
"eslint-config-sukka": "^3.0.4",
"eslint-import-resolver-typescript": "^3.6.0",
Expand Down
4 changes: 3 additions & 1 deletion pnpm-lock.yaml

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

0 comments on commit 290a697

Please sign in to comment.