Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lỗi nếu thay thế ký tự đặc biệt (concatBy) bằng xâu rỗng #1

Open
hieu-van opened this issue Jul 25, 2023 · 0 comments

Comments

@hieu-van
Copy link

Chào bro, nay tôi thấy trong thư viện bro có một lỗi là nếu như concatBy có giá trị là string rỗng (ví dụ có dấu cách thì bỏ dấu cách), thì chương trình sẽ bị lỗi như sau:

...\node_modules\jsrmvi\lib\index.js:54
            .replace(new RegExp("\\" + c + "+\\" + c, 'g'), c) // replace repeated c to single c (e.g. `a---b` to `a-b`)
                     ^

SyntaxError: Invalid regular expression: /\+\/g: \ at end of pattern

Theo tôi thấy thì chắc cần có một cách để handle trường hợp đặc biệt này?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant