File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,18 @@ import type { Page } from "@cosense/types/rest";
3
3
import type { Change } from "./change.ts" ;
4
4
import { findMetadata , getHelpfeels } from "./findMetadata.ts" ;
5
5
import { isSameArray } from "./isSameArray.ts" ;
6
+ import { isString } from "@core/unknownutil/is/string" ;
6
7
7
8
export function * makeChanges (
8
9
before : Page ,
9
- after : string [ ] ,
10
+ after : ( string | { text : string } ) [ ] ,
10
11
userId : string ,
11
12
) : Generator < Change , void , unknown > {
12
13
// Prevent newline characters from being included in the text
13
14
// This ensures consistent line handling across different platforms
14
- const after_ = after . flatMap ( ( text ) => text . split ( "\n" ) ) ;
15
+ const after_ = after . flatMap ( ( text ) =>
16
+ ( isString ( text ) ? text : text . text ) . split ( "\n" )
17
+ ) ;
15
18
16
19
// First, yield changes in the main content
17
20
// Content changes must be processed before metadata to maintain consistency
Original file line number Diff line number Diff line change @@ -48,7 +48,10 @@ export const patch = (
48
48
update : (
49
49
lines : BaseLine [ ] ,
50
50
metadata : PatchMetadata ,
51
- ) => string [ ] | undefined | Promise < string [ ] | undefined > ,
51
+ ) =>
52
+ | ( string | { text : string } ) [ ]
53
+ | undefined
54
+ | Promise < ( string | { text : string } ) [ ] | undefined > ,
52
55
options ?: PatchOptions ,
53
56
) : Promise < Result < string , PushError | Socket . DisconnectReason > > =>
54
57
push (
You can’t perform that action at this time.
0 commit comments