This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "MongoSourceChangeEvent", | |
"namespace": "com.company.common.avro", | |
"type": "record", | |
"fields": [ | |
{ | |
"name": "_id", | |
"type": "string" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is just the IEEE 754 spec. Nothing specific to JavaSctipt. | |
* */ | |
typeof NaN; // number | |
/* | |
* JavaScript will invoke ToPrimitive operation. | |
* In this case, because the hint sent to ToPrimitive is "default", the flow is: [].valueOf -> [].toString. | |
* [].toString returns "", so "" + "" === "" | |
* */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const truncateString = (str, len) => { | |
if (str.length > len && str.length > 0) { | |
let newStr = str + ' '; | |
newStr = str.substr(0, len); | |
newStr = str.substr(0, newStr.lastIndexOf(' ')); | |
newStr = newStr.length > 0 ? newStr : str.substr(0, len); | |
return `${newStr}...`; | |
} | |
return str; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PORT=5000 |