Git Product home page Git Product logo

Comments (23)

net-tech avatar net-tech commented on July 18, 2024 1

I would just keep it simple

from decancer.

null8626 avatar null8626 commented on July 18, 2024 1

Hey @net-tech! Due to a slight hiccup in the cure_char_inner function, this bug apparently still persists for ASCII characters by v3.0.0, i'm so sorry for this. 😭 This bug should be fixed by the latest update, v3.1.2! ❤️

from decancer.

net-tech avatar net-tech commented on July 18, 2024 1

Hey @net-tech! Due to a slight hiccup in the cure_char_inner function, this bug apparently still persists for ASCII characters by v3.0.0, i'm so sorry for this. 😭 This bug should be fixed by the latest update, v3.1.2! ❤️

No problem! Thanks for letting me know.

from decancer.

null8626 avatar null8626 commented on July 18, 2024 1

@net-tech Hai! You can now support me through donations at ko-fi. So sorry for the delay, setting it up took a while!

from decancer.

net-tech avatar net-tech commented on July 18, 2024 1

Just donated! Thank you for setting it up and for fixing the issue!

from decancer.

null8626 avatar null8626 commented on July 18, 2024

Hi! Yes, unfortunately this is an intentional design decision. All characters are lowercased in order to ease the comparison checks later.

from decancer.

null8626 avatar null8626 commented on July 18, 2024

May i ask why you would want this to be a feature? Because the purpose of the output of decancer is for comparison, not to display (it's not used for formatting!)

I recommend you use the provided methods contains, equals, startsWith, and endsWith rather than using toString(), only use it as a last resort.

from decancer.

net-tech avatar net-tech commented on July 18, 2024

May i ask why you would want this to be a feature?

I'm working on a Discord bot that cleans up the display names of members (You seem to be familiar with what Discord and its bots are) so I'm just trying to replace the characters that are strange.

I was originally using https://www.npmjs.com/package/@aero/sanitizer but decancer is more performant which is what attracted me to it.

from decancer.

null8626 avatar null8626 commented on July 18, 2024

Ah, i see, i could make a feature that lets you customize how the curing process works, though that would be breaking (for some bindings) therefore would be for a major update.

from decancer.

net-tech avatar net-tech commented on July 18, 2024

I see. How would adjusting the curing process look like from a dev perspective?

from decancer.

null8626 avatar null8626 commented on July 18, 2024

It's complicated, but it would be something like:

if input_character.is_uppercase:
  return lowercased_output.to_uppercase()

then, on the user-end, you would call something like this:

decancer(text, {
  retainCapitalization: true
})

or

const config = decancer.config({
  retainCapitalization: true
})

decancer(text, config)

from decancer.

net-tech avatar net-tech commented on July 18, 2024

Yeah that would be very nice

from decancer.

null8626 avatar null8626 commented on July 18, 2024

Please note that this change would be major and breaking (therefore for v3.0.0) - and such change would be time consuming. Be patient!

from decancer.

net-tech avatar net-tech commented on July 18, 2024

No problem and thanks for your quick replies!

from decancer.

null8626 avatar null8626 commented on July 18, 2024

@net-tech Quick question regarding the ambiguity of capitalization: Some unicode characters, like 🆑 are shown in uppercase CL, do you think decancer should output them in uppercase as well? (Despite 🆑 technically being neither a lowercase nor uppercase character)

If yes, this can be ambiguous when the package says retainCapitalization. I could keep it simple with just uppercasing output characters where the original input characters are in uppercase.

from decancer.

null8626 avatar null8626 commented on July 18, 2024

Hai! By 19 February 2024, this issue has been resolved in the latest commit. At the moment you just need to wait until v3.0.0 is out.

from decancer.

net-tech avatar net-tech commented on July 18, 2024

Wow! Amazing. Do you have a one time donation link somewhere?

from decancer.

null8626 avatar null8626 commented on July 18, 2024

Thank you soo much for that offer! ❤️ I've never gotten a donation before -- i'm afraid at the moment donation links won't be available until 22 April 2024. I'll let you know once it's available!

from decancer.

net-tech avatar net-tech commented on July 18, 2024

No problem. When it's available let me know via this issue or [email protected]. It will be a small amount but I'm still dedicated to giving something

from decancer.

null8626 avatar null8626 commented on July 18, 2024

It's finally here!

For your use case, it's probably either

const output = decancer(string, {
  retainCapitalization: true
})

Or if you call decancer() multiple times, you can do

const options = decancer.options({
  retainCapitalization: true
})

const output = decancer(string, options)

Or if you want for decancer to keep capitalization and not cure characters from the world's major foreign scripts, you can do

// output is a javascript string
const output = decancer.format(string)

Cheers! If you have any problems or found any bugs, please be sure to let me know! Happy coding! Much love ❤️❤️

from decancer.

net-tech avatar net-tech commented on July 18, 2024

Thank you so much!

from decancer.

null8626 avatar null8626 commented on July 18, 2024

❤️

from decancer.

null8626 avatar null8626 commented on July 18, 2024

Thank you so much for the donation! I'm glad that my project helped yours! ❤️

from decancer.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.