diff --git a/examples/simple.js b/examples/simple.js index 1f5b68b..ede70ba 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -1,7 +1,7 @@ "use strict"; const Rectangle = require('../lib/Rectangle').default; -const cursor = require('kittik-cursor').Cursor.create().resetTTY(); +const cursor = require('kittik-cursor').default.create().resetTTY(); Rectangle.create({text: 'Text here!', x: 'center', width: 20, background: 'green', foreground: 'black'}).render(cursor); Rectangle.create({x: 'center', y: 'middle', width: '50%', height: '20%', background: 'dark_blue'}).render(cursor); diff --git a/src/Rectangle.js b/src/Rectangle.js index 38489fc..ea83968 100644 --- a/src/Rectangle.js +++ b/src/Rectangle.js @@ -7,16 +7,16 @@ import Shape from 'kittik-shape-basic'; */ export default class Rectangle extends Shape { render(cursor) { - let text = this.getText(); - let width = this.getWidth(); - let height = this.getHeight(); - let x1 = this.getX(); - let y1 = this.getY(); - let x2 = x1 + width; - let y2 = y1 + height; - let background = this.getBackground(); - let foreground = this.getForeground(); - let filler = ' '.repeat(width); + const text = this.getText(); + const width = this.getWidth(); + const height = this.getHeight(); + const x1 = this.getX(); + const y1 = this.getY(); + const x2 = x1 + width; + const y2 = y1 + height; + const background = this.getBackground(); + const foreground = this.getForeground(); + const filler = ' '.repeat(width); if (typeof background !== 'undefined') cursor.background(background); if (typeof foreground !== 'undefined') cursor.foreground(foreground); diff --git a/test/unit/Rectangle.test.js b/test/unit/Rectangle.test.js index 247b4c9..a72e0b7 100644 --- a/test/unit/Rectangle.test.js +++ b/test/unit/Rectangle.test.js @@ -1,7 +1,7 @@ import { assert } from 'chai'; import sinon from 'sinon'; import Rectangle from '../../src/Rectangle'; -import { Cursor } from 'kittik-cursor'; +import Cursor from 'kittik-cursor'; describe('Shape::Rectangle', () => { it('Should properly render with default options', () => {