Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit 16f72cc

Browse files
committed
lint files
1 parent fc3d99d commit 16f72cc

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

composition/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function asyncComposition (...callbacks) {
1818
}
1919

2020
function lowercaseText (text) {
21-
return text.toLowerCase()
21+
return text.toLowerCase()
2222
}
2323

2424
function addEmojis (text) {
@@ -31,5 +31,5 @@ function separateText (text) {
3131

3232
const makeNiceText = asyncComposition(lowercaseText, addEmojis, separateText)
3333

34-
console.log( makeNiceText('Hello there') )
35-
console.log( makeNiceText('Composition is AWESOME') )
34+
console.log(makeNiceText('Hello there'))
35+
console.log(makeNiceText('Composition is AWESOME'))

currying/regular-validation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// regular function to validate some text
2-
function validateTextBetween(minSize, maxSize, errorMessage, text) {
2+
function validateTextBetween (minSize, maxSize, errorMessage, text) {
33
const textSize = (text || '').trim().length
44

55
if (textSize < minSize || textSize > maxSize) {

currying/validaton-with-currying.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* BUT, using currying to make more reusable
44
*/
55

6-
function validateTextBetween(minSize) {
6+
function validateTextBetween (minSize) {
77
return function (maxSize) {
88
return function (errorMessage) {
99
return function (text) {
@@ -19,7 +19,7 @@ function validateTextBetween(minSize) {
1919
}
2020
}
2121

22-
function applyValidation(callback) {
22+
function applyValidation (callback) {
2323
return function (value) {
2424
try {
2525
callback(value)

functor/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ console.log('new value:', poweredNumbers) // [22, 24, 26, 28]
1616

1717
// now lets create our own functor
1818

19-
function ourFunctor(value) {
19+
function ourFunctor (value) {
2020
return {
2121
value,
22-
invalid() {
22+
invalid () {
2323
return this.value === null || this.value === undefined
2424
},
25-
map(callback) {
25+
map (callback) {
2626
if (this.invalid()) return ourFunctor(null)
2727

2828
const newValue = callback(this.value)

lazy-evaluation/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// sample usage of lazy evaluation concept
22

33
function eagerRobustCalculation (valueA, valueB) {
4-
const timeToEnd = Date.now() + 2_500
4+
const timeToEnd = Date.now() + 2500
55
const poweredValue = Math.pow(valueA, 3)
66

77
// just for slow things out for better demonstration
@@ -11,7 +11,7 @@ function eagerRobustCalculation (valueA, valueB) {
1111
}
1212

1313
function lazyRobustCalculation (valueA) {
14-
const timeToEnd = Date.now() + 2_500
14+
const timeToEnd = Date.now() + 2500
1515
const poweredValue = Math.pow(valueA, 3)
1616

1717
// just for slow things out for better demonstration
@@ -24,11 +24,11 @@ function lazyRobustCalculation (valueA) {
2424

2525
console.time('#eager function')
2626

27-
console.log( eagerRobustCalculation(3, 100) ) // 127
28-
console.log( eagerRobustCalculation(3, 200) ) // 227
29-
console.log( eagerRobustCalculation(3, 300) ) // 327
27+
console.log(eagerRobustCalculation(3, 100)) // 127
28+
console.log(eagerRobustCalculation(3, 200)) // 227
29+
console.log(eagerRobustCalculation(3, 300)) // 327
3030

31-
console.timeEnd('#eager function') // 7507.036ms
31+
console.timeEnd('#eager function') // 7507.036ms
3232

3333
/**
3434
* in the lazy function, the idea is that we calculate
@@ -40,8 +40,8 @@ console.time('#lazy evaluation')
4040

4141
const lazyPoweredThree = lazyRobustCalculation(3)
4242

43-
console.log( lazyPoweredThree(100) ) // 127
44-
console.log( lazyPoweredThree(200) ) // 227
45-
console.log( lazyPoweredThree(300) ) // 327
43+
console.log(lazyPoweredThree(100)) // 127
44+
console.log(lazyPoweredThree(200)) // 227
45+
console.log(lazyPoweredThree(300)) // 327
4646

47-
console.timeEnd('#lazy evaluation') // 2499.923ms
47+
console.timeEnd('#lazy evaluation') // 2499.923ms

0 commit comments

Comments
 (0)