@less-is-more/less-js 1.4.29 → 1.4.31-0
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.
- package/package.json +1 -1
- package/src/cache.js +4 -2
- package/src/db.js +7 -1
package/package.json
CHANGED
package/src/cache.js
CHANGED
|
@@ -87,13 +87,15 @@ module.exports = class Cache {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
static _zip(text) {
|
|
90
|
-
const zipData = zlib
|
|
90
|
+
const zipData = zlib
|
|
91
|
+
.brotliCompressSync(Buffer.from(text, "utf-8"))
|
|
92
|
+
.toString("base64");
|
|
91
93
|
return zipData;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
static _unzip(base64) {
|
|
95
97
|
const buffer = Buffer.from(base64, "base64");
|
|
96
|
-
const text = zlib.
|
|
98
|
+
const text = zlib.brotliDecompressSync(buffer).toString();
|
|
97
99
|
return text;
|
|
98
100
|
}
|
|
99
101
|
|
package/src/db.js
CHANGED
|
@@ -12,12 +12,14 @@ module.exports = class Db {
|
|
|
12
12
|
static SQL_TYPE_UPDATE = Sequelize.QueryTypes.UPDATE;
|
|
13
13
|
static SQL_TYPE_DELETE = Sequelize.QueryTypes.DELETE;
|
|
14
14
|
static Op = Sequelize.Op;
|
|
15
|
+
static #logger;
|
|
15
16
|
|
|
16
|
-
static init(host, database, user, password) {
|
|
17
|
+
static init(host, database, user, password, logger = false) {
|
|
17
18
|
this.#host = host;
|
|
18
19
|
this.#database = database;
|
|
19
20
|
this.#user = user;
|
|
20
21
|
this.#password = password;
|
|
22
|
+
this.#logger = logger;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
static getInstance() {
|
|
@@ -40,6 +42,10 @@ module.exports = class Db {
|
|
|
40
42
|
min: 0,
|
|
41
43
|
idle: 10000,
|
|
42
44
|
},
|
|
45
|
+
logging: this.#logger ? console.log : false,
|
|
46
|
+
dialectOptions: {
|
|
47
|
+
compress: true,
|
|
48
|
+
},
|
|
43
49
|
}
|
|
44
50
|
);
|
|
45
51
|
} else {
|