@runnerty/module-core
Advanced tools
+5
-5
| { | ||
| "name": "@runnerty/module-core", | ||
| "version": "3.0.5", | ||
| "version": "3.0.6", | ||
| "description": "Runnerty module core classes", | ||
@@ -36,7 +36,7 @@ "author": "Runnerty Tech", | ||
| "devDependencies": { | ||
| "eslint": "^7.20.0", | ||
| "eslint-config-prettier": "^8.1.0", | ||
| "eslint-plugin-prettier": "^3.3.1", | ||
| "prettier": "^2.2.1" | ||
| "eslint": "^7.32.0", | ||
| "eslint-config-prettier": "^8.3.0", | ||
| "eslint-plugin-prettier": "^4.0.0", | ||
| "prettier": "^2.4.1" | ||
| } | ||
| } |
+12
-24
@@ -40,8 +40,4 @@ 'use strict'; | ||
| sendMain(notification) { | ||
| return new Promise((resolve, reject) => { | ||
| this.resolve = resolve; | ||
| this.reject = reject; | ||
| this.send(notification); | ||
| }); | ||
| async sendMain(notification) { | ||
| await this.send(notification); | ||
| } | ||
@@ -53,14 +49,8 @@ | ||
| end(options) { | ||
| async end(options) { | ||
| if (!options) options = {}; | ||
| options.end = options.end || 'end'; | ||
| switch (options.end) { | ||
| case 'error': | ||
| this.logger.log('error', options.messageLog); | ||
| this.reject(options.messageLog || ''); | ||
| break; | ||
| default: | ||
| this.resolve(); | ||
| break; | ||
| if (options.end === 'error') { | ||
| this.logger.log('error', options.messageLog); | ||
| } | ||
@@ -111,11 +101,9 @@ } | ||
| async getUid() { | ||
| return new Promise((resolve, reject) => { | ||
| crypto.randomBytes(16, (err, buffer) => { | ||
| if (err) { | ||
| this.logger.log('error', `setUid Notifier: ${err}`); | ||
| reject(err); | ||
| } else { | ||
| resolve(this.id + '_' + buffer.toString('hex')); | ||
| } | ||
| }); | ||
| crypto.randomBytes(16, (err, buffer) => { | ||
| if (err) { | ||
| this.logger.log('error', `setUid Notifier: ${err}`); | ||
| throw new Error(`setUid Notifier: ${err}`); | ||
| } else { | ||
| return this.id + '_' + buffer.toString('hex'); | ||
| } | ||
| }); | ||
@@ -122,0 +110,0 @@ } |
34788
-0.76%840
-1.41%