feat(trim): add trim start

This commit is contained in:
Nan72 2025-02-14 12:41:42 +07:00
parent 8c0826fecb
commit dfdf760823
No known key found for this signature in database
4 changed files with 19 additions and 1 deletions

View File

@ -86,3 +86,4 @@ See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) fo
# TODO # TODO
[ ] padding [ ] padding
[ ] Truncate

View File

@ -13,6 +13,7 @@ const entrypoints = [
"./src/to-upper.ts", "./src/to-upper.ts",
"./src/trim.ts", "./src/trim.ts",
"./src/trim-end.ts", "./src/trim-end.ts",
"./src/trim-start.ts",
]; ];
async function build() { async function build() {

View File

@ -63,6 +63,11 @@
"name": "Trim the end of clipboard text", "name": "Trim the end of clipboard text",
"main": "dist/trim-end.js", "main": "dist/trim-end.js",
"cmds": [] "cmds": []
},
{
"name": "Trim the start of clipboard text",
"main": "dist/trim-start.js",
"cmds": []
} }
] ]
}, },

11
src/trim-start.ts Normal file
View File

@ -0,0 +1,11 @@
import { expose } from "@kksh/api/headless";
import trimStart from "lodash/trimStart";
import { BaseExt } from "./base";
class TrimStartExt extends BaseExt {
constructor() {
super(trimStart);
}
}
expose(new TrimStartExt());