From 4e04f55ba68318a2b32cda34c15b2b0c2a8f6854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 18 Mar 2022 17:09:57 +0100 Subject: [PATCH] Make all named exports work for ESM (#2247) --- lib/objection.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/objection.js b/lib/objection.js index 062d8e726..5ed2fa8fa 100644 --- a/lib/objection.js +++ b/lib/objection.js @@ -1,6 +1,14 @@ 'use strict'; -const { wrapError, ...DbErrorClasses } = require('db-errors'); +const { + DBError, + UniqueViolationError, + NotNullViolationError, + ForeignKeyViolationError, + ConstraintViolationError, + CheckViolationError, + DataError, +} = require('db-errors'); const { Model: NativeModel } = require('./model/Model'); const { QueryBuilder: NativeQueryBuilder } = require('./queryBuilder/QueryBuilder'); const { QueryBuilderBase } = require('./queryBuilder/QueryBuilderBase'); @@ -88,5 +96,11 @@ module.exports = { knexSnakeCaseMappers, knexIdentifierMapping, - ...DbErrorClasses, + DBError, + UniqueViolationError, + NotNullViolationError, + ForeignKeyViolationError, + ConstraintViolationError, + CheckViolationError, + DataError, };