Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
case-anything
Advanced tools
camelCase, kebabCase, ... a simple integration with nano package size. (SMALL footprint!)
npm i case-anything
camelCase, kebabCase, ... a simple integration with nano package size. (SMALL footprint!)
I created this package because most other packages that do simple case changing are so big...
I wanted to try my hand at the smallest iteration possible.
case-anything supports tree-shaking.
import { camelCase, pascalCase, kebabCase, snakeCase, constantCase, pathCase } from 'case-anything'
const testString = 'PonytaVaporeon_Poliwrath-BUTTERFREE'
// or any variant on this
camelCase('ponyta-vaporeon-poliwrath-butterfree')
=== 'ponytaVaporeonPoliwrathButterfree'
pascalCase('ponytaVaporeonPoliwrathButterfree')
=== 'PonytaVaporeonPoliwrathButterfree'
kebabCase('ponytaVaporeonPoliwrathButterfree')
=== 'ponyta-vaporeon-poliwrath-butterfree'
snakeCase('ponytaVaporeonPoliwrathButterfree')
=== 'ponyta_vaporeon_poliwrath_butterfree'
constantCase('ponytaVaporeonPoliwrathButterfree')
=== 'PONYTA_VAPOREON_POLIWRATH_BUTTERFREE'
pathCase('ponytaVaporeonPoliwrathButterfree')
=== 'Ponyta/Vaporeon/Poliwrath/BUTTERFREE'
It is literally just this code:
function getParts (string) {
return string.match(/^[a-z]+|[A-Z][a-z]+|[A-Z]+|[a-z]+/g)
}
export function camelCase (string) {
return getParts(string)
.reduce((result, match, index) => {
return (index === 0)
? match.toLowerCase()
: result + match[0].toUpperCase() + match.slice(1).toLowerCase()
}, '')
}
export function kebabCase (string) {
return getParts(string)
.join('-').toLowerCase()
}
// etc...
FAQs
camelCase, kebab-case, PascalCase... a simple integration with nano package size. (SMALL footprint!)
The npm package case-anything receives a total of 669,359 weekly downloads. As such, case-anything popularity was classified as popular.
We found that case-anything demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.