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

multi-sitemap

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-sitemap - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1-alpha.1

1

dist/__tests__/mocks/SitemapWriterMock.js

@@ -12,2 +12,3 @@ "use strict";

name: name,
filename: name + ".xml",
add: function (entries) {

@@ -14,0 +15,0 @@ (_a = _this.streams[name]).push.apply(_a, entries);

10

dist/__tests__/SitemapProcessor-test.js

@@ -77,7 +77,7 @@ "use strict";

index: [
{ url: 'https://domain.tld/sitemap/pages' },
{ url: 'https://domain.tld/sitemap/products-1' },
{ url: 'https://domain.tld/sitemap/products-2' },
{ url: 'https://domain.tld/sitemap/products-3' },
{ url: 'https://domain.tld/sitemap/products-4' }
{ url: 'https://domain.tld/sitemap/pages.xml' },
{ url: 'https://domain.tld/sitemap/products-1.xml' },
{ url: 'https://domain.tld/sitemap/products-2.xml' },
{ url: 'https://domain.tld/sitemap/products-3.xml' },
{ url: 'https://domain.tld/sitemap/products-4.xml' }
],

@@ -84,0 +84,0 @@ pages: ['https://domain.tld/', 'https://domain.tld/about'],

@@ -6,3 +6,3 @@ import { ISitemapReader, ISitemapWriter, SitemapEntryConfig } from './types';

private publicDirectory;
private sitemaps;
private sitemapFilenames;
private writer;

@@ -9,0 +9,0 @@ constructor({publicHost, maxEntriesPerFile, publicDirectory, writer}: {

@@ -49,3 +49,3 @@ "use strict";

var publicHost = _a.publicHost, _b = _a.maxEntriesPerFile, maxEntriesPerFile = _b === void 0 ? 50000 : _b, publicDirectory = _a.publicDirectory, writer = _a.writer;
this.sitemaps = [];
this.sitemapFilenames = [];
// Normalize `publicHost`

@@ -91,3 +91,3 @@ if (publicHost.endsWith('/')) {

_a.sent();
this.sitemaps.push(stream.name);
this.sitemapFilenames.push(stream.filename);
stream = null;

@@ -117,3 +117,3 @@ _a.label = 3;

_a.sent();
this.sitemaps.push(stream.name);
this.sitemapFilenames.push(stream.filename);
_a.label = 10;

@@ -142,3 +142,3 @@ case 10:

_b.sent();
this.sitemaps.push(name);
this.sitemapFilenames.push(stream.filename);
return [2 /*return*/];

@@ -158,4 +158,4 @@ }

stream = _a.sent();
entries = this.sitemaps.map(function (name) { return ({
url: _this.publicDirectory + "/" + name
entries = this.sitemapFilenames.map(function (filename) { return ({
url: _this.publicDirectory + "/" + filename
}); });

@@ -162,0 +162,0 @@ return [4 /*yield*/, stream.add(this.mapEntriesToFullUrls(entries))];

@@ -57,6 +57,8 @@ "use strict";

var _this = this;
var filename = path.join(this.directory, name + ".txt");
this.fileStreamWriter.open(filename);
var filename = name + '.txt';
var sitemapPath = path.join(this.directory, filename);
this.fileStreamWriter.open(sitemapPath);
var writerStream = {
name: name,
filename: filename,
add: function (entries) { return __awaiter(_this, void 0, void 0, function () {

@@ -63,0 +65,0 @@ var _i, entries_1, entryOrUrl, url;

@@ -62,8 +62,9 @@ "use strict";

var _this = this;
var filename;
var filename, sitemapPath;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
filename = path.join(this.directory, name + ".xml");
this.fileStreamWriter.open(filename);
filename = name + '.xml';
sitemapPath = path.join(this.directory, filename);
this.fileStreamWriter.open(sitemapPath);
return [4 /*yield*/, this.fileStreamWriter.write('<?xml version="1.0" encoding="UTF-8"?>')];

@@ -83,2 +84,3 @@ case 1:

name: name,
filename: filename,
add: function (entries) { return __awaiter(_this, void 0, void 0, function () {

@@ -85,0 +87,0 @@ var _i, entries_1, entryOrUrl, entry;

@@ -18,2 +18,3 @@ export interface ISitemapReader {

name: string;
filename: string;
add(entries: SitemapEntryConfig[]): Promise<void>;

@@ -20,0 +21,0 @@ end(): Promise<void>;

{
"name": "multi-sitemap",
"version": "0.3.0",
"version": "0.3.1-alpha.1",
"description": "Painless creation of large dynamic sitemaps that consist of multiple files.",
"repository": "https://github.com/amannn/multi-sitemap",
"author": "Jan Amann <jan@amann.me>",

@@ -6,0 +7,0 @@ "main": "dist/index.js",

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