hexo-swpp 2.4.1 → 2.4.2

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.
@@ -267,22 +267,21 @@ module.exports = (hexo, config, pluginConfig, swRules) => {
267
267
  const isMerge = (pathname, tidied) => {
268
268
  // noinspection JSUnresolvedVariable
269
269
  const optional = pluginConfig.json?.merge
270
- if (!optional) return false
271
270
  const {tag_dir, archive_dir, category_dir} = config
272
271
  if (pathname.includes(`/${tag_dir}/`)) {
273
- if (optional.tags ?? true)
272
+ if (optional?.tags ?? true)
274
273
  return tidied.tags = true
275
274
  } else if (pathname.includes(`/${archive_dir}/`)) {
276
- if (optional.archives ?? true)
275
+ if (optional?.archives ?? true)
277
276
  return tidied.archives = true
278
277
  } else if (pathname.includes(`/${category_dir}/`)) {
279
- if (optional.categories ?? true)
278
+ if (optional?.categories ?? true)
280
279
  return tidied.categories = true
281
280
  } else if (pathname.startsWith('/page/') || pathname.length <= 1) {
282
- if (optional.index ?? true)
281
+ if (optional?.index ?? true)
283
282
  return tidied.index = true
284
283
  } else {
285
- const list = optional.custom
284
+ const list = optional?.custom
286
285
  if (!list) return false
287
286
  for (let reg of list) {
288
287
  if (pathname.startsWith(`/${reg}/`))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-swpp",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "hexo-log": "^3.0.0",