Skip to content

Commit e3b5661

Browse files
committed
A simple module, to be used as a mixin to a ts file.
1 parent f0db5e7 commit e3b5661

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

js-and-ts/format.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const surroundWithStars = (value) => {
2+
const valueLength = value.toString().length;
3+
const topBottomBorder = '*'.repeat(valueLength + 2);
4+
5+
return topBottomBorder
6+
+ "\n"
7+
+ '*' + value.toString() + '*'
8+
+ "\n"
9+
+ topBottomBorder;
10+
}
11+
12+
module.exports.Formatter = { surroundWithStars };
13+

0 commit comments

Comments
 (0)