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

robots-txt-guard

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robots-txt-guard - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

3

lib/guard.js

@@ -17,2 +17,5 @@ 'use strict';

var rules = group.rules
.filter(function (rule) {
return !!rule.path;
})
.map(function (rule) {

@@ -19,0 +22,0 @@ return {

2

package.json
{
"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');
});
});
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