Skip to content

Commit 0801bcf

Browse files
committed
docs(shape): Update examples
1 parent e8221c2 commit 0801bcf

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

examples/Rectangle.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
"use strict";
22

3-
const Cursor = require('kittik-cursor').default;
4-
const Shape = require('../lib/Shape').default;
3+
const Cursor = require('kittik-cursor');
4+
const Shape = require('../lib/Shape');
55
const cursor = new Cursor().resetTTY();
66

77
// Create class that extends from Shape and implement render() method
88
class Rectangle extends Shape {
99
render(cursor) {
10-
let text = this.getText();
11-
let width = this.getWidth();
12-
let height = this.getHeight();
13-
let x1 = this.getX();
14-
let y1 = this.getY();
15-
let x2 = x1 + width;
16-
let y2 = y1 + height;
17-
let background = this.getBackground();
18-
let foreground = this.getForeground();
19-
let filler = ' '.repeat(width);
10+
const text = this.getText();
11+
const width = this.getWidth();
12+
const height = this.getHeight();
13+
const x1 = this.getX();
14+
const y1 = this.getY();
15+
const x2 = x1 + width;
16+
const y2 = y1 + height;
17+
const background = this.getBackground();
18+
const foreground = this.getForeground();
19+
const filler = ' '.repeat(width);
2020

2121
if (typeof background !== 'undefined') cursor.background(background);
2222
if (typeof foreground !== 'undefined') cursor.foreground(foreground);

examples/Text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

3-
const Cursor = require('kittik-cursor').default;
4-
const Shape = require('../lib/Shape').default;
3+
const Cursor = require('kittik-cursor');
4+
const Shape = require('../lib/Shape');
55
const cursor = new Cursor().resetTTY();
66

77
// Create class that extends from Shape and implement render() method

0 commit comments

Comments
 (0)