Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cliui, UI } from './build/lib/index.js'
import type { UIOptions } from './build/lib/index.d.ts'
import { wrap, stripAnsi } from './build/lib/string-utils.js'

export default function ui (opts: UIOptions): UI {
export default function ui (opts?: UIOptions): UI {
return cliui(opts, {
stringWidth: (str: string) => {
return [...str].length
Expand Down
2 changes: 1 addition & 1 deletion lib/cjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cliui, UIOptions } from './index.js'
const stringWidth = require('string-width')
const stripAnsi = require('strip-ansi')
const wrap = require('wrap-ansi')
export default function ui (opts: UIOptions) {
export default function ui (opts?: UIOptions) {
return cliui(opts, {
stringWidth,
stripAnsi,
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ function alignCenter (str: string, width: number): string {
}

let mixin: Mixin
export function cliui (opts: Partial<UIOptions>, _mixin: Mixin) {
export function cliui (opts: Partial<UIOptions> | undefined | null, _mixin: Mixin) {
mixin = _mixin
return new UI({
width: opts?.width || getWindowWidth(),
Expand Down