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

replace in stringSanitizer.js #7

Closed
ChandreshL opened this issue Jan 23, 2019 · 3 comments
Closed

replace in stringSanitizer.js #7

ChandreshL opened this issue Jan 23, 2019 · 3 comments

Comments

@ChandreshL
Copy link

TypeError: Cannot read property 'replace' of undefined
at Object.removeNonBreakableSpace (c:\path\node_modules\linguee\utils\stringSanitizer.js:4:18)


Posible solution

if(str)
return str.replace(/\u00A0/g, ' ');
else
return str;

@Einenlum
Copy link
Contributor

Hi @ChandreshL, thank you for your feedback.

This is strange since str is set to '' by default in function(str = '').
Would you have more details and a concrete example where it fails?

Thanks!

@ChandreshL
Copy link
Author

ChandreshL commented Jan 24, 2019

Hello, @Einenlum,

I installed the library and tested it with the example code that is on the README.md
Only change I made was in the options in translate function as, { from: 'ger', to: 'eng' }

I got version 1.0.0 from npm and it doesn't have str set to '' by default!
But the one of the commit on the github updates it to default empty string.

It is useful to me to create my own word lists, and saves me a lot of time!

Thanks

@Einenlum
Copy link
Contributor

Oh, thanks @ChandreshL ! Indeed, it's a release problem. We'll take care of this. Thanks for your feedback!

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