drizzle-orm 0.10.10 → 0.10.11

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.
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  /* eslint-disable max-classes-per-file */
6
6
  const fs = require("fs");
7
7
  const path = require("path");
8
+ const crypto = require("crypto");
8
9
  const builders_1 = require("../builders");
9
10
  const transaction_1 = require("../builders/transaction/transaction");
10
11
  const tables_1 = require("../tables");
@@ -68,26 +69,15 @@ class Migrator {
68
69
  await transaction.commit();
69
70
  }
70
71
  catch (e) {
71
- if (this.db.logger()) {
72
- this.db.logger().error(e);
73
- }
72
+ // if (this.db.logger()) {
73
+ // this.db.logger()!.error(e);
74
+ // }
74
75
  transaction.rollback();
76
+ throw e;
75
77
  }
76
78
  }
77
79
  generateHash(value) {
78
- let hash = 0;
79
- let i;
80
- let chr;
81
- if (value.length === 0)
82
- return '';
83
- for (i = 0; i < value.length; i += 1) {
84
- chr = value.charCodeAt(i);
85
- // eslint-disable-next-line no-bitwise
86
- hash = ((hash << 5) - hash) + chr;
87
- // eslint-disable-next-line no-bitwise
88
- hash |= 0;
89
- }
90
- return Buffer.from(value).toString('base64');
80
+ return crypto.createHash('sha256').update(value).digest('hex');
91
81
  }
92
82
  }
93
83
  exports.default = Migrator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-orm",
3
- "version": "0.10.10",
3
+ "version": "0.10.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "homepage": "https://github.com/lambda-direct/drizzle-orm#readme",
25
25
  "devDependencies": {
26
+ "@types/node": "^17.0.20",
26
27
  "@typescript-eslint/eslint-plugin": "4.10.0",
27
28
  "eslint": "7.15.0",
28
29
  "eslint-config-airbnb-typescript": "12.0.0",