sindresorhus / pupa

Simple micro templating
MIT License
362 stars 22 forks source link

Added object-path as formatting resolver #16

Closed brunos3d closed 4 years ago

brunos3d commented 4 years ago

I opened this issue to report a possible problem while searching for values in the data argument. 😅

In the conversation I proposed a solution that would implement the object-path package to solve the problem, if this implementation is valid I created this Pull Request to speed up the process. 😃

✅ All tests passed.

mukaschultze commented 4 years ago

LGTM

brunos3d commented 4 years ago

I found an issue, and decided to convert the PR to draft PR.

brunos3d commented 4 years ago

I've been doing some tests with the regex and they all lead me to results that don't fit the purpose of this package.

Turn this:

const braceRegex = /{(\d+|[a-z$_-\s][a-z\d$_-\s]*?(?:\.[a-z\d$_-\s]*?)*?)}/gi;

Into this:

const braceRegex = /{(.*?)}/gi;

I am afraid to merge any changes that break a project as currently pupa has almost 4 million weekly downloads.

With that I decided to create an alternative package, I will call it pupo, upload it in the NPM and start using it in my project.

Thank you for your attention, I believe this PR will be closed here.