| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,7 @@ const { | |||
| 24 | 24 | const { kEmptyObject } = require('internal/util'); | |
| 25 | 25 | const { | |
| 26 | 26 | validateFunction, | |
| 27 | + validateObject, | ||
| 27 | 28 | validateString, | |
| 28 | 29 | } = require('internal/validators'); | |
| 29 | 30 | const internal_async_hooks = require('internal/async_hooks'); | |
@@ -276,9 +277,7 @@ const storageHook = createHook({ | |||
| 276 | 277 | ||
| 277 | 278 | class AsyncLocalStorage { | |
| 278 | 279 | constructor(options = kEmptyObject) { | |
| 279 | - if (typeof options !== 'object' || options === null) { | ||
| 280 | - throw new ERR_INVALID_ARG_TYPE('options', 'Object', options); | ||
| 281 | - } | ||
| 280 | + validateObject(options, 'options'); | ||
| 282 | 281 | ||
| 283 | 282 | const { onPropagate = null } = options; | |
| 284 | 283 | if (onPropagate !== null && typeof onPropagate !== 'function') { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments