Skip to content

Commit

Permalink
fix: standardjs error for empty if block
Browse files Browse the repository at this point in the history
  • Loading branch information
Nesopie committed Jun 17, 2024
1 parent 3d122f6 commit a6f08ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cjs/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function base (ALPHABET) {
const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
function encode (source) {
if (ArrayBuffer.isView(source)) {
// eslint-disable-next-line no-empty
if (source instanceof Uint8Array) { } else if (ArrayBuffer.isView(source)) {
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
} else if (Array.isArray(source)) {
source = Uint8Array.from(source)
Expand Down
3 changes: 2 additions & 1 deletion src/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function base (ALPHABET) {
const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
function encode (source) {
if (ArrayBuffer.isView(source)) {
// eslint-disable-next-line no-empty
if (source instanceof Uint8Array) { } else if (ArrayBuffer.isView(source)) {
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
} else if (Array.isArray(source)) {
source = Uint8Array.from(source)
Expand Down
4 changes: 3 additions & 1 deletion ts_src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ function base (ALPHABET: string): base.BaseConverter {
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up

function encode (source: Uint8Array | number[]): string {
if (ArrayBuffer.isView(source)) {
//eslint-disable-next-line no-empty
if (source instanceof Uint8Array) {}
else if (ArrayBuffer.isView(source)) {
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
} else if (Array.isArray(source)) {
source = Uint8Array.from(source)
Expand Down

0 comments on commit a6f08ec

Please sign in to comment.