Socket
Socket
Sign inDemoInstall

contentful-sitemap

Package Overview
Dependencies
68
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.14 to 1.0.15

10

package.json
{
"name": "contentful-sitemap",
"version": "1.0.14",
"version": "1.0.15",
"description": "Easily generate a sitemap.xml file that consists of both static routes and dynamic routes generated from Contentful content.",

@@ -58,4 +58,4 @@ "repository": "ryanhefner/contentful-sitemap",

"path-to-regexp": "^6.1.0",
"sitemap": "^6.1.7",
"snyk": "^1.388.0"
"sitemap": "^6.3.0",
"snyk": "^1.391.1"
},

@@ -82,3 +82,3 @@ "devDependencies": {

"regenerator-runtime": "^0.13.7",
"rollup": "^2.26.9",
"rollup": "^2.26.11",
"rollup-plugin-babel": "^4.4.0",

@@ -88,3 +88,3 @@ "rollup-plugin-commonjs": "^10.1.0",

"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^7.0.1",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.0.2"

@@ -91,0 +91,0 @@ },

@@ -1,2 +0,2 @@

/*! contentful-sitemap v1.0.14 | (c) 2020 Ryan Hefner | MIT License | https://github.com/ryanhefner/contentful-sitemap !*/
/*! contentful-sitemap v1.0.15 | (c) 2020 Ryan Hefner | MIT License | https://github.com/ryanhefner/contentful-sitemap !*/
(function (global, factory) {

@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

@@ -1,2 +0,2 @@

/*! contentful-sitemap v1.0.14 | (c) 2020 Ryan Hefner | MIT License | https://github.com/ryanhefner/contentful-sitemap !*/
/*! contentful-sitemap v1.0.15 | (c) 2020 Ryan Hefner | MIT License | https://github.com/ryanhefner/contentful-sitemap !*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["contentful-sitemap"]={})}(this,(function(t){"use strict";var e=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};var r=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new _(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return N()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=j(a,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?d:p,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f="suspendedStart",p="suspendedYield",h="executing",d="completed",y={};function v(){}function m(){}function g(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(S([])));x&&x!==r&&n.call(x,i)&&(b=x);var L=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){var r;this._invoke=function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,u){var c=l(t[o],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function j(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:N}}function N(){return{value:e,done:!0}}return m.prototype=L.constructor=g,g.constructor=m,m.displayName=c(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},t.awrap=function(t){return{__await:t}},E(O.prototype),O.prototype[a]=function(){return this},t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(L),c(L,u,"Generator"),L[i]=function(){return this},L.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));function n(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}var o=function(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)}))}};function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?i(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u=require("path-to-regexp"),c=require("invariant"),s=require("lodash.has"),l=require("lodash.get"),f=require("sitemap"),p=f.SitemapStream,h=f.streamToPromise,d=function(){function t(t,e,r){var n=this;void 0===e&&(e=[]),void 0===r&&(r={}),t||("production"!==process.env.NODE_ENV?c(!1,"Contentful client not provided to ContentfulSitemap"):c(!1)),!function(t){return!(!t.getEntries||"function"!=typeof t.getEntries||!t.getEntry||"function"!=typeof t.getEntry||!t.getLocales||"function"!=typeof t.getLocales)}(t)&&("production"!==process.env.NODE_ENV?c(!1,"`client` is not a valid instance of `ContentfulClientApi`"):c(!1)),this.client=t,this.routes=e.map((function(t){return Object.assign({},n.route,t)})),this.options=Object.assign({},this.options,r)}var e=t.prototype;return e.addRoute=function(t){return this.routes=[].concat(this.routes,[Object.assign({},this.route,t)]),this},e.loadLocales=function(){var t=o(r.mark((function t(){var e;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.getLocales();case 3:return e=t.sent,t.abrupt("return",Promise.resolve(e));case 7:return t.prev=7,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}}),t,this,[[0,7]])})));return function(){return t.apply(this,arguments)}}(),e.loadEntry=function(){var t=o(r.mark((function t(e){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.getEntry(e);case 3:return n=t.sent,t.abrupt("return",Promise.resolve(n));case 7:return t.prev=7,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}}),t,this,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),e.loadEntries=function(){var t=o(r.mark((function t(e,n,o){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===n&&(n=0),void 0===o&&(o=[]),t.prev=2,t.next=5,this.client.getEntries(Object.assign({},e,{skip:n}));case 5:if(!((i=t.sent).skip+i.items.length<i.total)){t.next=8;break}return t.abrupt("return",this.loadEntries(e,n+i.limit,[].concat(o,i.items)));case 8:return t.abrupt("return",Promise.resolve(Object.assign({},i,{items:[].concat(o,i.items)})));case 11:return t.prev=11,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",Promise.reject(t.t0));case 15:case"end":return t.stop()}}),t,this,[[2,11]])})));return function(e,r,n){return t.apply(this,arguments)}}(),e.buildLocaleLinks=function(t,e){return void 0===e&&(e={}),this.options.locales.map((function(r){return{url:decodeURIComponent(t(a(a({},e),{},{locale:r}))),lang:r}}))},e.filterEntry=function(t,e,r){if("object"!=typeof t||0===Object.keys(t).length)return!1;e.params&&Object.keys(e.params).forEach((function(r){var n=e.params[r];if(!s(t,n)||!l(t,n)||void 0===l(t,n))return!1}));var n=this.buildEntryParams(t,e,r),o=!0;e.params&&u.parse(e.pattern).forEach((function(t){"object"==typeof t&&t.name&&((!n.hasOwnProperty(t.name)||!n[t.name]||void 0===n[t.name])&&(o=!1))}));return o},e.buildEntryParams=function(t,e,r){var n=Object.assign({},r);return e.params&&Object.keys(e.params).forEach((function(r){var o=e.params[r];n[r]=l(t,o)})),n},e.handleQueryRoute=function(){var t=o(r.mark((function t(e,n,o){var i,u,c=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===o&&(o={}),Object.assign({},e.query,{select:(e.query.select||"")+(this.options.dynamicLastmod?","+this.options.lastmodParam:"")}),t.prev=2,t.next=5,this.loadEntries(e.query);case 5:if(i=t.sent,u=[],i&&i.items&&i.items.length&&Array.isArray(i.items)){t.next=10;break}return t.abrupt("return",Promise.resolve(u));case 10:return i.items.filter((function(t){return"object"==typeof t&&Object.keys(t).length>0})).filter((function(t){return c.filterEntry(t,e,o)})).forEach((function(t){var r=c.buildEntryParams(t,e,o);c.options.dynamicLastmod&&(e.lastmodISO=l(t,c.options.lastmodParam)),c.options.dynamicLocales&&(e.links=c.buildLocaleLinks(n,r)),u.push(a(a({},e),{},{url:decodeURIComponent(n(r))}))})),t.abrupt("return",Promise.resolve(u));case 14:return t.prev=14,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",Promise.reject(t.t0));case 18:case"end":return t.stop()}}),t,this,[[2,14]])})));return function(e,r,n){return t.apply(this,arguments)}}(),e.parseRoutes=function(){var t=o(r.mark((function t(){var e,n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=this.routes.map(function(){var t=o(r.mark((function t(e){var o,i,c,s,f;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.id||!n.options.dynamicLastmod){t.next=5;break}return t.next=3,n.loadEntry(e.id);case 3:o=t.sent,e.lastmodISO=l(o,n.options.lastmodParam);case 5:if(!e.pattern){t.next=22;break}if(i=u.compile(e.pattern),c={},n.options.defaultLocale&&Object.assign(c,((s={})[n.options.localeParam]=n.options.defaultLocale,s)),!e.query){t.next=14;break}return t.next=12,n.handleQueryRoute(e,i,c);case 12:return f=t.sent,t.abrupt("return",f);case 14:return t.prev=14,n.options.dynamicLocales&&(e.links=n.buildLocaleLinks(i,c)),t.abrupt("return",[a(a({},e),{},{url:decodeURIComponent(i(c))})]);case 19:return t.prev=19,t.t0=t.catch(14),t.abrupt("return",null);case 22:return t.abrupt("return",Promise.resolve([e]));case 23:case"end":return t.stop()}}),t,null,[[14,19]])})));return function(e){return t.apply(this,arguments)}}()).filter((function(t){return null!==t})).reduce((function(t,e){return t.concat(e)}),[]),t.abrupt("return",Promise.resolve(e));case 5:return t.prev=5,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",Promise.reject(t.t0));case 9:case"end":return t.stop()}}),t,this,[[0,5]])})));return function(){return t.apply(this,arguments)}}(),e.buildRoutes=function(){var t=o(r.mark((function t(){var e,n,o=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.dynamicLocales){t.next=5;break}return t.next=3,this.loadLocales();case 3:e=t.sent,this.options.locales=e.items.map((function(t){return!o.options.defaultLocale&&t.default&&(o.options.defaultLocale=t.code),t.code}));case 5:return t.next=7,this.parseRoutes();case 7:return n=t.sent,t.abrupt("return",Promise.all(n).then((function(t){return t.reduce((function(t,e){return t.concat(e)}),[])})));case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.toXML=function(t){var e=this;this.buildRoutes().then((function(r){var n=new p({hostname:e.options.origin});r.forEach((function(t){return n.write(t)})),n.end(),h(n).then((function(e){return t(e.toString(),null)}))})).catch((function(e){return t(null,e)}))},t}();d.prototype.routes=[],d.prototype.route={url:null,changefreq:null,lastmod:null,priority:1,id:null,pattern:null,params:null,query:null},d.prototype.options={locales:[],dynamicLocales:!1,dynamicLastmod:!1,origin:"",lastmodParam:"sys.updatedAt",localeParam:"locale",defaultLocale:null},t.ContentfulSitemap=d,Object.defineProperty(t,"__esModule",{value:!0})}));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc