Skip to content

Error on node 23 with util.isRegExp #3

@cbayarri

Description

@cbayarri

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @daybrush/jsdoc@0.4.7 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@daybrush/jsdoc/lib/jsdoc/util/dumper.js b/node_modules/@daybrush/jsdoc/lib/jsdoc/util/dumper.js
index ad2cf55..7e061d5 100644
--- a/node_modules/@daybrush/jsdoc/lib/jsdoc/util/dumper.js
+++ b/node_modules/@daybrush/jsdoc/lib/jsdoc/util/dumper.js
@@ -95,13 +95,13 @@ ObjectWalker.prototype.walk = function(o) {
             return newArray;
         });
     }
-    else if ( util.isRegExp(o) ) {
+    else if (  o instanceof RegExp ) {
         result = '<RegExp ' + o + '>';
     }
-    else if ( util.isDate(o) ) {
+    else if (  o instanceof Date ) {
         result = '<Date ' + o.toUTCString() + '>';
     }
-    else if ( util.isError(o) ) {
+    else if (  o instanceof Error ) {
         result = { message: o.message };
     }
     else if ( this.isFunction(o) ) {

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions