robots-txt-guard
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -17,2 +17,5 @@ 'use strict'; | ||
var rules = group.rules | ||
.filter(function (rule) { | ||
return !!rule.path; | ||
}) | ||
.map(function (rule) { | ||
@@ -19,0 +22,0 @@ return { |
{ | ||
"name": "robots-txt-guard", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Validate urls against robots.txt rules.", | ||
@@ -5,0 +5,0 @@ "main": "lib/guard.js", |
@@ -83,3 +83,20 @@ /*global describe, it*/ | ||
}); | ||
it('should pick most specific agent', function () { | ||
// both groups should behave the same, regardless of the order of the rules | ||
var robotsTxt = guard({ | ||
groups: [{ | ||
agents: [ '*' ], | ||
rules: [ | ||
{ rule: 'disallow', path: '' } | ||
] | ||
}] | ||
}); | ||
assert.ok(robotsTxt.isAllowed('agent', '/'), '1'); | ||
assert.ok(robotsTxt.isAllowed('agent', '/path'), '2'); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13099
305