File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -550,11 +550,8 @@ export const translateCommand = new Command('translate')
550550 additionalPrompts : sourceFrontmatter . i18n ?. additionalPrompts ,
551551 } )
552552
553- // eslint-disable-next-line @typescript-eslint/no-unused-vars
554- const { i18n : _ , ...newFrontmatter } = {
555- ...sourceFrontmatter ,
556- sourceSHA,
557- }
553+ const newFrontmatter = { ...sourceFrontmatter , sourceSHA }
554+ delete newFrontmatter . i18n
558555
559556 const { data, content } = matter ( targetContent )
560557 const typedData = data as I18nFrontmatter
@@ -574,18 +571,13 @@ export const translateCommand = new Command('translate')
574571 }
575572 }
576573
577- const finalFrontmatter =
578- typeof newFrontmatter . title === 'string'
579- ? newFrontmatter
580- : ( ( ) => {
581- // eslint-disable-next-line @typescript-eslint/no-unused-vars
582- const { title : _ , ...rest } = newFrontmatter
583- return rest
584- } ) ( )
574+ if ( typeof newFrontmatter . title !== 'string' ) {
575+ delete newFrontmatter . title
576+ }
585577
586578 targetContent = matter . stringify (
587579 content . startsWith ( '\n' ) ? content : '\n' + content ,
588- finalFrontmatter ,
580+ newFrontmatter ,
589581 )
590582
591583 await fs . mkdir ( targetBase , { recursive : true } )
You can’t perform that action at this time.
0 commit comments