@@ -39,7 +39,7 @@ export type WithId<T = {}> = T extends never ? never : T & { id: string }
39
39
export function createAction (
40
40
initialValues : SetRequired < Partial < Omit < EditorAction , 'id' > > , 'type' > ,
41
41
) {
42
- const action : EditorAction = defaults ( { } , initialValues , { id : uniqueId ( ) } )
42
+ const action : EditorAction = defaults ( { id : uniqueId ( ) } , initialValues )
43
43
if ( action . type === CopilotDocV1 . Type . SkillUsage ) {
44
44
action . skillUsage = CopilotDocV1 . SkillUsageType . ReadyToUse
45
45
}
@@ -49,18 +49,17 @@ export function createAction(
49
49
export function createGroup (
50
50
initialValues : Partial < Omit < EditorGroup , 'id' | 'opers' > > = { } ,
51
51
) : EditorGroup {
52
- const group : EditorGroup = defaults ( { name : '' , opers : [ ] } , initialValues , {
53
- id : uniqueId ( ) ,
52
+ const group : EditorGroup = defaults ( { id : uniqueId ( ) } , initialValues , {
53
+ name : '' ,
54
+ opers : [ ] ,
54
55
} )
55
56
return group
56
57
}
57
58
58
59
export function createOperator (
59
60
initialValues : Omit < EditorOperator , 'id' > ,
60
61
) : EditorOperator {
61
- const operator : EditorOperator = defaults ( { skill : 1 } , initialValues , {
62
- id : uniqueId ( ) ,
63
- } )
62
+ const operator : EditorOperator = defaults ( { id : uniqueId ( ) } , initialValues )
64
63
return operator
65
64
}
66
65
0 commit comments