feat(reverse): add command

This commit is contained in:
Nan72 2025-02-26 15:59:55 +07:00
parent d8e33a3eb5
commit 3a17380b0b
No known key found for this signature in database
3 changed files with 16 additions and 0 deletions

View File

@ -16,6 +16,7 @@ const entrypoints = [
"./src/headless/trim-start.ts",
"./src/headless/random-case.ts",
"./src/headless/lorem.ts",
"./src/headless/reverse.ts",
"./src/preference/truncate.ts",
"./src/preference/pad.ts",
"./src/preference/repeat.ts",

View File

@ -80,6 +80,11 @@
"main": "dist/lorem.js",
"name": "Generate a Lorem Ipsum sentence into your clipboard",
"cmds": []
},
{
"name": "Reverse clipboard text",
"main": "dist/reverse.js",
"cmds": []
}
],
"templateUiCmds": [

10
src/headless/reverse.ts Normal file
View File

@ -0,0 +1,10 @@
import { expose } from "@kksh/api/headless";
import { BaseExt } from "./base";
class ReverseExt extends BaseExt {
constructor() {
super((text: string) => text.split('').reverse().join(''));
}
}
expose(new ReverseExt());