We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
validateObject
1 parent 28f9089 commit 54b748aCopy full SHA for 54b748a
lib/async_hooks.js
@@ -24,6 +24,7 @@ const {
24
const { kEmptyObject } = require('internal/util');
25
const {
26
validateFunction,
27
+ validateObject,
28
validateString,
29
} = require('internal/validators');
30
const internal_async_hooks = require('internal/async_hooks');
@@ -276,9 +277,7 @@ const storageHook = createHook({
276
277
278
class AsyncLocalStorage {
279
constructor(options = kEmptyObject) {
- if (typeof options !== 'object' || options === null) {
280
- throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
281
- }
+ validateObject(options, 'options');
282
283
const { onPropagate = null } = options;
284
if (onPropagate !== null && typeof onPropagate !== 'function') {
0 commit comments