@util.js/node-timers 0.41.4 → 0.41.6
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/Timers.js +2 -2
- package/lib/schedule.js +2 -2
- package/package.json +3 -4
- package/test/TimersTest.js +8 -8
package/lib/Timers.js
CHANGED
|
@@ -6,7 +6,7 @@ const privates = new Privates();
|
|
|
6
6
|
function delegate(thiz, functionName) {
|
|
7
7
|
if (!privates.get(thiz, functionName))
|
|
8
8
|
throw new ReferenceError(
|
|
9
|
-
"Timers#" + functionName + " is undefined. It is not in this build."
|
|
9
|
+
"Timers#" + functionName + " is undefined. It is not in this build.",
|
|
10
10
|
);
|
|
11
11
|
const proxy = privates.getCallProxy(thiz);
|
|
12
12
|
return proxy[functionName](proxy);
|
|
@@ -97,7 +97,7 @@ module.exports = class Timers {
|
|
|
97
97
|
|
|
98
98
|
if (typeof functionToThrottle !== "function")
|
|
99
99
|
throw new TypeError(
|
|
100
|
-
`functionToThrottle (${functionToThrottle}) must be a function
|
|
100
|
+
`functionToThrottle (${functionToThrottle}) must be a function.`,
|
|
101
101
|
);
|
|
102
102
|
|
|
103
103
|
let lastRan;
|
package/lib/schedule.js
CHANGED
|
@@ -17,7 +17,7 @@ function wrap(thiz) {
|
|
|
17
17
|
timezone,
|
|
18
18
|
context,
|
|
19
19
|
runOnInit,
|
|
20
|
-
unrefTimeout
|
|
20
|
+
unrefTimeout,
|
|
21
21
|
) {
|
|
22
22
|
return new thiz.cron.CronJob(
|
|
23
23
|
cronTime,
|
|
@@ -27,7 +27,7 @@ function wrap(thiz) {
|
|
|
27
27
|
timezone,
|
|
28
28
|
context,
|
|
29
29
|
runOnInit,
|
|
30
|
-
unrefTimeout
|
|
30
|
+
unrefTimeout,
|
|
31
31
|
);
|
|
32
32
|
};
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Chris Topher <c@creemama.com>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@util.js/privates": "0.41.
|
|
5
|
-
"cron": "
|
|
4
|
+
"@util.js/privates": "0.41.6",
|
|
5
|
+
"cron": "4.4.0"
|
|
6
6
|
},
|
|
7
7
|
"description": "An object to hold JavaScript timers: https://nodejs.org/api/timers.html",
|
|
8
8
|
"keywords": [
|
|
@@ -26,6 +26,5 @@
|
|
|
26
26
|
"type": "git",
|
|
27
27
|
"url": "https://github.com/creemama/utiljs/tree/master/packages/utiljs-node-timers"
|
|
28
28
|
},
|
|
29
|
-
"version": "0.41.
|
|
30
|
-
"gitHead": "2119863a175cf7095ca3a2417e61af32974add15"
|
|
29
|
+
"version": "0.41.6"
|
|
31
30
|
}
|
package/test/TimersTest.js
CHANGED
|
@@ -47,7 +47,7 @@ describe("Timers#setInterval(callback, delay[, ...args]) and Timers#clearInterva
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
25,
|
|
50
|
-
"foobar"
|
|
50
|
+
"foobar",
|
|
51
51
|
);
|
|
52
52
|
});
|
|
53
53
|
});
|
|
@@ -64,7 +64,7 @@ describe("Timers#setTimeout(callback, delay[, ...args])", () => {
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
25,
|
|
67
|
-
"foobar"
|
|
67
|
+
"foobar",
|
|
68
68
|
);
|
|
69
69
|
});
|
|
70
70
|
});
|
|
@@ -83,8 +83,8 @@ describe("Timers#clearImmediate(immediate)", () => {
|
|
|
83
83
|
++numCalls;
|
|
84
84
|
done(
|
|
85
85
|
new Error(
|
|
86
|
-
"We did not expect execution to notify the immediate callback."
|
|
87
|
-
)
|
|
86
|
+
"We did not expect execution to notify the immediate callback.",
|
|
87
|
+
),
|
|
88
88
|
);
|
|
89
89
|
});
|
|
90
90
|
require("fs").readFile(__filename, "utf8", (string) => {
|
|
@@ -121,12 +121,12 @@ describe("Timers#clearTimeout(timeout)", () => {
|
|
|
121
121
|
++numCalls;
|
|
122
122
|
done(
|
|
123
123
|
new Error(
|
|
124
|
-
"We did not expect execution to notify the timeout callback."
|
|
125
|
-
)
|
|
124
|
+
"We did not expect execution to notify the timeout callback.",
|
|
125
|
+
),
|
|
126
126
|
);
|
|
127
127
|
},
|
|
128
128
|
10,
|
|
129
|
-
"foobar"
|
|
129
|
+
"foobar",
|
|
130
130
|
);
|
|
131
131
|
timers.clearTimeout(timeout);
|
|
132
132
|
});
|
|
@@ -222,7 +222,7 @@ describe("Times#throttle(func, limit)", () => {
|
|
|
222
222
|
expect(await timers.throttle(() => "foo", "foo")()).to.eql("foo");
|
|
223
223
|
|
|
224
224
|
expect(() => timers.throttle(() => "foo", Symbol("foo"))).to.throw(
|
|
225
|
-
TypeError
|
|
225
|
+
TypeError,
|
|
226
226
|
);
|
|
227
227
|
});
|
|
228
228
|
});
|