Skip to content

Commit

Permalink
BREAKING CHANGE: remove isDeepEqual function (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
homura authored Jun 12, 2024
1 parent 8d11c75 commit b370502
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-rabbits-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ckb-lumos/base": minor
---

**BREAKING CHANGE**: remove unused `isDeepEqual` function to reduce the package size
6 changes: 3 additions & 3 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
"@types/blake2b": "^2.1.0",
"@types/lodash.isequal": "^4.5.5",
"blake2b": "^2.1.3",
"js-xxhash": "^1.0.4",
"lodash.isequal": "^4.5.0"
"js-xxhash": "^1.0.4"
},
"devDependencies": {
"jsbi": "^4.1.0"
"jsbi": "^4.1.0",
"lodash.isequal": "^4.5.0"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 0 additions & 6 deletions packages/base/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import blake2b, { Blake2b } from "blake2b";
import isEqual from "lodash.isequal";
import { xxHash32 } from "js-xxhash";
import { bytes, number, BytesLike } from "@ckb-lumos/codec";
import { BI, BIish } from "@ckb-lumos/bi";
Expand Down Expand Up @@ -149,10 +148,6 @@ function assertHexadecimal(debugPath: string, str: string): void {
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
function isDeepEqual(a: any, b: any): boolean {
return isEqual(a, b);
}
// Buffer.from('TYPE_ID')
const TYPE_ID_CODE_HASH =
"0x00000000000000000000000000000000000000000000000000545950455f4944";
Expand Down Expand Up @@ -272,6 +267,5 @@ export {
hashCode,
assertHexString,
assertHexadecimal,
isDeepEqual,
generateTypeIdScript,
};
5 changes: 3 additions & 2 deletions packages/base/tests/since.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const test = require("ava");
const isEqual = require("lodash.isequal");
const { BI } = require("@ckb-lumos/bi");

const { since, utils } = require("../src");
const { since } = require("../src");

const {
parseSinceCompatible,
Expand Down Expand Up @@ -91,7 +92,7 @@ test.before(() => {
test("parsedSince", (t) => {
fixtrues.forEach((v) => {
const parsed = parseSinceCompatible(v.since);
t.true(utils.isDeepEqual(parsed, v.parsed));
t.true(isEqual(parsed, v.parsed));
});
});

Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

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

1 comment on commit b370502

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 New canary release: 0.0.0-canary-b370502-20240612030640

npm install @ckb-lumos/[email protected]

Please sign in to comment.