Skip to content

Commit

Permalink
Add breaks between helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemBaskal committed May 26, 2020
1 parent 3f38bdf commit 65e87f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/src/helpers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,14 @@ export const formatNumber = (num) => {
export const normalizeMultiline = (multiline) => `${normalizeTextarea(multiline)
.map((line) => line.trim())
.join('\n')}\n`;

/**
* @param ip {string}
* @returns {number}
*/
export const ipToInt = (ip) => ip.split('.')
.reduce((int, oct) => (int << 8) + parseInt(oct, 10), 0) >>> 0;

/**
* @param cidr {string}
* @param ip {string}
Expand All @@ -509,6 +511,7 @@ export const isIpInCidr = (cidr, ip) => {
const mask = ~((2 ** (32 - bits)) - 1);
return (ipToInt(ip) & mask) === (ipToInt(range) & mask);
};

/**
* @param rawClients {string}
* @param currentClient {string}
Expand Down

0 comments on commit 65e87f3

Please sign in to comment.