Skip to content

Commit

Permalink
please eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
porsager committed Mar 21, 2024
1 parent 2524083 commit 3446454
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
6 changes: 3 additions & 3 deletions cjs/src/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ module.exports = Subscribe;function Subscribe(postgres, options) {
return { stream, state: xs.state }

function error(e) {
console.error('Unexpected error during logical streaming - reconnecting', e)
console.error('Unexpected error during logical streaming - reconnecting', e) // eslint-disable-line
}

function data(x) {
if (x[0] === 0x77)
if (x[0] === 0x77) {
parse(x.subarray(25), state, sql.options.parsers, handle, options.transform)
else if (x[0] === 0x6b && x[17]) {
} else if (x[0] === 0x6b && x[17]) {
state.lsn = x.subarray(1, 9)
pong()
}
Expand Down
6 changes: 4 additions & 2 deletions cjs/tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1791,15 +1791,17 @@ t('Recreate prepared statements on RevalidateCachedQuery error', async() => {

t('Properly throws routine error on not prepared statements', async() => {
await sql`create table x (x text[])`
const { routine } = await sql.unsafe(`insert into x(x) values (('a', 'b'))`).catch(e => e)
const { routine } = await sql.unsafe(`
insert into x(x) values (('a', 'b'))
`).catch(e => e)

return ['transformAssignedExpr', routine, await sql`drop table x`]
})

t('Properly throws routine error on not prepared statements in transaction', async() => {
const { routine } = await sql.begin(sql => [
sql`create table x (x text[])`,
sql`insert into x(x) values (('a', 'b'))`,
sql`insert into x(x) values (('a', 'b'))`
]).catch(e => e)

return ['transformAssignedExpr', routine]
Expand Down
6 changes: 3 additions & 3 deletions deno/src/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ export default function Subscribe(postgres, options) {
return { stream, state: xs.state }

function error(e) {
console.error('Unexpected error during logical streaming - reconnecting', e)
console.error('Unexpected error during logical streaming - reconnecting', e) // eslint-disable-line
}

function data(x) {
if (x[0] === 0x77)
if (x[0] === 0x77) {
parse(x.subarray(25), state, sql.options.parsers, handle, options.transform)
else if (x[0] === 0x6b && x[17]) {
} else if (x[0] === 0x6b && x[17]) {
state.lsn = x.subarray(1, 9)
pong()
}
Expand Down
6 changes: 4 additions & 2 deletions deno/tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1793,15 +1793,17 @@ t('Recreate prepared statements on RevalidateCachedQuery error', async() => {

t('Properly throws routine error on not prepared statements', async() => {
await sql`create table x (x text[])`
const { routine } = await sql.unsafe(`insert into x(x) values (('a', 'b'))`).catch(e => e)
const { routine } = await sql.unsafe(`
insert into x(x) values (('a', 'b'))
`).catch(e => e)

return ['transformAssignedExpr', routine, await sql`drop table x`]
})

t('Properly throws routine error on not prepared statements in transaction', async() => {
const { routine } = await sql.begin(sql => [
sql`create table x (x text[])`,
sql`insert into x(x) values (('a', 'b'))`,
sql`insert into x(x) values (('a', 'b'))`
]).catch(e => e)

return ['transformAssignedExpr', routine]
Expand Down
6 changes: 3 additions & 3 deletions src/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ export default function Subscribe(postgres, options) {
return { stream, state: xs.state }

function error(e) {
console.error('Unexpected error during logical streaming - reconnecting', e)
console.error('Unexpected error during logical streaming - reconnecting', e) // eslint-disable-line
}

function data(x) {
if (x[0] === 0x77)
if (x[0] === 0x77) {
parse(x.subarray(25), state, sql.options.parsers, handle, options.transform)
else if (x[0] === 0x6b && x[17]) {
} else if (x[0] === 0x6b && x[17]) {
state.lsn = x.subarray(1, 9)
pong()
}
Expand Down
6 changes: 4 additions & 2 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1791,15 +1791,17 @@ t('Recreate prepared statements on RevalidateCachedQuery error', async() => {

t('Properly throws routine error on not prepared statements', async() => {
await sql`create table x (x text[])`
const { routine } = await sql.unsafe(`insert into x(x) values (('a', 'b'))`).catch(e => e)
const { routine } = await sql.unsafe(`
insert into x(x) values (('a', 'b'))
`).catch(e => e)

return ['transformAssignedExpr', routine, await sql`drop table x`]
})

t('Properly throws routine error on not prepared statements in transaction', async() => {
const { routine } = await sql.begin(sql => [
sql`create table x (x text[])`,
sql`insert into x(x) values (('a', 'b'))`,
sql`insert into x(x) values (('a', 'b'))`
]).catch(e => e)

return ['transformAssignedExpr', routine]
Expand Down

0 comments on commit 3446454

Please sign in to comment.