From 1e8d9d00f37db9ba9cff627e157f31def56e88cb Mon Sep 17 00:00:00 2001 From: Nan72 Date: Fri, 14 Feb 2025 12:29:10 +0700 Subject: [PATCH] feat(kebab): add kebad --- build.ts | 1 + package.json | 5 +++++ src/kebab.ts | 11 +++++++++++ 3 files changed, 17 insertions(+) create mode 100644 src/kebab.ts diff --git a/build.ts b/build.ts index a8296cb..6adecdc 100644 --- a/build.ts +++ b/build.ts @@ -6,6 +6,7 @@ import {$} from "bun"; const entrypoints = [ "./src/camel-case.ts", "./src/capitalize.ts", + "./src/kebab.ts", ]; async function build() { diff --git a/package.json b/package.json index 9ff0b26..5861479 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,11 @@ "name": "Convert clipboard text to Capitalize", "main": "dist/capitalize.js", "cmds": [] + }, + { + "name": "Convert clipboard text to kebab-case (dash-case)", + "main": "dist/kebab.js", + "cmds": [] } ] }, diff --git a/src/kebab.ts b/src/kebab.ts new file mode 100644 index 0000000..83869a4 --- /dev/null +++ b/src/kebab.ts @@ -0,0 +1,11 @@ +import {expose} from "@kksh/api/headless"; +import kebabCase from "lodash/kebabCase"; +import {BaseExt} from "./base"; + +class KebabExt extends BaseExt { + constructor() { + super(kebabCase); + } +} + +expose(new KebabExt());