Comparing version 3.0.0 to 3.1.0
@@ -0,1 +1,4 @@ | ||
# 3.1.0 | ||
- fixes #187, #188 typescript errors | ||
- adds support for full precision priority #176 | ||
# 3.0.0 | ||
@@ -2,0 +5,0 @@ - Converted project to typescript |
@@ -9,2 +9,3 @@ /*! | ||
export * from './lib/errors'; | ||
export * from './lib/types'; | ||
export default sm; |
@@ -21,3 +21,4 @@ "use strict"; | ||
__export(require("./lib/errors")); | ||
__export(require("./lib/types")); | ||
exports.default = sm; | ||
//# sourceMappingURL=index.js.map |
@@ -272,3 +272,8 @@ "use strict"; | ||
else if (this.priority !== undefined && p === 'priority') { | ||
this.url.element(p, parseFloat(this.priority + '').toFixed(1)); | ||
if (this.conf.fullPrecisionPriority) { | ||
this.url.element(p, this.priority + ''); | ||
} | ||
else { | ||
this.url.element(p, parseFloat(this.priority + '').toFixed(1)); | ||
} | ||
} | ||
@@ -275,0 +280,0 @@ else if (this.ampLink && p === 'ampLink') { |
@@ -45,3 +45,3 @@ /// <reference types="node" /> | ||
*/ | ||
constructor(urls: string | Sitemap["urls"], hostname?: string, cacheTime?: number, xslUrl?: string, xmlNs?: string); | ||
constructor(urls?: string | Sitemap["urls"], hostname?: string, cacheTime?: number, xslUrl?: string, xmlNs?: string); | ||
/** | ||
@@ -63,3 +63,3 @@ * Clear sitemap cache | ||
*/ | ||
add(url: string): number; | ||
add(url: string | SitemapItemOptions): number; | ||
/** | ||
@@ -69,5 +69,3 @@ * Delete url from sitemap | ||
*/ | ||
del(url: string | { | ||
url: string; | ||
}): number; | ||
del(url: string | SitemapItemOptions): number; | ||
/** | ||
@@ -74,0 +72,0 @@ * Create sitemap xml |
@@ -64,7 +64,10 @@ /* eslint-disable camelcase, semi, space-before-function-paren, padded-blocks */ | ||
this.hostname = hostname; | ||
// URL list for sitemap | ||
this.urls = []; | ||
// Make copy of object | ||
if (urls) | ||
if (urls) { | ||
this.urls = Array.isArray(urls) ? Array.from(urls) : [urls]; | ||
} | ||
else { | ||
// URL list for sitemap | ||
this.urls = []; | ||
} | ||
// sitemap cache | ||
@@ -71,0 +74,0 @@ this.cacheResetPeriod = cacheTime || 0; |
@@ -22,3 +22,3 @@ import builder from 'xmlbuilder'; | ||
export interface INewsItem { | ||
access: 'Registration' | 'Subscription'; | ||
access?: 'Registration' | 'Subscription'; | ||
publication: { | ||
@@ -28,7 +28,7 @@ name: string; | ||
}; | ||
genres: string; | ||
genres?: string; | ||
publication_date: string; | ||
title: string; | ||
keywords: string; | ||
stock_tickers: string; | ||
keywords?: string; | ||
stock_tickers?: string; | ||
} | ||
@@ -83,2 +83,3 @@ export interface ISitemapImg { | ||
changefreq?: EnumChangefreq; | ||
fullPrecisionPriority?: boolean; | ||
priority?: number; | ||
@@ -85,0 +86,0 @@ news?: INewsItem; |
{ | ||
"name": "sitemap", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Sitemap-generating framework", | ||
@@ -111,3 +111,2 @@ "keywords": [ | ||
"source-map": "~0.7.3", | ||
"standard": "^12.0.1", | ||
"stats-lite": "^2.2.0", | ||
@@ -114,0 +113,0 @@ "typescript": "^3.4.5" |
@@ -7,2 +7,8 @@ sitemap.js | ||
Maintainers | ||
----------- | ||
- [@ekalinin](https://github.com/ekalinin) | ||
- [@derduher](https://github.com/derduher) | ||
[![Build Status](https://travis-ci.org/ekalinin/sitemap.js.svg?branch=master)](https://travis-ci.org/ekalinin/sitemap.js) | ||
@@ -9,0 +15,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
87800
22
1337
362
0