Socket
Socket
Sign inDemoInstall

@alexvyber/convert-case

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @alexvyber/convert-case

convert camelCase to kebab-case


Version published
Maintainers
1
Install size
7.14 kB
Created

Readme

Source

Case Convert

Package for converting string cases

Install

npm install @alexvyber/convert-case
pnpm add @alexvyber/convert-case
yarn add @alexvyber/convert-case

Example

import { camelToKebab, kebabToCamel } from "@alexvyber/convert-case"

console.log(camelToKebab("SomeString")) // => some-string
console.log(camelToKebab("otherString")) // => other-string

console.log(kebabToCamel("some-string")) // => SomeString
console.log(kebabToCamel("other-string")) // => OtherString

API

Table of Contents
  • camelToKebab
  • kebabToCamel

camelToKebab

Converts a string from CamelCase to kebab-case.

Parameters
  • input T The string in CamelCase to be converted
Examples
camelToKebab("SomeString") // "some-string"

Returns Kebabtize The string in kebab-case

kebabToCamel

Converts a string from kebab-case to CamelCase.

Parameters
  • input T The string in kebab-case to be converted
Examples
kebabToCamel("some-string") // "SomeString"

Returns Camelize The string in CamelCase

Keywords

FAQs

Last updated on 05 May 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc