@azteam/express 1.2.340 → 1.2.342

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
23
23
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24
24
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
25
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
26
- var TEMPLATE_DIR = _path["default"].resolve(__dirname, '../template/sitemap');
26
+ var TEMPLATE_DIR = _path["default"].join(__dirname, '..', '..', 'template/sitemap');
27
27
  var SitemapController = /*#__PURE__*/function (_Controller) {
28
28
  _inherits(SitemapController, _Controller);
29
29
  var _super = _createSuper(SitemapController);
@@ -36,6 +36,11 @@ var SitemapController = /*#__PURE__*/function (_Controller) {
36
36
  return _this;
37
37
  }
38
38
  _createClass(SitemapController, [{
39
+ key: "customPath",
40
+ value: function customPath(item, pattern) {
41
+ return _util["default"].format(pattern, item.slug);
42
+ }
43
+ }, {
39
44
  key: "postGetSitemap",
40
45
  value: function postGetSitemap() {
41
46
  var _this2 = this;
@@ -68,7 +73,7 @@ var SitemapController = /*#__PURE__*/function (_Controller) {
68
73
  data = paginateData.docs.map(function (item) {
69
74
  if (item.slug !== 'home') {
70
75
  return {
71
- path: _util["default"].format(pattern, item.slug),
76
+ path: _this2.customPath(item, pattern),
72
77
  modified_at: item.modified_at
73
78
  };
74
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.340",
3
+ "version": "1.2.342",
4
4
  "license": "MIT",
5
5
  "author": "toda <sp.azsolution.net@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -4,7 +4,7 @@ import util from 'util';
4
4
 
5
5
  import Controller from './Controller';
6
6
 
7
- const TEMPLATE_DIR = path.resolve(__dirname, '../template/sitemap');
7
+ const TEMPLATE_DIR = path.join(__dirname, '..', '..', 'template/sitemap');
8
8
 
9
9
  class SitemapController extends Controller {
10
10
  constructor(repository, pathName = null) {
@@ -12,6 +12,10 @@ class SitemapController extends Controller {
12
12
  this.sitemapName = _.camelCase(this.name);
13
13
  }
14
14
 
15
+ customPath(item, pattern) {
16
+ return util.format(pattern, item.slug);
17
+ }
18
+
15
19
  postGetSitemap() {
16
20
  return {
17
21
  path: '/sitemap',
@@ -34,7 +38,7 @@ class SitemapController extends Controller {
34
38
  data = paginateData.docs.map((item) => {
35
39
  if (item.slug !== 'home') {
36
40
  return {
37
- path: util.format(pattern, item.slug),
41
+ path: this.customPath(item, pattern),
38
42
  modified_at: item.modified_at,
39
43
  };
40
44
  }
File without changes
File without changes
File without changes
File without changes