Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new Func() in globalize dist folder #943

Open
bomao-paypal opened this issue Sep 29, 2023 · 1 comment
Open

new Func() in globalize dist folder #943

bomao-paypal opened this issue Sep 29, 2023 · 1 comment

Comments

@bomao-paypal
Copy link

After installing globalize package, in node_modules/globalize/dist/globalize/message.js, we saw new Func() expression. This causes unsafe-eval issue.

Our app has dependency of relative-time package, relative-time package is internally called globalize which is exporting all modules such as date, currency, message, etc.. Then, we saw globalize/dist/globalize/message.js file contains below code snippet with new Func():

if (typeof messages == 'string') { var f = new Function( 'number, plural, select, pluralFuncs, fmt', 'return ' + compileMsg(this, messages)); return f(this.runtime.number, this.runtime.plural, this.runtime.select, this.runtime.pluralFuncs, this.runtime.fmt); }

We are not using message feature at all, so wondering if you can fix this, otherwise please let us know if there is any workaround for it, thanks.

@rxaviers
Copy link
Member

Hi @bomao-paypal, I am open to consider including this enhancement. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants