Skip to content

Commit

Permalink
revert src/js/internal/util/inspect.js change
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Jan 7, 2025
1 parent d1b8559 commit cf371b1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/js/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
const { pathToFileURL } = require("node:url");
let BufferModule;

const { validateObject } = require("internal/validators");

const primordials = require("internal/primordials");
const {
Array,
Expand Down Expand Up @@ -355,6 +353,18 @@ const codes = {}; // exported from errors.js
return error;
};
}
/**
* @param {unknown} value
* @param {string} name
* @param {{ allowArray?: boolean, allowFunction?: boolean, nullable?: boolean }} [options] */
const validateObject = (value, name, allowArray = false) => {
if (
value === null ||
(!allowArray && $isJSArray(value)) ||
(typeof value !== "object" && typeof value !== "function")
)
throw new codes.ERR_INVALID_ARG_TYPE(name, "Object", value);
};

const builtInObjects = new SafeSet(
ArrayPrototypeFilter(
Expand Down

0 comments on commit cf371b1

Please sign in to comment.