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

@alex-drocks/react-snap-sitemap

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alex-drocks/react-snap-sitemap - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

2

package.json

@@ -7,3 +7,3 @@ {

},
"version": "0.2.2",
"version": "0.2.3",
"description": "Create a sitemap post react-snap SSR",

@@ -10,0 +10,0 @@ "keywords": [

@@ -15,2 +15,4 @@ # React Snap Sitemap

You can also add `--change-frequency=always|daily|weekly|monthly|yearly|never`.
You can also add `--change-frequency=always|daily|weekly|monthly|yearly|never`.
If you need trailing slashes at the end of your URLs add `--add-slash=true`

@@ -11,2 +11,3 @@ #!/usr/bin/env node

const preFormattedChangeFrequency = args.find((arg) => arg.startsWith('--change-frequency='));
const addSlash = args.find((arg) => arg.startsWith('--add-slash='));
let blackList = [];

@@ -21,3 +22,2 @@

let baseUrl;
if (preFormattedBaseUrl) {

@@ -28,3 +28,2 @@ baseUrl = preFormattedBaseUrl.split('=')[1];

}
if (baseUrl.length === 0) {

@@ -35,3 +34,2 @@ throw (new Error('Pass a valid url to --base-url'));

let changeFrequency;
if (preFormattedChangeFrequency) {

@@ -43,2 +41,5 @@ changeFrequency = preFormattedChangeFrequency.split('=')[1];

const shouldAddSlashes = addSlash ? true : false;
console.log({shouldAddSlashes})
const asyncReaddir = promisify(readdir), asyncWriteFile = promisify(writeFile), asyncLStat = promisify(lstat);

@@ -107,4 +108,9 @@

.forEach(url => {
const isMainPage = url + "/" === baseUrl;
const u = urlset.ele('url');
u.ele('loc', url);
if (!isMainPage && shouldAddSlashes) {
u.ele("loc", url + "/");
} else {
u.ele('loc', url);
}
u.ele('lastmod', formatDate(Date.now()))

@@ -115,5 +121,3 @@ if (changeFrequency) {

url + "/" === baseUrl
? u.ele('priority', "1.0")
: u.ele('priority', "0.8");
isMainPage ? u.ele('priority', "1.0") : u.ele('priority', "0.5");
});

@@ -120,0 +124,0 @@

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