Skip to content

Commit 4e04f55

Browse files
authored
Make all named exports work for ESM (#2247)
1 parent 6ab6dd8 commit 4e04f55

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

lib/objection.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
'use strict';
22

3-
const { wrapError, ...DbErrorClasses } = require('db-errors');
3+
const {
4+
DBError,
5+
UniqueViolationError,
6+
NotNullViolationError,
7+
ForeignKeyViolationError,
8+
ConstraintViolationError,
9+
CheckViolationError,
10+
DataError,
11+
} = require('db-errors');
412
const { Model: NativeModel } = require('./model/Model');
513
const { QueryBuilder: NativeQueryBuilder } = require('./queryBuilder/QueryBuilder');
614
const { QueryBuilderBase } = require('./queryBuilder/QueryBuilderBase');
@@ -88,5 +96,11 @@ module.exports = {
8896
knexSnakeCaseMappers,
8997
knexIdentifierMapping,
9098

91-
...DbErrorClasses,
99+
DBError,
100+
UniqueViolationError,
101+
NotNullViolationError,
102+
ForeignKeyViolationError,
103+
ConstraintViolationError,
104+
CheckViolationError,
105+
DataError,
92106
};

0 commit comments

Comments
 (0)