ismx-nexo-node-app 0.4.111 → 0.4.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,11 @@ var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Hash = void 0;
5
5
  class Hash extends Set {
6
+ get size() {
7
+ return Object.keys(this.dict).length;
8
+ }
6
9
  constructor(dict) {
7
10
  super();
8
- this.size = 0;
9
11
  this[_a] = "Hash";
10
12
  this.dict = dict !== null && dict !== void 0 ? dict : {};
11
13
  }
@@ -34,9 +36,6 @@ class Hash extends Set {
34
36
  values() {
35
37
  return Object.keys(this.dict).values();
36
38
  }
37
- length() {
38
- return Object.keys(this.dict).length;
39
- }
40
39
  [Symbol.iterator]() {
41
40
  return Object.keys(this.dict)[Symbol.iterator]();
42
41
  }
@@ -221,7 +221,7 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
221
221
  return this.query(query, values).then((result) => { var _a, _b; return (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.list) !== null && _b !== void 0 ? _b : []; });
222
222
  });
223
223
  }
224
- selectSet(tableName, select, filters) {
224
+ selectHash(tableName, select, filters) {
225
225
  return __awaiter(this, void 0, void 0, function* () {
226
226
  if (!this.tables[tableName])
227
227
  throw new Error(`table ${tableName} does not exist`);
@@ -5,7 +5,7 @@ export interface Pagination<T> {
5
5
  export type Transient<T> = Omit<T, 'id'>;
6
6
  export declare class Hash<T extends string | number | symbol> extends Set<T> {
7
7
  dict: Record<T, any>;
8
- size: number;
8
+ get size(): number;
9
9
  constructor(dict?: Record<T, any>);
10
10
  add(value: T): this;
11
11
  clear(): void;
@@ -15,7 +15,6 @@ export declare class Hash<T extends string | number | symbol> extends Set<T> {
15
15
  entries(): SetIterator<[T, T]>;
16
16
  keys(): SetIterator<T>;
17
17
  values(): SetIterator<T>;
18
- length(): number;
19
18
  [Symbol.iterator](): SetIterator<T>;
20
19
  [Symbol.toStringTag]: string;
21
20
  }
@@ -51,7 +51,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase {
51
51
  select(tableName: string, select: string, filters?: {
52
52
  [key: string]: Valuable | Array<Valuable>;
53
53
  }): Promise<string[]>;
54
- selectSet<T>(tableName: string, select: string, filters: Partial<T>): Promise<Hash<Primitive>>;
54
+ selectHash<T>(tableName: string, select: string, filters: Partial<T>): Promise<Hash<Primitive>>;
55
55
  toWhere(tableName: string, filters?: {
56
56
  [key: string]: Valuable | Array<Valuable>;
57
57
  }, alias?: string, index?: number): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.111",
3
+ "version": "0.4.113",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -8,7 +8,10 @@ export type Transient<T> = Omit<T, 'id'>
8
8
  export class Hash<T extends string | number | symbol> extends Set<T>
9
9
  {
10
10
  dict: Record<T, any>
11
- size: number = 0;
11
+
12
+ get size(): number {
13
+ return Object.keys(this.dict).length;
14
+ }
12
15
 
13
16
  constructor(dict?: Record<T, any>) {
14
17
  super()
@@ -40,9 +43,6 @@ export class Hash<T extends string | number | symbol> extends Set<T>
40
43
  values(): SetIterator<T> {
41
44
  return Object.keys(this.dict).values() as SetIterator<T>;
42
45
  }
43
- length(): number {
44
- return Object.keys(this.dict).length;
45
- }
46
46
  [Symbol.iterator](): SetIterator<T> {
47
47
  return (Object.keys(this.dict) as T[])[Symbol.iterator]()
48
48
  }
@@ -193,7 +193,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
193
193
  return this.query<{list:string[]}>(query, values).then((result) => result[0]?.list ?? []);
194
194
  }
195
195
 
196
- async selectSet<T>(tableName: string, select: string, filters: Partial<T>): Promise<Hash<Primitive>>
196
+ async selectHash<T>(tableName: string, select: string, filters: Partial<T>): Promise<Hash<Primitive>>
197
197
  {
198
198
  if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
199
199
  let schema = this.tables[tableName][0].schema;