Skip to content

Commit

Permalink
Weird stuff with formatting or smth.
Browse files Browse the repository at this point in the history
  • Loading branch information
untio11 committed Nov 18, 2024
1 parent 78a2882 commit e917f0c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/types/intersection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export class IntersectionType<Types extends OneOrMore<BaseObjectLikeTypeImpl<unk
/** {@inheritdoc BaseTypeImpl.typeConfig} */
readonly typeConfig: undefined;

constructor(readonly types: Types, name?: string) {
constructor(
readonly types: Types,
name?: string,
) {
super();
this.isDefaultName = !name;
this.name = name || defaultName(types);
Expand Down
2 changes: 1 addition & 1 deletion src/types/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ type Bound<T extends 'min' | 'max'> = {
function selectBound<T extends 'min' | 'max'>(key: T, current: NumberTypeConfig, update: NumberTypeConfig): Bound<T> {
const exclKey = `${key}Exclusive` as const;

const onlyTheBound = (c: NumberTypeConfig) => ({ [key]: c[key], [exclKey]: c[exclKey] } as Bound<T>);
const onlyTheBound = (c: NumberTypeConfig) => ({ [key]: c[key], [exclKey]: c[exclKey] }) as Bound<T>;

const currentPosition: number | undefined = current[key] ?? current[exclKey];
if (currentPosition == null) return onlyTheBound(update);
Expand Down
7 changes: 6 additions & 1 deletion src/types/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export class RecordType<
/** {@inheritdoc BaseTypeImpl.typeConfig} */
readonly typeConfig: undefined;

constructor(readonly keyType: KeyTypeImpl, readonly valueType: ValueTypeImpl, name?: string, readonly strict = true) {
constructor(
readonly keyType: KeyTypeImpl,
readonly valueType: ValueTypeImpl,
name?: string,
readonly strict = true,
) {
super();
this.isDefaultName = !name;
this.name = name || `Record<${keyType.name}, ${valueType.name}>`;
Expand Down
5 changes: 4 additions & 1 deletion src/types/union.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export class UnionType<
/** {@inheritdoc BaseTypeImpl.typeConfig} */
readonly typeConfig: undefined;

constructor(readonly types: Types, name?: string) {
constructor(
readonly types: Types,
name?: string,
) {
super();
this.isDefaultName = !name;
this.name = name || types.map(type => bracketsIfNeeded(type.name, '|')).join(' | ');
Expand Down

0 comments on commit e917f0c

Please sign in to comment.