mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
lib: refactor to use validateObject() validator
Use the `validateObject()` validator in source maps where appropriate. PR-URL: https://github.com/nodejs/node/pull/41845 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
46ed078607
commit
c90bb7cd93
1 file changed
+2
-6
@@ -75,9 +75,7 @@ const {
|
||||
StringPrototypeCharAt,
|
||||
} = primordials;
|
||||
|
||||
const {
|
||||
ERR_INVALID_ARG_TYPE
|
||||
} = require('internal/errors').codes;
|
||||
const { validateObject } = require('internal/validators');
|
||||
|
||||
let base64Map;
|
||||
|
||||
@@ -317,9 +315,7 @@ function decodeVLQ(stringCharIterator) {
|
||||
* @return {SourceMapV3}
|
||||
*/
|
||||
function cloneSourceMapV3(payload) {
|
||||
if (typeof payload !== 'object') {
|
||||
throw new ERR_INVALID_ARG_TYPE('payload', ['Object'], payload);
|
||||
}
|
||||
validateObject(payload, 'payload');
|
||||
payload = { ...payload };
|
||||
for (const key in payload) {
|
||||
if (ObjectPrototypeHasOwnProperty(payload, key) &&
|
||||
|
||||
Reference in new issue
Block a user