jalasem / templatestringparser

A package that helps you process template strings against values
https://www.npmjs.com/package/templatestringparser
MIT License
12 stars 4 forks source link

Change name of function to erase Mail-use reference #3

Closed Israel-Laguan closed 8 months ago

Israel-Laguan commented 4 years ago

Problem

The most important function on the package is named in a confusing way, like this:

https://github.com/jalasem/templatestringparser/blob/29fec424a86ee72110c7f98629989b15df8e9251/index.js#L17

To me it looks like it comes from a mail related code and the functions was simply copy-pasted keeping the same name. This looks weird to me and confusing at some extend, as the purpose of the function is not intended just for mails but templating strings/substitute in templates. I think some developers trying to contribute can find that name confusing as well.

Proposal

Change from processMail to something more descriptive as processString or parseTemplate.

Further improvements to structure, even cut this function in two or more, can be done but that is out of the scope of this issue.

tunjioye commented 4 years ago

Thank you @Israel-Laguan for raising this issue. This issue will be closed once the code is updated.

mihrab34 commented 8 months ago

@jalasem