GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: refactor to use `validateObject()` validator · nodejs/node@c90bb7c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/source_map
    • source_map.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/source_map/source_map.js‎

Copy file name to clipboardExpand all lines: lib/internal/source_map/source_map.js
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ const {
7575
StringPrototypeCharAt,
7676
} = primordials;
7777

78-
const {
79-
ERR_INVALID_ARG_TYPE
80-
} = require('internal/errors').codes;
78+
const { validateObject } = require('internal/validators');
8179

8280
let base64Map;
8381

@@ -317,9 +315,7 @@ function decodeVLQ(stringCharIterator) {
317315
* @return {SourceMapV3}
318316
*/
319317
function cloneSourceMapV3(payload) {
320-
if (typeof payload !== 'object') {
321-
throw new ERR_INVALID_ARG_TYPE('payload', ['Object'], payload);
322-
}
318+
validateObject(payload, 'payload');
323319
payload = { ...payload };
324320
for (const key in payload) {
325321
if (ObjectPrototypeHasOwnProperty(payload, key) &&

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.