Skip to content

string-width error in Nestjs #356

@reza-madani

Description

@reza-madani

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch cli-table3@0.6.5 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/cli-table3/src/utils.js b/node_modules/cli-table3/src/utils.js
index d21e251..778c282 100644
--- a/node_modules/cli-table3/src/utils.js
+++ b/node_modules/cli-table3/src/utils.js
@@ -1,4 +1,7 @@
-const stringWidth = require('string-width');
+let stringWidth = require('string-width');
+if (typeof stringWidth !== 'function' && stringWidth.default) {
+  stringWidth = stringWidth.default;
+}
 
 function codeRegex(capture) {
   return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions