Skip to content

Commit

Permalink
refactor: Use null as default parameter value explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
warxander committed Nov 19, 2023
1 parent 0807293 commit f5505cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export function getFrame(): IFrame {
frame.setMouseCursor(mouseCursor);
},

buildStyleSelector(class_: string, subClass: string | null): string {
buildStyleSelector(class_: string, subClass: string | null = null): string {
return frame.buildStyleSelector(class_, subClass ?? undefined);
},

Expand Down Expand Up @@ -282,7 +282,7 @@ export function setNextFrameDisableMove() {
Frame.setNextFrameDisableMove();
}

export function beginFrame(id: string | null) {
export function beginFrame(id: string | null = null) {
setFrame(new Frame(id ?? undefined));
}

Expand Down
2 changes: 1 addition & 1 deletion src/items/hyperlink.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Frame, MouseCursor, getFrameChecked } from '../core/frame';
import { Color } from '../core/types';

export function hyperlink(url: string, urlText: string | null) {
export function hyperlink(url: string, urlText: string | null = null) {
const frame = getFrameChecked();

const painter = frame.getPainter();
Expand Down
2 changes: 1 addition & 1 deletion src/items/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface ISliderResponse {
value: number;
}

export function slider(value: number, min: number, max: number, w: number, text: string | null): ISliderResponse {
export function slider(value: number, min: number, max: number, w: number, text: string | null = null): ISliderResponse {
const frame = getFrameChecked();

const input = frame.getInput();
Expand Down

0 comments on commit f5505cb

Please sign in to comment.