Skip to content

clean function str not replace method #5

@kakui-lau

Description

@kakui-lau

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch aware@0.3.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/aware/index.js b/node_modules/aware/index.js
index 6f1d10e..87a944b 100644
--- a/node_modules/aware/index.js
+++ b/node_modules/aware/index.js
@@ -180,5 +180,8 @@ function tokenize(str){
  * @return {String}     Clean token name
  */
 function clean(str) {
+  if (!str.replace) {
+    return null;
+  }
   return str.replace(/#\{([^\}]+)\}/g, '$1');
 }
\ No newline at end of file

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