chore(.gitignore): add test.ts to the list of ignored files

fix(prepare-commit-msg-hook.ts): add missing await keyword to getStagedFiles() function call
feat(prepare-commit-msg-hook.ts): add spinner to indicate commit message generation progress
feat(utils/mergeDiffs.ts): add mergeDiffs function to merge array of strings into an array of strings with a maximum length
The test.ts file is now ignored by git. The missing await keyword has been added to the getStagedFiles() function call. A spinner has been added to indicate the progress of commit message generation. The mergeDiffs function has been added to merge an array of strings into an array of strings with a maximum length.
This commit is contained in:
di-sukharev
2023-03-29 10:43:27 +08:00
parent ea864d18f4
commit 4cc73208cd
3 changed files with 16 additions and 9 deletions
@@ -1,5 +1,5 @@
import { tokenCount } from './tokenCount'
export function mergeStrings(arr: string[], maxStringLength: number): string[] {
import { tokenCount } from './tokenCount';
export function mergeDiffs(arr: string[], maxStringLength: number): string[] {
const mergedArr: string[] = [];
let currentItem: string = arr[0];
for (const item of arr.slice(1)) {