@platformatic/sql-mapper
Advanced tools
Comparing version 0.21.1 to 0.22.0
@@ -174,3 +174,7 @@ 'use strict' | ||
// would need to use this same namespace | ||
app.decorate('platformatic', mapper) | ||
if (app.hasDecorator('platformatic')) { | ||
Object.assign(app.platformatic, mapper) | ||
} else { | ||
app.decorate('platformatic', mapper) | ||
} | ||
@@ -177,0 +181,0 @@ app.decorateRequest('platformaticContext', null) |
{ | ||
"name": "@platformatic/sql-mapper", | ||
"version": "0.21.1", | ||
"version": "0.22.0", | ||
"description": "A data mapper utility for SQL databases", | ||
@@ -17,7 +17,7 @@ "main": "mapper.js", | ||
"devDependencies": { | ||
"fastify": "^4.13.0", | ||
"fastify": "^4.17.0", | ||
"snazzy": "^9.0.0", | ||
"standard": "^17.0.0", | ||
"tap": "^16.3.4", | ||
"tsd": "^0.28.0" | ||
"tsd": "^0.28.1" | ||
}, | ||
@@ -24,0 +24,0 @@ "dependencies": { |
@@ -224,1 +224,14 @@ | ||
}) | ||
test('platformatic decorator already present', async ({ teardown }) => { | ||
async function onDatabaseLoad (db, sql) { | ||
} | ||
const app = fastify() | ||
app.decorate('platformatic', {}) | ||
teardown(() => app.close()) | ||
app.register(plugin, { | ||
connectionString: connInfo.connectionString, | ||
onDatabaseLoad | ||
}) | ||
await app.ready() | ||
}) |
159772
5048