Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
A collection of functions for working with different casings.
npm install --save kasi
These functions allow you to check if a string is using a specific casing.
isCamelCase
import {isCamelCase} from 'kasi';
isCamelCase ( 'fooBar' ); // => true
isCamelCase ( 'foo-bar' ); // => false
isConstantCase
import {isConstantCase} from 'kasi';
isConstantCase ( 'FOO_BAR' ); // => true
isConstantCase ( 'fooBar' ); // => false
isDotCase
import {isDotCase} from 'kasi';
isDotCase ( 'foo.bar' ); // => true
isDotCase ( 'fooBar' ); // => false
isKebabCase
import {isKebabCase} from 'kasi';
isKebabCase ( 'foo-bar' ); // => true
isKebabCase ( 'fooBar' ); // => false
isLowerCase
import {isLowerCase} from 'kasi';
isLowerCase ( 'foo' ); // => true
isLowerCase ( 'Foo' ); // => false
isPascalCase
import {isPascalCase} from 'kasi';
isPascalCase ( 'FooBar' ); // => true
isPascalCase ( 'fooBar' ); // => false
isPathCase
import {isPathCase} from 'kasi';
isPathCase ( 'foo/bar' ); // => true
isPathCase ( 'fooBar' ); // => false
isSnakeCase
import {isSnakeCase} from 'kasi';
isSnakeCase ( 'foo_bar' ); // => true
isSnakeCase ( 'fooBar' ); // => false
isTitleCase
import {isTitleCase} from 'kasi';
isTitleCase ( 'Foo Bar' ); // => true
isTitleCase ( 'fooBar' ); // => false
isUpperCase
import {isUpperCase} from 'kasi';
isUpperCase ( 'FOO' ); // => true
isUpperCase ( 'foo' ); // => false
These functions allow you to convert a string to a specific casing.
toCamelCase
import {toCamelCase} from 'kasi';
toCamelCase ( 'foo-bar' ); // => 'fooBar'
toCamelCase ( 'foo_bar' ); // => 'fooBar'
toConstantCase
import {toConstantCase} from 'kasi';
toConstantCase ( 'fooBar' ); // => 'FOO_BAR'
toConstantCase ( 'foo-bar' ); // => 'FOO_BAR'
toDotCase
import {toDotCase} from 'kasi';
toDotCase ( 'fooBar' ); // => 'foo.bar'
toDotCase ( 'foo-bar' ); // => 'foo.bar'
toKebabCase
import {toKebabCase} from 'kasi';
toKebabCase ( 'fooBar' ); // => 'foo-bar'
toKebabCase ( 'foo_bar' ); // => 'foo-bar'
toLowerCase
import {toLowerCase} from 'kasi';
toLowerCase ( 'FooBar' ); // => 'foobar'
toLowerCase ( 'foo-bar' ); // => 'foo-bar'
toPascalCase
import {toPascalCase} from 'kasi';
toPascalCase ( 'foo-bar' ); // => 'FooBar'
toPascalCase ( 'foo_bar' ); // => 'FooBar'
toPathCase
import {toPathCase} from 'kasi';
toPathCase ( 'fooBar' ); // => 'foo/bar'
toPathCase ( 'foo-bar' ); // => 'foo/bar'
toSnakeCase
import {toSnakeCase} from 'kasi';
toSnakeCase ( 'fooBar' ); // => 'foo_bar'
toSnakeCase ( 'foo-bar' ); // => 'foo_bar'
toTitleCase
import {toTitleCase} from 'kasi';
toTitleCase ( 'fooBar' ); // => 'Foo Bar'
toTitleCase ( 'foo-bar' ); // => 'Foo Bar'
toUpperCase
import {toUpperCase} from 'kasi';
toUpperCase ( 'fooBar' ); // => 'FOOBAR'
toUpperCase ( 'foo-bar' ); // => 'FOO-BAR'
These extra functions perform other operations related to casings.
apply
Transform a string to the given casing. Useful in combination with detect
.
import {apply} from 'kasi';
apply ( 'foo-bar', 'camel' ); // => 'fooBar'
apply ( 'foo-bar', 'constant' ); // => 'FOO_BAR'
copy
This function copies the casing of a string to another string, character by character. The two strings must have the same length.
import {copy} from 'kasi';
copy ( 'sIlLy', 'lions' ); // => 'lIoNs'
copy ( 'SiLlY', 'lions' ); // => 'LiOnS'
detect
This function detects the casing of a string. Useful in combination with apply
.
import {detect} from 'kasi';
detect ( 'fooBar' ); // => 'camel'
detect ( 'FOO_BAR' ); // => 'constant'
detect ( ' foo BAR ' ); // => 'unknown'
MIT © Fabio Spampinato
FAQs
A collection of functions for working with different casings.
We found that kasi demonstrated a not healthy version release cadence and project activity because the last version was released 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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.