@sapphire-sh/utils 1.27.0 → 1.28.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/lib/logger.js +1 -1
- package/lib/queue.d.ts +0 -1
- package/lib/queue.js +2 -5
- package/package.json +1 -1
package/lib/logger.js
CHANGED
|
@@ -19,7 +19,7 @@ function log(level, message, payload) {
|
|
|
19
19
|
}
|
|
20
20
|
const ts = new Date().toISOString();
|
|
21
21
|
const prefix = `[${ts}] [${LogLevel[level].toUpperCase()}]`;
|
|
22
|
-
const payloadStr = payload
|
|
22
|
+
const payloadStr = payload === undefined ? '' : serializePayload(payload);
|
|
23
23
|
const output = `${prefix} ${message}${payloadStr}`;
|
|
24
24
|
if (level === LogLevel.ERROR) {
|
|
25
25
|
console.error(output);
|
package/lib/queue.d.ts
CHANGED
package/lib/queue.js
CHANGED
|
@@ -18,7 +18,6 @@ class Queue {
|
|
|
18
18
|
head = null;
|
|
19
19
|
tail = null;
|
|
20
20
|
_size = 0;
|
|
21
|
-
constructor() { }
|
|
22
21
|
enqueue(value) {
|
|
23
22
|
const newNode = new QueueNode(value);
|
|
24
23
|
if (this.isEmpty() || !this.tail) {
|
|
@@ -71,10 +70,8 @@ class Queue {
|
|
|
71
70
|
return true;
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
|
-
else {
|
|
75
|
-
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
73
|
+
else if (node.value === value) {
|
|
74
|
+
return true;
|
|
78
75
|
}
|
|
79
76
|
node = node.next;
|
|
80
77
|
}
|