Skip to content

Commit e855dc8

Browse files
committed
format source
1 parent f4b4057 commit e855dc8

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/helpers/rearrange.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
module.exports = (collection, property, orderSpec) => {
44
if (orderSpec == null || orderSpec === '*') return Object.values(collection)
55
const sourceCollection = Object.values(collection).reduce((accum, it) => accum.set(it[property], it), new Map())
6-
const order = orderSpec.split(',').map((it) => it.trim()).filter((it) => {
7-
if (it.charAt() !== '!') return true
8-
sourceCollection.delete(it.substr(1))
9-
})
6+
const order = orderSpec
7+
.split(',')
8+
.map((it) => it.trim())
9+
.filter((it) => {
10+
if (it.charAt() !== '!') return true
11+
sourceCollection.delete(it.substr(1))
12+
})
1013
const restIdx = order.indexOf('*')
1114
if (~restIdx) order.splice(restIdx, 1)
1215
const targetCollection = order.reduce((accum, key) => {

src/helpers/siteStartPage.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
'use strict'
22

3-
module.exports = ({ data: { root: { contentCatalog } } }) =>
4-
contentCatalog && contentCatalog.getSiteStartPage()
3+
module.exports = ({
4+
data: {
5+
root: {
6+
contentCatalog = { getSiteStartPage() {} },
7+
},
8+
},
9+
}) => contentCatalog.getSiteStartPage()

0 commit comments

Comments
 (0)