UNPKG

@condor-labs/redis

Version:

This module provide and usefull helper to use the official Node_redis library.

16 lines (14 loc) 445 B
const extractClientValue = (keyName = '', clientString = '') => { const key = `${keyName}=` const clientkeys = clientString.split(/\s/) for (const clientkey of clientkeys) { if (clientkey.includes(key)) { return clientkey.replace(key, '') } } } const removeIpPort = (ip) => { const index = ip.indexOf(':') return ip.substring(0, index) } module.exports = { extractClientValue, removeIpPort }