Skip to content

Commit e577866

Browse files
New internal option for trailing space
1 parent 12974b8 commit e577866

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

libs/assembling/assembler/src/lib/assembler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ export function Assembler<T extends FormatterType>(
8080
const lf = useOptions?.eol === 'crlf' ? '\r\n' : '\n';
8181

8282
// combine strings and return
83-
return strings.join(lf) + lf;
83+
return strings.join(lf) + (useOptions.trailingSpace ? lf : '');
8484
}

libs/assembling/config/src/lib/assembler.interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ export interface IAssemblerInputOptions<T extends FormatterType>
8282
style: Partial<ICodeStyle>;
8383
/** Do we process the code as if we know nothing about the source? */
8484
vanilla?: boolean;
85+
/** Do we have a trailing space or not? */
86+
trailingSpace?: boolean;
8587
}
8688

8789
/**
@@ -105,4 +107,5 @@ export const DEFAULT_ASSEMBLER_OPTIONS: IAssemblerOptions<FiddleFormatter> = {
105107
autoDoc: false,
106108
styleAndFormat: true,
107109
spaceOffset: 0,
110+
trailingSpace: true,
108111
};

0 commit comments

Comments
 (0)