mirror of
https://github.com/yamadashy/repomix.git
synced 2025-06-11 00:25:54 +03:00
refactor(website): Extract default pack options to eliminate duplication
This commit is contained in:
@@ -13,8 +13,7 @@ export interface PackOptions {
|
||||
compress: boolean;
|
||||
}
|
||||
|
||||
export function usePackOptions() {
|
||||
const packOptions = reactive<PackOptions>({
|
||||
const DEFAULT_PACK_OPTIONS: PackOptions = {
|
||||
format: 'xml',
|
||||
removeComments: false,
|
||||
removeEmptyLines: false,
|
||||
@@ -25,7 +24,10 @@ export function usePackOptions() {
|
||||
ignorePatterns: '',
|
||||
outputParsable: false,
|
||||
compress: false,
|
||||
});
|
||||
};
|
||||
|
||||
export function usePackOptions() {
|
||||
const packOptions = reactive<PackOptions>({ ...DEFAULT_PACK_OPTIONS });
|
||||
|
||||
const getPackRequestOptions = computed(() => ({
|
||||
removeComments: packOptions.removeComments,
|
||||
@@ -44,16 +46,7 @@ export function usePackOptions() {
|
||||
}
|
||||
|
||||
function resetOptions() {
|
||||
packOptions.format = 'xml';
|
||||
packOptions.removeComments = false;
|
||||
packOptions.removeEmptyLines = false;
|
||||
packOptions.showLineNumbers = false;
|
||||
packOptions.fileSummary = true;
|
||||
packOptions.directoryStructure = true;
|
||||
packOptions.includePatterns = '';
|
||||
packOptions.ignorePatterns = '';
|
||||
packOptions.outputParsable = false;
|
||||
packOptions.compress = false;
|
||||
Object.assign(packOptions, DEFAULT_PACK_OPTIONS);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user