not-node 6.2.23 → 6.2.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.2.23",
3
+ "version": "6.2.24",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,6 +2,9 @@ const notEnv = require("../env.js");
2
2
  const notCommon = require("../common");
3
3
  const { error } = require("not-log")(module, "ClusterRedis");
4
4
 
5
+ /**
6
+ * Cluster event bus driver upon Redis events
7
+ */
5
8
  module.exports = class notClusterRedisProvider {
6
9
  static #clientGetter = null;
7
10
  static #clientName = "db.redis";
@@ -1,7 +1,10 @@
1
1
  const { log } = require("not-log")(module, "notCluster");
2
2
  const notClusterRedis = require("./cluster.redis.js");
3
3
 
4
- module.exports = class notCluster {
4
+ /**
5
+ * Interface to event bus of cluster
6
+ */
7
+ class notCluster {
5
8
  static #provider = notClusterRedis;
6
9
 
7
10
  static setProvider(newProvider) {
@@ -22,4 +25,6 @@ module.exports = class notCluster {
22
25
  static emit() {
23
26
  return this.#provider.emit(...arguments);
24
27
  }
25
- };
28
+ }
29
+
30
+ module.exports = notCluster;
package/src/common.js CHANGED
@@ -210,15 +210,13 @@ module.exports.tryFile = (filePath) => {
210
210
  * @param {string} filePath full path to file
211
211
  * @return {Promise<boolean>} true if path exists and it's a file
212
212
  **/
213
- module.exports.tryFileAsync = (filePath) => {
214
- return new Promise((resolve, reject) => {
215
- try {
216
- const stat = fs.lstatSync(filePath);
217
- resolve(stat && stat.isFile());
218
- } catch (e) {
219
- reject(false);
220
- }
221
- });
213
+ module.exports.tryFileAsync = async (filePath) => {
214
+ try {
215
+ const stat = await fs.promises.lstat(filePath);
216
+ return stat && stat.isFile();
217
+ } catch (e) {
218
+ return false;
219
+ }
222
220
  };
223
221
 
224
222
  /**