Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
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 130,826 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.