From 0341a5e86433de40a7de555a065e602e258f1911 Mon Sep 17 00:00:00 2001 From: Nan72 Date: Fri, 14 Feb 2025 12:25:40 +0700 Subject: [PATCH] feat(capital): add capital command --- build.ts | 5 ++++- package.json | 7 ++++++- src/capitalize.ts | 11 +++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/capitalize.ts diff --git a/build.ts b/build.ts index c4b09a8..a8296cb 100644 --- a/build.ts +++ b/build.ts @@ -3,7 +3,10 @@ import {join} from "path"; import {refreshTemplateWorkerCommand} from "@kksh/api/dev"; import {$} from "bun"; -const entrypoints = ["./src/camel-case.ts"]; +const entrypoints = [ + "./src/camel-case.ts", + "./src/capitalize.ts", +]; async function build() { try { diff --git a/package.json b/package.json index 21174fc..9ff0b26 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,14 @@ }, "headlessCmds": [ { - "name": "Convert clipboard text to Camel Case", + "name": "Convert clipboard text to camelCase", "main": "dist/camel-case.js", "cmds": [] + }, + { + "name": "Convert clipboard text to Capitalize", + "main": "dist/capitalize.js", + "cmds": [] } ] }, diff --git a/src/capitalize.ts b/src/capitalize.ts new file mode 100644 index 0000000..a6bd495 --- /dev/null +++ b/src/capitalize.ts @@ -0,0 +1,11 @@ +import {expose} from "@kksh/api/headless"; +import capitalize from "lodash/capitalize"; +import {BaseExt} from "./base"; + +class CapitalizeExt extends BaseExt { + constructor() { + super(capitalize); + } +} + +expose(new CapitalizeExt());