We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
validateObject()
1 parent 07b6bf4 commit 59a15e8Copy full SHA for 59a15e8
lib/internal/source_map/source_map.js
@@ -75,9 +75,7 @@ const {
75
StringPrototypeCharAt,
76
} = primordials;
77
78
-const {
79
- ERR_INVALID_ARG_TYPE
80
-} = require('internal/errors').codes;
+const { validateObject } = require('internal/validators');
81
82
let base64Map;
83
@@ -317,9 +315,7 @@ function decodeVLQ(stringCharIterator) {
317
315
* @return {SourceMapV3}
318
316
*/
319
function cloneSourceMapV3(payload) {
320
- if (typeof payload !== 'object') {
321
- throw new ERR_INVALID_ARG_TYPE('payload', ['Object'], payload);
322
- }
+ validateObject(payload, 'payload');
323
payload = { ...payload };
324
for (const key in payload) {
325
if (ObjectPrototypeHasOwnProperty(payload, key) &&
0 commit comments