Skip to content

Commit 8d68411

Browse files
committed
Updated gitignore
1 parent d1083d1 commit 8d68411

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ typings/
7171

7272
# Serverless directories
7373
.serverless
74+
75+
.idea
76+
.vscode

‎lib/region.js‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
class Region {
4+
constructor(left, top, width, height) {
5+
this.left = left;
6+
this.top = top;
7+
this.width = width;
8+
this.height = height;
9+
}
10+
11+
area() {
12+
return this.width * this.height;
13+
}
14+
15+
toString() {
16+
return `(${this.left}, ${this.top}, ${this.left + this.width}, ${this.top + this.height})`;
17+
}
18+
}
19+
20+
module.exports = Region;

0 commit comments

Comments
 (0)