How to use the isIPRange function from validator

Find comprehensive JavaScript validator.isIPRange code examples handpicked from public code repositorys.

777
778
779
780
781
782
783
784
785
786
          result.remoteAddr ? `${result.remoteAddr}/32` : null
        ]
      : f.trim()
  )
  .flat()
  .filter(f => f && typeof f === 'string' && isIPRange(f))

const debugInfo = {
  host,
  effectiveFirewall,
fork icon7
star icon26
watch icon4

+ 2 other calls in file

27
28
29
30
31
32
33
34
35
36
  {
    require: false,
    type: Schema.Types.String,
    validate: {
      validator(c) {
        return validator.isIPRange(c, 4);
      },
    },
  },
],
fork icon0
star icon3
watch icon0

29
30
31
32
33
34
35
36
37
38
  {
    require: true,
    type: Schema.Types.String,
    validate: {
      validator(c) {
        return validator.isIPRange(c, 4) || validator.isIP(c, 4);
      },
    },
  },
],
fork icon0
star icon3
watch icon0