@faasjs/knex 3.1.2 → 3.1.3

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/dist/index.js CHANGED
@@ -58,9 +58,9 @@ var Knex = class {
58
58
  this.config.connection[key.replace("connection_", "")] = value;
59
59
  } else this.config[key] = value;
60
60
  }
61
- if (data.config.plugins?.[this.name]?.config)
61
+ if (data.config.plugins?.[this.name || this.type]?.config)
62
62
  this.config = deep_merge.deepMerge(
63
- data.config.plugins[this.name].config,
63
+ data.config.plugins[this.name || this.type].config,
64
64
  this.config
65
65
  );
66
66
  switch (this.config.client) {
@@ -191,6 +191,7 @@ var Knex = class {
191
191
  return this.adapter.schema;
192
192
  }
193
193
  async quit() {
194
+ if (!global.FaasJS_Knex[this.name]) return;
194
195
  try {
195
196
  await global.FaasJS_Knex[this.name].adapter.destroy();
196
197
  delete global.FaasJS_Knex[this.name];
package/dist/index.mjs CHANGED
@@ -52,9 +52,9 @@ var Knex = class {
52
52
  this.config.connection[key.replace("connection_", "")] = value;
53
53
  } else this.config[key] = value;
54
54
  }
55
- if (data.config.plugins?.[this.name]?.config)
55
+ if (data.config.plugins?.[this.name || this.type]?.config)
56
56
  this.config = deepMerge(
57
- data.config.plugins[this.name].config,
57
+ data.config.plugins[this.name || this.type].config,
58
58
  this.config
59
59
  );
60
60
  switch (this.config.client) {
@@ -185,6 +185,7 @@ var Knex = class {
185
185
  return this.adapter.schema;
186
186
  }
187
187
  async quit() {
188
+ if (!global.FaasJS_Knex[this.name]) return;
188
189
  try {
189
190
  await global.FaasJS_Knex[this.name].adapter.destroy();
190
191
  delete global.FaasJS_Knex[this.name];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/knex",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,9 +34,9 @@
34
34
  "dist"
35
35
  ],
36
36
  "dependencies": {
37
- "@faasjs/deep_merge": "3.1.2",
38
- "@faasjs/func": "3.1.2",
39
- "@faasjs/logger": "3.1.2"
37
+ "@faasjs/deep_merge": "3.1.3",
38
+ "@faasjs/func": "3.1.3",
39
+ "@faasjs/logger": "3.1.3"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "knex": "*"