1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.NeDBService = void 0;
|
4 | const adapter_1 = require("./adapter");
|
5 | class NeDBService extends adapter_1.NeDbAdapter {
|
6 | async find(params) {
|
7 | if (params) {
|
8 | params.query = await this.sanitizeQuery(params);
|
9 | }
|
10 | return this._find(params);
|
11 | }
|
12 | async get(id, params) {
|
13 | if (params) {
|
14 | params.query = await this.sanitizeQuery(params);
|
15 | }
|
16 | return this._get(id, params);
|
17 | }
|
18 | async create(data, params) {
|
19 | return this._create(data, params);
|
20 | }
|
21 | async update(id, data, params) {
|
22 | if (params) {
|
23 | params.query = await this.sanitizeQuery(params);
|
24 | }
|
25 | return this._update(id, data, params);
|
26 | }
|
27 | async patch(id, data, params) {
|
28 | if (params) {
|
29 | const { $limit, ...query } = await this.sanitizeQuery(params);
|
30 | params.query = query;
|
31 | }
|
32 | return this._patch(id, data, params);
|
33 | }
|
34 | async remove(id, params) {
|
35 | if (params) {
|
36 | const { $limit, ...query } = await this.sanitizeQuery(params);
|
37 | params.query = query;
|
38 | }
|
39 | return this._remove(id, params);
|
40 | }
|
41 | }
|
42 | exports.NeDBService = NeDBService;
|
43 |
|
\ | No newline at end of file |