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

metalsmith-sitemap

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-sitemap - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

test/fixtures/win32-backslash/expected/backslash/index.html

14

lib/index.js

@@ -102,3 +102,3 @@ /**

if (omitIndex && path.basename(file) === 'index.html') {
return S(file).chompRight('index.html').s;
return replaceBackslash(S(file).chompRight('index.html')).s;
}

@@ -108,9 +108,17 @@

if (omitExtension) {
return S(file).chompRight(path.extname(file)).s;
return replaceBackslash(S(file).chompRight(path.extname(file))).s;
}
// Otherwise just use 'file'
return file;
return replaceBackslash(S(file)).s;
}
function replaceBackslash(url) {
if (path.sep != '/') {
return url.replaceAll(path.sep, '/');
}
return url;
}
Object.keys(files).forEach(function(file) {

@@ -117,0 +125,0 @@ // Get the current file's frontmatter

{
"name": "metalsmith-sitemap",
"version": "1.1.0",
"version": "1.2.0",
"description": "A metalsmith plugin for generating a sitemap.xml file.",

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

@@ -195,2 +195,13 @@ var assert = require('assert');

it('should replace win32 backslash by slash', function(done){
Metalsmith('test/fixtures/win32-backslash')
.use(sitemap('http://www.website.com/'))
.build(function(err){
if (err) {
return done(err);
}
equal('test/fixtures/win32-backslash/expected', 'test/fixtures/win32-backslash/build');
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