Skip to content

Commit

Permalink
fix: do use async function for transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Mar 2, 2019
1 parent 3ba1da8 commit 78f4ea6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]
},
"dependencies": {
"slonik": "^15.4.2"
"slonik": "^16.8.0"
},
"description": "Normalizes Slonik query.",
"devDependencies": {
Expand All @@ -24,13 +24,13 @@
"babel-plugin-transform-export-default-name": "^2.0.4",
"coveralls": "^3.0.3",
"eslint": "^5.14.1",
"eslint-config-canonical": "^16.1.0",
"flow-bin": "^0.93.0",
"eslint-config-canonical": "^16.2.0",
"flow-bin": "^0.94.0",
"flow-copy-source": "^2.0.3",
"husky": "^1.3.1",
"nyc": "^13.3.0",
"semantic-release": "^15.13.3",
"sinon": "^7.2.4"
"sinon": "^7.2.6"
},
"engines": {
"node": ">=8.0"
Expand Down
2 changes: 1 addition & 1 deletion src/factories/createQueryNormalisationInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type ConfigurationType = {|

export default (configuration?: ConfigurationType): InterceptorType => {
return {
transformQuery: async (context, query) => {
transformQuery: (context, query) => {
let sql = query.sql;

if (!configuration || configuration.stripComments !== false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import test from 'ava';
import createQueryContext from '../../helpers/createQueryContext';
import createQueryNormalisationInterceptor from '../../../src/factories/createQueryNormalisationInterceptor';

test('strips comments from the query', async (t) => {
test('strips comments from the query', (t) => {
const interceptor = createQueryNormalisationInterceptor({
stripComments: true
});
Expand All @@ -15,7 +15,7 @@ test('strips comments from the query', async (t) => {
throw new Error('Unexpected state.');
}

const query = await transformQuery(createQueryContext(), {
const query = transformQuery(createQueryContext(), {
sql: 'SELECT 1; --',
values: []
});
Expand Down

0 comments on commit 78f4ea6

Please sign in to comment.