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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize logic #64

Open
throrin19 opened this issue Jul 20, 2023 · 0 comments
Open

Sanitize logic #64

throrin19 opened this issue Jul 20, 2023 · 0 comments

Comments

@throrin19
Copy link

throrin19 commented Jul 20, 2023

Expected behavior 馃樃

Hello, I want to migrate from String.js older (but very important code) used tu sanitize string in our apps but I can't recreate the same usage with voca.

Actually I use this with string.js :

S(text).trim()
        .latinise()
        .humanize()
        .stripPunctuation()
        .underscore().s

And this is the result I want for this strings :

original sanitized
Volume chaudi猫re & appoint volume_chaudiere_appoint
test___multi__underscore test_multi_underscore
Volume chaudi猫re & appoint 12 volume_chaudiere_appoint_12
A 11yn a_11yn
Well k1 well_k1
test&12 test12
a & b a_b
a&b ab

This is really important to keep this sanitized format for us. Without it, all our application is broken for existing data.

Actual behavior 馃樋

Actually, I converted this function doing this :

snakeCase(latinise(text))

But I have problem with text with attached numeric and alphanumeric characters, or with special char between them :

original sanitized
A 11yn a_11_yn
Well k1 well_k_1
test&12 test_12
a&b a_b

I test many functions and I can't find any voca function to do our sanitized part

Steps to reproduce 馃懛

Pass the original texts into snakeCase(latinise(text))

Technical details: 馃敡

Browser/OS type: directly in node 18
Node version: latest node 18 LTS

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

1 participant