diff --git a/libs/executor.js b/libs/executor.js index f842597..05e0e5a 100644 --- a/libs/executor.js +++ b/libs/executor.js @@ -26,10 +26,13 @@ const catcher = (e) => e(this) * @param {QueryOptions} opts - Options for query execution. * @returns {Promise} A promise that resolves to the result object. */ -module.exports = (query, opts) => { +const rq = (query, opts) => { try { return executeQuery(query, null, opts).then(arrayToObject) } catch (error) { return catcher.bind(error) } } + +exports.rq = rq +module.exports = rq diff --git a/package.json b/package.json index 9b56c26..5d85c46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@syarul/requrse", - "version": "0.1.8", + "version": "0.1.9", "description": "Lightweight driven query language", "main": "libs/executor.js", "scripts": {