ismx-nexo-node-app 0.4.155 → 0.4.156

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.
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class ObjectUtils {
4
+ static camelToSnake(str) {
5
+ return str.replace(/([A-Z])/g, '_$1').toLowerCase();
6
+ }
4
7
  static snakeToCamel(obj) {
5
8
  if (typeof obj === 'string')
6
9
  return obj.toLowerCase().replace(/([-_][a-z])/g, group => group.toUpperCase().replace('-', '').replace('_', ''));
@@ -1,4 +1,5 @@
1
1
  export default class ObjectUtils {
2
+ static camelToSnake(str: string): string;
2
3
  static snakeToCamel(obj: any): any;
3
4
  static fromEntries(iterable: [string, any][]): {
4
5
  [key: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.155",
3
+ "version": "0.4.156",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -1,5 +1,9 @@
1
1
  export default class ObjectUtils {
2
2
 
3
+ static camelToSnake(str: string) {
4
+ return str.replace(/([A-Z])/g, '_$1').toLowerCase();
5
+ }
6
+
3
7
  static snakeToCamel(obj: any): any {
4
8
  if (typeof obj === 'string')
5
9
  return obj.toLowerCase().replace(/([-_][a-z])/g, group =>
@@ -213,6 +213,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
213
213
  let [ table, schema, column ] = [ this.tables[tableName], this.tables[tableName][0].schema, PostgresUtils.camelToSnake(select) ];
214
214
  if (PostgresUtils.isReservedWord(column)) column = `"${column}"`;
215
215
 
216
+
216
217
  if (!PostgresUtils.columns(table).includes(column)) throw new Error(`column ${column} does not exist in table ${tableName}`);
217
218
  let { where, values } = this.toWhere(tableName, filters);
218
219