mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
[ci] format
This commit is contained in:
parent
5428b3da08
commit
5d566cfeca
2 changed files with 32 additions and 14 deletions
|
@ -10,7 +10,12 @@ import { resolveConfig } from '../../core/config/config.js';
|
|||
import { createSettings } from '../../core/config/settings.js';
|
||||
import * as msg from '../../core/messages.js';
|
||||
import { DEFAULT_PREFERENCES } from '../../preferences/defaults.js';
|
||||
import { coerce, isValidKey, type PreferenceKey, type PreferenceLocation } from '../../preferences/index.js';
|
||||
import {
|
||||
coerce,
|
||||
isValidKey,
|
||||
type PreferenceKey,
|
||||
type PreferenceLocation,
|
||||
} from '../../preferences/index.js';
|
||||
import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js';
|
||||
// @ts-expect-error flattie types are mispackaged
|
||||
import { flattie } from 'flattie';
|
||||
|
@ -300,15 +305,21 @@ function formatTable(
|
|||
b
|
||||
)} ${space(colBLength - b.toString().length - 3)} ${dim(chars.v)}`;
|
||||
}
|
||||
const top = dim(`${chars.topLeft}${chars.h.repeat(colALength + 1)}${chars.hBottom}${chars.h.repeat(
|
||||
colBLength
|
||||
)}${chars.topRight}`);
|
||||
const bottom = dim(`${chars.bottomLeft}${chars.h.repeat(colALength + 1)}${chars.hTop}${chars.h.repeat(
|
||||
colBLength
|
||||
)}${chars.bottomRight}`);
|
||||
const divider = dim(`${chars.vRightThick}${chars.hThick.repeat(colALength + 1)}${
|
||||
chars.hThickCross
|
||||
}${chars.hThick.repeat(colBLength)}${chars.vLeftThick}`);
|
||||
const top = dim(
|
||||
`${chars.topLeft}${chars.h.repeat(colALength + 1)}${chars.hBottom}${chars.h.repeat(
|
||||
colBLength
|
||||
)}${chars.topRight}`
|
||||
);
|
||||
const bottom = dim(
|
||||
`${chars.bottomLeft}${chars.h.repeat(colALength + 1)}${chars.hTop}${chars.h.repeat(
|
||||
colBLength
|
||||
)}${chars.bottomRight}`
|
||||
);
|
||||
const divider = dim(
|
||||
`${chars.vRightThick}${chars.hThick.repeat(colALength + 1)}${
|
||||
chars.hThickCross
|
||||
}${chars.hThick.repeat(colBLength)}${chars.vLeftThick}`
|
||||
);
|
||||
const rows: string[] = [top, formatRow(-1, colA, colB, bold), divider];
|
||||
let i = 0;
|
||||
for (const [key, value] of Object.entries(object)) {
|
||||
|
|
|
@ -27,9 +27,11 @@ export interface PreferenceOptions {
|
|||
location?: PreferenceLocation;
|
||||
}
|
||||
|
||||
type DeepPartial<T> = T extends object ? {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
} : T;
|
||||
type DeepPartial<T> = T extends object
|
||||
? {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
}
|
||||
: T;
|
||||
|
||||
export type PreferenceKey = DotKeys<Preferences>;
|
||||
export interface PreferenceList extends Record<PreferenceLocation, DeepPartial<Preferences>> {
|
||||
|
@ -82,7 +84,12 @@ export default function createPreferences(config: AstroConfig): AstroPreferences
|
|||
stores[location].set(key, value);
|
||||
},
|
||||
async getAll() {
|
||||
return Object.assign({}, DEFAULT_PREFERENCES, stores['global'].getAll(), stores['project'].getAll());
|
||||
return Object.assign(
|
||||
{},
|
||||
DEFAULT_PREFERENCES,
|
||||
stores['global'].getAll(),
|
||||
stores['project'].getAll()
|
||||
);
|
||||
},
|
||||
async list() {
|
||||
return {
|
||||
|
|
Loading…
Add table
Reference in a new issue