UNPKG

kevoree-group-centralizedws

Version:

WebSocket group based on a centralized architecture that only sends partial model to connected clients

11 lines (10 loc) 243 B
module.exports = function shrink(str, length) { if (str && typeof str === 'string') { if (str.length > length) { return str.substr(0, length - 3) + '...'; } else { return str.substr(0, length); } } return str; };