Skip to content

Commit

Permalink
chore: update code to use const and cleanup export
Browse files Browse the repository at this point in the history
  • Loading branch information
knownasilya committed Mar 29, 2022
1 parent 452a849 commit 5b405e0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use strict";
'use strict';

exports = module.exports = cliWidth;
module.exports = cliWidth;

function normalizeOpts(options) {
let defaultOpts = {
const defaultOpts = {
defaultWidth: 0,
output: process.stdout,
tty: require("tty"),
tty: require('tty'),
};

if (!options) {
Expand All @@ -23,7 +23,7 @@ function normalizeOpts(options) {
}

function cliWidth(options) {
let opts = normalizeOpts(options);
const opts = normalizeOpts(options);

if (opts.output.getWindowSize) {
return opts.output.getWindowSize()[0] || opts.defaultWidth;
Expand All @@ -38,7 +38,7 @@ function cliWidth(options) {
}

if (process.env.CLI_WIDTH) {
let width = parseInt(process.env.CLI_WIDTH, 10);
const width = parseInt(process.env.CLI_WIDTH, 10);

if (!isNaN(width) && width !== 0) {
return width;
Expand Down

0 comments on commit 5b405e0

Please sign in to comment.