IP

Validates if the input data is a valid IP address or if it is within a specified CIDR range.

Options
  • privatebooleanif specified, check if we have an IP address from a private block
  • publicbooleanif specified, check if we have a publicly accessible IP address
  • rangearray of ip | CIDR notationif specified, check if the input IP is within the specified CIDR block
'use strict';
thorin.validate('IP', 'inputString', {
   private: false,
   public: true,
   range: ['4.4.4.0/24']
});
Do you have a question or is something missing?

You can always create a new issue on GitHub or contact one of the core founders by chat.