Skip to content

replacer doesn't always see the passed callback  #5

Description

@katrinanova

code below finds match "@bb45" but then gives error Uncaught TypeError: done is not a function

  asyncReplace("abc12@bb45 #", /(@[a-z0-9_]{2,38})(?=\s|$)/gi, replacer, function(err, result) {
    console.log(result); 
  });

function replacer(match, p1, p2, p3, offset, string, done){
    console.log("match: ", match)
    setTimeout(function() {
        done(null, match);
    }, 100);
};

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