Closed weixsong closed 9 years ago
Thanks for taking a look at this, as I've mentioned in a code comment I think that if you ask to put something before or after a specific item in the pipeline, and that item does not exist, then this should fail with some kind of error.
I think in the case of asking to remove something that doesn't exist, there should be no warning and no error, the user asked for a thing to be removed, and once the method is done that thing is not in the pipeline, so there is no harm done.
Also, please provide some tests for these changes.
@olivernn , yes, I think you are right. Thanks for the comments.
@olivernn , I've made a change and added some test cases, pls help to review the code.
Looks good, perhaps its worth expanding on the tests to make sure that, as well as throwing an error, that the functions are not added to the pipeline. Once that is done I think its ready to go, just squash all your commits down into one commit. Thanks again for your work!
@olivernn , sorry for the inconvenience, I'm not familiar with git rebase command, I've some trouble with rebase, so I refork your repo and commit the change patch. :)
new commit: #149
Issue link: https://github.com/olivernn/lunr.js/issues/146