New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

absolution

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absolution - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

3

index.js

@@ -25,2 +25,5 @@ var htmlparser = require('htmlparser2');

attribs[attr] = url.resolve(base, attribs[attr]);
if (options.decorator) {
attribs[attr] = options.decorator(attribs[attr]);
}
}

@@ -27,0 +30,0 @@ });

2

package.json
{
"name": "absolution",
"version": "0.1.0",
"version": "0.2.0",
"description": "absolution accepts HTML and a base URL, and returns HTML with absolute URLs. Great for generating valid RSS feeds.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -27,4 +27,14 @@ # absolution

If you want to do further processing of each absolute URL, you can also pass a decorator function:
var clean = absolution(dirty, 'http://example.com', {
decorator: function(url) {
return 'http://mycoolthing.com?url=' + encodeURIComponent(url);
}
});
## Changelog
0.2.0: decorator option added.
0.1.0: initial release.

@@ -31,0 +41,0 @@

@@ -35,3 +35,10 @@ var assert = require("assert");

});
it('should support the decorator option', function() {
assert.equal(absolution('<a href="../peer.html">Test</a>', 'http://example.com/child/', {
decorator: function(url) {
return 'http://test.com?url=' + encodeURIComponent(url);
}
}), '<a href="http://test.com?url=http%3A%2F%2Fexample.com%2Fpeer.html">Test</a>');
});
});
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