Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ip-filter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-filter - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

11

CHANGELOG.md
## 1.0.0 - 2015-05-24
- Release v1.0.0 / npm@v1.0.0
- add support for no strict mode
- run npm-related(1)
- run keywords(1)
- Commits on May 23, 2015
- add test for when invalid ip
- implement
## 0.0.0 - 2015-05-23
- first commits
- first commits

4

index.js

@@ -13,4 +13,4 @@ /*!

module.exports = function ipFilter (ip, patterns) {
if (!ipRegex().test(ip)) {
module.exports = function ipFilter (ip, patterns, strict) {
if (!strict && !ipRegex().test(ip)) {
throw new Error('ip-filter expect only valid IPv4/IPv6 IPs')

@@ -17,0 +17,0 @@ }

{
"name": "ip-filter",
"version": "0.0.0",
"version": "1.0.0",
"description": "Filter valid IPv4 or IPv6 IP against glob pattern, array, string, regexp or matcher function, if match return the checked IP, otherwise return falsey value.",

@@ -13,4 +13,4 @@ "repository": "tunnckoCore/ip-filter",

"dependencies": {
"ip-regex": "^1.0.3",
"is-match": "^0.2.0"
"ip-regex": "~1.0.3",
"is-match": "~0.2.0"
},

@@ -20,3 +20,21 @@ "devDependencies": {

},
"keywords": []
"keywords": [
"array",
"check",
"filter",
"glob",
"ip",
"ips",
"ipv",
"ismatch",
"match",
"matcher",
"micro",
"micromatch",
"patterns",
"regexp",
"string",
"valid",
"validate"
]
}

@@ -31,2 +31,10 @@ # ip-filter [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url]

## See also
- [apidocs-cli](https://github.com/tunnckocore/apidocs-cli): Async CLI for automatically generating API docs from code comments
- [is-missing](https://github.com/tunnckoCore/is-missing): Check that given `name` or `user/repo` exists in npm registry or in… [more](https://github.com/tunnckoCore/is-missing)
- [koa-ip-filter](https://github.com/tunnckocore/koa-ip-filter): Filter IPs with a glob pattern, regex, string, array or matcher function.… [more](https://github.com/tunnckocore/koa-ip-filter)
- [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster… [more](https://github.com/jonschlinkert/micromatch)
- [npm-related](https://github.com/tunnckoCore/npm-related): Thin wrapper on top of `helper-related` for generating a list of links… [more](https://github.com/tunnckoCore/npm-related)
## Contributing

@@ -33,0 +41,0 @@

@@ -41,2 +41,10 @@ /*!

})
test('should support no strict mode to compare other than IPs', function (done) {
var actual = ipFilter('x-koaip', ['*-koaip', '!foo-koa'], true)
var expected = 'x-koaip'
test.equal(actual, expected)
done()
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc