mirror of
https://github.com/NaN72dev/kunkun-ext-string-utils.git
synced 2025-04-03 17:56:45 +00:00
feat(reverse): add command
This commit is contained in:
parent
d8e33a3eb5
commit
3a17380b0b
1
build.ts
1
build.ts
@ -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",
|
||||
|
@ -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
10
src/headless/reverse.ts
Normal 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());
|
Loading…
x
Reference in New Issue
Block a user