Skip to content

Commit

Permalink
rlp: apply strict-boolean-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrocheleau committed Jul 9, 2022
1 parent a0a60ab commit 30a257b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/rlp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function encodeLength(len: number, offset: number): Uint8Array {
export function decode(input: Input, stream?: false): Uint8Array | NestedUint8Array
export function decode(input: Input, stream?: true): Decoded
export function decode(input: Input, stream = false): Uint8Array | NestedUint8Array | Decoded {
if (!input || (input as any).length === 0) {
if (typeof input === 'undefined' || input === null || (input as any).length === 0) {
return Uint8Array.from([])
}

Expand Down
2 changes: 1 addition & 1 deletion packages/rlp/test/dataTypes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tape('invalid RLPs', (t) => {
RLP.decode(input)
st.ok(false)
} catch (e: any) {
if (msg) {
if (typeof msg !== 'undefined') {
st.deepEqual(e.message, msg)
} else {
// FIXME: check for exception name
Expand Down

1 comment on commit 30a257b

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 30a257b Previous: 01f38c8 Ratio
Block 9422906 16954 ops/sec (±6.02%) 35883 ops/sec (±0.69%) 2.12
Block 9422908 17715 ops/sec (±3.27%) 36052 ops/sec (±0.71%) 2.04

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.