Git Product home page Git Product logo

change-case's People

Contributors

bartoszlorek avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jcgoette q00u

change-case's Issues

How does the title case conversion work?

I find the title case conversion extremely useful. Especially how it leaves the words like "of" and "and" in lowercase.
I was hoping to code something similar but am stumped on how to handle these words. At first I thought of just using a simple RegEx to check for such trivial prepositions, but that is a brute force method, and I was interested in the creative code you may have employed.

Unfortunately, I have yet not been able to figure out what code is being used. From what I have seen, most of your cases are stored in /scripts/cases.js which imports toTitleCase from 'to-title-case'. This is based on a work by Blake Embrey which has the following code:

return noCase(value, locale).replace(/^.| ./g, function (m) {
    return upperCase(m, locale)
})

Heading over to the noCase function doesn't seem to mention any occurrence of "of", "and", etc. So, I am stuck.

Could you please help a fellow coder? Thanks!

Shortcut issue on OSX 10.14.5 Chrome Version 75.0.3770.100

alt + 1 alt + 2 alt + 3 alt + 4 Since these shortcut keys are always active, it is not possible to type some characters, such as exclamation mark ( ! alt + 1), sharp (# alt + 3) etc.

"11_upperCase": {
"description": "UPPERCASE",
"suggested_key": {
"default": "Alt+1"
}
},
"12_lowerCase": {
"description": "lowercase",
"suggested_key": {
"default": "Alt+2"
}
},
"13_titleCase": {
"description": "Title Case",
"suggested_key": {
"default": "Alt+3"
}
},
"14_sentenceCase": {
"description": "Sentence case",
"suggested_key": {
"default": "Alt+4"
}
},

add an option to remove whitespace and special caracters

add an option to remove whitespace, for example:

15 3 214 5 -> 1532145
dDaD f 45 98 - > dDaDf4598

Removing non alphnumeric:

a*_25_5-6-6$.etc -> a25566etc (only alphnumeric lasts)
Remove: ! @ # & ( ) โ€“ [ { } ] : ; ', ? / * ` ~ $ ^ + = < > โ€œ .

Incorrect Title Case

Thanks very much for your handy extension!
However, your Title Case incorrectly capitalizes "The" instead of "the":

  • Incorrect: Birth of The Cool
  • Correct: Birth of the Cool

Articles (a, an, the) should be lowercase according to Chicago Manual of Style, AP Style, NY Times Style, etc. I can find no style that would capitalize "The". See Words Not Capitalized in Title Case.
Please correct this. Thank you.

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.