UNPKG

1.3 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.NeDBService = void 0;
4const adapter_1 = require("./adapter");
5class 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}
42exports.NeDBService = NeDBService;
43//# sourceMappingURL=index.js.map
\No newline at end of file